Browse Source

moved org.yakindu.sct.simulation.runtime to 'archive'

Andreas Mülder 13 years ago
parent
commit
afec52104b
60 changed files with 0 additions and 4275 deletions
  1. 0 8
      plugins/org.yakindu.sct.simulation.runtime/.classpath
  2. 0 40
      plugins/org.yakindu.sct.simulation.runtime/.project
  3. 0 3
      plugins/org.yakindu.sct.simulation.runtime/.settings/org.eclipse.core.resources.prefs
  4. 0 12
      plugins/org.yakindu.sct.simulation.runtime/.settings/org.eclipse.jdt.core.prefs
  5. 0 19
      plugins/org.yakindu.sct.simulation.runtime/META-INF/MANIFEST.MF
  6. 0 7
      plugins/org.yakindu.sct.simulation.runtime/build.properties
  7. 0 187
      plugins/org.yakindu.sct.simulation.runtime/customBuildCallbacks.xml
  8. 0 11
      plugins/org.yakindu.sct.simulation.runtime/plugin.xml
  9. 0 104
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/AbstractStatechart.java
  10. 0 5
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/HistoryMode.java
  11. 0 12
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/ITrigger.java
  12. 0 5
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/PseudostateKind.java
  13. 0 7
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTAction.java
  14. 0 89
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTCompoundState.java
  15. 0 14
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTConstantTimeEvent.java
  16. 0 45
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTDefaultTimingService.java
  17. 0 14
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTEvent.java
  18. 0 31
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTFinalState.java
  19. 0 7
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTGuard.java
  20. 0 61
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTNode.java
  21. 0 53
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTPseudostate.java
  22. 0 22
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTReaction.java
  23. 0 106
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTRegion.java
  24. 0 45
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTSignalEvent.java
  25. 0 28
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTSimpleState.java
  26. 0 140
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTState.java
  27. 0 10
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTTimeEvent.java
  28. 0 9
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTTimingService.java
  29. 0 171
      plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTTransition.java
  30. 0 32
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/EvaluationException.java
  31. 0 37
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/ExecutionScope.java
  32. 0 83
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/ExecutionScopeAdapter.java
  33. 0 59
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/GuardExpression.java
  34. 0 60
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/RTActionStatement.java
  35. 0 251
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/RTStatechart.java
  36. 0 32
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/StatechartRuntimeException.java
  37. 0 46
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/TimeEventExpression.java
  38. 0 432
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/builder/SGraphBuilder.java
  39. 0 29
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Assert.java
  40. 0 54
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Assign.java
  41. 0 113
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/BinaryOperation.java
  42. 0 78
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Conditional.java
  43. 0 38
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Constant.java
  44. 0 358
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/CoreFunction.java
  45. 0 33
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/ExpressionRuntimeException.java
  46. 0 188
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Function.java
  47. 0 30
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/FunctionMethod.java
  48. 0 42
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/ProcedureCall.java
  49. 0 19
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTExpression.java
  50. 0 85
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTScope.java
  51. 0 18
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTStatement.java
  52. 0 98
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTTrigger.java
  53. 0 49
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTTriggerEvent.java
  54. 0 70
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTVariable.java
  55. 0 47
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Raise.java
  56. 0 32
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/StatementSequence.java
  57. 0 59
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/UnaryOperation.java
  58. 0 48
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/VariableRef.java
  59. 0 32
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/builder/BuilderException.java
  60. 0 458
      plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/builder/STextBuilder.java

+ 0 - 8
plugins/org.yakindu.sct.simulation.runtime/.classpath

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-gen"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

+ 0 - 40
plugins/org.yakindu.sct.simulation.runtime/.project

@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.yakindu.sct.simulation.runtime</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.openarchitectureware.base.oawBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.xtend.shared.ui.xtendBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.openarchitectureware.base.oawNature</nature>
-		<nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature>
-	</natures>
-</projectDescription>

+ 0 - 3
plugins/org.yakindu.sct.simulation.runtime/.settings/org.eclipse.core.resources.prefs

@@ -1,3 +0,0 @@
-#Sat Sep 10 11:23:39 CEST 2011
-eclipse.preferences.version=1
-encoding/<project>=UTF-8

+ 0 - 12
plugins/org.yakindu.sct.simulation.runtime/.settings/org.eclipse.jdt.core.prefs

@@ -1,12 +0,0 @@
-#Tue Nov 24 17:42:55 CET 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5

+ 0 - 19
plugins/org.yakindu.sct.simulation.runtime/META-INF/MANIFEST.MF

@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Yakindu SCT Runtime
-Bundle-SymbolicName: org.yakindu.sct.simulation.runtime;singleton:=true
-Bundle-Version: 1.1.0.qualifier
-Bundle-Vendor: YAKINDU
-Require-Bundle: org.yakindu.sct.model.sgraph,
- org.eclipse.xtext,
- org.yakindu.sct.model.stext,
- org.yakindu.sct.model.stext.ui,
- org.eclipse.core.runtime,
- org.yakindu.sct.simulation.core
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ActivationPolicy: lazy
-Export-Package: org.yakindu.sct.simulation.runtime,
- org.yakindu.sct.simulation.runtime.sgraph,
- org.yakindu.sct.simulation.runtime.sgraph.builder,
- org.yakindu.sct.simulation.runtime.stext,
- org.yakindu.sct.simulation.runtime.stext.builder

+ 0 - 7
plugins/org.yakindu.sct.simulation.runtime/build.properties

@@ -1,7 +0,0 @@
-source.. = src/,\
-           src-gen/
-output.. = bin/
-customBuildCallbacks = customBuildCallbacks.xml
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml

+ 0 - 187
plugins/org.yakindu.sct.simulation.runtime/customBuildCallbacks.xml

@@ -1,187 +0,0 @@
-<!--
-
-    Copyright (c) 2010 committers of YAKINDU and others.
-    All rights reserved. This program and the accompanying materials
-    are made available under the terms of the Eclipse Public License v1.0
-    which accompanies this distribution, and is available at
-    http://www.eclipse.org/legal/epl-v10.html
-
-    Contributors:
-        committers of YAKINDU - initial API and implementation
-
--->
-<!-- ===================================================================== -->
-<!-- Custom targets called from a project's generated build.xml            -->
-<!-- Set customBuildCallbacks=<path/to/this/file> in your build.properties.-->
-<!-- ===================================================================== -->
-<project name="Build specific targets and properties" default="noDefault">
-
-	<!-- ===================================================================== -->
-	<!-- Default target                                                        -->
-	<!-- ===================================================================== -->
-	<target name="noDefault">
-		<echo message="This file must be called with explicit targets" />
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do before the target build.jars                              -->
-	<!-- Available parameters :                                                -->
-	<!--   build.result.folder - folder to contain the build results           -->
-	<!-- ===================================================================== -->
-	<target name="pre.build.jars">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do after the target build.jars                               -->
-	<!-- Available parameters :                                                -->
-	<!--   build.result.folder - folder to contain the build results           -->
-	<!-- ===================================================================== -->
-	<target name="post.build.jars">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do before the target build.sources                           -->
-	<!-- Available parameters :                                                -->
-	<!--   build.result.folder - folder to contain the build results           -->
-	<!-- ===================================================================== -->
-	<target name="pre.build.sources">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do after the target build.sources                            -->
-	<!-- Available parameters :                                                -->
-	<!--   build.result.folder - folder to contain the build results           -->
-	<!-- ===================================================================== -->
-	<target name="post.build.sources">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do before the compilation target <name>                      -->
-	<!-- Substitute "name" with the name of the compilation target, eg @dot    -->
-	<!-- Available parameters :                                                -->
-	<!--   source.foldern : n = 1 ... N, the source folders                    -->
-	<!--   target.folder  : where the results of the compilation go            -->
-	<!--   <name>.classpath : name = name of the compilation target. A         -->
-	<!--                      reference to the classpath structure.            -->
-	<!-- ===================================================================== -->
-	<target name="pre.name">
-	</target>
-
-	<target name="pre.@dot">
-		<!-- generate code, making use of oaw workflow -->
-		<echo message="GENERATING CODE ..." />
-
-		<path id="oaw.classpath">
-			<pathelement path="${source.folder1}" />
-			<path refid="@dot.classpath" />
-		</path>
-		
-		<!--<pathconvert pathsep="${line.separator}|   |- " property="echo.oaw.classpath" refid="oaw.classpath" />
-				<echo message="|- oaw.classpath" />
-				<echo message="|   |" />
-				<echo message="|   |- ${echo.oaw.classpath}" />-->			
-
-		<taskdef name="oaw4" classname="org.eclipse.emf.mwe.core.ant.WorkflowAntTask" classpathref="oaw.classpath" />
-		<oaw4 file="${source.folder1}com/yakindu/statechart/runtime/generator/generate_Runtime.oaw" fork="true" failOnError="true" classpathref="oaw.classpath"/>
-
-		<echo message="DONE!" />
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do during the compilation target <name>, after the compile   -->
-	<!-- but before jaring.  Substitute "name" with the name of the compilation-->
-	<!-- target, eg @dot                                                       -->
-	<!-- Available parameters :                                                -->
-	<!--   source.foldern : n = 1 ... N, the source folders                    -->
-	<!--   target.folder  : where the results of the compilation go            -->
-	<!--   <name>.classpath : name = name of the compilation target. A         -->
-	<!--                      reference to the classpath structure.            -->
-	<!-- ===================================================================== -->
-	<target name="post.compile.name">
-	</target>
-
-	<target name="post.compile.@dot">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do after the compilation target <name>                       -->
-	<!-- Substitute "name" with the name of the compilation target, eg @dot    -->
-	<!-- Available parameters :                                                -->
-	<!--   jar.location - the location of the compilation results              -->
-	<!--   <name>.classpath : name = name of the compilation target. A         -->
-	<!--                      reference to the classpath structure.            -->
-	<!-- ===================================================================== -->
-	<target name="post.name">
-	</target>
-
-	<target name="post.@dot">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do before the target gather.bin.parts                         -->
-	<!-- Available parameters :                                                -->
-	<!--   build.result.folder - folder containing the build results           -->
-	<!--   target.folder - destination folder                                  -->
-	<!-- ===================================================================== -->
-	<target name="pre.gather.bin.parts">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do after the target gather.bin.parts                         -->
-	<!-- Available parameters :                                                -->
-	<!--   build.result.folder - folder containing the build results           -->
-	<!--   target.folder - destination folder                                  -->
-	<!-- ===================================================================== -->
-	<target name="post.gather.bin.parts">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do before the target gather.sources                          -->
-	<!-- Available parameters :                                                -->
-	<!--   destination.temp.folder - destination folder                        -->
-	<!-- ===================================================================== -->
-	<target name="pre.gather.sources">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do after the target gather.sources                           -->
-	<!-- Available parameters :                                                -->
-	<!--   destination.temp.folder - destination folder                        -->
-	<!-- ===================================================================== -->
-	<target name="post.gather.sources">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do before the target gather.logs                             -->
-	<!-- Available parameters :                                                -->
-	<!--   destination.temp.folder - destination folder                        -->
-	<!-- ===================================================================== -->
-	<target name="pre.gather.logs">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do after the target gather.logs                              -->
-	<!-- Available parameters :                                                -->
-	<!--   destination.temp.folder - destination folder                        -->
-	<!-- ===================================================================== -->
-	<target name="post.gather.logs">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do before the target clean                                   -->
-	<!-- Available parameters :                                                -->
-	<!--   destination.temp.folder - destination folder                        -->
-	<!-- ===================================================================== -->
-	<target name="pre.clean">
-	</target>
-
-	<!-- ===================================================================== -->
-	<!-- Steps to do after the target clean                                    -->
-	<!-- Available parameters :                                                -->
-	<!--   plugin.destination - final destination of the build                 -->
-	<!--   build.result.folder - results of the compilation                    -->
-	<!--   temp.folder - temporary folder                                      -->
-	<!-- ===================================================================== -->
-	<target name="post.clean">
-	</target>
-</project>

+ 0 - 11
plugins/org.yakindu.sct.simulation.runtime/plugin.xml

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-   <extension
-         point="org.yakindu.sct.simulation.core.sgraph.executionbuilder">
-      <SGraphExecutionBuilder
-            class="org.yakindu.sct.simulation.runtime.sgraph.builder.SGraphBuilder">
-      </SGraphExecutionBuilder>
-   </extension>
-
-</plugin>

+ 0 - 104
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/AbstractStatechart.java

@@ -1,104 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-
-public abstract class AbstractStatechart {
-
-	protected Set<RTEvent> raisedEvents = new HashSet<RTEvent>();
-
-	private String id;
-
-	// the nested regions of this state, sorted by priority
-
-	private List<RTRegion> regions = new ArrayList<RTRegion>();
-
-	private List<RTTransition> transitions = new ArrayList<RTTransition>();
-	//private List<RTReaction> localReactions = new ArrayList<RTReaction>();
-
-	// used to request time events from environment
-	protected RTTimingService timingService = null;
-
-	protected Set<RTEvent> currentEvents = new HashSet<RTEvent>();
-
-	protected AbstractStatechart(String id) {
-		this.id = id;
-		this.timingService = new RTDefaultTimingService(this);
-	}
-
-	protected AbstractStatechart(String id, RTTimingService timingService) {
-		this.id = id;
-		this.timingService = timingService;
-	}
-
-	public List<RTRegion> getRegions() {
-		return regions;
-	}
-
-	protected List<RTTransition> getTransitions() {
-
-		return transitions;
-
-	}
-
-	public void setEvent(RTEvent event) {
-		synchronized (raisedEvents) {
-			raisedEvents.add(event);
-		}
-	}
-
-	protected void requestTimeEvent(RTTimeEvent event) {
-		timingService.requestTimeEvent(event);
-	}
-
-	protected void cancelTimeEvent(RTTimeEvent event) {
-		timingService.cancelTimeEvent(event);
-	}
-
-
-	public void enter() {
-		// enter all nested regions (in the order of their priority)
-		for (RTRegion region : regions) {
-			region.enter();
-		}
-
-	}
-
-	public void runCycle() {
-		synchronized (raisedEvents) {
-			currentEvents.clear();
-			currentEvents.addAll(raisedEvents);
-			raisedEvents.clear();
-		}
-		reactOn(currentEvents);
-
-	}
-
-	public void leave() {
-
-		// leave all nested regions (in the reverse order of their priority)
-		for (ListIterator<RTRegion> iterator = regions.listIterator(regions
-				.size()); iterator.hasPrevious();) {
-			iterator.previous().leave();
-		}
-
-	}
-
-	
-	private void reactOn(Set<RTEvent> events) {
-		// pass events to our nested regions (in the order of their priority)
-		for (RTRegion region : regions) {
-			region.reactOn(events);
-		}
-	}
-
-	public String getId() {
-		return id;
-	}
-	
-	
-
-}

+ 0 - 5
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/HistoryMode.java

@@ -1,5 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public enum HistoryMode {
-	SHALLOW, DEEP
-}

+ 0 - 12
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/ITrigger.java

@@ -1,12 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.Set;
-
-
-public interface ITrigger {
-
-	boolean isEnabled(Set<RTEvent> events);
-
-	RTTimeEvent getTimeTrigger();
-
-}

+ 0 - 5
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/PseudostateKind.java

@@ -1,5 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public enum PseudostateKind {
-	INITIAL, SHALLOWHISTORY, DEEPHISTORY, FINAL, CHOICE, JUNCTION
-}

+ 0 - 7
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTAction.java

@@ -1,7 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public abstract class RTAction {
-
-	public abstract void execute();
-
-}

+ 0 - 89
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTCompoundState.java

@@ -1,89 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-
-/**
- * Representation of a state that contains nested regions with sub-states.
- * Composite states may have an arbitrary number of nested regions, which are
- * virtually executed in parallel (in fact, there execution is sequentialized
- * based on their priorities). As a composite state always is "in" its
- * sub-states, it may itself not contain a do action.
- */
-public class RTCompoundState extends RTState {
-
-	// the nested regions of this state, sorted by priority
-	private List<RTRegion> regions = new ArrayList<RTRegion>();
-
-	public RTCompoundState(String id, String name, RTRegion container,
-			RTAction entryAction, RTAction exitAction) {
-		super(id, name, container, entryAction, exitAction);
-	}
-
-	public List<RTRegion> getRegions() {
-		return regions;
-	}
-
-	protected void enter() {
-
-		shallowEnter();
-		// now enter all nested regions (in the order of their priority)
-		for (RTRegion region : regions) {
-			region.enter();
-		}
-
-	}
-
-	protected void shallowEnter() {
-
-		// let the super implementation request time events and execute the entry action of this state
-		super.enter();
-
-	}
-
-	protected void reenter(HistoryMode history) {
-
-		shallowEnter();
-		// let the nested regions re-enter their former states
-		for (RTRegion region : regions) {
-			// if we have are in DEEP history mode, notify our nested regions 
-			// to reenter into their former states as well
-			if (history == HistoryMode.DEEP) {
-				region.reenter(history);
-			} else {
-				region.enter();
-			}
-		}
-
-	}
-
-	protected void reactLocallyOn(Set<RTEvent> events) {
-		// as a compound state does not locally react on events (it may not
-		// specify a do action), forward to the nested regions (in the order of
-		// their priority)
-		for (RTRegion region : regions) {
-			region.reactOn(events);
-		}
-	}
-
-	protected void leave() {
-
-		// leave all nested regions (in the reverse order of their priority)
-		for (ListIterator<RTRegion> iterator = regions.listIterator(regions
-				.size()); iterator.hasPrevious();) {
-			iterator.previous().leave();
-		}
-		shallowLeave();
-
-	}
-
-	protected void shallowLeave() {
-
-		// let the super implementation execute the exit action of this state
-		super.leave();
-
-	}
-
-}

+ 0 - 14
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTConstantTimeEvent.java

@@ -1,14 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public class RTConstantTimeEvent extends RTTimeEvent {
-	private long duration = -1;
-
-	public RTConstantTimeEvent(String id, long duration) {
-		super(id);
-		this.duration = duration;
-	}
-
-	public long getDuration() {
-		return duration;
-	}
-}

+ 0 - 45
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTDefaultTimingService.java

@@ -1,45 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Timer;
-import java.util.TimerTask;
-
-public class RTDefaultTimingService implements RTTimingService {
-
-	private final AbstractStatechart statechart;
-
-	public RTDefaultTimingService(AbstractStatechart statechart) {
-		this.statechart = statechart;
-	}
-
-	private Set<RTTimeEvent> canceledRequestedEvents = new HashSet<RTTimeEvent>();
-
-	public void requestTimeEvent(final RTTimeEvent timeEvent) {
-
-		canceledRequestedEvents.remove(timeEvent);
-
-		// run a timer (there is an own thread for this);
-		Timer timer = new Timer();
-		timer.schedule(new TimerTask() {
-
-			@Override
-			public void run() {
-				if (canceledRequestedEvents.contains(timeEvent)) {
-					canceledRequestedEvents.remove(timeEvent);
-				} else {
-					statechart.setEvent(timeEvent);
-				}
-			}
-
-		}, timeEvent.getDuration());
-
-	}
-
-	public void cancelTimeEvent(final RTTimeEvent timeEvent) {
-
-		canceledRequestedEvents.add(timeEvent);
-
-	}
-
-}

+ 0 - 14
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTEvent.java

@@ -1,14 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public abstract class RTEvent {
-
-	protected String id;
-
-	public RTEvent(String id) {
-		this.id = id;
-	}
-
-	public String getId() {
-		return id;
-	}
-}

+ 0 - 31
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTFinalState.java

@@ -1,31 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.Set;
-
-/**
- * Representation of a final state. A final state is some sort of event sink, i.e.
- * it does not react on any events, and it further has to entry, do, or exit action.
- */
-public class RTFinalState extends RTState {
-
-	public RTFinalState(String id, RTRegion owningRegion) {
-		super(id, "FINAL", owningRegion, null, null);
-	}
-
-	protected void enter() {
-		// only notify the containing region that we are the current state
-		owningRegion.setCurrentState(this);
-	}
-
-	protected void reactOn(Set<RTEvent> events) {
-		// do nothing, just ignore all events 
-	}
-
-	protected void reactLocallyOn(Set<RTEvent> events) {
-		// never called, as reactOn is overwritten as well
-	}
-
-	protected void leave() {
-		// do nothing, just ignore
-	}
-}

+ 0 - 7
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTGuard.java

@@ -1,7 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public abstract class RTGuard {
-
-	public abstract boolean evaluate();
-
-}

+ 0 - 61
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTNode.java

@@ -1,61 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Representation of a node (which is the abstract super concept of State and
- * Pseudostate). A node may have incoming and outgoing transitions. As the
- * statechart may only reside "in" states, pseudostates will normally directly
- * trigger an outgoing transition when being entered.
- */
-public abstract class RTNode {
-
-	private String id;
-	protected RTRegion owningRegion;
-
-	protected List<RTTransition> incomingTransitions = new ArrayList<RTTransition>();
-	protected List<RTTransition> outgoingTransitions = new ArrayList<RTTransition>();
-
-	public RTNode(String id, RTRegion owner) {
-		this.id = id;
-		this.owningRegion = owner;
-		this.owningRegion.getNodes().add(this);
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	protected RTRegion getOwningRegion() {
-		return owningRegion;
-	}
-
-	public List<RTTransition> getIncomingTransitions() {
-		return incomingTransitions;
-	}
-
-	public List<RTTransition> getOutgoingTransitions() {
-		return outgoingTransitions;
-	}
-
-	protected RTTransition getEnabledOutgoingTransitionOfHighestPriority() {
-
-		Set<RTEvent> s = Collections.emptySet();
-		for (RTTransition transition : outgoingTransitions) {
-			
-			if (transition.isTriggeredBy(s)) {
-				return transition;
-			}
-		}
-		return null;
-
-	}
-
-	protected abstract void enter();
-
-	protected abstract void leave();
-
-}

+ 0 - 53
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTPseudostate.java

@@ -1,53 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-/**
- * Representation of a Pseudostate.
- */
-public class RTPseudostate extends RTNode {
-
-	PseudostateKind kind;
-
-	public RTPseudostate(String id, RTRegion owningRegion, PseudostateKind kind) {
-		super(id, owningRegion);
-		this.kind = kind;
-	}
-
-	public PseudostateKind getKind() {
-		return kind;
-	}
-
-	protected void enter() {
-		if (kind == PseudostateKind.INITIAL) {
-			// go directly into the next state (special transition needs no
-			// event
-			outgoingTransitions.get(0).take();
-		} else if (kind == PseudostateKind.SHALLOWHISTORY
-				|| kind == PseudostateKind.DEEPHISTORY) {
-			// if this is the first time we enter this state, prolong the
-			// default transition, else reenter the region
-			if (owningRegion.getCurrentState() == null) {
-				outgoingTransitions.get(0).take();
-			} else {
-				owningRegion.reenter(kind == PseudostateKind.SHALLOWHISTORY
-						? HistoryMode.SHALLOW
-						: HistoryMode.DEEP);
-			}
-		} else if (kind == PseudostateKind.CHOICE) {
-			// choose the first outgoing transition that can be taken and take it
-			getEnabledOutgoingTransitionOfHighestPriority().take();
-		} else if (kind == PseudostateKind.JUNCTION) {
-			// just take the single outgoing transition to the next state
-			outgoingTransitions.get(0).take();
-		} else {
-			throw new IllegalArgumentException("UNSUPPORTED Pseudostate Kind");
-		}
-
-	}
-
-	protected void leave() {
-
-		// do nothing by default
-
-	}
-
-}

+ 0 - 22
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTReaction.java

@@ -1,22 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-
-public class RTReaction {
-
-	protected ITrigger trigger;
-	protected RTAction action;
-
-	public RTReaction(ITrigger trigger, RTAction action) {
-		this.trigger = trigger;
-		this.action = action;
-	}
-
-	public RTAction getAction() {
-		return action;
-	}
-
-	public ITrigger getTrigger() {
-		return trigger;
-	}
-
-}

+ 0 - 106
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTRegion.java

@@ -1,106 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.HashSet;
-import java.util.Set;
-
-public class RTRegion {
-
-	private String id;
-	private int priority;
-	private AbstractStatechart owningStatechart;
-	private RTCompoundState owningState;
-
-	private Set<RTNode> nodes = new HashSet<RTNode>();
-
-	protected RTState currentState;
-
-	public RTRegion(String id, int priority, AbstractStatechart owner) {
-		this.id = id;
-		this.priority = priority;
-		this.owningStatechart = owner;
-		this.owningStatechart.getRegions().add(this);
-	}
-
-	public RTRegion(String id, int priority, RTCompoundState owner) {
-		this.id = id;
-		this.priority = priority;
-		this.owningState = owner;
-		this.owningState.getRegions().add(this);
-	}
-
-	/** Returns the id of the region.
-	 */
-	public String getId() {
-		return id;
-	}
-
-	/** Returns the priority of the region. Regions with lower priority value will be evaluated 
-	 * before regions with higher priority value.
-	 */
-	public int getPriority() {
-		return priority;
-	}
-
-	public AbstractStatechart getStatechart() {
-		if (owningStatechart != null) {
-			return owningStatechart;
-		} else {
-			return owningState.getStatechart();
-		}
-	}
-
-	protected RTCompoundState getOwningState() {
-		return owningState;
-	}
-
-	protected AbstractStatechart getOwningStatechart() {
-		return owningStatechart;
-	}
-
-	public Set<RTNode> getNodes() {
-		return nodes;
-	}
-
-	private RTNode getInitialNode() {
-		for (RTNode node : nodes) {
-			if (node instanceof RTPseudostate
-					&& ((RTPseudostate) node).getKind() == PseudostateKind.INITIAL) {
-				return node;
-			}
-		}
-		throw new IllegalStateException("No initial state present");
-	}
-
-	protected void setCurrentState(RTState state) {
-		this.currentState = state;
-	}
-
-	public RTState getCurrentState() {
-		return currentState;
-	}
-
-	protected void enter() {
-
-		getInitialNode().enter();
-
-	}
-
-	protected void reenter(HistoryMode history) {
-
-		currentState.reenter(history);
-
-	}
-
-	protected void reactOn(Set<RTEvent> events) {
-
-		currentState.reactOn(events);
-
-	}
-
-	protected void leave() {
-
-		currentState.leave();
-
-	}
-
-}

+ 0 - 45
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTSignalEvent.java

@@ -1,45 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public class RTSignalEvent extends RTEvent {
-
-	protected Class<?> type;
-	private Object value;
-
-	public RTSignalEvent(String id, Class<Object> type) {
-		super(id);
-		this.type = type;
-	}
-
-	public RTSignalEvent(String id) {
-		super(id);
-	}
-
-	public RTSignalEvent() {
-		this(null);
-	}
-
-	public Object getValue() {
-		return value;
-	}
-
-	public void setValue(Object value) {
-		this.value = value;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public void setType(Class<?> type) {
-		this.type = type;
-	}
-
-	public Class<?> getType() {
-		return type;
-	}
-	
-	
-	
-	
-
-}

+ 0 - 28
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTSimpleState.java

@@ -1,28 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.Set;
-
-/**
- * Representation of a simple state without nested regions. A simple state may
- * specify a do action, which is executed when the statechart resides "in" this
- * state.
- */
-public class RTSimpleState extends RTState {
-
-	private RTAction doAction;
-
-	public RTSimpleState(String id, String name, RTRegion owningRegion,
-			RTAction entryAction, RTAction doAction, RTAction exitAction) {
-		super(id, name, owningRegion, entryAction, exitAction);
-		this.doAction = doAction;
-	}
-
-	protected void reactLocallyOn(Set<RTEvent> events) {
-		performLocalReactions(events);
-	}
-
-	public RTAction getDoAction() {
-		return doAction;
-	}
- 
-}

+ 0 - 140
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTState.java

@@ -1,140 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Representation of a state (i.e. abstract base class for CompoundState, SimpleState,
- * and FinalState). A state has the unique property, that the system may be "in"
- * it, i.e. the state will - if being entered - react to incoming events of its
- * Statechart until it has been left again (although FinalStates will not show any reaction). 
- * When being entered or left, a state may execute an Action, i.e. its entry or exit action 
- * respectively.
- */
-public abstract class RTState extends RTNode {
-
-	private RTAction entryAction;
-	private RTAction exitAction;
-	private String name;
-
-	protected List<RTReaction> localReactions = new ArrayList<RTReaction>();
-
-	public RTState(String id, String name, RTRegion owningRegion,
-			RTAction entryAction, RTAction exitAction) {
-		super(id, owningRegion);
-		this.name = name;
-		this.entryAction = entryAction;
-		this.exitAction = exitAction;
-		
-	}
-
-	public void addLocalReaction(RTReaction reaction) {
-		localReactions.add(reaction);
-	}
-	
-	public String getName() {
-		return name;
-	}
-
-	protected AbstractStatechart getStatechart() {
-		return owningRegion.getStatechart();
-	}
-
-	protected void enter() {
-
-		owningRegion.setCurrentState(this);
-
-		// see if we have transitions that are time-triggered
-		for (RTTransition transition : outgoingTransitions) {
-			if (transition.isTimeTriggered()) {
-				// register timer with timing service
-				getStatechart().requestTimeEvent(transition.getTimeTrigger());
-			}
-		}
-
-		// execute entry action
-		if (entryAction != null) {
-			entryAction.execute();
-		}
-
-		((RTStatechart) getStatechart()).stateEntered(this);
-
-	}
-
-	protected void reenter(HistoryMode history) {
-
-		enter();
-
-	}
-
-	protected void reactOn(Set<RTEvent> events) {
-
-		RTTransition transition = getEnabledOutgoingTransitionOfHighestPriority(events);
-		if (transition != null) {
-			// if there is an enabled transition, take it
-			transition.take();
-		} else {
-			// otherwise this state might react to it (by executing a do action
-			// or by delegating to nested regions)
-			reactLocallyOn(events);
-		}
-
-	}
-
-	private RTTransition getEnabledOutgoingTransitionOfHighestPriority(
-			Set<RTEvent> events) {
-
-		for (RTTransition transition : outgoingTransitions /* sorted by priority */) {
-			if (transition.isTriggeredBy(events)) {
-				return transition;
-			}
-		}
-		return null;
-
-	}
-
-	protected abstract void reactLocallyOn(Set<RTEvent> events);
-
-	protected void leave() {
-
-		// see if we have transitions that are time-triggered
-		for (RTTransition transition : outgoingTransitions) {
-			if (transition.isTimeTriggered()) {
-				// cancel all time events that could have been requested
-				getStatechart().cancelTimeEvent(transition.getTimeTrigger());
-			}
-		}
-
-		if (exitAction != null) {
-			exitAction.execute();
-		}
-
-		((RTStatechart) getStatechart()).stateLeft(this);
-
-	}
-
-	public RTAction getEntryAction() {
-		return entryAction;
-	}
-
-	public RTAction getExitAction() {
-		return exitAction;
-	}
-
-	
-	protected void performLocalReactions(Set<RTEvent> events) {
-		perfotmParentReactions(events);
-		for (RTReaction reaction : localReactions) {
-			if (reaction.getTrigger().isEnabled(events)) reaction.getAction().execute();
-		}
-	}
-
-	protected void perfotmParentReactions(Set<RTEvent> events) {
-		RTState state = getOwningRegion().getOwningState();
-		if (state != null) {
-			state.performLocalReactions(events);
-		}
-	}
-
-}

+ 0 - 10
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTTimeEvent.java

@@ -1,10 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public abstract class RTTimeEvent extends RTEvent {
-
-	public RTTimeEvent(String id) {
-		super(id);
-	}
-
-	public abstract long getDuration();
-}

+ 0 - 9
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTTimingService.java

@@ -1,9 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public interface RTTimingService {
-
-	public void requestTimeEvent(RTTimeEvent timeEvent);
-
-	public void cancelTimeEvent(RTTimeEvent timeEvent);
-
-}

+ 0 - 171
plugins/org.yakindu.sct.simulation.runtime/src-gen/org/yakindu/sct/simulation/runtime/sgraph/RTTransition.java

@@ -1,171 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Representation of a transition. A transition always connects a source node to
- * a target node. It may react on a time trigger and/or multiple signal triggers
- * and may be additionally guarded. In case a transition is taken, its action
- * will be executed.
- */
-public class RTTransition extends RTReaction {
-
-	private String id;
-	private int priority;
-
-	private RTNode sourceNode;
-	private RTNode targetNode;
-
-	private RTRegion commonAncestorRegion;
-	private List<RTCompoundState> enclosingStatesToEnter;
-	private List<RTCompoundState> enclosingStatesToLeave;
-
-	public RTTransition(String id, int priority, ITrigger trigger, RTAction action,
-			RTNode sourceNode, RTNode targetNode) {
-
-		super(trigger, action);
-		
-		this.id = id;
-		this.priority = priority;
-
-		this.trigger = trigger;
-		this.action = action;
-
-		this.sourceNode = sourceNode;
-		sourceNode.outgoingTransitions.add(this);
-		this.targetNode = targetNode;
-		targetNode.incomingTransitions.add(this);
-
-		// compute common ancestor region
-		commonAncestorRegion = getCommonAncestorRegion(sourceNode, targetNode);
-		commonAncestorRegion.getStatechart().getTransitions().add(this);
-		// compute which enclosing compound states have to be entered or left, when taking the transition
-		enclosingStatesToEnter = getEnclosingStatesToEnter(targetNode,
-				commonAncestorRegion);
-		enclosingStatesToLeave = getEnclosingStatesToLeave(sourceNode,
-				commonAncestorRegion);
-	}
-
-	protected boolean isTriggeredBy(Set<RTEvent> events) {
-
-		return (trigger != null) ? trigger.isEnabled(events) : true ;
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	public int getPriority() {
-		return priority;
-	}
-
-
-	public RTTimeEvent getTimeTrigger() {
-		return trigger.getTimeTrigger();
-	}
-
-	protected boolean isTimeTriggered() {
-		return (trigger != null) ? trigger.getTimeTrigger() != null : false;
-	}
-
-	protected void take() {
-
-		// first perform all local reactions of non effected parent states...
-		if (getCommonParentState() != null) getCommonParentState().performLocalReactions(commonAncestorRegion.getStatechart().currentEvents);
-		
-		// leave all enclosing states from the souceNode's container up to
-		// the common ancestor region
-		for (RTCompoundState state : enclosingStatesToLeave) {
-			state.shallowLeave();
-		}
-		sourceNode.leave();
-
-		((RTStatechart) commonAncestorRegion.getStatechart())
-				.transitionFired(this);
-
-		if (action != null) {
-			action.execute();
-		}
-
-		// enter all enclosing states from the common ancestor region to the
-		// targetNode's container
-		for (RTCompoundState state : enclosingStatesToEnter) {
-			state.shallowEnter();
-		}
-		targetNode.enter();
-
-	}
-
-	private List<RTCompoundState> getEnclosingStatesToEnter(RTNode targetNode,
-			RTRegion commonAncestorRegion) {
-
-		// compute all enclosing state that have to be entered
-		List<RTCompoundState> enclosingStatesToEnter = new ArrayList<RTCompoundState>();
-		RTRegion targetRegion = targetNode.getOwningRegion();
-		while (targetRegion != commonAncestorRegion) {
-			RTCompoundState state = targetRegion.getOwningState();
-			enclosingStatesToEnter.add(state);
-			targetRegion = state.getOwningRegion();
-
-		}
-		Collections.reverse(enclosingStatesToEnter); // ensure entering is done
-														// in reverse order
-		return enclosingStatesToEnter;
-
-	}
-
-	private List<RTCompoundState> getEnclosingStatesToLeave(RTNode sourceNode,
-			RTRegion commonAncestorRegion) {
-
-		// compute all enclosing compound states up to the ancestor region
-		List<RTCompoundState> enclosingStatesToLeave = new ArrayList<RTCompoundState>();
-		RTRegion sourceRegion = sourceNode.getOwningRegion();
-		while (sourceRegion != commonAncestorRegion) {
-			RTCompoundState state = sourceRegion.getOwningState();
-			enclosingStatesToLeave.add(state);
-			sourceRegion = state.getOwningRegion();
-		}
-		return enclosingStatesToLeave;
-
-	}
-
-	private RTRegion getCommonAncestorRegion(RTNode sourceNode, RTNode targetNode) {
-		RTRegion candidate = sourceNode.getOwningRegion();
-		while (candidate != null
-				&& !isRegionAncestorOfNode(candidate, targetNode)) {
-			candidate = candidate.getOwningState() != null ? candidate
-					.getOwningState().getOwningRegion() : null;
-		}
-		return candidate;
-	}
-
-	private boolean isRegionAncestorOfNode(RTRegion region, RTNode node) {
-		if (node.getOwningRegion() == region) {
-			return true;
-		} else {
-			if (node.getOwningRegion().getOwningState() == null) {
-				return false;
-			} else {
-				return isRegionAncestorOfNode(region, node.getOwningRegion()
-						.getOwningState());
-			}
-		}
-	}
-
-	public RTNode getSourceNode() {
-		return sourceNode;
-	}
-
-	public RTNode getTargetNode() {
-		return targetNode;
-	}
-
-	public RTState getCommonParentState() {
-		return (commonAncestorRegion != null)  
-				? commonAncestorRegion.getOwningState()
-				: null;
-	}
-}

+ 0 - 32
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/EvaluationException.java

@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime;
-
-public class EvaluationException extends RuntimeException {
-
-	private static final long serialVersionUID = 3452634362782831486L;
-
-	public EvaluationException() {
-	}
-
-	public EvaluationException(String message) {
-		super(message);
-	}
-
-	public EvaluationException(Throwable cause) {
-		super(cause);
-	}
-
-	public EvaluationException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-}

+ 0 - 37
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/ExecutionScope.java

@@ -1,37 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime;
-
-import java.util.Collection;
-import java.util.Set;
-
-import org.yakindu.sct.simulation.runtime.sgraph.RTSignalEvent;
-import org.yakindu.sct.simulation.runtime.stext.RTVariable;
-
-public interface ExecutionScope {
-
-	Object getValue(String varName);
-
-	RTVariable getVariable(String varName);
-
-	void addVariable(RTVariable var);
-
-	void call(String procedureId);
-
-	void raise(String signal, Object object);
-
-	void setVariableValue(RTVariable variable, Object object);
-	
-	Collection<RTVariable> getVariables();
-
-	Set<RTSignalEvent> getEvents();
-
-}

+ 0 - 83
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/ExecutionScopeAdapter.java

@@ -1,83 +0,0 @@
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.yakindu.sct.simulation.core.ISGraphExecutionScope;
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-import org.yakindu.sct.simulation.runtime.stext.RTVariable;
-
-/**
- * Adapts the {@link ISGraphExecutionScope} interface to the runtime
- * {@link ExecutionScope}
- * 
- */
-public class ExecutionScopeAdapter implements ISGraphExecutionScope {
-
-	private final ExecutionScope scope;
-
-	public ExecutionScopeAdapter(ExecutionScope scope) {
-		this.scope = scope;
-	}
-
-	public ScopeSlot getVariable(String varName) {
-		return toScope(scope.getVariable(varName));
-	}
-
-	public List<ScopeVariable> getVariables() {
-		List<ScopeVariable> scopeVariables = new ArrayList<ScopeVariable>();
-		Collection<RTVariable> variables = scope.getVariables();
-		for (RTVariable rtVariable : variables) {
-			scopeVariables.add(toScope(rtVariable));
-		}
-		return scopeVariables;
-	}
-
-	private ScopeVariable toScope(RTVariable rtVariable) {
-		return new ScopeVariable(rtVariable.getName(), rtVariable.getType(),
-				rtVariable.getValue());
-	}
-
-	public void setSlotValue(ScopeSlot variable, Object object) {
-		RTVariable rtVar = scope.getVariable(variable.getName());
-		scope.setVariableValue(rtVar, object);
-
-	}
-
-	public void createVariable(String varName, Object value, Class<?> type) {
-		RTVariable var = new RTVariable(varName);
-		var.setValue(value);
-		scope.addVariable(var);
-
-	}
-
-	public void call(String procedureId) {
-		// TODO
-	}
-
-	public void raise(String signal) {
-		scope.raise(signal, null);
-	}
-
-	public List<ScopeEvent> getEvents() {
-
-		List<ScopeEvent> scopeEvents = new ArrayList<ScopeEvent>();
-		Collection<RTSignalEvent> events = scope.getEvents();
-		for (RTSignalEvent rtEvent : events) {
-			scopeEvents.add(toScope(rtEvent));
-		}
-		return scopeEvents;
-	}
-	
-	
-	private ScopeEvent toScope(RTSignalEvent rtEvent) {
-		return new ScopeEvent(rtEvent.getId(), rtEvent.getType(), rtEvent.getValue());
-	}
-
-	
-	public void raise(ScopeEvent event) {
-		scope.raise(event.getName(), event.getValue());	
-	}
-	
-}

+ 0 - 59
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/GuardExpression.java

@@ -1,59 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-import org.yakindu.sct.simulation.runtime.stext.RTExpression;
-
-
-public class GuardExpression extends RTGuard {
-
-	private RTExpression expression;
-	private ExecutionScope scope;
-	
-	public GuardExpression() {
-		super();
-	}
-
-	public GuardExpression(RTExpression expression, ExecutionScope scope) {
-		super();
-		this.expression = expression;
-		this.scope = scope;
-	}	
-
-
-	
-	public RTExpression getExpression() {
-		return expression;
-	}
-
-	public void setExpression(RTExpression expression) {
-		this.expression = expression;
-	}
-
-	public ExecutionScope getScope() {
-		return scope;
-	}
-
-	public void setScope(ExecutionScope scope) {
-		this.scope = scope;
-	}
-
-	public boolean evaluate() {
-		Object result = expression.execute(scope);
-		
-		if (result instanceof Boolean)
-			return ((Boolean) result).booleanValue();
-		
-		throw new StatechartRuntimeException();
-	}
-
-}

+ 0 - 60
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/RTActionStatement.java

@@ -1,60 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-import org.yakindu.sct.simulation.runtime.stext.RTStatement;
-
-
-public class RTActionStatement extends RTAction {
-
-	protected RTStatement statement;
-	protected ExecutionScope scope;
-	
-	
-	public RTActionStatement(RTStatement statement, ExecutionScope scope) {
-		super();
-		this.statement = statement;
-		this.scope = scope;
-	}
-	
-	
-
-	public RTStatement getStatement() {
-		return statement;
-	}
-
-
-
-	public void setStatement(RTStatement statement) {
-		this.statement = statement;
-	}
-
-
-
-	public ExecutionScope getScope() {
-		return scope;
-	}
-
-
-
-	public void setScope(ExecutionScope scope) {
-		this.scope = scope;
-	}
-
-
-
-	@Override
-	public void execute() {
-		statement.execute(scope);
-	}
-
-}

+ 0 - 251
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/RTStatechart.java

@@ -1,251 +0,0 @@
-/**
-
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.yakindu.sct.model.sgraph.Transition;
-import org.yakindu.sct.model.sgraph.Vertex;
-import org.yakindu.sct.simulation.core.ISGraphExecutionFacade;
-import org.yakindu.sct.simulation.core.ISGraphExecutionListener;
-import org.yakindu.sct.simulation.core.ISGraphExecutionScope;
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-import org.yakindu.sct.simulation.runtime.stext.RTVariable;
-
-public class RTStatechart extends AbstractStatechart implements ExecutionScope,
-		ISGraphExecutionFacade {
-
-	protected Map<Object, Object> aliasToElementMap = new HashMap<Object, Object>();
-	protected Map<Object, Object> elementToAliasMap = new HashMap<Object, Object>();
-
-	protected Set<RTSignalEvent> events = new HashSet<RTSignalEvent>();
-	protected Map<String, RTSignalEvent> eventMap = new HashMap<String, RTSignalEvent>();
-
-	protected Set<RTVariable> variables = new HashSet<RTVariable>();
-	protected Map<String, RTVariable> variableMap = new HashMap<String, RTVariable>();
-
-	protected Set<RTState> currentStateConfigurartion = new HashSet<RTState>();
-
-	protected List<ISGraphExecutionListener> listeners = new ArrayList<ISGraphExecutionListener>();
-
-	public RTStatechart(String id) {
-		super(id);
-	}
-
-	public RTStatechart(String id, RTTimingService timingService) {
-		super(id, timingService);
-		listeners = new ArrayList<ISGraphExecutionListener>();
-	}
-
-	public RTTimingService getTimingService() {
-		return timingService;
-	}
-
-	public void setTimingService(RTTimingService ts) {
-		timingService = ts;
-	}
-
-	public synchronized void removeExecutionListener(ISGraphExecutionListener listener) {
-		listeners.remove(listener);
-	}
-
-	public synchronized void addExecutionListener(ISGraphExecutionListener listener) {
-		listeners.add(listener);
-	}
-
-	/**
-	 * Adds a signal event definition to the interface of the statechart. only
-	 * those events, that are registered should be used during operation.
-	 * 
-	 * @param event
-	 */
-	public void addSignalEvent(RTSignalEvent event) {
-		events.add(event);
-		eventMap.put(event.getId(), event);
-	}
-
-	/**
-	 * Gets a signal event by its id.
-	 * 
-	 * @param id
-	 * @return the signal event
-	 */
-	public RTSignalEvent getSignalEvent(String id) {
-		return eventMap.get(id);
-	}
-
-	public Set<RTEvent> getRaisedEvents() {
-		return Collections.unmodifiableSet(raisedEvents);
-	}
-
-	/**
-	 * @return The list of all defined signal events of this statechart.
-	 */
-	public Set<RTSignalEvent> getSignalEvents() {
-		return Collections.unmodifiableSet(events);
-	}
-
-	public void addVariable(RTVariable var) {
-		variables.add(var);
-		variableMap.put(var.getName(), var);
-	}
-
-	public Object getValue(String varName) {
-		RTVariable var = getVariable(varName);
-		return (var != null) ? var.getValue() : null;
-	}
-
-	public RTVariable getVariable(String varName) {
-		return variableMap.get(varName);
-	}
-
-	public Set<RTVariable> getVariables() {
-		return Collections.unmodifiableSet(variables);
-	}
-
-	protected synchronized void stateLeft(RTState state) {
-		currentStateConfigurartion.remove(state);
-		for (ISGraphExecutionListener listener : listeners) {
-			listener.stateLeft((Vertex) elementToAliasMap.get(state));
-		}
-	}
-
-	protected synchronized void stateEntered(RTState state) {
-		currentStateConfigurartion.add(state);
-		for (ISGraphExecutionListener listener : listeners) {
-			listener.stateEntered((Vertex) elementToAliasMap.get(state));
-		}
-	}
-
-	protected synchronized void transitionFired(RTReaction trans) {
-		for (ISGraphExecutionListener listener : listeners) {
-			listener.transitionFired((Transition) elementToAliasMap.get(trans));
-		}
-	}
-
-	public synchronized void setVariableValue(RTVariable variable, Object value) {
-		variable.setValue(value);
-		for (ISGraphExecutionListener listener : listeners) {
-			listener.variableValueChanged(variable.getName(), value);
-		}
-	}
-
-	public synchronized Set<RTState> getCurrentStateConfiguration() {
-		return Collections.unmodifiableSet(currentStateConfigurartion);
-	}
-
-	public synchronized void raise(String signal, Object object) {
-		RTSignalEvent event = eventMap.get(signal);
-		event.setValue(object);
-		setEvent(event);
-		for (ISGraphExecutionListener listener : listeners) {
-			listener.eventRaised(signal);
-		}
-
-	}
-
-	public synchronized void reset(String signal) {
-		RTSignalEvent event = eventMap.get(signal);
-		event.setValue(null);
-		raisedEvents.remove(event);
-	}
-
-	public void call(String procedureId) {
-		// TODO Auto-generated method stub
-	}
-
-	/**
-	 * If a node is registered with a key then it can be accessed by the key
-	 * using this method. Before a node can be accessed this way it must be
-	 * registered using {@link #registerNode}.
-	 * 
-	 * @param alias
-	 * @return the node object that is registered for the given key.
-	 */
-	public Object getElementByAlias(Object alias) {
-		return aliasToElementMap.get(alias);
-	}
-
-	/**
-	 * If a node is registered with a key then it can be accessed by the key
-	 * using this method. Before a node can be accessed this way it must be
-	 * registered using {@link #registerNode}.
-	 * 
-	 * @param element
-	 * @return the node object that is registered for the given key.
-	 */
-	public Object getAliasByElement(Object element) {
-		return elementToAliasMap.get(element);
-	}
-
-	/**
-	 * Nodes can optionally be regitered with a key for later lookup.
-	 * 
-	 * @param key
-	 *            the key object
-	 * @param element
-	 *            the node
-	 */
-	public void defineAlias(Object alias, Object element) {
-		aliasToElementMap.put(alias, element);
-		elementToAliasMap.put(element, alias);
-	}
-
-	public List<RTRegion> getAllRegions() {
-		List<RTRegion> allRegions = new ArrayList<RTRegion>();
-
-		allRegions.addAll(getRegions());
-		for (RTRegion region : getRegions()) {
-			addAllRegions(allRegions, region);
-		}
-
-		return allRegions;
-	}
-
-	protected void addAllRegions(List<RTRegion> regions, RTRegion region) {
-		for (RTNode node : region.getNodes()) {
-			if (node instanceof RTCompoundState)
-				addAllRegions(regions, (RTCompoundState) node);
-		}
-	}
-
-	protected void addAllRegions(List<RTRegion> regions, RTCompoundState cState) {
-		regions.addAll(cState.getRegions());
-
-		for (RTRegion region : cState.getRegions()) {
-			addAllRegions(regions, region);
-		}
-	}
-
-	public ISGraphExecutionScope getExecutionScope() {
-		return new ExecutionScopeAdapter(this);
-	}
-
-	public Set<RTSignalEvent> getEvents() {
-		return Collections.unmodifiableSet(events);
-	}
-
-	public Set<Vertex> getStateConfiguration() {
-		Set<Vertex> result = new HashSet<Vertex>();
-		Set<RTState> currentStateConfiguration = getCurrentStateConfiguration();
-		for (RTState rtState : currentStateConfiguration) {
-			result.add((Vertex) elementToAliasMap.get(rtState));
-		}
-		return result;
-	}
-}

+ 0 - 32
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/StatechartRuntimeException.java

@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-public class StatechartRuntimeException extends RuntimeException {
-
-	private static final long serialVersionUID = 1L;
-
-	public StatechartRuntimeException() {
-	}
-
-	public StatechartRuntimeException(String message) {
-		super(message);
-	}
-
-	public StatechartRuntimeException(Throwable cause) {
-		super(cause);
-	}
-
-	public StatechartRuntimeException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-}

+ 0 - 46
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/TimeEventExpression.java

@@ -1,46 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.sgraph;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-import org.yakindu.sct.simulation.runtime.stext.RTTriggerEvent;
-
-public class TimeEventExpression extends org.yakindu.sct.simulation.runtime.sgraph.RTTimeEvent {
-
-	protected RTTriggerEvent.TimeEvent timeEvent;
-	protected ExecutionScope scope;
-
-	public TimeEventExpression(String id, RTTriggerEvent.TimeEvent timeEvent, ExecutionScope scope) {
-		super(id);
-		this.timeEvent = timeEvent;
-		this.scope = scope;
-	}
-
-
-		
-	public RTTriggerEvent.TimeEvent getTimeEvent() {
-			return timeEvent;
-		}
-
-
-
-	public void setTimeEvent(RTTriggerEvent.TimeEvent timeEvent) {
-			this.timeEvent = timeEvent;
-		}
-
-
-	@Override
-	public long getDuration() {
-		return ((Integer)timeEvent.execute(scope)).longValue();
-	}
-
-	
-}

+ 0 - 432
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/sgraph/builder/SGraphBuilder.java

@@ -1,432 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.sgraph.builder;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.EcoreUtil2;
-import org.yakindu.sct.model.sgraph.Choice;
-import org.yakindu.sct.model.sgraph.Effect;
-import org.yakindu.sct.model.sgraph.Entry;
-import org.yakindu.sct.model.sgraph.Event;
-import org.yakindu.sct.model.sgraph.FinalState;
-import org.yakindu.sct.model.sgraph.Region;
-import org.yakindu.sct.model.sgraph.Scope;
-import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.Transition;
-import org.yakindu.sct.model.sgraph.Trigger;
-import org.yakindu.sct.model.sgraph.Variable;
-import org.yakindu.sct.model.stext.stext.EntryEvent;
-import org.yakindu.sct.model.stext.stext.EventSpec;
-import org.yakindu.sct.model.stext.stext.ExitEvent;
-import org.yakindu.sct.model.stext.stext.Expression;
-import org.yakindu.sct.model.stext.stext.LocalReaction;
-import org.yakindu.sct.model.stext.stext.ReactionTrigger;
-import org.yakindu.sct.model.stext.stext.RegularEventSpec;
-import org.yakindu.sct.model.stext.stext.TimeEventSpec;
-import org.yakindu.sct.model.stext.stext.TimeUnit;
-import org.yakindu.sct.simulation.core.ISGraphExecutionBuilder;
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-import org.yakindu.sct.simulation.runtime.sgraph.GuardExpression;
-import org.yakindu.sct.simulation.runtime.sgraph.PseudostateKind;
-import org.yakindu.sct.simulation.runtime.sgraph.RTAction;
-import org.yakindu.sct.simulation.runtime.sgraph.RTActionStatement;
-import org.yakindu.sct.simulation.runtime.sgraph.RTCompoundState;
-import org.yakindu.sct.simulation.runtime.sgraph.RTFinalState;
-import org.yakindu.sct.simulation.runtime.sgraph.RTGuard;
-import org.yakindu.sct.simulation.runtime.sgraph.RTNode;
-import org.yakindu.sct.simulation.runtime.sgraph.RTPseudostate;
-import org.yakindu.sct.simulation.runtime.sgraph.RTReaction;
-import org.yakindu.sct.simulation.runtime.sgraph.RTRegion;
-import org.yakindu.sct.simulation.runtime.sgraph.RTSignalEvent;
-import org.yakindu.sct.simulation.runtime.sgraph.RTSimpleState;
-import org.yakindu.sct.simulation.runtime.sgraph.RTState;
-import org.yakindu.sct.simulation.runtime.sgraph.RTStatechart;
-import org.yakindu.sct.simulation.runtime.sgraph.RTTimeEvent;
-import org.yakindu.sct.simulation.runtime.sgraph.RTTransition;
-import org.yakindu.sct.simulation.runtime.stext.Function;
-import org.yakindu.sct.simulation.runtime.stext.FunctionMethod;
-import org.yakindu.sct.simulation.runtime.stext.RTExpression;
-import org.yakindu.sct.simulation.runtime.stext.RTStatement;
-import org.yakindu.sct.simulation.runtime.stext.RTTrigger;
-import org.yakindu.sct.simulation.runtime.stext.RTVariable;
-import org.yakindu.sct.simulation.runtime.stext.builder.STextBuilder;
-
-/**
- * 
- * @author axel terfloth
- * @author andreas muelder
- * 
- */
-public class SGraphBuilder extends Function implements ISGraphExecutionBuilder {
-
-	private STextBuilder textBuilder;
-
-	public SGraphBuilder() {
-		textBuilder = new STextBuilder();
-	}
-
-	protected static Comparator<RTRegion> regionComparator = new Comparator<RTRegion>() {
-		public int compare(RTRegion o1, RTRegion o2) {
-			return o1.getPriority() - o2.getPriority();
-		}
-	};
-
-	public RTStatechart build(Statechart source) {
-		RTStatechart sc = new RTStatechart(source.getName());
-		// Build the structure with states and regions
-		build(sc, source.eContents());
-		// Build the transitions
-		EList<EObject> allContentsOfType = new BasicEList<EObject>(
-				EcoreUtil2.getAllContentsOfType(source, Transition.class));
-		build(sc, allContentsOfType);
-		return sc;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTStatechart statechart, Scope scope) {
-		build(statechart, new BasicEList<EObject>(scope.getDeclarations()));
-		return statechart;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTStatechart tParent, Event event) {
-		RTSignalEvent signalEvent = (RTSignalEvent) textBuilder.build(event);
-		tParent.addSignalEvent(signalEvent);
-		tParent.defineAlias(event, signalEvent);
-		return event;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTStatechart statechart, Region region) {
-		RTRegion runtimeRegion = new RTRegion("" + region.getPriority(),
-				region.getPriority(), statechart);
-		Collections.sort(statechart.getRegions(), regionComparator);
-		build(runtimeRegion, region.eContents());
-		return runtimeRegion;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTCompoundState compoundState, Region region) {
-		RTRegion runtimeRegion = new RTRegion("" + region.getPriority(),
-				region.getPriority(), compoundState);
-		Collections.sort(compoundState.getRegions(), regionComparator);
-		build(runtimeRegion, region.eContents());
-		return runtimeRegion;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTRegion region, Choice choice) {
-		RTPseudostate runtimeChoice = new RTPseudostate("", region,
-				PseudostateKind.CHOICE);
-		((RTStatechart) region.getStatechart()).defineAlias(choice,
-				runtimeChoice);
-		return runtimeChoice;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTRegion runtimeRegion, Entry entry) {
-		PseudostateKind kind = null;
-		switch (entry.getKind()) {
-		case INITIAL:
-			kind = PseudostateKind.INITIAL;
-			break;
-		case DEEP_HISTORY:
-			kind = PseudostateKind.DEEPHISTORY;
-			break;
-		case SHALLOW_HISTORY:
-			kind = PseudostateKind.SHALLOWHISTORY;
-			break;
-		default:
-			throw new IllegalStateException("Unknown Entry kind "
-					+ entry.getKind());
-		}
-		RTPseudostate pseudoState = new RTPseudostate(runtimeRegion.getId()
-				+ "." + "TODO", runtimeRegion, kind);
-		((RTStatechart) runtimeRegion.getStatechart()).defineAlias(entry,
-				pseudoState);
-		return pseudoState;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTStatechart statechart, Variable definition) {
-		RTVariable var = (RTVariable) textBuilder.build(definition);
-		statechart.addVariable(var);
-		statechart.defineAlias(definition, var);
-		return var;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTRegion parent, State state) {
-		RTState runtimeState = null;
-
-		LocalReaction entryReaction = getReactionByTriggerEventType(state,
-				EntryEvent.class);
-		LocalReaction exitReaction = getReactionByTriggerEventType(state,
-				ExitEvent.class);
-
-		List<LocalReaction> localReactions = getLocalReactions(state);
-		if (entryReaction != null)
-			localReactions.remove(entryReaction);
-		if (exitReaction != null)
-			localReactions.remove(exitReaction);
-
-		// Build the transition action
-		RTAction entryAction = buildAction(
-				(RTStatechart) parent.getStatechart(), entryReaction);
-		RTAction exitAction = buildAction(
-				(RTStatechart) parent.getStatechart(), exitReaction);
-
-		if (state.isSubmachine()) {
-			runtimeState = new RTCompoundState(parent.getId() + "."
-					+ state.getName(), state.getName(), parent, entryAction,
-					exitAction);
-
-			EList<Region> regions = state.getSubstatechart().getRegions();
-			EList<EObject> contents = new BasicEList<EObject>();
-			contents.addAll(regions);
-			build(runtimeState, contents);
-
-			// Build the scopes
-			EList<EObject> scopes = new BasicEList<EObject>();
-			scopes.addAll(state.getSubstatechart().getScopes());
-			build(parent.getStatechart(), scopes);
-			// Build the transitions
-			EList<EObject> transitions = new BasicEList<EObject>(
-					EcoreUtil2.getAllContentsOfType(state.getSubstatechart(),
-							Transition.class));
-			build(parent.getStatechart(), transitions);
-
-		} else if (state.isComposite()) {
-			runtimeState = new RTCompoundState(parent.getId() + "."
-					+ state.getName(), state.getName(), parent, entryAction,
-					exitAction);
-			build(runtimeState, state.eContents());
-
-		} else if (state.isSimple()) {
-			runtimeState = new RTSimpleState(parent.getId() + "."
-					+ state.getName(), state.getName(), parent, entryAction,
-					null, exitAction);
-		}
-
-		for (LocalReaction reaction : localReactions) {
-			runtimeState.addLocalReaction(buildReaction(
-					(RTStatechart) parent.getStatechart(), reaction));
-		}
-
-		((RTStatechart) parent.getStatechart())
-				.defineAlias(state, runtimeState);
-
-		return runtimeState;
-	}
-
-	private RTReaction buildReaction(RTStatechart context,
-			LocalReaction reaction) {
-		Trigger trigger = reaction.getTrigger();
-		RTTrigger rtTrigger = buildTrigger(context, trigger);
-
-		RTAction action = buildAction(context, reaction.getEffect());
-
-		return new RTReaction(rtTrigger, action);
-	}
-
-	protected RTAction buildAction(ExecutionScope scope,
-			LocalReaction entryReaction) {
-		if (entryReaction != null) {
-			Effect effect = entryReaction.getEffect();
-			RTStatement statement = (RTStatement) textBuilder.build(effect);
-			if (statement != null) {
-				return new RTActionStatement(statement, scope);
-			}
-		}
-		return null;
-	}
-
-	protected <T extends EObject> LocalReaction getReactionByTriggerEventType(
-			State state, Class<T> triggerType) {
-
-		// TODO: derive localReactions from scope.
-		for (Scope declarationScope : state.getScopes()) {
-			EList<EObject> entryEvents = new BasicEList<EObject>(
-					EcoreUtil2.getAllContentsOfType(declarationScope,
-							triggerType));
-
-			if (!entryEvents.isEmpty()) {
-				return (LocalReaction) entryEvents.get(0).eContainer()
-						.eContainer();
-			}
-		}
-		return null;
-	}
-
-	protected List<LocalReaction> getLocalReactions(State state) {
-
-		// TODO: derive localReactions from scope.
-		for (Scope declarationScope : state.getScopes()) {
-			return EcoreUtil2.getAllContentsOfType(declarationScope,
-					LocalReaction.class);
-		}
-		return null;
-	}
-
-	protected LocalReaction getExitReaction(State state) {
-		return null;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTRegion runtimeRegion, FinalState finalState) {
-		RTFinalState state = new RTFinalState(runtimeRegion.getId()
-				+ ".<final>", runtimeRegion);
-		((RTStatechart) runtimeRegion.getStatechart()).defineAlias(finalState,
-				state);
-		return state;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTCompoundState compound, Transition transition) {
-		// TODO
-		return null;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTCompoundState compound, Scope scope) {
-		// TODO
-		return null;
-	}
-
-	@FunctionMethod("")
-	public Object build(RTStatechart tParent, Transition transition) {
-		RTNode fromNode = (RTNode) tParent.getElementByAlias(transition
-				.getSource());
-		RTNode toNode = (RTNode) tParent.getElementByAlias(transition
-				.getTarget());
-
-		if (fromNode == null || toNode == null)
-			return null; // >>>>>>>>> exit here on false precondition
-
-		Trigger trigger = transition.getTrigger();
-		RTTrigger rtTrigger = buildTrigger(tParent, trigger);
-
-		RTAction action = buildAction(tParent, transition.getEffect());
-
-		String id = "t@"
-				+ transition.getSource().getOutgoingTransitions()
-						.indexOf(transition);
-		RTReaction tTrans = new RTTransition(id, transition.getPriority(),
-				rtTrigger, action, fromNode, toNode);
-		tParent.defineAlias(transition, tTrans);
-
-		return tTrans;
-	}
-
-	protected RTAction buildAction(RTStatechart tParent, Effect effect) {
-		// Build the transition action
-		RTAction action = null;
-		RTStatement statement = (RTStatement) textBuilder.build(effect);
-		if (statement != null) {
-			action = new RTActionStatement(statement, tParent);
-		}
-		return action;
-	}
-
-	protected RTTrigger buildTrigger(RTStatechart tParent,
-
-	Trigger trigger) {
-
-		RTTrigger rtTrigger = null;
-		RTTimeEvent timeTrigger = null;
-		Set<RTSignalEvent> signalTriggers = new HashSet<RTSignalEvent>();
-		RTGuard guard = null;
-
-		// // TODO: Das muss hier raus:
-		if (trigger instanceof ReactionTrigger) {
-			EList<EventSpec> triggers = ((ReactionTrigger) trigger)
-					.getTriggers();
-			for (EventSpec eventSpec : triggers) {
-				if (eventSpec instanceof RegularEventSpec) {
-					Event event = ((RegularEventSpec) eventSpec).getEvent();
-					String name = event.getName();
-					RTSignalEvent signalEvent = tParent.getSignalEvent(name);
-					if (signalEvent != null) {
-						signalTriggers.add(signalEvent);
-					}
-				}
-				if (eventSpec instanceof TimeEventSpec) {
-					final TimeUnit unit = ((TimeEventSpec) eventSpec).getUnit();
-
-					final long value = ((TimeEventSpec) eventSpec).getValue();
-					timeTrigger = new RTTimeEvent("id") {
-						@Override
-						public long getDuration() {
-							if (unit == TimeUnit.SECOND) {
-								return value * 1000;
-							} else if (unit == TimeUnit.MILLISECOND) {
-								return value;
-							} else if (unit == TimeUnit.NANOSECOND) {
-								return value / 1000;
-							}
-							return value;
-						}
-					};
-
-				}
-				// TODO: TimeEvent
-			}
-
-			// Build the transition action
-			Expression guardExp = ((ReactionTrigger) trigger)
-					.getGuardExpression();
-			RTExpression rtGuardExp = (RTExpression) textBuilder
-					.build(guardExp);
-			if (rtGuardExp != null) {
-				guard = new GuardExpression(rtGuardExp, tParent);
-			}
-
-			rtTrigger = new RTTrigger(timeTrigger, signalTriggers, guard);
-		}
-		return rtTrigger;
-	}
-
-	protected void build(Object targetParent, EList<EObject> sourceChildren) {
-		for (EObject source : sourceChildren) {
-			build(targetParent, source);
-		}
-	}
-
-	protected Object build(Object targetParent, EObject sourceChild) {
-		if (sourceChild == null)
-			return null;
-
-		Object[] params = new Object[] { targetParent, sourceChild };
-
-		Function f = lookup(this.getClass(), "build", params);
-		if (f != null)
-			return f.execute(params);
-
-		throw new IllegalStateException("No function  build("
-				+ targetParent.getClass().getName() + ", "
-				+ sourceChild.eClass().getName() + ") !");
-	}
-
-	public boolean isBuilderFor(EObject context) {
-		String resourceExtension = context.eResource().getURI().lastSegment();
-		return resourceExtension.endsWith("sct");
-	}
-
-}

+ 0 - 29
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Assert.java

@@ -1,29 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.EvaluationException;
-
-public class Assert {
-	
-	
-	private Assert() {
-		super();
-	}
-
-	
-	public static Boolean filterBoolean(Object value) {
-		if (value instanceof Boolean) return (Boolean) value;
-		
-		throw new EvaluationException("Boolean value expected");
-	}
-
-}

+ 0 - 54
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Assign.java

@@ -1,54 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-/**
- * 
- * @author terfloth@itemis.de
- * 
- */
-public class Assign implements RTStatement {
-
-	protected VariableRef varRef;
-	protected RTExpression expression;
-
-	public Assign() {
-		super();
-	}
-
-	public Assign(VariableRef varRef, RTExpression expression) {
-		this();
-		this.varRef = varRef;
-		this.expression = expression;
-	}
-
-	public VariableRef getVarRef() {
-		return varRef;
-	}
-
-	public void setVarRef(VariableRef varRef) {
-		this.varRef = varRef;
-	}
-
-	public RTExpression getExpression() {
-		return expression;
-	}
-
-	public void setExpression(RTExpression expression) {
-		this.expression = expression;
-	}
-
-	public void execute(ExecutionScope scope) {
-		scope.setVariableValue(varRef.getVariable(scope),(expression.execute(scope)));
-	}
-}

+ 0 - 113
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/BinaryOperation.java

@@ -1,113 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.EvaluationException;
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public class BinaryOperation implements RTExpression {
-
-	
-	protected RTExpression expr1;
-	protected RTExpression expr2;
-	protected Operator   operator;
-	
-	public BinaryOperation() {
-	}
-	
-	public BinaryOperation(Operator operator, RTExpression expr1, RTExpression expr2) {
-		super();
-		this.expr1 = expr1;
-		this.expr2 = expr2;
-		this.operator = operator;
-	}
-
-	public BinaryOperation(String operator, RTExpression expr1, RTExpression expr2) {
-		this(new Operator(operator), expr1, expr2);
-	}
-
-	public RTExpression getExpr1() {
-		return expr1;
-	}
-
-	public void setExpr1(RTExpression expr1) {
-		this.expr1 = expr1;
-	}
-
-	public RTExpression getExpr2() {
-		return expr2;
-	}
-
-	public void setExpr2(RTExpression expr2) {
-		this.expr2 = expr2;
-	}
-
-	public Operator getOperator() {
-		return operator;
-	}
-
-	public void setOperator(Operator operator) {
-		this.operator = operator;
-	}
-
-	public Object execute(ExecutionScope scope) {
-		return operator.execute(this, scope);
-	}
-
-		
-	public static class Operator{
-
-		protected String function = null;
-		
-		
-		public Operator() {
-			super();
-		}
-
-		public Operator(String function) {
-			super();
-			this.function = function;
-		}
-
-		public Object execute(BinaryOperation operation, ExecutionScope scope) {
-			Object[] operands = new Object[2];
-			operands[0] = operation.expr1.execute(scope);
-			operands[1] = operation.expr2.execute(scope);
-		
-			Function func = Function.lookup(CoreFunction.class, function, operands);
-			if (func == null) 
-				throw new EvaluationException("Can't resolve function '" + function 
-						+ "' for types (" + operands[0].getClass().getName() + ", " 
-						+  operands[1].getClass().getName() + ") !");
-
-			return func.execute(operands);
-		}		
-	}
-	
-	
-	public static Operator OR = new Operator() {
-		public Object execute(BinaryOperation operation, ExecutionScope scope) {
-			return Assert.filterBoolean( operation.expr1.execute(scope)).booleanValue() 
-					? Boolean.TRUE
-					: Assert.filterBoolean( operation.expr2.execute(scope) ) ; 
-		}
-	};
-
-	public static Operator AND = new Operator() {
-		public Object execute(BinaryOperation operation, ExecutionScope scope) {
-			return Assert.filterBoolean( operation.expr1.execute(scope)).booleanValue() 
-					? Assert.filterBoolean( operation.expr2.execute(scope) )
-					: Boolean.FALSE ; 
-		}
-	};
-
-	
-}

+ 0 - 78
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Conditional.java

@@ -1,78 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public class Conditional implements RTExpression {
-
-	protected RTExpression condition;
-	protected RTExpression trueValue;
-	protected RTExpression falseValue;
-	
-	
-	public Conditional() {
-	}
-	
-	
-	public Conditional(RTExpression condition, RTExpression trueValue, RTExpression falseValue) {
-		super();
-		this.condition = condition;
-		this.trueValue = trueValue;
-		this.falseValue = falseValue;
-	}
-
-
-	
-	public RTExpression getCondition() {
-		return condition;
-	}
-
-
-	public void setCondition(RTExpression condition) {
-		this.condition = condition;
-	}
-
-
-	public RTExpression getTrueValue() {
-		return trueValue;
-	}
-
-
-	public void setTrueValue(RTExpression trueValue) {
-		this.trueValue = trueValue;
-	}
-
-
-	public RTExpression getFalseValue() {
-		return falseValue;
-	}
-
-
-	public void setFalseValue(RTExpression falseValue) {
-		this.falseValue = falseValue;
-	}
-
-
-	public Object execute(ExecutionScope scope) {
-		
-		Object conditionResult = condition.execute(scope);
-		
-		if (! (conditionResult instanceof Boolean)) {
-			throw new RuntimeException("Evaluation Error: condition must be boolean.");
-		}
-		
-		return ((Boolean) conditionResult).booleanValue() ? 
-				trueValue.execute(scope) : 
-				falseValue.execute(scope);
-	}
-
-}

+ 0 - 38
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Constant.java

@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-/**
- * 
- * @author terfloth@itemis.de
- *
- */
-public class Constant implements RTExpression {
-	
-	protected Object value;
-	
-	public Constant(Object value) {
-		super();
-		this.value = value;
-	}
-
-	public Object getValue() {
-		return value;
-	}
-
-	public Object execute(ExecutionScope scope) {
-		return value;
-	}
-	
-	
-}

+ 0 - 358
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/CoreFunction.java

@@ -1,358 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-public class CoreFunction extends Function {
-
-	public static String EQUALS = "==";
-	public static String NOT_EQUALS = "!=";
-	public static String SMALLER = "<";
-	public static String SMALLER_EQUAL = "<=";
-	public static String GREATER = ">";
-	public static String GREATER_EQUAL = ">=";
-
-	public static String BIT_AND = "&";
-	public static String BIT_OR = "|";
-	public static String BIT_XOR = "^";
-	public static String BIT_LSHIFT = "<<";
-	public static String BIT_RSHIFT = ">>";
-	public static String BIT_COMPLEMENT = "~";
-
-	public static String PLUS = "+";
-	public static String MINUS = "-";
-	public static String MULTIPLY = "*";
-	public static String DIVIDE = "/";
-	public static String MODULO = "%";
-
-	public static String POSITIVE = "+";
-	public static String NEGATIVE = "-";
-	public static String NOT = "!";
-
-	@FunctionMethod("+")
-	public Integer plus(Integer i1, Integer i2) {
-		return i1 + i2;
-	}
-
-	@FunctionMethod("+")
-	public Float plus(Float f1, Float f2) {
-		return f1 + f2;
-	}
-
-	@FunctionMethod("+")
-	public Float plus(Integer f1, Float f2) {
-		return f1 + f2;
-	}
-
-	@FunctionMethod("+")
-	public Float plus(Float f1, Integer f2) {
-		return f1 + f2;
-	}
-
-	@FunctionMethod("+")
-	public Integer positive(Integer i) {
-		return i;
-	}
-
-	@FunctionMethod("+")
-	public Float positive(Float f) {
-		return f;
-	}
-
-	@FunctionMethod("-")
-	public Integer negative(Integer i) {
-		return -i;
-	}
-
-	@FunctionMethod("-")
-	public Float negative(Float f) {
-		return -f;
-	}
-
-	@FunctionMethod("-")
-	public Integer minus(Integer i1, Integer i2) {
-		return i1 - i2;
-	}
-
-	@FunctionMethod("-")
-	public Float minus(Integer i1, Float i2) {
-		return i1 - i2;
-	}
-
-	@FunctionMethod("-")
-	public Float minus(Float i1, Integer i2) {
-		return i1 - i2;
-	}
-
-	@FunctionMethod("-")
-	public Float minus(Float i1, Float i2) {
-		return i1 - i2;
-	}
-
-	@FunctionMethod("*")
-	public Integer mul(Integer i1, Integer i2) {
-		return i1 * i2;
-	}
-
-	@FunctionMethod("*")
-	public Float mul(Integer i1, Float i2) {
-		return i1 * i2;
-	}
-
-	@FunctionMethod("*")
-	public Float mul(Float i1, Integer i2) {
-		return i1 * i2;
-	}
-
-	@FunctionMethod("*")
-	public Float mul(Float i1, Float i2) {
-		return i1 * i2;
-	}
-
-	@FunctionMethod("/")
-	public Integer div(Integer i1, Integer i2) {
-		return i1 / i2;
-	}
-
-	@FunctionMethod("/")
-	public Float div(Float i1, Integer i2) {
-		return i1 / i2;
-	}
-
-	@FunctionMethod("/")
-	public Float div(Integer i1, Float i2) {
-		return i1 / i2;
-	}
-
-	@FunctionMethod("/")
-	public Float div(Float i1, Float i2) {
-		return i1 / i2;
-	}
-
-	@FunctionMethod("%")
-	public Integer mod(Integer i1, Integer i2) {
-		return i1 % i2;
-	}
-
-	@FunctionMethod("%")
-	public Float mod(Integer i1, Float i2) {
-		return i1 % i2;
-	}
-
-	@FunctionMethod("%")
-	public Float mod(Float i1, Integer i2) {
-		return i1 % i2;
-	}
-
-	@FunctionMethod("%")
-	public Float mod(Float i1, Float i2) {
-		return i1 % i2;
-	}
-
-	@FunctionMethod("<<")
-	public Integer left(Integer i1, Integer i2) {
-		return i1 << i2;
-	}
-
-	@FunctionMethod(">>")
-	public Integer right(Integer i1, Integer i2) {
-		return i1 >> i2;
-	}
-
-	@FunctionMethod("&")
-	public Integer bitwiseAnd(Integer i1, Integer i2) {
-		return i1 & i2;
-	}
-
-	@FunctionMethod("|")
-	public Integer bitwiseOr(Integer i1, Integer i2) {
-		return i1 | i2;
-	}
-
-	@FunctionMethod("^")
-	public Integer bitwiseXor(Integer i1, Integer i2) {
-		return i1 ^ i2;
-	}
-
-	@FunctionMethod("^")
-	public Long bitwiseXor(Long l1, Long l2) {
-		return l1 ^ l2;
-	}
-
-	@FunctionMethod("==")
-	public Boolean equals(Boolean b1, Boolean b2) {
-		return b1.equals(b2);
-	}
-
-	@FunctionMethod("==")
-	public Boolean equals(Integer i1, Integer i2) {
-		return i1.intValue() == i2.intValue();
-	}
-
-	@FunctionMethod("==")
-	public Boolean equals(Float i1, Integer i2) {
-		return i1.intValue() == i2.intValue();
-	}
-
-	@FunctionMethod("==")
-	public Boolean equals(Integer i1, Float i2) {
-		return i1.intValue() == i2.intValue();
-	}
-
-	@FunctionMethod("==")
-	public Boolean equals(Float i1, Float i2) {
-		return i1.floatValue() == i2.floatValue();
-	}
-
-	@FunctionMethod("==")
-	public Boolean equals(String string1, String string2) {
-		return string1.equals(string2);
-	}
-
-	@FunctionMethod("!=")
-	public Boolean notEquals(Boolean b1, Boolean b2) {
-		return b1.booleanValue() != b2.booleanValue();
-	}
-
-	@FunctionMethod("!=")
-	public Boolean notEquals(Integer i1, Integer i2) {
-		return i1.intValue() != i2.intValue();
-	}
-
-	@FunctionMethod("!=")
-	public Boolean notEquals(Integer i1, Float i2) {
-		return i1.intValue() != i2.intValue();
-	}
-
-	@FunctionMethod("!=")
-	public Boolean notEquals(Float i1, Integer i2) {
-		return i1.intValue() != i2.intValue();
-	}
-
-	@FunctionMethod("!=")
-	public Boolean notEquals(Float i1, Float i2) {
-		return i1.floatValue() != i2.floatValue();
-	}
-
-	@FunctionMethod("!=")
-	public Boolean notEquals(String i1, String i2) {
-		return !i1.equals(i2);
-	}
-
-	@FunctionMethod(">=")
-	public Boolean greaterEqual(Integer i1, Integer i2) {
-		return i1 >= i2;
-	}
-
-	@FunctionMethod(">=")
-	public Boolean greaterEqual(Integer i1, Float i2) {
-		return i1 >= i2;
-	}
-
-	@FunctionMethod(">=")
-	public Boolean greaterEqual(Float i1, Integer i2) {
-		return i1 >= i2;
-	}
-
-	@FunctionMethod(">=")
-	public Boolean greaterEqual(Float i1, Float i2) {
-		return i1 >= i2;
-	}
-
-	@FunctionMethod("<=")
-	public Boolean smallerEqual(Integer i1, Integer i2) {
-		return i1 <= i2;
-	}
-
-	@FunctionMethod("<=")
-	public Boolean smallerEqual(Integer i1, Float i2) {
-		return i1 <= i2;
-	}
-
-	@FunctionMethod("<=")
-	public Boolean smallerEqual(Float i1, Integer i2) {
-		return i1 <= i2;
-	}
-
-	@FunctionMethod("<=")
-	public Boolean smallerEqual(Float i1, Float i2) {
-		return i1 <= i2;
-	}
-
-	@FunctionMethod(">")
-	public Boolean greater(Integer i1, Integer i2) {
-		return i1 > i2;
-	}
-
-	@FunctionMethod(">")
-	public Boolean greater(Float i1, Integer i2) {
-		return i1 > i2;
-	}
-
-	@FunctionMethod(">")
-	public Boolean greater(Integer i1, Float i2) {
-		return i1 > i2;
-	}
-
-	@FunctionMethod(">")
-	public Boolean greater(Float i1, Float i2) {
-		return i1 > i2;
-	}
-
-	@FunctionMethod("<")
-	public Boolean smaller(Integer i1, Integer i2) {
-		return i1 < i2;
-	}
-
-	@FunctionMethod("<")
-	public Boolean smaller(Integer i1, Float i2) {
-		return i1 < i2;
-	}
-
-	@FunctionMethod("<")
-	public Boolean smaller(Float i1, Integer i2) {
-		return i1 < i2;
-	}
-
-	@FunctionMethod("<")
-	public Boolean smaller(Float i1, Float i2) {
-		return i1 < i2;
-	}
-
-	@FunctionMethod("!")
-	public Boolean not(Boolean b) {
-		return !b;
-	}
-
-	@FunctionMethod("+")
-	public Boolean positive(Boolean b) {
-		return b;
-	}
-
-	@FunctionMethod("+")
-	public String positive(String s) {
-		return s;
-	}
-
-	@FunctionMethod("+")
-	public Double positive(Double d) {
-		return d;
-	}
-
-	@FunctionMethod("-")
-	public Double negative(Double d) {
-		return -d;
-	}
-
-	@FunctionMethod("~")
-	public Integer complement(Integer i) {
-		return ~i;
-	}
-}

+ 0 - 33
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/ExpressionRuntimeException.java

@@ -1,33 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-public class ExpressionRuntimeException extends RuntimeException {
-
-	private static final long serialVersionUID = 1L;
-
-	public ExpressionRuntimeException() {
-		// TODO Auto-generated constructor stub
-	}
-
-	public ExpressionRuntimeException(String message) {
-		super(message);
-	}
-
-	public ExpressionRuntimeException(Throwable cause) {
-		super(cause);
-	}
-
-	public ExpressionRuntimeException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-}

+ 0 - 188
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Function.java

@@ -1,188 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.yakindu.sct.simulation.runtime.EvaluationException;
-
-/**
- * 
- * @author axel terfloth
- * @author andreas muelder
- * 
- */
-public class Function {
-	/**
-	 * Sorts a {@link Collection} of {@link Method} . The most specialized
-	 * parameter types are put first.
-	 * 
-	 * @author muelder
-	 * 
-	 */
-	public static class PolymorphicComparator implements Comparator<Method> {
-
-		public int compare(Method method1, Method method2) {
-			Class<?>[] parameterTypes1 = method1.getParameterTypes();
-			Class<?>[] parameterTypes2 = method2.getParameterTypes();
-
-			if (parameterTypes1.length != parameterTypes2.length)
-				return -1;
-
-			for (int i = 0; i < parameterTypes1.length; i++) {
-				final Class<?> class1 = parameterTypes1[i];
-				final Class<?> class2 = parameterTypes2[i];
-				if (class1.equals(class2))
-					continue;
-				if (class1.isAssignableFrom(class2)
-						|| Void.class.equals(class2)) {
-					return 1;
-				}
-				if (class2.isAssignableFrom(class1)
-						|| Void.class.equals(class1)) {
-					return -1;
-				}
-			}
-			return 0;
-		}
-	}
-
-	protected Method functionMethod;
-
-	/**
-	 * Looks up the appropriate function for the given parameter types. This
-	 * lookup currently does not perform a polymophic lookup.
-	 * 
-	 * @param name
-	 * @param paramTypes
-	 * @return
-	 */
-	public static Function lookup(Class<?> functionClass, String name,
-			Class<?>[] paramTypes) {
-
-		List<Method> functionMethods = new ArrayList<Method>();
-		addFunctionMethods(functionClass, functionMethods);
-		Collections.sort(functionMethods, new PolymorphicComparator());
-		for (Method fMethod : functionMethods) {
-			FunctionMethod fAnno = fMethod.getAnnotation(FunctionMethod.class);
-			if ((name.equals(fMethod.getName())) || name.equals(fAnno.value())) {
-				if (isCallable(paramTypes, fMethod.getParameterTypes())) {
-					return createFunction(functionClass, fMethod);
-				}
-			}
-		}
-		return null;
-	}
-
-	private static void addFunctionMethods(Class<?> functionClass,
-			List<Method> methodList) {
-		List<Method> result = new ArrayList<Method>();
-		Method[] methods = functionClass.getDeclaredMethods();
-		for (int i = 0; i < methods.length; i++) {
-			Method fMethod = methods[i];
-			FunctionMethod fAnno = fMethod.getAnnotation(FunctionMethod.class);
-			if (fAnno != null) {
-				result.add(fMethod);
-			}
-		}
-		methodList.addAll(result);
-		if (functionClass.getSuperclass() != null) {
-			addFunctionMethods(functionClass.getSuperclass(), methodList);
-		}
-	}
-
-	private static boolean isCallable(Class<?>[] paramTypes,
-			Class<?>[] parameterTypes) {
-		if (paramTypes.length != parameterTypes.length)
-			return false;
-		for (int i = 0; i < paramTypes.length; i++) {
-			Class<?> class1 = paramTypes[i];
-			Class<?> class2 = parameterTypes[i];
-			if (!class2.isAssignableFrom(class1))
-				return false;
-		}
-		return true;
-
-	}
-
-	public static Function lookup(Class<?> functionClass, String name,
-			Object[] params) {
-		Class<?>[] paramTypes = new Class<?>[params.length];
-		for (int i = 0; i < params.length; i++) {
-			paramTypes[i] = params[i].getClass();
-		}
-		return lookup(functionClass, name, paramTypes);
-	}
-
-	protected static Function createFunction(Class<?> functionClass,
-			Method functionMethod) {
-
-		if (functionClass == null || functionMethod == null)
-			return null;
-
-		try {
-			Constructor<?> constr;
-			try {
-				constr = (Constructor<?>) functionClass
-						.getConstructor(new Class<?>[0]);
-			} catch (NoSuchMethodException e) {
-				throw new ExpressionRuntimeException(
-						"Missing default constructor in class "
-								+ functionClass.getName()
-								+ " while loading function "
-								+ functionMethod.getName() + " !");
-			}
-
-			Function func = (Function) constr.newInstance(new Object[0]);
-			func.setFunctionMethod(functionMethod);
-			return func;
-
-		} catch (ExpressionRuntimeException e) {
-			throw e;
-		} catch (Exception e) {
-			throw new ExpressionRuntimeException("Error loading function "
-					+ functionMethod.getName() + " from function class "
-					+ functionClass.getName() + " !", e);
-		}
-	}
-
-	public Function() {
-		super();
-	}
-
-	public Method getFunctionMethod() {
-		return functionMethod;
-	}
-
-	public void setFunctionMethod(Method functionMethod) {
-		this.functionMethod = functionMethod;
-	}
-
-	public Object execute(Object[] params) {
-		try {
-			return getFunctionMethod().invoke(this, params);
-		} catch (IllegalArgumentException e) {
-			throw new EvaluationException(e);
-		} catch (IllegalAccessException e) {
-			throw new EvaluationException(e);
-		} catch (InvocationTargetException e) {
-			throw new EvaluationException(e.getCause());
-		}
-	}
-
-}

+ 0 - 30
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/FunctionMethod.java

@@ -1,30 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-
-/**
- * Indicates that a method is a function.
- * 
- * @author terfloth@itemis.de 
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface FunctionMethod {
-	String value() ;
-}

+ 0 - 42
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/ProcedureCall.java

@@ -1,42 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public class ProcedureCall implements RTStatement {
-
-	protected String procedureId;
-	
-	
-	public ProcedureCall() {
-		super();
-	}
-
-	public ProcedureCall(String procedureId) {
-		super();
-		this.procedureId = procedureId;
-	}
-	
-
-	public String getProcedureId() {
-		return procedureId;
-	}
-
-	public void setProcedureId(String procedureId) {
-		this.procedureId = procedureId;
-	}
-
-	public void execute(ExecutionScope scope) {
-		scope.call(procedureId);
-	}
-
-}

+ 0 - 19
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTExpression.java

@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public interface RTExpression {
-	
-	Object execute(ExecutionScope scope);
-
-}

+ 0 - 85
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTScope.java

@@ -1,85 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-import org.yakindu.sct.simulation.runtime.sgraph.RTSignalEvent;
-
-
-/**
- * 
- * @author terfloth@itemis.de
- */
-public class RTScope implements ExecutionScope {
-
-	protected Map<String, RTVariable> variables = new HashMap<String, RTVariable>();
-	
-	/* (non-Javadoc)
-	 * @see com.yakindu.statechart.model.expressions.runtime.ExecutionScope#getValue(java.lang.String)
-	 */
-	public Object getValue(String varName) {
-		RTVariable var = getVariable(varName);
-		
-		// TODO : handle not existing variables.
-		return (var != null) ? var.getValue() : null ;
-	}
-
-	/* (non-Javadoc)
-	 * @see com.yakindu.statechart.model.expressions.runtime.ExecutionScope#getVariable(java.lang.String)
-	 */
-	public RTVariable getVariable(String varName) {
-		return variables.get(varName);
-	}
-		
-	/* (non-Javadoc)
-	 * @see com.yakindu.statechart.model.expressions.runtime.ExecutionScope#addVariable(com.yakindu.statechart.model.expressions.runtime.Variable)
-	 */
-	public void addVariable(RTVariable var) {
-		// TODO : check for exceptions etc...
-		variables.put(var.getName(), var);
-	}
-
-
-	/* (non-Javadoc)
-	 * @see com.yakindu.statechart.model.expressions.runtime.ExecutionScope#call(java.lang.String)
-	 */
-	public void call(String procedureId) {
-		// TODO Auto-generated method stub
-	}
-
-	/* (non-Javadoc)
-	 * @see com.yakindu.statechart.model.expressions.runtime.ExecutionScope#raise(java.lang.String)
-	 */
-	public void raise(String signal, Object object) {
-		// TODO Auto-generated method stub		
-	}
-
-	public void setVariableValue(RTVariable variable, Object object) {
-		variable.setValue(object);
-		
-	}
-
-	public Collection<RTVariable> getVariables() {
-		return variables.values();
-	}
-
-	public Set<RTSignalEvent> getEvents() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	
-	
-}

+ 0 - 18
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTStatement.java

@@ -1,18 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public interface RTStatement {
-
-	void execute(ExecutionScope scope);
-}

+ 0 - 98
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTTrigger.java

@@ -1,98 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.yakindu.sct.simulation.runtime.sgraph.ITrigger;
-import org.yakindu.sct.simulation.runtime.sgraph.RTEvent;
-import org.yakindu.sct.simulation.runtime.sgraph.RTGuard;
-import org.yakindu.sct.simulation.runtime.sgraph.RTSignalEvent;
-import org.yakindu.sct.simulation.runtime.sgraph.RTTimeEvent;
-
-/**
- * 
- * @author terfloth
- */
-public class RTTrigger  implements ITrigger{
-	
-	private RTGuard guard;
-	private Set<RTSignalEvent> signalTriggers = new HashSet<RTSignalEvent>();
-	private RTTimeEvent timeTrigger;
-
-
-	public RTTrigger(RTTimeEvent timeTrigger, Set<RTSignalEvent> signalTriggers, RTGuard guard) {
-
-		this.timeTrigger = timeTrigger;
-		if (signalTriggers != null) {
-			this.signalTriggers.addAll(signalTriggers);
-		}
-		this.guard = guard;
-	}
-
-	
-	
-	public boolean isEnabled(Set<RTEvent> events) {
-
-		if ( hasTriggerEvents() ) {
-			return matchesTriggerEvents(events) && matchesGuard();
-		}
-		
-		return matchesGuard();
-	}
-	
-	
-			
-
-	private boolean matchesTriggerEvents(Set<RTEvent> events) {
-		return !Collections.disjoint(this.signalTriggers, events) || (timeTrigger != null && events.contains(timeTrigger));
-			
-	}		
-			
-	private boolean matchesGuard() {
-		if (guard == null) {
-			return true;
-		} else {
-			return guard.evaluate();
-		}
-	}
-
-
-	private boolean hasTriggerEvents() {
-		return !signalTriggers.isEmpty() || timeTrigger!=null;
-	}
-
-
-
-	
-	
-	public RTGuard getGuard() {
-		return guard;
-	}
-
-
-	public RTTimeEvent getTimeTrigger() {
-		return timeTrigger;
-	}
-
-	protected boolean isTimeTriggered() {
-		return timeTrigger != null;
-	}
-	
-	public Set<RTSignalEvent> getSignalTriggers() {
-		return signalTriggers;
-	}
-
-
-	
-}

+ 0 - 49
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTTriggerEvent.java

@@ -1,49 +0,0 @@
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public class RTTriggerEvent {
-
-	public static class SignalEvent extends RTTriggerEvent {
-		protected String signal;
-
-		public SignalEvent(String signal) {
-			super();
-			this.signal = signal;
-		}
-
-		public String getSignal() {
-			return signal;
-		}
-
-		public void setSignal(String signal) {
-			this.signal = signal;
-		}
-		
-	}
-	
-	public static class TimeEvent extends RTTriggerEvent implements RTExpression {
-		protected RTExpression durationExp;
-
-		
-		public TimeEvent(RTExpression timeValueExp) {
-			super();
-			this.durationExp = timeValueExp;
-		}
-
-		public RTExpression getDurationExp() {
-			return durationExp;
-		}
-
-		public void setDurationExp(RTExpression timeValueExp) {
-			this.durationExp = timeValueExp;
-		}
-
-		public Object execute(ExecutionScope scope) {
-			return durationExp.execute(scope);
-		}
-		
-		
-	}
-
-}

+ 0 - 70
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/RTVariable.java

@@ -1,70 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.EvaluationException;
-
-/**
- * 
- * 
- * @author terfloth@itemis.de
- */
-public class RTVariable {
-
-	protected String name;
-	protected Object value;
-	protected Class<?> type;
-
-	public RTVariable() {
-		super();
-	}
-
-	public RTVariable(String name) {
-		this();
-		this.name = name;
-	}
-
-	public RTVariable(String name, Class<Object> type) {
-		this();
-		this.name = name;
-		this.type = type;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public Class<?> getType() {
-		return type;
-	}
-
-	public void setType(Class<?> type) {
-		this.type = type;
-	}
-
-	public Object getValue() {
-		return value;
-	}
-
-	public void setValue(Object value) {
-		if (type != null && (!type.isAssignableFrom(value.getClass()))) {
-			throw new EvaluationException("Variable <" + name + "> of type "
-					+ type + " is not assignable from " + value.getClass()
-					+ " value.");
-		}
-		this.value = value;
-	}
-
-}

+ 0 - 47
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/Raise.java

@@ -1,47 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public class Raise implements RTStatement {
-
-	protected String signal;
-	protected RTExpression valueExpression;
-	
-	
-	public Raise() {
-		super();
-	}
-	
-
-	public Raise(String signal, RTExpression valueExp) {
-		this();
-		this.signal = signal;
-		this.valueExpression = valueExp;
-	}
-
-
-	public String getSignal() {
-		return signal;
-	}
-
-
-	public void setSignal(String signal) {
-		this.signal = signal;
-	}
-
-
-	public void execute(ExecutionScope scope) {
-		scope.raise(signal, valueExpression != null ? valueExpression.execute(scope) : null);
-	}
-
-}

+ 0 - 32
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/StatementSequence.java

@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import java.util.ArrayList;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-/**
- * A statement sequence is a statement that executes a list of statements.
- *  
- * @author terfloth@itemis.de
- */
-public class StatementSequence extends ArrayList<RTStatement> implements RTStatement {
-
-	private static final long serialVersionUID = -7484316500582800045L;
-
-	public void execute(ExecutionScope scope) {
-		for (RTStatement stmt : this) {	
-			stmt.execute(scope);
-		}
-	}
-
-}

+ 0 - 59
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/UnaryOperation.java

@@ -1,59 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.EvaluationException;
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public class UnaryOperation implements RTExpression {
-
-	
-	protected RTExpression expression;
-	protected String operator;
-	
-	public UnaryOperation() {
-	}
-	
-	public UnaryOperation(String operator, RTExpression expr) {
-		super();
-		this.expression = expr;
-		this.operator = operator;
-	}
-
-	public RTExpression getExpression() {
-		return expression;
-	}
-
-	public void setExpression(RTExpression expr) {
-		this.expression = expr;
-	}
-
-
-	public String getOperator() {
-		return operator;
-	}
-
-	public void setOperator(String operator) {
-		this.operator = operator;
-	}
-
-	public Object execute(ExecutionScope scope) {
-		Object[] operands = new Object[1];
-		operands[0] = expression.execute(scope);
-	
-		Function func = Function.lookup(CoreFunction.class, operator, operands);
-		
-		if (func == null) throw new EvaluationException("Can't resolve function '" + operator + "' for type " + operands[0].getClass().getName() + " !");
-		
-		return func.execute(operands);
-	}
-	
-}

+ 0 - 48
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/VariableRef.java

@@ -1,48 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext;
-
-import org.yakindu.sct.simulation.runtime.ExecutionScope;
-
-public class VariableRef implements RTExpression {
-
-	protected String name;
-	
-	
-	public VariableRef() {
-		super();
-	}
-
-	public VariableRef(String name) {
-		this();
-		this.name = name;
-	}
-
-	
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	
-	public RTVariable getVariable(ExecutionScope scope) {
-		return scope.getVariable(name);
-	}
-	
-	
-	public Object execute(ExecutionScope scope) {
-		return getVariable(scope).getValue();
-	}
-
-}

+ 0 - 32
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/builder/BuilderException.java

@@ -1,32 +0,0 @@
-/**
- * Copyright (c) 2010 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext.builder;
-
-public class BuilderException extends RuntimeException {
-
-	private static final long serialVersionUID = 1L;
-
-	public BuilderException() {
-	}
-
-	public BuilderException(String message) {
-		super(message);
-	}
-
-	public BuilderException(Throwable cause) {
-		super(cause);
-	}
-
-	public BuilderException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-}

+ 0 - 458
plugins/org.yakindu.sct.simulation.runtime/src/org/yakindu/sct/simulation/runtime/stext/builder/STextBuilder.java

@@ -1,458 +0,0 @@
-/**
- * Copyright (c) 2010-2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.simulation.runtime.stext.builder;
-
-import static org.yakindu.sct.simulation.runtime.stext.CoreFunction.BIT_AND;
-import static org.yakindu.sct.simulation.runtime.stext.CoreFunction.BIT_OR;
-import static org.yakindu.sct.simulation.runtime.stext.CoreFunction.BIT_XOR;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.common.util.Enumerator;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.Type;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-import org.yakindu.sct.simulation.runtime.sgraph.RTSignalEvent;
-import org.yakindu.sct.simulation.runtime.stext.Assign;
-import org.yakindu.sct.simulation.runtime.stext.BinaryOperation;
-import org.yakindu.sct.simulation.runtime.stext.Conditional;
-import org.yakindu.sct.simulation.runtime.stext.Constant;
-import org.yakindu.sct.simulation.runtime.stext.CoreFunction;
-import org.yakindu.sct.simulation.runtime.stext.Function;
-import org.yakindu.sct.simulation.runtime.stext.FunctionMethod;
-import org.yakindu.sct.simulation.runtime.stext.ProcedureCall;
-import org.yakindu.sct.simulation.runtime.stext.RTExpression;
-import org.yakindu.sct.simulation.runtime.stext.RTStatement;
-import org.yakindu.sct.simulation.runtime.stext.RTTrigger;
-import org.yakindu.sct.simulation.runtime.stext.RTTriggerEvent;
-import org.yakindu.sct.simulation.runtime.stext.RTVariable;
-import org.yakindu.sct.simulation.runtime.stext.Raise;
-import org.yakindu.sct.simulation.runtime.stext.StatementSequence;
-import org.yakindu.sct.simulation.runtime.stext.UnaryOperation;
-import org.yakindu.sct.simulation.runtime.stext.VariableRef;
-
-/**
- * The ExpressionBuilder creates an executable structure from the textual
- * expression definition or the corresponding EMF based abstract syntax tree.
- * This AST is defined by the expression grammer of this plugin.<br>
- * <br>
- * Expression builder instances are state-less so a single instance can be used
- * to build expression runtime structures multiple times and in parallel.<br>
- * <br>
- * The current implementation mainly consist of a set of builder functions with
- * a name prefix 'build'. This class defines a build function for each grammar
- * rule. So when changing the grammer it will be necessary to change, add or
- * remove build methods for the affected grammar rules. The implementation
- * strongly relies on dynamic dispatch of build function calls and therefore
- * makes use of the 'pluggable adapter' pattern and Java reflection. <br>
- * <br>
- * 
- * @author terfloth@itemis.de
- * @author andreas muelder
- */
-public class STextBuilder extends Function {
-
-	/** Builder functions always */
-	protected static Class<?>[] paramTypes = new Class[] { EObject.class };
-
-	protected static Map<String, String> assignFunctionMap = new HashMap<String, String>();
-
-	static {
-		assignFunctionMap.put("multAssign", "*");
-		assignFunctionMap.put("divAssign", "/");
-		assignFunctionMap.put("modAssign", "%");
-		assignFunctionMap.put("addAssign", "+");
-		assignFunctionMap.put("subAssign", "-");
-		assignFunctionMap.put("leftShiftAssign", "<<");
-		assignFunctionMap.put("rightShiftAssign", ">>");
-		assignFunctionMap.put("andAssign", "&");
-		assignFunctionMap.put("xorAssign", "^");
-		assignFunctionMap.put("orAssign", "|");
-	}
-
-	@FunctionMethod("build")
-	public RTTrigger buildTrigger(EObject obj) {
-		return (RTTrigger) build(getToOne(obj, "event"));
-	}
-
-	@FunctionMethod("build")
-	public RTTriggerEvent buildSignalEvent(EObject obj) {
-		return new RTTriggerEvent.SignalEvent(getString(obj, "identifier"));
-	}
-
-	@FunctionMethod("build")
-	public RTTriggerEvent buildTimeEvent(EObject obj) {
-		return new RTTriggerEvent.TimeEvent(buildRefExpression(obj, "duration"));
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildTimeConstant(EObject obj) {
-		int duration = getInteger(obj, "value");
-		String unit = getLiteral(obj, "unit");
-
-		if (unit != null) {
-			if ("second".equals(unit))
-				duration *= 1000;
-			else if ("nanosecond".equals(unit))
-				duration /= 1000;
-		}
-
-		return new Constant(duration);
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildGuardExpression(EObject obj) {
-		return buildRefExpression(obj, "expression");
-	}
-
-	@FunctionMethod("build")
-	public RTStatement buildReactionEffect(EObject obj) {
-		StatementSequence seq = new StatementSequence();
-		for (EObject child : obj.eContents()) {
-			RTStatement stmt = (RTStatement) build(child);
-			if (stmt != null)
-				seq.add(stmt);
-		}
-		return seq;
-	}
-
-	@FunctionMethod("build")
-	public RTVariable buildVariableDefinition(EObject obj) {
-		RTVariable variable = new RTVariable();
-		VariableDefinition definition = (VariableDefinition) obj;
-
-
-		//TODO: Default value
-		variable.setName(definition.getName());
-		Type type = definition.getType();
-
-		if (type == Type.BOOLEAN) {
-			variable.setType(Boolean.class);
-			variable.setValue(false);
-		} else if (type == Type.INTEGER) {
-			variable.setType(Integer.class);
-			variable.setValue(0);
-		} else if (type == Type.REAL) {
-			variable.setType(Float.class);
-			variable.setValue(0.0f);
-		}
-		return variable;
-	}
-
-	
-	@FunctionMethod("build")
-	public RTSignalEvent buildEventDefinition(EObject obj) {
-		RTSignalEvent event = new RTSignalEvent();
-		EventDefinition definition = (EventDefinition) obj;
-
-
-		//TODO: Default value
-		event.setId(definition.getName());
-		Type type = definition.getType();
-
-		if (type == Type.BOOLEAN) {
-			event.setType(Boolean.class);
-			event.setValue(null);
-		} else if (type == Type.INTEGER) {
-			event.setType(Integer.class);
-			event.setValue(null);
-		} else if (type == Type.REAL) {
-			event.setType(Float.class);
-			event.setValue(null);
-		}
-		return event;
-	}
-
-	@FunctionMethod("build")
-	public RTStatement buildEventRaising(EObject obj) {
-
-		EObject event = getToOne(obj, "event");
-		RTExpression value = buildRefExpression(obj, "value");
-
-		return new Raise(getString(event, "name"), value);
-	}
-
-	@FunctionMethod("build")
-	public RTStatement buildOperationCall(EObject obj) {
-		EObject operation = getToOne(obj, "operation");
-		return new ProcedureCall(getString(operation, "name"));
-	}
-
-	@FunctionMethod("build")
-	public RTStatement buildAssignment(EObject obj) {
-		EObject variable = getToOne(obj, "varRef");
-		if (variable == null)
-			throw new IllegalStateException("Unknown variable reference " + obj);
-		RTExpression exp = (RTExpression) build(getToOne(obj, "expression"));
-		String operator = getLiteral(obj, "operator");
-		VariableRef var = new VariableRef(getString(variable, "name"));
-		
-		if (! "assign".equals(operator)) {
-			String mappedOperator = assignFunctionMap.get(operator);
-			if (mappedOperator == null) 
-				throw new BuilderException("Assignment operator '" + operator + "' can not be resolved to a function.");
-			
-			exp = new BinaryOperation(mappedOperator, var, exp);
-		}
-
-		return new Assign(var, exp);
-	}
-	
-	
-	@FunctionMethod("build")
-	public RTExpression buildConditionalExpression(EObject obj) {
-		
-		RTExpression condition = buildRefExpression(obj, "condition");
-		RTExpression trueCase = buildRefExpression(obj, "trueCase");
-		RTExpression falseCase = buildRefExpression(obj, "falseCase");
-
-		if (condition != null && trueCase != null && falseCase != null)
-			return new Conditional(condition, trueCase, falseCase);
-		
-		return condition;
-	}
-
-
-	@FunctionMethod("build")
-	public RTExpression buildLogicalOrExpression(EObject obj) {
-
-		RTExpression op1 = buildRefExpression(obj, "leftOperand");
-		RTExpression op2 = buildRefExpression(obj, "rightOperand");
-
-		if (op1 != null && op2 != null)
-			return new BinaryOperation(BinaryOperation.OR, op1, op2);
-
-		return op1;
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildLogicalAndExpression(EObject obj) {
-
-		RTExpression op1 = buildRefExpression(obj, "leftOperand");
-		RTExpression op2 = buildRefExpression(obj, "rightOperand");
-
-		if (op1 != null && op2 != null)
-			return new BinaryOperation(BinaryOperation.AND, op1, op2);
-
-		return op1;
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildBitwiseXorExpression(EObject obj) {
-
-		RTExpression op1 = buildRefExpression(obj, "leftOperand");
-		RTExpression op2 = buildRefExpression(obj, "rightOperand");
-
-		if (op1 != null && op2 != null)
-			return new BinaryOperation(BIT_XOR, op1, op2);
-
-		return op1;
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildBitwiseOrExpression(EObject obj) {
-
-		RTExpression op1 = buildRefExpression(obj, "leftOperand");
-		RTExpression op2 = buildRefExpression(obj, "rightOperand");
-
-		if (op1 != null && op2 != null)
-			return new BinaryOperation(BIT_OR, op1, op2);
-
-		return op1;
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildBitwiseAndExpression(EObject obj) {
-
-		RTExpression op1 = buildRefExpression(obj, "leftOperand");
-		RTExpression op2 = buildRefExpression(obj, "rightOperand");
-
-		if (op1 != null && op2 != null)
-			return new BinaryOperation(BIT_AND, op1, op2);
-
-		return op1;
-	}
-
-	public RTExpression buildBinaryOperation(EObject obj) {
-		RTExpression op1 = buildRefExpression(obj, "leftOperand");
-		RTExpression op2 = buildRefExpression(obj, "rightOperand");
-		String operator = getLiteral(obj, "operator");
-
-		if (op1 != null && op2 != null)
-			return new BinaryOperation(operator, op1, op2);
-
-		return op1;
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildLogicalRelationExpression(EObject obj) {
-		return buildBinaryOperation(obj);
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildLogicalNotExpression(EObject obj) {
-		RTExpression operand = buildRefExpression(obj, "operand");
-
-		if (operand != null)
-			return new UnaryOperation(CoreFunction.NOT, operand);
-
-		return operand;
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildShiftExpression(EObject obj) {
-		return buildBinaryOperation(obj);
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildAdditiveExpression(EObject obj) {
-		return buildBinaryOperation(obj);
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildNumericalMultiplyDivideExpression(EObject obj) {
-		return buildBinaryOperation(obj);
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildNumericalAddSubtractExpression(EObject obj) {
-		return buildBinaryOperation(obj);
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildNumericalUnaryExpression(EObject obj) {
-
-		RTExpression operand = buildRefExpression(obj, "operand");
-		String operator = getLiteral(obj, "operator");
-
-		if (operand != null && operator != null)
-			return new UnaryOperation(operator, operand);
-
-		return operand;
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildNestedExpression(EObject obj) {
-		return buildRefExpression(obj, "expression");
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildPrimitiveValueExpression(EObject obj) {
-		return buildRefExpression(obj, "value");
-	}
-	@FunctionMethod("build")
-	public RTExpression buildIntLiteral(EObject object){
-		return new Constant(getInteger(object, "value"));
-	}
-	@FunctionMethod("build")
-	public RTExpression buildBoolLiteral(EObject object){
-		return new Constant(getBoolean(object, "value"));
-	}
-	@FunctionMethod("build")
-	public RTExpression buildRealLiteral(EObject object){
-		return new Constant(getFloat(object, "value"));
-	}
-
-	@FunctionMethod("build")
-	public RTExpression buildElementReferenceExpression(EObject obj) {
-		// TODO: Do we really need an ElementReferenceExpression? Or is a
-		// VariableReferenceExpression enough?
-		EObject var = getToOne(obj, "value");
-		return new VariableRef(getString(var, "name"));
-	}
-
-	/**
-	 * build method that performs the dynamic dispatch to the appropriate
-	 * (correctly named) builder function. The parameter is always a EObject and
-	 * since we have use dynamic EMF we match by naming conventions.
-	 * 
-	 * @param obj
-	 * @return
-	 */
-	public Object build(EObject obj) {
-		if (obj == null)
-			return null;
-
-		Object[] params = new Object[] { obj };
-
-		Function f = STextBuilder.lookup(this.getClass(), "build"
-				+ obj.eClass().getName(), paramTypes);
-		if (f != null)
-			return f.execute(params);
-
-		throw new BuilderException("No builder function for: "
-				+ obj.eClass().getName());
-	}
-
-	protected RTExpression buildRefExpression(EObject obj, String refName) {
-		return (RTExpression) build(getToOne(obj, refName));
-	}
-
-	protected EObject getToOne(EObject obj, String name) {
-		EStructuralFeature feature = obj.eClass().getEStructuralFeature(name);
-		if (feature instanceof EReference) {
-			EReference ref = (EReference) feature;
-			return (EObject) obj.eGet(ref);
-		}
-		throw new BuilderException();
-	}
-
-	protected String getString(EObject obj, String name) {
-		EStructuralFeature feature = obj.eClass().getEStructuralFeature(name);
-		if (feature instanceof EAttribute) {
-			EAttribute attr = (EAttribute) feature;
-			return (String) obj.eGet(attr);
-		}
-		throw new BuilderException();
-	}
-
-	protected Integer getInteger(EObject obj, String name) {
-		EStructuralFeature feature = obj.eClass().getEStructuralFeature(name);
-		if (feature instanceof EAttribute) {
-			EAttribute attr = (EAttribute) feature;
-			return (Integer) obj.eGet(attr);
-		}
-		throw new BuilderException();
-	}
-	protected Boolean getBoolean(EObject obj, String name) {
-		EStructuralFeature feature = obj.eClass().getEStructuralFeature(name);
-		if (feature instanceof EAttribute) {
-			EAttribute attr = (EAttribute) feature;
-			return (Boolean) obj.eGet(attr);
-		}
-		throw new BuilderException();
-	}
-	protected Float getFloat(EObject obj, String name) {
-		EStructuralFeature feature = obj.eClass().getEStructuralFeature(name);
-		if (feature instanceof EAttribute) {
-			EAttribute attr = (EAttribute) feature;
-			return (Float) obj.eGet(attr);
-		}
-		throw new BuilderException();
-	}
-
-	protected String getLiteral(EObject obj, String name) {
-		EStructuralFeature feature = obj.eClass().getEStructuralFeature(name);
-		if (feature instanceof EAttribute) {
-			EAttribute attr = (EAttribute) feature;
-			String literalValue = ((Enumerator) obj.eGet(attr)).getName();
-
-			return ("NULL".equals(literalValue)) ? null : literalValue;
-		}
-		throw new BuilderException();
-	}
-
-}