Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2017-08-02 04:55:12 -0400
committerJuergen Haug2017-08-02 04:55:12 -0400
commit92e03aae3dad9b4163de30b19b973c0176bc6172 (patch)
treeb4690376c70a2ca0c2a73b584d1e711285fad0a4
parent0c64a34fbe7d42aed56c8e2657992b1fcbfdd9bd (diff)
downloadorg.eclipse.etrice-92e03aae3dad9b4163de30b19b973c0176bc6172.tar.gz
org.eclipse.etrice-92e03aae3dad9b4163de30b19b973c0176bc6172.tar.xz
org.eclipse.etrice-92e03aae3dad9b4163de30b19b973c0176bc6172.zip
[core.genmodel.fsm] model improvements + cleanup from rebase
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/model/fsmgen.ecore14
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java2
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FSMGenElement.java18
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java9
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java130
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java38
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java4
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java4
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java14
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java4
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FSMGenElementImpl.java39
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java11
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java40
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java4
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java97
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java4
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java71
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java18
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java27
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend2
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java32
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.java7
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java356
23 files changed, 472 insertions, 473 deletions
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/model/fsmgen.ecore b/plugins/org.eclipse.etrice.core.genmodel.fsm/model/fsmgen.ecore
index 96d95871a..8e21e576e 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/model/fsmgen.ecore
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/model/fsmgen.ecore
@@ -2,7 +2,7 @@
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="fsmgen" nsURI="http://www.eclipse.org/etrice/generator/fsm"
nsPrefix="fsmgen">
- <eClassifiers xsi:type="ecore:EClass" name="GraphContainer">
+ <eClassifiers xsi:type="ecore:EClass" name="GraphContainer" eSuperTypes="#//FSMGenElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="graph" eType="#//Graph"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="component" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//ModelComponent"/>
@@ -13,19 +13,20 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="initializedCommonData"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Graph">
+ <eClassifiers xsi:type="ecore:EClass" name="Graph" eSuperTypes="#//FSMGenElement">
<eOperations name="toString" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="body" value="StringBuilder result = new StringBuilder();&#xD;&#xA;result.append(&quot;StateGraph {\n&quot;);&#xD;&#xA;for (Node n : getNodes()) {&#xD;&#xA;&#x9;result.append(&quot; &quot; + n.toString() + &quot;\n&quot;);&#xD;&#xA;}&#xD;&#xA;for (Link l : getLinks()) {&#xD;&#xA;&#x9;result.append(&quot; &quot; + l.toString() + &quot;\n&quot;);&#xD;&#xA;}&#xD;&#xA;result.append(&quot;}&quot;);&#xD;&#xA;return result.toString();"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="nodes" upperBound="-1"
- eType="#//Node" containment="true" eOpposite="#//Node/graph"/>
+ eType="#//Node" containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="links" upperBound="-1"
eType="#//Link" containment="true" eOpposite="#//Link/graph"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="stateGraph" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//StateGraph"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="node" eType="#//Node" eOpposite="#//Node/graph"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="GraphItem">
+ <eClassifiers xsi:type="ecore:EClass" name="GraphItem" eSuperTypes="#//FSMGenElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="inherited" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
defaultValueLiteral="false"/>
</eClassifiers>
@@ -36,7 +37,7 @@
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="graph" eType="#//Graph"
- eOpposite="#//Graph/nodes"/>
+ eOpposite="#//Graph/node"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="subgraph" eType="#//Graph"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="outgoing" upperBound="-1"
@@ -67,7 +68,7 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="commonData" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="transition" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//TransitionBase"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="CommonTrigger">
+ <eClassifiers xsi:type="ecore:EClass" name="CommonTrigger" eSuperTypes="#//FSMGenElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="msg" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ifitem" eType="ecore:EClass ../../org.eclipse.etrice.core.fsm/model/generated/FSM.ecore#//AbstractInterfaceItem"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="hasGuard" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
@@ -75,4 +76,5 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="links" upperBound="-1"
eType="#//Link"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="FSMGenElement"/>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java
index e04f2acf8..84a78c3c4 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/CommonTrigger.java
@@ -28,7 +28,7 @@ import org.eclipse.etrice.core.fsm.fSM.AbstractInterfaceItem;
* @model
* @generated
*/
-public interface CommonTrigger extends EObject {
+public interface CommonTrigger extends FSMGenElement {
/**
* Returns the value of the '<em><b>Msg</b></em>' reference.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FSMGenElement.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FSMGenElement.java
new file mode 100644
index 000000000..c54c1f195
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FSMGenElement.java
@@ -0,0 +1,18 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>FSM Gen Element</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getFSMGenElement()
+ * @model
+ * @generated
+ */
+public interface FSMGenElement extends EObject {
+} // FSMGenElement
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java
index f210ab049..c7b2e0478 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenFactory.java
@@ -76,6 +76,15 @@ public interface FsmGenFactory extends EFactory {
CommonTrigger createCommonTrigger();
/**
+ * Returns a new object of class '<em>FSM Gen Element</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>FSM Gen Element</em>'.
+ * @generated
+ */
+ FSMGenElement createFSMGenElement();
+
+ /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java
index 664dd3261..eade0240a 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/FsmGenPackage.java
@@ -58,6 +58,34 @@ public interface FsmGenPackage extends EPackage {
FsmGenPackage eINSTANCE = org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl.init();
/**
+ * The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FSMGenElementImpl <em>FSM Gen Element</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FSMGenElementImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getFSMGenElement()
+ * @generated
+ */
+ int FSM_GEN_ELEMENT = 6;
+
+ /**
+ * The number of structural features of the '<em>FSM Gen Element</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FSM_GEN_ELEMENT_FEATURE_COUNT = 0;
+
+ /**
+ * The number of operations of the '<em>FSM Gen Element</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int FSM_GEN_ELEMENT_OPERATION_COUNT = 0;
+
+ /**
* The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphContainerImpl <em>Graph Container</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -74,7 +102,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_CONTAINER__GRAPH = 0;
+ int GRAPH_CONTAINER__GRAPH = FSM_GEN_ELEMENT_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Component</b></em>' reference.
@@ -83,7 +111,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_CONTAINER__COMPONENT = 1;
+ int GRAPH_CONTAINER__COMPONENT = FSM_GEN_ELEMENT_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Initialized Triggers In States</b></em>' attribute.
@@ -92,7 +120,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_CONTAINER__INITIALIZED_TRIGGERS_IN_STATES = 2;
+ int GRAPH_CONTAINER__INITIALIZED_TRIGGERS_IN_STATES = FSM_GEN_ELEMENT_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Initialized Chain Heads</b></em>' attribute.
@@ -101,7 +129,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_CONTAINER__INITIALIZED_CHAIN_HEADS = 3;
+ int GRAPH_CONTAINER__INITIALIZED_CHAIN_HEADS = FSM_GEN_ELEMENT_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>Initialized Common Data</b></em>' attribute.
@@ -110,7 +138,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_CONTAINER__INITIALIZED_COMMON_DATA = 4;
+ int GRAPH_CONTAINER__INITIALIZED_COMMON_DATA = FSM_GEN_ELEMENT_FEATURE_COUNT + 4;
/**
* The number of structural features of the '<em>Graph Container</em>' class.
@@ -119,7 +147,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_CONTAINER_FEATURE_COUNT = 5;
+ int GRAPH_CONTAINER_FEATURE_COUNT = FSM_GEN_ELEMENT_FEATURE_COUNT + 5;
/**
* The number of operations of the '<em>Graph Container</em>' class.
@@ -128,7 +156,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_CONTAINER_OPERATION_COUNT = 0;
+ int GRAPH_CONTAINER_OPERATION_COUNT = FSM_GEN_ELEMENT_OPERATION_COUNT + 0;
/**
* The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl <em>Graph</em>}' class.
@@ -147,7 +175,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH__NODES = 0;
+ int GRAPH__NODES = FSM_GEN_ELEMENT_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Links</b></em>' containment reference list.
@@ -156,7 +184,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH__LINKS = 1;
+ int GRAPH__LINKS = FSM_GEN_ELEMENT_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>State Graph</b></em>' reference.
@@ -165,7 +193,16 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH__STATE_GRAPH = 2;
+ int GRAPH__STATE_GRAPH = FSM_GEN_ELEMENT_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Node</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GRAPH__NODE = FSM_GEN_ELEMENT_FEATURE_COUNT + 3;
/**
* The number of structural features of the '<em>Graph</em>' class.
@@ -174,7 +211,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_FEATURE_COUNT = 3;
+ int GRAPH_FEATURE_COUNT = FSM_GEN_ELEMENT_FEATURE_COUNT + 4;
/**
* The operation id for the '<em>To String</em>' operation.
@@ -183,7 +220,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH___TO_STRING = 0;
+ int GRAPH___TO_STRING = FSM_GEN_ELEMENT_OPERATION_COUNT + 0;
/**
* The number of operations of the '<em>Graph</em>' class.
@@ -192,7 +229,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_OPERATION_COUNT = 1;
+ int GRAPH_OPERATION_COUNT = FSM_GEN_ELEMENT_OPERATION_COUNT + 1;
/**
* The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphItemImpl <em>Graph Item</em>}' class.
@@ -211,7 +248,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_ITEM__INHERITED = 0;
+ int GRAPH_ITEM__INHERITED = FSM_GEN_ELEMENT_FEATURE_COUNT + 0;
/**
* The number of structural features of the '<em>Graph Item</em>' class.
@@ -220,7 +257,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_ITEM_FEATURE_COUNT = 1;
+ int GRAPH_ITEM_FEATURE_COUNT = FSM_GEN_ELEMENT_FEATURE_COUNT + 1;
/**
* The number of operations of the '<em>Graph Item</em>' class.
@@ -229,7 +266,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int GRAPH_ITEM_OPERATION_COUNT = 0;
+ int GRAPH_ITEM_OPERATION_COUNT = FSM_GEN_ELEMENT_OPERATION_COUNT + 0;
/**
* The meta object id for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.NodeImpl <em>Node</em>}' class.
@@ -251,7 +288,7 @@ public interface FsmGenPackage extends EPackage {
int NODE__INHERITED = GRAPH_ITEM__INHERITED;
/**
- * The feature id for the '<em><b>Graph</b></em>' container reference.
+ * The feature id for the '<em><b>Graph</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -466,7 +503,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int COMMON_TRIGGER__MSG = 0;
+ int COMMON_TRIGGER__MSG = FSM_GEN_ELEMENT_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Ifitem</b></em>' reference.
@@ -475,7 +512,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int COMMON_TRIGGER__IFITEM = 1;
+ int COMMON_TRIGGER__IFITEM = FSM_GEN_ELEMENT_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Has Guard</b></em>' attribute.
@@ -484,7 +521,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int COMMON_TRIGGER__HAS_GUARD = 2;
+ int COMMON_TRIGGER__HAS_GUARD = FSM_GEN_ELEMENT_FEATURE_COUNT + 2;
/**
* The feature id for the '<em><b>Trigger</b></em>' attribute.
@@ -493,7 +530,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int COMMON_TRIGGER__TRIGGER = 3;
+ int COMMON_TRIGGER__TRIGGER = FSM_GEN_ELEMENT_FEATURE_COUNT + 3;
/**
* The feature id for the '<em><b>Links</b></em>' reference list.
@@ -502,7 +539,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int COMMON_TRIGGER__LINKS = 4;
+ int COMMON_TRIGGER__LINKS = FSM_GEN_ELEMENT_FEATURE_COUNT + 4;
/**
* The number of structural features of the '<em>Common Trigger</em>' class.
@@ -511,7 +548,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int COMMON_TRIGGER_FEATURE_COUNT = 5;
+ int COMMON_TRIGGER_FEATURE_COUNT = FSM_GEN_ELEMENT_FEATURE_COUNT + 5;
/**
* The number of operations of the '<em>Common Trigger</em>' class.
@@ -520,7 +557,7 @@ public interface FsmGenPackage extends EPackage {
* @generated
* @ordered
*/
- int COMMON_TRIGGER_OPERATION_COUNT = 0;
+ int COMMON_TRIGGER_OPERATION_COUNT = FSM_GEN_ELEMENT_OPERATION_COUNT + 0;
/**
@@ -632,6 +669,17 @@ public interface FsmGenPackage extends EPackage {
EReference getGraph_StateGraph();
/**
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNode <em>Node</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Node</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNode()
+ * @see #getGraph()
+ * @generated
+ */
+ EReference getGraph_Node();
+
+ /**
* Returns the meta object for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#toString() <em>To String</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -673,10 +721,10 @@ public interface FsmGenPackage extends EPackage {
EClass getNode();
/**
- * Returns the meta object for the container reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}'.
+ * Returns the meta object for the reference '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the container reference '<em>Graph</em>'.
+ * @return the meta object for the reference '<em>Graph</em>'.
* @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph()
* @see #getNode()
* @generated
@@ -911,6 +959,16 @@ public interface FsmGenPackage extends EPackage {
EReference getCommonTrigger_Links();
/**
+ * Returns the meta object for class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.FSMGenElement <em>FSM Gen Element</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>FSM Gen Element</em>'.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FSMGenElement
+ * @generated
+ */
+ EClass getFSMGenElement();
+
+ /**
* Returns the meta object for the attribute '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger#isHasGuard <em>Has Guard</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1029,6 +1087,14 @@ public interface FsmGenPackage extends EPackage {
EReference GRAPH__STATE_GRAPH = eINSTANCE.getGraph_StateGraph();
/**
+ * The meta object literal for the '<em><b>Node</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference GRAPH__NODE = eINSTANCE.getGraph_Node();
+
+ /**
* The meta object literal for the '<em><b>To String</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1065,7 +1131,7 @@ public interface FsmGenPackage extends EPackage {
EClass NODE = eINSTANCE.getNode();
/**
- * The meta object literal for the '<em><b>Graph</b></em>' container reference feature.
+ * The meta object literal for the '<em><b>Graph</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -1245,6 +1311,16 @@ public interface FsmGenPackage extends EPackage {
EReference COMMON_TRIGGER__LINKS = eINSTANCE.getCommonTrigger_Links();
/**
+ * The meta object literal for the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FSMGenElementImpl <em>FSM Gen Element</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FSMGenElementImpl
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.FsmGenPackageImpl#getFSMGenElement()
+ * @generated
+ */
+ EClass FSM_GEN_ELEMENT = eINSTANCE.getFSMGenElement();
+
+ /**
* The meta object literal for the '<em><b>Has Guard</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java
index 375b761f9..3ccf32198 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Graph.java
@@ -3,9 +3,6 @@
package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EObject;
-
import org.eclipse.etrice.core.fsm.fSM.StateGraph;
/**
@@ -20,17 +17,17 @@ import org.eclipse.etrice.core.fsm.fSM.StateGraph;
* <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNodes <em>Nodes</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getLinks <em>Links</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getStateGraph <em>State Graph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNode <em>Node</em>}</li>
* </ul>
*
* @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraph()
* @model
* @generated
*/
-public interface Graph extends EObject {
+public interface Graph extends FSMGenElement {
/**
* Returns the value of the '<em><b>Nodes</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node}.
- * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Nodes</em>' containment reference list isn't clear,
@@ -39,8 +36,7 @@ public interface Graph extends EObject {
* <!-- end-user-doc -->
* @return the value of the '<em>Nodes</em>' containment reference list.
* @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraph_Nodes()
- * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph
- * @model opposite="graph" containment="true"
+ * @model containment="true"
* @generated
*/
EList<Node> getNodes();
@@ -90,6 +86,34 @@ public interface Graph extends EObject {
void setStateGraph(StateGraph value);
/**
+ * Returns the value of the '<em><b>Node</b></em>' reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}'.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Node</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Node</em>' reference.
+ * @see #setNode(Node)
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getGraph_Node()
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph
+ * @model opposite="graph"
+ * @generated
+ */
+ Node getNode();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNode <em>Node</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Node</em>' reference.
+ * @see #getNode()
+ * @generated
+ */
+ void setNode(Node value);
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model annotation="http://www.eclipse.org/emf/2002/GenModel body='StringBuilder result = new StringBuilder();\r\nresult.append(\"StateGraph {\\n\");\r\nfor (Node n : getNodes()) {\r\n\tresult.append(\" \" + n.toString() + \"\\n\");\r\n}\r\nfor (Link l : getLinks()) {\r\n\tresult.append(\" \" + l.toString() + \"\\n\");\r\n}\r\nresult.append(\"}\");\r\nreturn result.toString();'"
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java
index 6d35d7c30..8f1f699d0 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphContainer.java
@@ -2,8 +2,6 @@
*/
package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
-import org.eclipse.emf.ecore.EObject;
-
import org.eclipse.etrice.core.fsm.fSM.ModelComponent;
/**
@@ -26,7 +24,7 @@ import org.eclipse.etrice.core.fsm.fSM.ModelComponent;
* @model
* @generated
*/
-public interface GraphContainer extends EObject {
+public interface GraphContainer extends FSMGenElement {
/**
* Returns the value of the '<em><b>Graph</b></em>' containment reference.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java
index b8cf1abc8..83f2d32e2 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/GraphItem.java
@@ -2,8 +2,6 @@
*/
package org.eclipse.etrice.core.genmodel.fsm.fsmgen;
-import org.eclipse.emf.ecore.EObject;
-
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Graph Item</b></em>'.
@@ -20,7 +18,7 @@ import org.eclipse.emf.ecore.EObject;
* @model
* @generated
*/
-public interface GraphItem extends EObject {
+public interface GraphItem extends FSMGenElement {
/**
* Returns the value of the '<em><b>Inherited</b></em>' attribute.
* The default value is <code>"false"</code>.
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java
index 0f5b2cb5f..2b0d00539 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/Node.java
@@ -30,28 +30,28 @@ import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
*/
public interface Node extends GraphItem {
/**
- * Returns the value of the '<em><b>Graph</b></em>' container reference.
- * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNodes <em>Nodes</em>}'.
+ * Returns the value of the '<em><b>Graph</b></em>' reference.
+ * It is bidirectional and its opposite is '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNode <em>Node</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Graph</em>' container reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Graph</em>' container reference.
+ * @return the value of the '<em>Graph</em>' reference.
* @see #setGraph(Graph)
* @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage#getNode_Graph()
- * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNodes
- * @model opposite="nodes" transient="false"
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph#getNode
+ * @model opposite="node"
* @generated
*/
Graph getGraph();
/**
- * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}' container reference.
+ * Sets the value of the '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node#getGraph <em>Graph</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Graph</em>' container reference.
+ * @param value the new value of the '<em>Graph</em>' reference.
* @see #getGraph()
* @generated
*/
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java
index 7601ca0c0..cf7e61ca7 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/CommonTriggerImpl.java
@@ -13,8 +13,6 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
-
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.etrice.core.fsm.fSM.AbstractInterfaceItem;
@@ -39,7 +37,7 @@ import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
*
* @generated
*/
-public class CommonTriggerImpl extends MinimalEObjectImpl.Container implements CommonTrigger {
+public class CommonTriggerImpl extends FSMGenElementImpl implements CommonTrigger {
/**
* The cached value of the '{@link #getMsg() <em>Msg</em>}' reference.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FSMGenElementImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FSMGenElementImpl.java
new file mode 100644
index 000000000..4fb50270e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FSMGenElementImpl.java
@@ -0,0 +1,39 @@
+/**
+ */
+package org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl;
+
+import org.eclipse.emf.ecore.EClass;
+
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FSMGenElement;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>FSM Gen Element</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class FSMGenElementImpl extends MinimalEObjectImpl.Container implements FSMGenElement {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected FSMGenElementImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return FsmGenPackage.Literals.FSM_GEN_ELEMENT;
+ }
+
+} //FSMGenElementImpl
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java
index 292f423a6..32092c0b0 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenFactoryImpl.java
@@ -62,6 +62,7 @@ public class FsmGenFactoryImpl extends EFactoryImpl implements FsmGenFactory {
case FsmGenPackage.NODE: return createNode();
case FsmGenPackage.LINK: return createLink();
case FsmGenPackage.COMMON_TRIGGER: return createCommonTrigger();
+ case FsmGenPackage.FSM_GEN_ELEMENT: return createFSMGenElement();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -132,6 +133,16 @@ public class FsmGenFactoryImpl extends EFactoryImpl implements FsmGenFactory {
* <!-- end-user-doc -->
* @generated
*/
+ public FSMGenElement createFSMGenElement() {
+ FSMGenElementImpl fsmGenElement = new FSMGenElementImpl();
+ return fsmGenElement;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public FsmGenPackage getFsmGenPackage() {
return (FsmGenPackage)getEPackage();
}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java
index fde7c38ec..d5f779776 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/FsmGenPackageImpl.java
@@ -13,6 +13,7 @@ import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.etrice.core.fsm.fSM.FSMPackage;
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.CommonTrigger;
+import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FSMGenElement;
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenFactory;
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph;
@@ -71,6 +72,13 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
private EClass commonTriggerEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass fsmGenElementEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -229,6 +237,15 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EReference getGraph_Node() {
+ return (EReference)graphEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EOperation getGraph__ToString() {
return graphEClass.getEOperations().get(0);
}
@@ -463,6 +480,15 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EClass getFSMGenElement() {
+ return fsmGenElementEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EAttribute getCommonTrigger_HasGuard() {
return (EAttribute)commonTriggerEClass.getEStructuralFeatures().get(2);
}
@@ -506,6 +532,7 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
createEReference(graphEClass, GRAPH__NODES);
createEReference(graphEClass, GRAPH__LINKS);
createEReference(graphEClass, GRAPH__STATE_GRAPH);
+ createEReference(graphEClass, GRAPH__NODE);
createEOperation(graphEClass, GRAPH___TO_STRING);
graphItemEClass = createEClass(GRAPH_ITEM);
@@ -537,6 +564,8 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
createEAttribute(commonTriggerEClass, COMMON_TRIGGER__HAS_GUARD);
createEAttribute(commonTriggerEClass, COMMON_TRIGGER__TRIGGER);
createEReference(commonTriggerEClass, COMMON_TRIGGER__LINKS);
+
+ fsmGenElementEClass = createEClass(FSM_GEN_ELEMENT);
}
/**
@@ -570,8 +599,12 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
// Set bounds for type parameters
// Add supertypes to classes
+ graphContainerEClass.getESuperTypes().add(this.getFSMGenElement());
+ graphEClass.getESuperTypes().add(this.getFSMGenElement());
+ graphItemEClass.getESuperTypes().add(this.getFSMGenElement());
nodeEClass.getESuperTypes().add(this.getGraphItem());
linkEClass.getESuperTypes().add(this.getGraphItem());
+ commonTriggerEClass.getESuperTypes().add(this.getFSMGenElement());
// Initialize classes, features, and operations; add parameters
initEClass(graphContainerEClass, GraphContainer.class, "GraphContainer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -582,9 +615,10 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
initEAttribute(getGraphContainer_InitializedCommonData(), ecorePackage.getEBoolean(), "initializedCommonData", null, 0, 1, GraphContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(graphEClass, Graph.class, "Graph", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getGraph_Nodes(), this.getNode(), this.getNode_Graph(), "nodes", null, 0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGraph_Nodes(), this.getNode(), null, "nodes", null, 0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGraph_Links(), this.getLink(), this.getLink_Graph(), "links", null, 0, -1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getGraph_StateGraph(), theFSMPackage.getStateGraph(), null, "stateGraph", null, 0, 1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getGraph_Node(), this.getNode(), this.getNode_Graph(), "node", null, 0, 1, Graph.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEOperation(getGraph__ToString(), ecorePackage.getEString(), "toString", 0, 1, IS_UNIQUE, IS_ORDERED);
@@ -592,7 +626,7 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
initEAttribute(getGraphItem_Inherited(), ecorePackage.getEBoolean(), "inherited", "false", 0, 1, GraphItem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(nodeEClass, Node.class, "Node", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getNode_Graph(), this.getGraph(), this.getGraph_Nodes(), "graph", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getNode_Graph(), this.getGraph(), this.getGraph_Node(), "graph", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getNode_Subgraph(), this.getGraph(), null, "subgraph", null, 0, 1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getNode_Outgoing(), this.getLink(), this.getLink_Source(), "outgoing", null, 0, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getNode_Incoming(), this.getLink(), this.getLink_Target(), "incoming", null, 0, -1, Node.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -620,6 +654,8 @@ public class FsmGenPackageImpl extends EPackageImpl implements FsmGenPackage {
initEAttribute(getCommonTrigger_Trigger(), ecorePackage.getEString(), "trigger", null, 0, 1, CommonTrigger.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCommonTrigger_Links(), this.getLink(), null, "links", null, 0, -1, CommonTrigger.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(fsmGenElementEClass, FSMGenElement.class, "FSMGenElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java
index 12e3225c5..6b2c3afdf 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphContainerImpl.java
@@ -9,8 +9,6 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
-
import org.eclipse.etrice.core.fsm.fSM.ModelComponent;
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
@@ -34,7 +32,7 @@ import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
*
* @generated
*/
-public class GraphContainerImpl extends MinimalEObjectImpl.Container implements GraphContainer {
+public class GraphContainerImpl extends FSMGenElementImpl implements GraphContainer {
/**
* The cached value of the '{@link #getGraph() <em>Graph</em>}' containment reference.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java
index 7a682f0ee..d99be696b 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphImpl.java
@@ -14,8 +14,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
-
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.etrice.core.fsm.fSM.StateGraph;
@@ -35,11 +34,12 @@ import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
* <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl#getNodes <em>Nodes</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl#getLinks <em>Links</em>}</li>
* <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl#getStateGraph <em>State Graph</em>}</li>
+ * <li>{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.impl.GraphImpl#getNode <em>Node</em>}</li>
* </ul>
*
* @generated
*/
-public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
+public class GraphImpl extends FSMGenElementImpl implements Graph {
/**
* The cached value of the '{@link #getNodes() <em>Nodes</em>}' containment reference list.
* <!-- begin-user-doc -->
@@ -71,6 +71,16 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
protected StateGraph stateGraph;
/**
+ * The cached value of the '{@link #getNode() <em>Node</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getNode()
+ * @generated
+ * @ordered
+ */
+ protected Node node;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -96,7 +106,7 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
*/
public EList<Node> getNodes() {
if (nodes == null) {
- nodes = new EObjectContainmentWithInverseEList<Node>(Node.class, this, FsmGenPackage.GRAPH__NODES, FsmGenPackage.NODE__GRAPH);
+ nodes = new EObjectContainmentEList<Node>(Node.class, this, FsmGenPackage.GRAPH__NODES);
}
return nodes;
}
@@ -156,6 +166,66 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
* <!-- end-user-doc -->
* @generated
*/
+ public Node getNode() {
+ if (node != null && node.eIsProxy()) {
+ InternalEObject oldNode = (InternalEObject)node;
+ node = (Node)eResolveProxy(oldNode);
+ if (node != oldNode) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.GRAPH__NODE, oldNode, node));
+ }
+ }
+ return node;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Node basicGetNode() {
+ return node;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetNode(Node newNode, NotificationChain msgs) {
+ Node oldNode = node;
+ node = newNode;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FsmGenPackage.GRAPH__NODE, oldNode, newNode);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setNode(Node newNode) {
+ if (newNode != node) {
+ NotificationChain msgs = null;
+ if (node != null)
+ msgs = ((InternalEObject)node).eInverseRemove(this, FsmGenPackage.NODE__GRAPH, Node.class, msgs);
+ if (newNode != null)
+ msgs = ((InternalEObject)newNode).eInverseAdd(this, FsmGenPackage.NODE__GRAPH, Node.class, msgs);
+ msgs = basicSetNode(newNode, msgs);
+ if (msgs != null) msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, FsmGenPackage.GRAPH__NODE, newNode, newNode));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public String toString() {
StringBuilder result = new StringBuilder();
result.append("StateGraph {\n");
@@ -178,10 +248,12 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
- case FsmGenPackage.GRAPH__NODES:
- return ((InternalEList<InternalEObject>)(InternalEList<?>)getNodes()).basicAdd(otherEnd, msgs);
case FsmGenPackage.GRAPH__LINKS:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getLinks()).basicAdd(otherEnd, msgs);
+ case FsmGenPackage.GRAPH__NODE:
+ if (node != null)
+ msgs = ((InternalEObject)node).eInverseRemove(this, FsmGenPackage.NODE__GRAPH, Node.class, msgs);
+ return basicSetNode((Node)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
@@ -198,6 +270,8 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
return ((InternalEList<?>)getNodes()).basicRemove(otherEnd, msgs);
case FsmGenPackage.GRAPH__LINKS:
return ((InternalEList<?>)getLinks()).basicRemove(otherEnd, msgs);
+ case FsmGenPackage.GRAPH__NODE:
+ return basicSetNode(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -217,6 +291,9 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
case FsmGenPackage.GRAPH__STATE_GRAPH:
if (resolve) return getStateGraph();
return basicGetStateGraph();
+ case FsmGenPackage.GRAPH__NODE:
+ if (resolve) return getNode();
+ return basicGetNode();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -241,6 +318,9 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
case FsmGenPackage.GRAPH__STATE_GRAPH:
setStateGraph((StateGraph)newValue);
return;
+ case FsmGenPackage.GRAPH__NODE:
+ setNode((Node)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -262,6 +342,9 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
case FsmGenPackage.GRAPH__STATE_GRAPH:
setStateGraph((StateGraph)null);
return;
+ case FsmGenPackage.GRAPH__NODE:
+ setNode((Node)null);
+ return;
}
super.eUnset(featureID);
}
@@ -280,6 +363,8 @@ public class GraphImpl extends MinimalEObjectImpl.Container implements Graph {
return links != null && !links.isEmpty();
case FsmGenPackage.GRAPH__STATE_GRAPH:
return stateGraph != null;
+ case FsmGenPackage.GRAPH__NODE:
+ return node != null;
}
return super.eIsSet(featureID);
}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java
index f52472dbb..239cfd8aa 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/GraphItemImpl.java
@@ -7,8 +7,6 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
-
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenPackage;
import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem;
@@ -25,7 +23,7 @@ import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphItem;
*
* @generated
*/
-public class GraphItemImpl extends MinimalEObjectImpl.Container implements GraphItem {
+public class GraphItemImpl extends FSMGenElementImpl implements GraphItem {
/**
* The default value of the '{@link #isInherited() <em>Inherited</em>}' attribute.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java
index 12cc1a35f..345898daa 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/impl/NodeImpl.java
@@ -17,7 +17,6 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
@@ -53,6 +52,16 @@ import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
*/
public class NodeImpl extends GraphItemImpl implements Node {
/**
+ * The cached value of the '{@link #getGraph() <em>Graph</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getGraph()
+ * @generated
+ * @ordered
+ */
+ protected Graph graph;
+
+ /**
* The cached value of the '{@link #getSubgraph() <em>Subgraph</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -147,8 +156,24 @@ public class NodeImpl extends GraphItemImpl implements Node {
* @generated
*/
public Graph getGraph() {
- if (eContainerFeatureID() != FsmGenPackage.NODE__GRAPH) return null;
- return (Graph)eInternalContainer();
+ if (graph != null && graph.eIsProxy()) {
+ InternalEObject oldGraph = (InternalEObject)graph;
+ graph = (Graph)eResolveProxy(oldGraph);
+ if (graph != oldGraph) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, FsmGenPackage.NODE__GRAPH, oldGraph, graph));
+ }
+ }
+ return graph;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Graph basicGetGraph() {
+ return graph;
}
/**
@@ -157,7 +182,12 @@ public class NodeImpl extends GraphItemImpl implements Node {
* @generated
*/
public NotificationChain basicSetGraph(Graph newGraph, NotificationChain msgs) {
- msgs = eBasicSetContainer((InternalEObject)newGraph, FsmGenPackage.NODE__GRAPH, msgs);
+ Graph oldGraph = graph;
+ graph = newGraph;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FsmGenPackage.NODE__GRAPH, oldGraph, newGraph);
+ if (msgs == null) msgs = notification; else msgs.add(notification);
+ }
return msgs;
}
@@ -167,14 +197,12 @@ public class NodeImpl extends GraphItemImpl implements Node {
* @generated
*/
public void setGraph(Graph newGraph) {
- if (newGraph != eInternalContainer() || (eContainerFeatureID() != FsmGenPackage.NODE__GRAPH && newGraph != null)) {
- if (EcoreUtil.isAncestor(this, newGraph))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ if (newGraph != graph) {
NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
+ if (graph != null)
+ msgs = ((InternalEObject)graph).eInverseRemove(this, FsmGenPackage.GRAPH__NODE, Graph.class, msgs);
if (newGraph != null)
- msgs = ((InternalEObject)newGraph).eInverseAdd(this, FsmGenPackage.GRAPH__NODES, Graph.class, msgs);
+ msgs = ((InternalEObject)newGraph).eInverseAdd(this, FsmGenPackage.GRAPH__NODE, Graph.class, msgs);
msgs = basicSetGraph(newGraph, msgs);
if (msgs != null) msgs.dispatch();
}
@@ -352,8 +380,8 @@ public class NodeImpl extends GraphItemImpl implements Node {
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FsmGenPackage.NODE__GRAPH:
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
+ if (graph != null)
+ msgs = ((InternalEObject)graph).eInverseRemove(this, FsmGenPackage.GRAPH__NODE, Graph.class, msgs);
return basicSetGraph((Graph)otherEnd, msgs);
case FsmGenPackage.NODE__OUTGOING:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getOutgoing()).basicAdd(otherEnd, msgs);
@@ -391,24 +419,11 @@ public class NodeImpl extends GraphItemImpl implements Node {
* @generated
*/
@Override
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID()) {
- case FsmGenPackage.NODE__GRAPH:
- return eInternalContainer().eInverseRemove(this, FsmGenPackage.GRAPH__NODES, Graph.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FsmGenPackage.NODE__GRAPH:
- return getGraph();
+ if (resolve) return getGraph();
+ return basicGetGraph();
case FsmGenPackage.NODE__SUBGRAPH:
return getSubgraph();
case FsmGenPackage.NODE__OUTGOING:
@@ -505,7 +520,7 @@ public class NodeImpl extends GraphItemImpl implements Node {
public boolean eIsSet(int featureID) {
switch (featureID) {
case FsmGenPackage.NODE__GRAPH:
- return getGraph() != null;
+ return graph != null;
case FsmGenPackage.NODE__SUBGRAPH:
return subgraph != null;
case FsmGenPackage.NODE__OUTGOING:
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java
index 56afe2997..b798bea30 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenAdapterFactory.java
@@ -92,6 +92,10 @@ public class FsmGenAdapterFactory extends AdapterFactoryImpl {
return createCommonTriggerAdapter();
}
@Override
+ public Adapter caseFSMGenElement(FSMGenElement object) {
+ return createFSMGenElementAdapter();
+ }
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -196,6 +200,20 @@ public class FsmGenAdapterFactory extends AdapterFactoryImpl {
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.etrice.core.genmodel.fsm.fsmgen.FSMGenElement <em>FSM Gen Element</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.etrice.core.genmodel.fsm.fsmgen.FSMGenElement
+ * @generated
+ */
+ public Adapter createFSMGenElementAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for the default case.
* <!-- begin-user-doc -->
* This default implementation returns null.
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java
index ffee2433b..64d86c43d 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src-gen/org/eclipse/etrice/core/genmodel/fsm/fsmgen/util/FsmGenSwitch.java
@@ -69,18 +69,21 @@ public class FsmGenSwitch<T> extends Switch<T> {
case FsmGenPackage.GRAPH_CONTAINER: {
GraphContainer graphContainer = (GraphContainer)theEObject;
T result = caseGraphContainer(graphContainer);
+ if (result == null) result = caseFSMGenElement(graphContainer);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FsmGenPackage.GRAPH: {
Graph graph = (Graph)theEObject;
T result = caseGraph(graph);
+ if (result == null) result = caseFSMGenElement(graph);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FsmGenPackage.GRAPH_ITEM: {
GraphItem graphItem = (GraphItem)theEObject;
T result = caseGraphItem(graphItem);
+ if (result == null) result = caseFSMGenElement(graphItem);
if (result == null) result = defaultCase(theEObject);
return result;
}
@@ -88,6 +91,7 @@ public class FsmGenSwitch<T> extends Switch<T> {
Node node = (Node)theEObject;
T result = caseNode(node);
if (result == null) result = caseGraphItem(node);
+ if (result == null) result = caseFSMGenElement(node);
if (result == null) result = defaultCase(theEObject);
return result;
}
@@ -95,12 +99,20 @@ public class FsmGenSwitch<T> extends Switch<T> {
Link link = (Link)theEObject;
T result = caseLink(link);
if (result == null) result = caseGraphItem(link);
+ if (result == null) result = caseFSMGenElement(link);
if (result == null) result = defaultCase(theEObject);
return result;
}
case FsmGenPackage.COMMON_TRIGGER: {
CommonTrigger commonTrigger = (CommonTrigger)theEObject;
T result = caseCommonTrigger(commonTrigger);
+ if (result == null) result = caseFSMGenElement(commonTrigger);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case FsmGenPackage.FSM_GEN_ELEMENT: {
+ FSMGenElement fsmGenElement = (FSMGenElement)theEObject;
+ T result = caseFSMGenElement(fsmGenElement);
if (result == null) result = defaultCase(theEObject);
return result;
}
@@ -199,6 +211,21 @@ public class FsmGenSwitch<T> extends Switch<T> {
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>FSM Gen Element</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>FSM Gen Element</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseFSMGenElement(FSMGenElement object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend b/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend
index dcd77d8fe..a27dfd142 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.xtend
@@ -77,7 +77,7 @@ class BasicFsmGenBuilder {
}
else if (mc.actualStateMachine!==null) {
// first state machine in the hierarchy: create it
- mc.actualStateMachine.createGraph
+ mc.actualStateMachine?.createGraph
}
}
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java
index 884a8ac4d..c27268adc 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java
@@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
@@ -46,7 +47,6 @@ import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
@SuppressWarnings("all")
public class BasicFsmGenBuilder {
@@ -113,7 +113,11 @@ public class BasicFsmGenBuilder {
boolean _tripleNotEquals = (_actualStateMachine != null);
if (_tripleNotEquals) {
StateGraph _actualStateMachine_1 = this.fsmHelpers.getActualStateMachine(mc);
- _xifexpression_1 = this.createGraph(_actualStateMachine_1);
+ Graph _createGraph = null;
+ if (_actualStateMachine_1!=null) {
+ _createGraph=this.createGraph(_actualStateMachine_1);
+ }
+ _xifexpression_1 = _createGraph;
}
_xifexpression = _xifexpression_1;
}
@@ -124,21 +128,21 @@ public class BasicFsmGenBuilder {
private Graph mergeGraph(final Graph graph, final StateGraph sg) {
EList<Node> _nodes = graph.getNodes();
- final Procedure1<Node> _function = new Procedure1<Node>() {
+ final Consumer<Node> _function = new Consumer<Node>() {
@Override
- public void apply(final Node it) {
+ public void accept(final Node it) {
it.setInherited(true);
}
};
- IterableExtensions.<Node>forEach(_nodes, _function);
+ _nodes.forEach(_function);
EList<Link> _links = graph.getLinks();
- final Procedure1<Link> _function_1 = new Procedure1<Link>() {
+ final Consumer<Link> _function_1 = new Consumer<Link>() {
@Override
- public void apply(final Link it) {
+ public void accept(final Link it) {
it.setInherited(true);
}
};
- IterableExtensions.<Link>forEach(_links, _function_1);
+ _links.forEach(_function_1);
this.createContents(graph, sg);
graph.setStateGraph(sg);
return graph;
@@ -210,21 +214,21 @@ public class BasicFsmGenBuilder {
_links.addAll(_map_3);
EList<State> _states_1 = sg.getStates();
Iterable<RefinedState> _filter_1 = Iterables.<RefinedState>filter(_states_1, RefinedState.class);
- final Procedure1<RefinedState> _function_4 = new Procedure1<RefinedState>() {
+ final Consumer<RefinedState> _function_4 = new Consumer<RefinedState>() {
@Override
- public void apply(final RefinedState it) {
+ public void accept(final RefinedState it) {
BasicFsmGenBuilder.this.handleRefinedState(it);
}
};
- IterableExtensions.<RefinedState>forEach(_filter_1, _function_4);
+ _filter_1.forEach(_function_4);
EList<RefinedTransition> _refinedTransitions = sg.getRefinedTransitions();
- final Procedure1<RefinedTransition> _function_5 = new Procedure1<RefinedTransition>() {
+ final Consumer<RefinedTransition> _function_5 = new Consumer<RefinedTransition>() {
@Override
- public void apply(final RefinedTransition it) {
+ public void accept(final RefinedTransition it) {
BasicFsmGenBuilder.this.handleRefinedTransition(it);
}
};
- IterableExtensions.<RefinedTransition>forEach(_refinedTransitions, _function_5);
+ _refinedTransitions.forEach(_function_5);
}
private void handleRefinedState(final RefinedState s) {
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.java b/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.java
index be6053683..bcb91cc50 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.java
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/ExtendedFsmGenBuilder.java
@@ -18,6 +18,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.function.Consumer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
@@ -218,14 +219,14 @@ public class ExtendedFsmGenBuilder extends BasicFsmGenBuilder {
private void computeTriggers(final List<Link> sameLevelLinks, final HashMap<String, CommonTrigger> caughtTriggers) {
final HashMap<TransitionBase, Link> trans2link = CollectionLiterals.<TransitionBase, Link>newHashMap();
- final Procedure1<Link> _function = new Procedure1<Link>() {
+ final Consumer<Link> _function = new Consumer<Link>() {
@Override
- public void apply(final Link it) {
+ public void accept(final Link it) {
TransitionBase _transition = it.getTransition();
trans2link.put(_transition, it);
}
};
- IterableExtensions.<Link>forEach(sameLevelLinks, _function);
+ sameLevelLinks.forEach(_function);
for (final Link l : sameLevelLinks) {
TransitionBase _transition = l.getTransition();
EList<Trigger> _triggers = ((TriggeredTransition) _transition).getTriggers();
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java b/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java
deleted file mode 100644
index 5bbb53340..000000000
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm2/xtend-gen/org/eclipse/etrice/core/genmodel/fsm/BasicFsmGenBuilder.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/**
- * Copyright (c) 2017 protos software gmbh (http://www.protos.de).
- * 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:
- * Henrik Rentz-Reichert (initial contribution)
- */
-package org.eclipse.etrice.core.genmodel.fsm;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.function.Consumer;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.etrice.core.fsm.fSM.ChoicePoint;
-import org.eclipse.etrice.core.fsm.fSM.ChoicepointTerminal;
-import org.eclipse.etrice.core.fsm.fSM.ModelComponent;
-import org.eclipse.etrice.core.fsm.fSM.NonInitialTransition;
-import org.eclipse.etrice.core.fsm.fSM.RefinedState;
-import org.eclipse.etrice.core.fsm.fSM.RefinedTransition;
-import org.eclipse.etrice.core.fsm.fSM.SimpleState;
-import org.eclipse.etrice.core.fsm.fSM.State;
-import org.eclipse.etrice.core.fsm.fSM.StateGraph;
-import org.eclipse.etrice.core.fsm.fSM.StateGraphNode;
-import org.eclipse.etrice.core.fsm.fSM.StateTerminal;
-import org.eclipse.etrice.core.fsm.fSM.SubStateTrPointTerminal;
-import org.eclipse.etrice.core.fsm.fSM.TrPoint;
-import org.eclipse.etrice.core.fsm.fSM.TrPointTerminal;
-import org.eclipse.etrice.core.fsm.fSM.Transition;
-import org.eclipse.etrice.core.fsm.fSM.TransitionTerminal;
-import org.eclipse.etrice.core.fsm.util.FSMHelpers;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.FsmGenFactory;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Graph;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.GraphContainer;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Link;
-import org.eclipse.etrice.core.genmodel.fsm.fsmgen.Node;
-import org.eclipse.xtext.xbase.lib.CollectionLiterals;
-import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.ListExtensions;
-
-@SuppressWarnings("all")
-public class BasicFsmGenBuilder {
- @Inject
- @Extension
- protected FSMHelpers fsmHelpers;
-
- protected final FsmGenFactory factory = FsmGenFactory.eINSTANCE;
-
- public BasicFsmGenBuilder(final Injector injector) {
- injector.injectMembers(this);
- }
-
- protected BasicFsmGenBuilder() {
- }
-
- public GraphContainer createTransformedModel(final ModelComponent mc) {
- return this.createContainer(mc);
- }
-
- private GraphContainer createContainer(final ModelComponent mc) {
- final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList(mc);
- final GraphContainer _result;
- synchronized (_createCache_createContainer) {
- if (_createCache_createContainer.containsKey(_cacheKey)) {
- return _createCache_createContainer.get(_cacheKey);
- }
- GraphContainer _createGraphContainer = this.factory.createGraphContainer();
- _result = _createGraphContainer;
- _createCache_createContainer.put(_cacheKey, _result);
- }
- _init_createContainer(_result, mc);
- return _result;
- }
-
- private final HashMap<ArrayList<?>, GraphContainer> _createCache_createContainer = CollectionLiterals.newHashMap();
-
- private void _init_createContainer(final GraphContainer it, final ModelComponent mc) {
- it.setComponent(mc);
- Graph _createStateMachine = this.createStateMachine(mc);
- it.setGraph(_createStateMachine);
- }
-
- private Graph createStateMachine(final ModelComponent mc) {
- Graph _xblockexpression = null;
- {
- final StateGraph superFSM = this.fsmHelpers.getSuperStateMachine(mc);
- Graph _xifexpression = null;
- boolean _notEquals = (!Objects.equal(superFSM, null));
- if (_notEquals) {
- Graph _xblockexpression_1 = null;
- {
- ModelComponent _modelComponent = this.fsmHelpers.getModelComponent(superFSM);
- final Graph baseGraph = this.createStateMachine(_modelComponent);
- StateGraph _actualStateMachine = this.fsmHelpers.getActualStateMachine(mc);
- _xblockexpression_1 = this.mergeGraph(baseGraph, _actualStateMachine);
- }
- _xifexpression = _xblockexpression_1;
- } else {
- StateGraph _actualStateMachine = this.fsmHelpers.getActualStateMachine(mc);
- Graph _createGraph = null;
- if (_actualStateMachine!=null) {
- _createGraph=this.createGraph(_actualStateMachine);
- }
- _xifexpression = _createGraph;
- }
- _xblockexpression = _xifexpression;
- }
- return _xblockexpression;
- }
-
- private Graph mergeGraph(final Graph graph, final StateGraph sg) {
- EList<Node> _nodes = graph.getNodes();
- final Consumer<Node> _function = new Consumer<Node>() {
- @Override
- public void accept(final Node it) {
- it.setInherited(true);
- }
- };
- _nodes.forEach(_function);
- EList<Link> _links = graph.getLinks();
- final Consumer<Link> _function_1 = new Consumer<Link>() {
- @Override
- public void accept(final Link it) {
- it.setInherited(true);
- }
- };
- _links.forEach(_function_1);
- this.createContents(graph, sg);
- graph.setStateGraph(sg);
- return graph;
- }
-
- private Graph createGraph(final StateGraph sg) {
- final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList(sg);
- final Graph _result;
- synchronized (_createCache_createGraph) {
- if (_createCache_createGraph.containsKey(_cacheKey)) {
- return _createCache_createGraph.get(_cacheKey);
- }
- Graph _createGraph = this.factory.createGraph();
- _result = _createGraph;
- _createCache_createGraph.put(_cacheKey, _result);
- }
- _init_createGraph(_result, sg);
- return _result;
- }
-
- private final HashMap<ArrayList<?>, Graph> _createCache_createGraph = CollectionLiterals.newHashMap();
-
- private void _init_createGraph(final Graph it, final StateGraph sg) {
- it.setStateGraph(sg);
- this.createContents(it, sg);
- }
-
- private void createContents(final Graph graph, final StateGraph sg) {
- EList<Node> _nodes = graph.getNodes();
- EList<ChoicePoint> _chPoints = sg.getChPoints();
- final Function1<ChoicePoint, Node> _function = new Function1<ChoicePoint, Node>() {
- @Override
- public Node apply(final ChoicePoint it) {
- return BasicFsmGenBuilder.this.createNode(it);
- }
- };
- List<Node> _map = ListExtensions.<ChoicePoint, Node>map(_chPoints, _function);
- _nodes.addAll(_map);
- EList<Node> _nodes_1 = graph.getNodes();
- EList<TrPoint> _trPoints = sg.getTrPoints();
- final Function1<TrPoint, Node> _function_1 = new Function1<TrPoint, Node>() {
- @Override
- public Node apply(final TrPoint it) {
- return BasicFsmGenBuilder.this.createNode(it);
- }
- };
- List<Node> _map_1 = ListExtensions.<TrPoint, Node>map(_trPoints, _function_1);
- _nodes_1.addAll(_map_1);
- EList<Node> _nodes_2 = graph.getNodes();
- EList<State> _states = sg.getStates();
- Iterable<SimpleState> _filter = Iterables.<SimpleState>filter(_states, SimpleState.class);
- final Function1<SimpleState, Node> _function_2 = new Function1<SimpleState, Node>() {
- @Override
- public Node apply(final SimpleState it) {
- return BasicFsmGenBuilder.this.createNode(it);
- }
- };
- Iterable<Node> _map_2 = IterableExtensions.<SimpleState, Node>map(_filter, _function_2);
- Iterables.<Node>addAll(_nodes_2, _map_2);
- EList<Link> _links = graph.getLinks();
- EList<Transition> _transitions = sg.getTransitions();
- final Function1<Transition, Link> _function_3 = new Function1<Transition, Link>() {
- @Override
- public Link apply(final Transition it) {
- return BasicFsmGenBuilder.this.createLink(it);
- }
- };
- List<Link> _map_3 = ListExtensions.<Transition, Link>map(_transitions, _function_3);
- _links.addAll(_map_3);
- EList<State> _states_1 = sg.getStates();
- Iterable<RefinedState> _filter_1 = Iterables.<RefinedState>filter(_states_1, RefinedState.class);
- final Consumer<RefinedState> _function_4 = new Consumer<RefinedState>() {
- @Override
- public void accept(final RefinedState it) {
- BasicFsmGenBuilder.this.handleRefinedState(it);
- }
- };
- _filter_1.forEach(_function_4);
- EList<RefinedTransition> _refinedTransitions = sg.getRefinedTransitions();
- final Consumer<RefinedTransition> _function_5 = new Consumer<RefinedTransition>() {
- @Override
- public void accept(final RefinedTransition it) {
- BasicFsmGenBuilder.this.handleRefinedTransition(it);
- }
- };
- _refinedTransitions.forEach(_function_5);
- }
-
- private void handleRefinedState(final RefinedState s) {
- StateGraph _subgraph = s.getSubgraph();
- boolean _notEquals = (!Objects.equal(_subgraph, null));
- if (_notEquals) {
- State _target = s.getTarget();
- StateGraph _subgraph_1 = _target.getSubgraph();
- boolean _notEquals_1 = (!Objects.equal(_subgraph_1, null));
- if (_notEquals_1) {
- State _target_1 = s.getTarget();
- StateGraph _subgraph_2 = _target_1.getSubgraph();
- final Graph targetGraph = this.createGraph(_subgraph_2);
- StateGraph _subgraph_3 = s.getSubgraph();
- this.mergeGraph(targetGraph, _subgraph_3);
- } else {
- State _target_2 = s.getTarget();
- Node _createNode = this.createNode(_target_2);
- StateGraph _subgraph_4 = s.getSubgraph();
- Graph _createGraph = this.createGraph(_subgraph_4);
- _createNode.setSubgraph(_createGraph);
- }
- }
- State _target_3 = s.getTarget();
- final Node target = this.createNode(_target_3);
- target.setStateGraphNode(s);
- }
-
- private void handleRefinedTransition(final RefinedTransition t) {
- Transition _target = t.getTarget();
- Link _createLink = this.createLink(_target);
- _createLink.setTransition(t);
- }
-
- private Link createLink(final Transition tr) {
- final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList(tr);
- final Link _result;
- synchronized (_createCache_createLink) {
- if (_createCache_createLink.containsKey(_cacheKey)) {
- return _createCache_createLink.get(_cacheKey);
- }
- Link _createLink = this.factory.createLink();
- _result = _createLink;
- _createCache_createLink.put(_cacheKey, _result);
- }
- _init_createLink(_result, tr);
- return _result;
- }
-
- private final HashMap<ArrayList<?>, Link> _createCache_createLink = CollectionLiterals.newHashMap();
-
- private void _init_createLink(final Link it, final Transition tr) {
- it.setTransition(tr);
- Node _xifexpression = null;
- if ((tr instanceof NonInitialTransition)) {
- TransitionTerminal _from = ((NonInitialTransition)tr).getFrom();
- _xifexpression = this.createNode(_from);
- }
- it.setSource(_xifexpression);
- TransitionTerminal _to = tr.getTo();
- Node _createNode = this.createNode(_to);
- it.setTarget(_createNode);
- }
-
- private Node _createNode(final StateGraphNode s) {
- final ArrayList<?> _cacheKey = CollectionLiterals.newArrayList(s);
- final Node _result;
- synchronized (_createCache_createNode) {
- if (_createCache_createNode.containsKey(_cacheKey)) {
- return _createCache_createNode.get(_cacheKey);
- }
- Node _createNode = this.factory.createNode();
- _result = _createNode;
- _createCache_createNode.put(_cacheKey, _result);
- }
- _init_createNode(_result, s);
- return _result;
- }
-
- private final HashMap<ArrayList<?>, Node> _createCache_createNode = CollectionLiterals.newHashMap();
-
- private void _init_createNode(final Node it, final StateGraphNode s) {
- it.setStateGraphNode(s);
- Graph _xifexpression = null;
- if ((s instanceof State)) {
- StateGraph _subgraph = ((State)s).getSubgraph();
- Graph _createGraph = null;
- if (_subgraph!=null) {
- _createGraph=this.createGraph(_subgraph);
- }
- _xifexpression = _createGraph;
- }
- it.setSubgraph(_xifexpression);
- }
-
- private Node _createNode(final ChoicepointTerminal tt) {
- ChoicePoint _cp = tt.getCp();
- return this.createNode(_cp);
- }
-
- private Node _createNode(final TrPointTerminal tt) {
- TrPoint _trPoint = tt.getTrPoint();
- return this.createNode(_trPoint);
- }
-
- private Node _createNode(final StateTerminal tt) {
- State _state = tt.getState();
- return this.createNode(_state);
- }
-
- private Node _createNode(final SubStateTrPointTerminal tt) {
- TrPoint _trPoint = tt.getTrPoint();
- return this.createNode(_trPoint);
- }
-
- private Node createNode(final EObject tt) {
- if (tt instanceof ChoicepointTerminal) {
- return _createNode((ChoicepointTerminal)tt);
- } else if (tt instanceof StateGraphNode) {
- return _createNode((StateGraphNode)tt);
- } else if (tt instanceof StateTerminal) {
- return _createNode((StateTerminal)tt);
- } else if (tt instanceof SubStateTrPointTerminal) {
- return _createNode((SubStateTrPointTerminal)tt);
- } else if (tt instanceof TrPointTerminal) {
- return _createNode((TrPointTerminal)tt);
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: " +
- Arrays.<Object>asList(tt).toString());
- }
- }
-}

Back to the top