summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2013-03-05 09:27:38 (EST)
committer Juergen Haug2013-03-06 10:04:46 (EST)
commit42bb0d6e52a14fd586bac0cf85ad8c611e6e3f23 (patch)
tree2352fa3b78e5e72969a52696b5a5450034d2d40f
parent91fe7f5032f5bc365ac0530d53d67567ce932174 (diff)
downloadorg.eclipse.etrice-42bb0d6e52a14fd586bac0cf85ad8c611e6e3f23.zip
org.eclipse.etrice-42bb0d6e52a14fd586bac0cf85ad8c611e6e3f23.tar.gz
org.eclipse.etrice-42bb0d6e52a14fd586bac0cf85ad8c611e6e3f23.tar.bz2
[core] (Bug 398876) add documentation to Xtext generated metarefs/changes/49/10849/3
models activated xtend2 support Change-Id: I448bc6724c3a8a6b3ba325486e1fb01b1d5f0597
-rw-r--r--plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore8
-rw-r--r--plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java8
-rw-r--r--plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java34
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext75
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend37
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/ImplPostprocesser.xtend69
-rw-r--r--plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java22
-rw-r--r--plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java10
-rw-r--r--plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostProcessing.java87
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/ETMapPostprocessor.ext17
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/postprocessing/DocuPostprocessor.xtend37
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/postprocessing/PostprocessorController.java22
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/xtend-gen/org/eclipse/etrice/core/etmap/postprocessing/DocuPostprocessor.java10
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhysPostprocessor.ext17
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/postprocessing/DocuPostprocessor.xtend37
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/postprocessing/PostprocessorController.java22
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/xtend-gen/org/eclipse/etrice/core/etphys/postprocessing/DocuPostprocessor.java10
-rw-r--r--plugins/org.eclipse.etrice.core.room/.classpath1
-rw-r--r--plugins/org.eclipse.etrice.core.room/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/Room.ecore13
-rw-r--r--plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/InterfaceItem.java2
-rw-r--r--plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/StateGraphItem.java2
-rw-r--r--plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/InterfaceItemImpl.java8
-rw-r--r--plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/StateGraphItemImpl.java13
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomPostprocessor.ext77
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend37
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/ImplPostprocessor.xtend66
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/PostprocessingHelpers.xtend44
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java23
-rw-r--r--plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java10
-rw-r--r--plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostprocessor.java84
-rw-r--r--plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/PostprocessingHelpers.java54
32 files changed, 777 insertions, 184 deletions
diff --git a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore
index 5a4e3c0..832c29a 100644
--- a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore
+++ b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/Config.ecore
@@ -4,22 +4,22 @@
<eClassifiers xsi:type="ecore:EClass" name="ConfigModel">
<eOperations name="getActorClassConfigs" upperBound="-1" eType="#//ActorClassConfig">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="EList&lt;ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ActorClassConfig>();&#xD;&#xA;&#x9; &#x9;&#x9;&#x9;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9; &#x9;&#x9;&#x9;&#x9;if(element instanceof ActorClassConfig)&#xD;&#xA;&#x9; &#x9;&#x9;&#x9;&#x9;&#x9;list.add((ActorClassConfig) element);&#xD;&#xA;&#x9; &#x9;&#x9; return list;"/>
+ <details key="body" value="EList&lt;ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ActorClassConfig>();&#xD;&#xA;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;if(element instanceof ActorClassConfig)&#xD;&#xA;&#x9;&#x9;list.add((ActorClassConfig) element);&#xD;&#xA;return list;&#xD;&#xA;"/>
</eAnnotations>
</eOperations>
<eOperations name="getActorInstanceConfigs" upperBound="-1" eType="#//ActorInstanceConfig">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="EList&lt;ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ActorInstanceConfig>();&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;&#x9;&#x9; &#x9;&#x9;if(element instanceof ActorInstanceConfig)&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;list.add((ActorInstanceConfig) element);&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;return list;"/>
+ <details key="body" value="EList&lt;ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ActorInstanceConfig>();&#xD;&#xA;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;if(element instanceof ActorInstanceConfig)&#xD;&#xA;&#x9;&#x9;list.add((ActorInstanceConfig) element);&#xD;&#xA;return list;"/>
</eAnnotations>
</eOperations>
<eOperations name="getProtocolClassConfigs" upperBound="-1" eType="#//ProtocolClassConfig">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="EList&lt;ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ProtocolClassConfig>();&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;&#x9;&#x9; &#x9;&#x9;if(element instanceof ProtocolClassConfig)&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;list.add((ProtocolClassConfig) element);&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;return list;"/>
+ <details key="body" value="EList&lt;ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;ProtocolClassConfig>();&#xD;&#xA;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;if(element instanceof ProtocolClassConfig)&#xD;&#xA;&#x9;&#x9;list.add((ProtocolClassConfig) element);&#xD;&#xA;return list;&#xD;&#xA;"/>
</eAnnotations>
</eOperations>
<eOperations name="getSubSystemConfigs" upperBound="-1" eType="#//SubSystemConfig">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="EList&lt;SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;SubSystemConfig>();&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;&#x9;&#x9; &#x9;&#x9;if(element instanceof SubSystemConfig)&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;list.add((SubSystemConfig) element);&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;return list;"/>
+ <details key="body" value="EList&lt;SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList&lt;SubSystemConfig>();&#xD;&#xA;for(ConfigElement element : this.getConfigElements())&#xD;&#xA;&#x9;if(element instanceof SubSystemConfig)&#xD;&#xA;&#x9;&#x9;list.add((SubSystemConfig) element);&#xD;&#xA;return list;"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
diff --git a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java
index ad8430e..7344b6a 100644
--- a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java
+++ b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/ConfigModel.java
@@ -88,7 +88,7 @@ public interface ConfigModel extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();\r\n\t \t\t\tfor(ConfigElement element : this.getConfigElements())\r\n\t \t\t\t\tif(element instanceof ActorClassConfig)\r\n\t \t\t\t\t\tlist.add((ActorClassConfig) element);\r\n\t \t\t return list;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();\r\nfor(ConfigElement element : this.getConfigElements())\r\n\tif(element instanceof ActorClassConfig)\r\n\t\tlist.add((ActorClassConfig) element);\r\nreturn list;\r\n'"
* @generated
*/
EList<ActorClassConfig> getActorClassConfigs();
@@ -97,7 +97,7 @@ public interface ConfigModel extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();\r\n\t\t\t\tfor(ConfigElement element : this.getConfigElements())\r\n\t\t\t \t\tif(element instanceof ActorInstanceConfig)\r\n\t\t\t\t\t\tlist.add((ActorInstanceConfig) element);\r\n\t\t\t\treturn list;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();\r\nfor(ConfigElement element : this.getConfigElements())\r\n\tif(element instanceof ActorInstanceConfig)\r\n\t\tlist.add((ActorInstanceConfig) element);\r\nreturn list;'"
* @generated
*/
EList<ActorInstanceConfig> getActorInstanceConfigs();
@@ -106,7 +106,7 @@ public interface ConfigModel extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();\r\n\t\t\t\tfor(ConfigElement element : this.getConfigElements())\r\n\t\t\t \t\tif(element instanceof ProtocolClassConfig)\r\n\t\t\t\t\t\tlist.add((ProtocolClassConfig) element);\r\n\t\t\t\treturn list;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();\r\nfor(ConfigElement element : this.getConfigElements())\r\n\tif(element instanceof ProtocolClassConfig)\r\n\t\tlist.add((ProtocolClassConfig) element);\r\nreturn list;\r\n'"
* @generated
*/
EList<ProtocolClassConfig> getProtocolClassConfigs();
@@ -115,7 +115,7 @@ public interface ConfigModel extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();\r\n\t\t\t\tfor(ConfigElement element : this.getConfigElements())\r\n\t\t\t \t\tif(element instanceof SubSystemConfig)\r\n\t\t\t\t\t\tlist.add((SubSystemConfig) element);\r\n\t\t\t\treturn list;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();\r\nfor(ConfigElement element : this.getConfigElements())\r\n\tif(element instanceof SubSystemConfig)\r\n\t\tlist.add((SubSystemConfig) element);\r\nreturn list;'"
* @generated
*/
EList<SubSystemConfig> getSubSystemConfigs();
diff --git a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java
index 1ce0df6..006bc1e 100644
--- a/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java
+++ b/plugins/org.eclipse.etrice.core.config/src-gen/org/eclipse/etrice/core/config/impl/ConfigModelImpl.java
@@ -164,10 +164,11 @@ public class ConfigModelImpl extends MinimalEObjectImpl.Container implements Con
public EList<ActorClassConfig> getActorClassConfigs()
{
EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ActorClassConfig)
- list.add((ActorClassConfig) element);
- return list;
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ActorClassConfig)
+ list.add((ActorClassConfig) element);
+ return list;
+
}
/**
@@ -178,10 +179,10 @@ public class ConfigModelImpl extends MinimalEObjectImpl.Container implements Con
public EList<ActorInstanceConfig> getActorInstanceConfigs()
{
EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ActorInstanceConfig)
- list.add((ActorInstanceConfig) element);
- return list;
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ActorInstanceConfig)
+ list.add((ActorInstanceConfig) element);
+ return list;
}
/**
@@ -192,10 +193,11 @@ public class ConfigModelImpl extends MinimalEObjectImpl.Container implements Con
public EList<ProtocolClassConfig> getProtocolClassConfigs()
{
EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ProtocolClassConfig)
- list.add((ProtocolClassConfig) element);
- return list;
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ProtocolClassConfig)
+ list.add((ProtocolClassConfig) element);
+ return list;
+
}
/**
@@ -206,10 +208,10 @@ public class ConfigModelImpl extends MinimalEObjectImpl.Container implements Con
public EList<SubSystemConfig> getSubSystemConfigs()
{
EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof SubSystemConfig)
- list.add((SubSystemConfig) element);
- return list;
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof SubSystemConfig)
+ list.add((SubSystemConfig) element);
+ return list;
}
/**
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext
index 8b65ca5..8614ef0 100644
--- a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/ConfigPostprocessor.ext
@@ -10,77 +10,8 @@
*
*******************************************************************************/
-import ecore;
import xtext;
-import room;
-process(xtext::GeneratedMetamodel this) :
- process(ePackage)
-;
-
-process(ecore::EPackage this) :
- this.eClassifiers.typeSelect(ecore::EClass).process()
-;
-
-process(EClass this) :
- switch(name){
- case("ConfigModel"):
- (addOperation(
- "getActorClassConfigs",
- ePackage.getEClassifier("ActorClassConfig"),
- -1,
- 'EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ActorClassConfig)
- list.add((ActorClassConfig) element);
- return list;'
- )->addOperation(
- "getActorInstanceConfigs",
- ePackage.getEClassifier("ActorInstanceConfig"),
- -1,
- 'EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ActorInstanceConfig)
- list.add((ActorInstanceConfig) element);
- return list;'
- )->addOperation(
- "getProtocolClassConfigs",
- ePackage.getEClassifier("ProtocolClassConfig"),
- -1,
- 'EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof ProtocolClassConfig)
- list.add((ProtocolClassConfig) element);
- return list;'
- )->addOperation(
- "getSubSystemConfigs",
- ePackage.getEClassifier("SubSystemConfig"),
- -1,
- 'EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();
- for(ConfigElement element : this.getConfigElements())
- if(element instanceof SubSystemConfig)
- list.add((SubSystemConfig) element);
- return list;'
- ))
- default: null
- }
-;
-
-
-
-create ecore::EOperation addOperation(ecore::EClassifier c, String strName, ecore::EClassifier type, Integer upperBound, String strBody):
- setName(strName) ->
- setEType(type) ->
- setUpperBound(upperBound)->
- addBodyAnnotation(strBody)->
- ((ecore::EClass)c).eOperations.add(this);
-
-create ecore::EAnnotation addBodyAnnotation(ecore::EOperation op, String strBody):
- setSource("http://www.eclipse.org/emf/2002/GenModel") ->
- this.createBody(strBody) ->
- op.eAnnotations.add(this);
-
-create ecore::EStringToStringMapEntry createBody(ecore::EAnnotation anno, String strBody):
- setKey("body") ->
- setValue(strBody) ->
- anno.details.add(this);
+process(GeneratedMetamodel this) :
+ JAVA org.eclipse.etrice.core.postprocessing.PostprocessorController.process(org.eclipse.xtext.GeneratedMetamodel)
+; \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
new file mode 100644
index 0000000..fb33a36
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing
+
+import org.eclipse.xtext.GeneratedMetamodel
+
+import static extension org.eclipse.emf.ecore.util.EcoreUtil.*
+import static extension org.eclipse.etrice.core.postprocessing.PostprocessingHelpers.*
+
+class DocuPostprocessor {
+
+ def process(GeneratedMetamodel metamodel) {
+// var pckg = metamodel.EPackage
+//
+// var mdl = pckg.getClass("ConfigModel")
+// mdl.setDocumentation(
+// '''
+// <br>
+// ''')
+//
+// mdl.getAttribute("name").setDocumentation(
+// '''
+// <br>
+// ''')
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/ImplPostprocesser.xtend b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/ImplPostprocesser.xtend
new file mode 100644
index 0000000..1fd6482
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/ImplPostprocesser.xtend
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing
+
+import org.eclipse.xtext.GeneratedMetamodel
+
+import static extension org.eclipse.etrice.core.postprocessing.PostprocessingHelpers.*
+
+class ImplPostProcessing {
+
+ def process(GeneratedMetamodel metamodel) {
+ var configPackage = metamodel.EPackage
+
+ var configModel = configPackage.getClass("ConfigModel")
+ configModel.addOperation(
+ "getActorClassConfigs",
+ configPackage.getEClassifier("ActorClassConfig"),
+ -1,
+ '''
+ EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ActorClassConfig)
+ list.add((ActorClassConfig) element);
+ return list;
+ ''')
+ configModel.addOperation(
+ "getActorInstanceConfigs",
+ configPackage.getEClassifier("ActorInstanceConfig"),
+ -1,
+ '''
+ EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ActorInstanceConfig)
+ list.add((ActorInstanceConfig) element);
+ return list;''')
+ configModel.addOperation(
+ "getProtocolClassConfigs",
+ configPackage.getEClassifier("ProtocolClassConfig"),
+ -1,
+ '''
+ EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof ProtocolClassConfig)
+ list.add((ProtocolClassConfig) element);
+ return list;
+ ''')
+ configModel.addOperation(
+ "getSubSystemConfigs",
+ configPackage.getEClassifier("SubSystemConfig"),
+ -1,
+ '''
+ EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();
+ for(ConfigElement element : this.getConfigElements())
+ if(element instanceof SubSystemConfig)
+ list.add((SubSystemConfig) element);
+ return list;''')
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java
new file mode 100644
index 0000000..9b90b83
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+public class PostprocessorController {
+ public static void process(GeneratedMetamodel metamodel){
+ new DocuPostprocessor().process(metamodel);
+ new ImplPostProcessing().process(metamodel);
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java b/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java
new file mode 100644
index 0000000..9c18df4
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java
@@ -0,0 +1,10 @@
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+@SuppressWarnings("all")
+public class DocuPostprocessor {
+ public Object process(final GeneratedMetamodel metamodel) {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostProcessing.java b/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostProcessing.java
new file mode 100644
index 0000000..873d23d
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostProcessing.java
@@ -0,0 +1,87 @@
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.etrice.core.postprocessing.PostprocessingHelpers;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.GeneratedMetamodel;
+
+@SuppressWarnings("all")
+public class ImplPostProcessing {
+ public boolean process(final GeneratedMetamodel metamodel) {
+ boolean _xblockexpression = false;
+ {
+ EPackage configPackage = metamodel.getEPackage();
+ EClass configModel = PostprocessingHelpers.getClass(configPackage, "ConfigModel");
+ EClassifier _eClassifier = configPackage.getEClassifier("ActorClassConfig");
+ int _minus = (-1);
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("EList<ActorClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorClassConfig>();");
+ _builder.newLine();
+ _builder.append("for(ConfigElement element : this.getConfigElements())");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if(element instanceof ActorClassConfig)");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("list.add((ActorClassConfig) element);");
+ _builder.newLine();
+ _builder.append("return list;");
+ _builder.newLine();
+ PostprocessingHelpers.addOperation(configModel,
+ "getActorClassConfigs", _eClassifier, Integer.valueOf(_minus), _builder.toString());
+ EClassifier _eClassifier_1 = configPackage.getEClassifier("ActorInstanceConfig");
+ int _minus_1 = (-1);
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append("EList<ActorInstanceConfig> list = new org.eclipse.emf.common.util.BasicEList<ActorInstanceConfig>();");
+ _builder_1.newLine();
+ _builder_1.append("for(ConfigElement element : this.getConfigElements())");
+ _builder_1.newLine();
+ _builder_1.append("\t");
+ _builder_1.append("if(element instanceof ActorInstanceConfig)");
+ _builder_1.newLine();
+ _builder_1.append("\t\t");
+ _builder_1.append("list.add((ActorInstanceConfig) element);");
+ _builder_1.newLine();
+ _builder_1.append("return list;");
+ PostprocessingHelpers.addOperation(configModel,
+ "getActorInstanceConfigs", _eClassifier_1, Integer.valueOf(_minus_1), _builder_1.toString());
+ EClassifier _eClassifier_2 = configPackage.getEClassifier("ProtocolClassConfig");
+ int _minus_2 = (-1);
+ StringConcatenation _builder_2 = new StringConcatenation();
+ _builder_2.append("EList<ProtocolClassConfig> list = new org.eclipse.emf.common.util.BasicEList<ProtocolClassConfig>();");
+ _builder_2.newLine();
+ _builder_2.append("for(ConfigElement element : this.getConfigElements())");
+ _builder_2.newLine();
+ _builder_2.append("\t");
+ _builder_2.append("if(element instanceof ProtocolClassConfig)");
+ _builder_2.newLine();
+ _builder_2.append("\t\t");
+ _builder_2.append("list.add((ProtocolClassConfig) element);");
+ _builder_2.newLine();
+ _builder_2.append("return list;");
+ _builder_2.newLine();
+ PostprocessingHelpers.addOperation(configModel,
+ "getProtocolClassConfigs", _eClassifier_2, Integer.valueOf(_minus_2), _builder_2.toString());
+ EClassifier _eClassifier_3 = configPackage.getEClassifier("SubSystemConfig");
+ int _minus_3 = (-1);
+ StringConcatenation _builder_3 = new StringConcatenation();
+ _builder_3.append("EList<SubSystemConfig> list = new org.eclipse.emf.common.util.BasicEList<SubSystemConfig>();");
+ _builder_3.newLine();
+ _builder_3.append("for(ConfigElement element : this.getConfigElements())");
+ _builder_3.newLine();
+ _builder_3.append("\t");
+ _builder_3.append("if(element instanceof SubSystemConfig)");
+ _builder_3.newLine();
+ _builder_3.append("\t\t");
+ _builder_3.append("list.add((SubSystemConfig) element);");
+ _builder_3.newLine();
+ _builder_3.append("return list;");
+ boolean _addOperation = PostprocessingHelpers.addOperation(configModel,
+ "getSubSystemConfigs", _eClassifier_3, Integer.valueOf(_minus_3), _builder_3.toString());
+ _xblockexpression = (_addOperation);
+ }
+ return _xblockexpression;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/ETMapPostprocessor.ext b/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/ETMapPostprocessor.ext
new file mode 100644
index 0000000..65d3e6a
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/ETMapPostprocessor.ext
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Juergen Haug
+ * 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+import xtext;
+
+process(GeneratedMetamodel this) :
+ JAVA org.eclipse.etrice.core.etmap.postprocessing.PostprocessorController.process(org.eclipse.xtext.GeneratedMetamodel)
+; \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/postprocessing/DocuPostprocessor.xtend b/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/postprocessing/DocuPostprocessor.xtend
new file mode 100644
index 0000000..420f9f3
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/postprocessing/DocuPostprocessor.xtend
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.etmap.postprocessing
+
+import org.eclipse.xtext.GeneratedMetamodel
+
+import static extension org.eclipse.emf.ecore.util.EcoreUtil.*
+import static extension org.eclipse.etrice.core.postprocessing.PostprocessingHelpers.*
+
+class DocuPostprocessor {
+
+ def process(GeneratedMetamodel metamodel) {
+// var pckg = metamodel.EPackage
+//
+// var mdl = pckg.getClass("MappingModel")
+// mdl.setDocumentation(
+// '''
+// <br>
+// ''')
+//
+// mdl.getAttribute("name").setDocumentation(
+// '''
+// <br>
+// ''')
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/postprocessing/PostprocessorController.java b/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/postprocessing/PostprocessorController.java
new file mode 100644
index 0000000..c7325df
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap/src/org/eclipse/etrice/core/etmap/postprocessing/PostprocessorController.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.etmap.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+public class PostprocessorController {
+
+ public static void process(GeneratedMetamodel metamodel){
+ new DocuPostprocessor().process(metamodel);
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.etmap/xtend-gen/org/eclipse/etrice/core/etmap/postprocessing/DocuPostprocessor.java b/plugins/org.eclipse.etrice.core.etmap/xtend-gen/org/eclipse/etrice/core/etmap/postprocessing/DocuPostprocessor.java
new file mode 100644
index 0000000..2f88993
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap/xtend-gen/org/eclipse/etrice/core/etmap/postprocessing/DocuPostprocessor.java
@@ -0,0 +1,10 @@
+package org.eclipse.etrice.core.etmap.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+@SuppressWarnings("all")
+public class DocuPostprocessor {
+ public Object process(final GeneratedMetamodel metamodel) {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhysPostprocessor.ext b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhysPostprocessor.ext
new file mode 100644
index 0000000..85a5fa1
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/ETPhysPostprocessor.ext
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Juergen Haug
+ * 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+import xtext;
+
+process(GeneratedMetamodel this) :
+ JAVA org.eclipse.etrice.core.etphys.postprocessing.PostprocessorController.process(org.eclipse.xtext.GeneratedMetamodel)
+; \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/postprocessing/DocuPostprocessor.xtend b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/postprocessing/DocuPostprocessor.xtend
new file mode 100644
index 0000000..fa17aea
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/postprocessing/DocuPostprocessor.xtend
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.etphys.postprocessing
+
+import org.eclipse.xtext.GeneratedMetamodel
+
+import static extension org.eclipse.emf.ecore.util.EcoreUtil.*
+import static extension org.eclipse.etrice.core.postprocessing.PostprocessingHelpers.*
+
+class DocuPostprocessor {
+
+ def process(GeneratedMetamodel metamodel) {
+// var pckg = metamodel.EPackage
+//
+// var mdl = pckg.getClass("PhysicalModel")
+// mdl.setDocumentation(
+// '''
+// <br>
+// ''')
+//
+// mdl.getAttribute("name").setDocumentation(
+// '''
+// <br>
+// ''')
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/postprocessing/PostprocessorController.java b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/postprocessing/PostprocessorController.java
new file mode 100644
index 0000000..b6bf950
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etphys/src/org/eclipse/etrice/core/etphys/postprocessing/PostprocessorController.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.etphys.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+public class PostprocessorController {
+
+ public static void process(GeneratedMetamodel metamodel){
+ new DocuPostprocessor().process(metamodel);
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.etphys/xtend-gen/org/eclipse/etrice/core/etphys/postprocessing/DocuPostprocessor.java b/plugins/org.eclipse.etrice.core.etphys/xtend-gen/org/eclipse/etrice/core/etphys/postprocessing/DocuPostprocessor.java
new file mode 100644
index 0000000..7430d1d
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etphys/xtend-gen/org/eclipse/etrice/core/etphys/postprocessing/DocuPostprocessor.java
@@ -0,0 +1,10 @@
+package org.eclipse.etrice.core.etphys.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+@SuppressWarnings("all")
+public class DocuPostprocessor {
+ public Object process(final GeneratedMetamodel metamodel) {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.room/.classpath b/plugins/org.eclipse.etrice.core.room/.classpath
index 42c365c..6714864 100644
--- a/plugins/org.eclipse.etrice.core.room/.classpath
+++ b/plugins/org.eclipse.etrice.core.room/.classpath
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
diff --git a/plugins/org.eclipse.etrice.core.room/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.core.room/META-INF/MANIFEST.MF
index 331c13f..55dc74d 100644
--- a/plugins/org.eclipse.etrice.core.room/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.core.room/META-INF/MANIFEST.MF
@@ -22,15 +22,16 @@ Import-Package: org.apache.log4j,
org.eclipse.etrice.core.room
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.etrice.core,
+ org.eclipse.etrice.core.formatting,
org.eclipse.etrice.core.naming,
org.eclipse.etrice.core.parseTreeConstruction,
org.eclipse.etrice.core.parser.antlr,
org.eclipse.etrice.core.parser.antlr.internal,
+ org.eclipse.etrice.core.postprocessing,
org.eclipse.etrice.core.room,
org.eclipse.etrice.core.room.impl,
org.eclipse.etrice.core.room.util,
org.eclipse.etrice.core.scoping,
org.eclipse.etrice.core.services,
- org.eclipse.etrice.core.validation,
- org.eclipse.etrice.core.formatting
+ org.eclipse.etrice.core.validation
Bundle-Activator: org.eclipse.etrice.core.RoomActivator
diff --git a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/Room.ecore b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/Room.ecore
index cb51d2c..f8133ff 100644
--- a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/Room.ecore
+++ b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/Room.ecore
@@ -2,7 +2,14 @@
<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="room" nsURI="http://www.eclipse.org/etrice/Room" nsPrefix="room">
<eClassifiers xsi:type="ecore:EClass" name="RoomModel">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="&lt;br>&#xD;&#xA;"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
+ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
+ <details key="documentation" value="&lt;br>&#xD;&#xA;"/>
+ </eAnnotations>
+ </eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="docu" eType="#//Documentation"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="imports" upperBound="-1"
@@ -224,7 +231,7 @@
<eClassifiers xsi:type="ecore:EClass" name="InterfaceItem">
<eOperations name="getGeneralProtocol" eType="#//GeneralProtocolClass">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="if (this instanceof org.eclipse.etrice.core.room.Port)&#xA;return ((org.eclipse.etrice.core.room.Port) this).getProtocol();&#xA;else if (this instanceof org.eclipse.etrice.core.room.SAPRef)&#xA;return ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();&#xA;else if (this instanceof org.eclipse.etrice.core.room.SPPRef)&#xA;return ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();return null;"/>
+ <details key="body" value="if (this instanceof org.eclipse.etrice.core.room.Port)&#xD;&#xA;&#x9;return ((org.eclipse.etrice.core.room.Port) this).getProtocol();&#xD;&#xA;else if (this instanceof org.eclipse.etrice.core.room.SAPRef)&#xD;&#xA;&#x9;return ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();&#xD;&#xA;else if (this instanceof org.eclipse.etrice.core.room.SPPRef)&#xD;&#xA;&#x9;return ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();&#xD;&#xA;return null;&#xD;&#xA;"/>
</eAnnotations>
</eOperations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
@@ -325,7 +332,7 @@
<eClassifiers xsi:type="ecore:EClass" name="StateGraphItem">
<eOperations name="getName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
- <details key="body" value="if (this instanceof org.eclipse.etrice.core.room.State) return ((org.eclipse.etrice.core.room.State)this).getName();&#xA;else if (this instanceof org.eclipse.etrice.core.room.TrPoint) return ((org.eclipse.etrice.core.room.TrPoint)this).getName();&#xA;else if (this instanceof org.eclipse.etrice.core.room.ChoicePoint) return ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();&#xA;else if (this instanceof org.eclipse.etrice.core.room.Transition) return ((org.eclipse.etrice.core.room.Transition)this).getName();&#xA;return &quot;&quot;;"/>
+ <details key="body" value="if (this instanceof org.eclipse.etrice.core.room.State) &#xD;&#xA;&#x9;return ((org.eclipse.etrice.core.room.State)this).getName();&#xD;&#xA;else if (this instanceof org.eclipse.etrice.core.room.TrPoint)&#xD;&#xA;&#x9;return ((org.eclipse.etrice.core.room.TrPoint)this).getName();&#xD;&#xA;else if (this instanceof org.eclipse.etrice.core.room.ChoicePoint)&#xD;&#xA;&#x9;return ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();&#xD;&#xA;else if (this instanceof org.eclipse.etrice.core.room.Transition)&#xD;&#xA;&#x9;return ((org.eclipse.etrice.core.room.Transition)this).getName();&#xD;&#xA;return &quot;&quot;;&#xD;&#xA;"/>
</eAnnotations>
</eOperations>
</eClassifiers>
diff --git a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/InterfaceItem.java b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/InterfaceItem.java
index 409630d..aa9c001 100644
--- a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/InterfaceItem.java
+++ b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/InterfaceItem.java
@@ -52,7 +52,7 @@ public interface InterfaceItem extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='if (this instanceof org.eclipse.etrice.core.room.Port)\nreturn ((org.eclipse.etrice.core.room.Port) this).getProtocol();\nelse if (this instanceof org.eclipse.etrice.core.room.SAPRef)\nreturn ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();\nelse if (this instanceof org.eclipse.etrice.core.room.SPPRef)\nreturn ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();return null;'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='if (this instanceof org.eclipse.etrice.core.room.Port)\r\n\treturn ((org.eclipse.etrice.core.room.Port) this).getProtocol();\r\nelse if (this instanceof org.eclipse.etrice.core.room.SAPRef)\r\n\treturn ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();\r\nelse if (this instanceof org.eclipse.etrice.core.room.SPPRef)\r\n\treturn ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();\r\nreturn null;\r\n'"
* @generated
*/
GeneralProtocolClass getGeneralProtocol();
diff --git a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/StateGraphItem.java b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/StateGraphItem.java
index e1d9adb..5ee9177 100644
--- a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/StateGraphItem.java
+++ b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/StateGraphItem.java
@@ -20,7 +20,7 @@ public interface StateGraphItem extends EObject
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @model kind="operation"
- * annotation="http://www.eclipse.org/emf/2002/GenModel body='if (this instanceof org.eclipse.etrice.core.room.State) return ((org.eclipse.etrice.core.room.State)this).getName();\nelse if (this instanceof org.eclipse.etrice.core.room.TrPoint) return ((org.eclipse.etrice.core.room.TrPoint)this).getName();\nelse if (this instanceof org.eclipse.etrice.core.room.ChoicePoint) return ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();\nelse if (this instanceof org.eclipse.etrice.core.room.Transition) return ((org.eclipse.etrice.core.room.Transition)this).getName();\nreturn \"\";'"
+ * annotation="http://www.eclipse.org/emf/2002/GenModel body='if (this instanceof org.eclipse.etrice.core.room.State) \r\n\treturn ((org.eclipse.etrice.core.room.State)this).getName();\r\nelse if (this instanceof org.eclipse.etrice.core.room.TrPoint)\r\n\treturn ((org.eclipse.etrice.core.room.TrPoint)this).getName();\r\nelse if (this instanceof org.eclipse.etrice.core.room.ChoicePoint)\r\n\treturn ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();\r\nelse if (this instanceof org.eclipse.etrice.core.room.Transition)\r\n\treturn ((org.eclipse.etrice.core.room.Transition)this).getName();\r\nreturn \"\";\r\n'"
* @generated
*/
String getName();
diff --git a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/InterfaceItemImpl.java b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/InterfaceItemImpl.java
index 0533c2c..d8ba399 100644
--- a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/InterfaceItemImpl.java
+++ b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/InterfaceItemImpl.java
@@ -100,11 +100,13 @@ public class InterfaceItemImpl extends MinimalEObjectImpl.Container implements I
public GeneralProtocolClass getGeneralProtocol()
{
if (this instanceof org.eclipse.etrice.core.room.Port)
- return ((org.eclipse.etrice.core.room.Port) this).getProtocol();
+ return ((org.eclipse.etrice.core.room.Port) this).getProtocol();
else if (this instanceof org.eclipse.etrice.core.room.SAPRef)
- return ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();
+ return ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();
else if (this instanceof org.eclipse.etrice.core.room.SPPRef)
- return ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();return null;
+ return ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();
+ return null;
+
}
/**
diff --git a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/StateGraphItemImpl.java b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/StateGraphItemImpl.java
index 522936d..5a0b745 100644
--- a/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/StateGraphItemImpl.java
+++ b/plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/StateGraphItemImpl.java
@@ -48,11 +48,16 @@ public class StateGraphItemImpl extends MinimalEObjectImpl.Container implements
*/
public String getName()
{
- if (this instanceof org.eclipse.etrice.core.room.State) return ((org.eclipse.etrice.core.room.State)this).getName();
- else if (this instanceof org.eclipse.etrice.core.room.TrPoint) return ((org.eclipse.etrice.core.room.TrPoint)this).getName();
- else if (this instanceof org.eclipse.etrice.core.room.ChoicePoint) return ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();
- else if (this instanceof org.eclipse.etrice.core.room.Transition) return ((org.eclipse.etrice.core.room.Transition)this).getName();
+ if (this instanceof org.eclipse.etrice.core.room.State)
+ return ((org.eclipse.etrice.core.room.State)this).getName();
+ else if (this instanceof org.eclipse.etrice.core.room.TrPoint)
+ return ((org.eclipse.etrice.core.room.TrPoint)this).getName();
+ else if (this instanceof org.eclipse.etrice.core.room.ChoicePoint)
+ return ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();
+ else if (this instanceof org.eclipse.etrice.core.room.Transition)
+ return ((org.eclipse.etrice.core.room.Transition)this).getName();
return "";
+
}
} //StateGraphItemImpl
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomPostprocessor.ext b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomPostprocessor.ext
index 261dfcd..a485922 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomPostprocessor.ext
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/RoomPostprocessor.ext
@@ -10,79 +10,8 @@
*
*******************************************************************************/
-// possible improvement: http://christiandietrich.wordpress.com/2011/07/22/customizing-xtext-metamodel-inference-using-xtend2/
-
-import ecore;
import xtext;
-process(xtext::GeneratedMetamodel this) :
- process(ePackage)
-;
-
-// the multiplicity is an optional attribute with a default of 1
-process(ecore::EPackage this) :
- this.eClassifiers.typeSelect(ecore::EClass).process()
-;
-
-process(EClass this) :
- switch (name) {
- case "Port": (eAllAttributes.select(e|e.name=="multiplicity").first().setDefaultValueLiteral("1")
- -> addOperation("isReplicated", getEcoreDataType("EBoolean")))
- case "ActorRef": (eAllAttributes.select(e|e.name=="size").first().setDefaultValueLiteral("1"))
- case "State": (addOperation("getName", getEcoreDataType("EString")))
- case "StateGraphItem": (addOperation("getName", getEcoreDataType("EString")))
- case "InterfaceItem": (addOperation("getGeneralProtocol", ePackage.getEClassifier("GeneralProtocolClass")))
- default: null
- }
-;
-
-EDataType getEcoreDataType(String name) :
- org::eclipse::emf::ecore::EcorePackage::eINSTANCE.getEClassifier(name)
-;
-
-addOperation(EClass this, String name, EClassifier type) :
- let op = newOperation(name, type) :
- newDelegatingBodyAnnotation(this, op)
-;
-
-create EOperation newOperation(EClass owner, String name, EClassifier type) :
- setName(name) -> setEType(type) -> owner.eOperations.add(this)
-;
-
-create EAnnotation newDelegatingBodyAnnotation(EClass cls, EOperation op) :
- let d = new EStringToStringMapEntry :
- setSource("http://www.eclipse.org/emf/2002/GenModel") ->
- d.setKey("body") ->
- switch (op.name) {
- case "getName":
- (switch (cls.name) {
- case "State":
- (d.setValue("return (this instanceof org.eclipse.etrice.core.room.SimpleState)? "
- +"((org.eclipse.etrice.core.room.SimpleState)this).getName() :"
- +"(this instanceof org.eclipse.etrice.core.room.RefinedState)? "
- +"(((org.eclipse.etrice.core.room.RefinedState)this).getTarget()==null?"
- +" \"\":((org.eclipse.etrice.core.room.RefinedState)this).getTarget().getName()) :"
- +"\"\";"))
- case "StateGraphItem":
- (d.setValue("if (this instanceof org.eclipse.etrice.core.room.State) return ((org.eclipse.etrice.core.room.State)this).getName();\n"
- + "else if (this instanceof org.eclipse.etrice.core.room.TrPoint) return ((org.eclipse.etrice.core.room.TrPoint)this).getName();\n"
- + "else if (this instanceof org.eclipse.etrice.core.room.ChoicePoint) return ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();\n"
- + "else if (this instanceof org.eclipse.etrice.core.room.Transition) return ((org.eclipse.etrice.core.room.Transition)this).getName();\n"
- + "return \"\";"))
- default: null
- })
- case "isReplicated":
- (d.setValue("return multiplicity>1 || multiplicity==-1;"))
- case "getGeneralProtocol":
- (d.setValue("if (this instanceof org.eclipse.etrice.core.room.Port)\n"
- +"return ((org.eclipse.etrice.core.room.Port) this).getProtocol();\n"
- +"else if (this instanceof org.eclipse.etrice.core.room.SAPRef)\n"
- +"return ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();\n"
- +"else if (this instanceof org.eclipse.etrice.core.room.SPPRef)\n"
- +"return ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();"
- +"return null;"))
- default: null
- } ->
- details.add(d) ->
- op.eAnnotations.add(this)
-;
+process(GeneratedMetamodel this) :
+ JAVA org.eclipse.etrice.core.postprocessing.PostprocessorController.process(org.eclipse.xtext.GeneratedMetamodel)
+; \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
new file mode 100644
index 0000000..1a56f5e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.xtend
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing
+
+import org.eclipse.xtext.GeneratedMetamodel
+
+import static extension org.eclipse.emf.ecore.util.EcoreUtil.*
+import static extension org.eclipse.etrice.core.postprocessing.PostprocessingHelpers.*
+
+class DocuPostprocessor {
+
+ def process(GeneratedMetamodel metamodel) {
+// var pckg = metamodel.EPackage
+//
+// var mdl = pckg.getClass("RoomModel")
+// mdl.setDocumentation(
+// '''
+// <br>
+// ''')
+//
+// mdl.getAttribute("name").setDocumentation(
+// '''
+// <br>
+// ''')
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/ImplPostprocessor.xtend b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/ImplPostprocessor.xtend
new file mode 100644
index 0000000..e7014d2
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/ImplPostprocessor.xtend
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing
+
+import org.eclipse.xtext.GeneratedMetamodel
+
+import org.eclipse.emf.ecore.EcorePackage
+
+import static extension org.eclipse.emf.ecore.util.EcoreUtil.*
+import static extension org.eclipse.etrice.core.postprocessing.PostprocessingHelpers.*
+
+class ImplPostprocessor {
+
+ def process(GeneratedMetamodel metamodel) {
+ var roomPackage = metamodel.EPackage
+
+ var port = roomPackage.getClass("Port")
+ port.getAttribute("multiplicity").setDefaultValueLiteral("1")
+ port.addOperation("isReplicated", EcorePackage::eINSTANCE.getEClassifier("EBoolean"), 1,
+ '''return multiplicity>1 || multiplicity==-1;''')
+
+ var actorRef = roomPackage.getClass("ActorRef")
+ actorRef.getAttribute("size").setDefaultValueLiteral("1")
+
+ var state = roomPackage.getClass("State")
+ state.addOperation("getName", EcorePackage::eINSTANCE.getEClassifier("EString"), 1,
+ '''return (this instanceof org.eclipse.etrice.core.room.SimpleState)? ((org.eclipse.etrice.core.room.SimpleState)this).getName() :(this instanceof org.eclipse.etrice.core.room.RefinedState)? (((org.eclipse.etrice.core.room.RefinedState)this).getTarget()==null? "":((org.eclipse.etrice.core.room.RefinedState)this).getTarget().getName()) :"";''')
+
+ var stateGraphItem = roomPackage.getClass("StateGraphItem")
+ stateGraphItem.addOperation("getName", EcorePackage::eINSTANCE.getEClassifier("EString"), 1,
+ '''
+ if (this instanceof org.eclipse.etrice.core.room.State)
+ return ((org.eclipse.etrice.core.room.State)this).getName();
+ else if (this instanceof org.eclipse.etrice.core.room.TrPoint)
+ return ((org.eclipse.etrice.core.room.TrPoint)this).getName();
+ else if (this instanceof org.eclipse.etrice.core.room.ChoicePoint)
+ return ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();
+ else if (this instanceof org.eclipse.etrice.core.room.Transition)
+ return ((org.eclipse.etrice.core.room.Transition)this).getName();
+ return "";
+ ''')
+
+ var interfaceItem = roomPackage.getClass("InterfaceItem")
+ interfaceItem.addOperation("getGeneralProtocol", roomPackage.getEClassifier("GeneralProtocolClass"), 1,
+ '''
+ if (this instanceof org.eclipse.etrice.core.room.Port)
+ return ((org.eclipse.etrice.core.room.Port) this).getProtocol();
+ else if (this instanceof org.eclipse.etrice.core.room.SAPRef)
+ return ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();
+ else if (this instanceof org.eclipse.etrice.core.room.SPPRef)
+ return ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();
+ return null;
+ ''')
+ }
+}
+
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/PostprocessingHelpers.xtend b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/PostprocessingHelpers.xtend
new file mode 100644
index 0000000..15806bb
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/PostprocessingHelpers.xtend
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing
+
+import org.eclipse.emf.ecore.EPackage
+import org.eclipse.emf.ecore.EClass
+import org.eclipse.emf.ecore.EClassifier
+import org.eclipse.emf.ecore.EcoreFactory
+
+class PostprocessingHelpers {
+
+ def static getClass(EPackage pckg, String name) {
+ pckg.getEClassifier(name) as EClass
+ }
+
+ def static getAttribute(EClass cls, String name) {
+ cls.EAllAttributes.findFirst(a | a.name.equals(name))
+ }
+
+ def static addOperation(EClass owner, String name, EClassifier type, Integer upperBound, String body){
+ var op = EcoreFactory::eINSTANCE.createEOperation()
+ op.setName(name)
+ op.setEType(type)
+ op.setUpperBound(upperBound)
+
+ var anno = EcoreFactory::eINSTANCE.createEAnnotation
+ anno.setSource("http://www.eclipse.org/emf/2002/GenModel")
+ anno.details.put("body", body)
+ op.EAnnotations.add(anno)
+
+ owner.EOperations.add(op)
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java
new file mode 100644
index 0000000..d319e33
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/postprocessing/PostprocessorController.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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:
+ * Juergen Haug
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+public class PostprocessorController {
+
+ public static void process(GeneratedMetamodel metamodel){
+ new DocuPostprocessor().process(metamodel);
+ new ImplPostprocessor().process(metamodel);
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java b/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java
new file mode 100644
index 0000000..9c18df4
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/DocuPostprocessor.java
@@ -0,0 +1,10 @@
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.xtext.GeneratedMetamodel;
+
+@SuppressWarnings("all")
+public class DocuPostprocessor {
+ public Object process(final GeneratedMetamodel metamodel) {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostprocessor.java b/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostprocessor.java
new file mode 100644
index 0000000..aa50852
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/ImplPostprocessor.java
@@ -0,0 +1,84 @@
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.etrice.core.postprocessing.PostprocessingHelpers;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.GeneratedMetamodel;
+
+@SuppressWarnings("all")
+public class ImplPostprocessor {
+ public boolean process(final GeneratedMetamodel metamodel) {
+ boolean _xblockexpression = false;
+ {
+ EPackage roomPackage = metamodel.getEPackage();
+ EClass port = PostprocessingHelpers.getClass(roomPackage, "Port");
+ EAttribute _attribute = PostprocessingHelpers.getAttribute(port, "multiplicity");
+ _attribute.setDefaultValueLiteral("1");
+ EClassifier _eClassifier = EcorePackage.eINSTANCE.getEClassifier("EBoolean");
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("return multiplicity>1 || multiplicity==-1;");
+ PostprocessingHelpers.addOperation(port, "isReplicated", _eClassifier, Integer.valueOf(1), _builder.toString());
+ EClass actorRef = PostprocessingHelpers.getClass(roomPackage, "ActorRef");
+ EAttribute _attribute_1 = PostprocessingHelpers.getAttribute(actorRef, "size");
+ _attribute_1.setDefaultValueLiteral("1");
+ EClass state = PostprocessingHelpers.getClass(roomPackage, "State");
+ EClassifier _eClassifier_1 = EcorePackage.eINSTANCE.getEClassifier("EString");
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append("return (this instanceof org.eclipse.etrice.core.room.SimpleState)? ((org.eclipse.etrice.core.room.SimpleState)this).getName() :(this instanceof org.eclipse.etrice.core.room.RefinedState)? (((org.eclipse.etrice.core.room.RefinedState)this).getTarget()==null? \"\":((org.eclipse.etrice.core.room.RefinedState)this).getTarget().getName()) :\"\";");
+ PostprocessingHelpers.addOperation(state, "getName", _eClassifier_1, Integer.valueOf(1), _builder_1.toString());
+ EClass stateGraphItem = PostprocessingHelpers.getClass(roomPackage, "StateGraphItem");
+ EClassifier _eClassifier_2 = EcorePackage.eINSTANCE.getEClassifier("EString");
+ StringConcatenation _builder_2 = new StringConcatenation();
+ _builder_2.append("if (this instanceof org.eclipse.etrice.core.room.State) ");
+ _builder_2.newLine();
+ _builder_2.append("\t");
+ _builder_2.append("return ((org.eclipse.etrice.core.room.State)this).getName();");
+ _builder_2.newLine();
+ _builder_2.append("else if (this instanceof org.eclipse.etrice.core.room.TrPoint)");
+ _builder_2.newLine();
+ _builder_2.append("\t");
+ _builder_2.append("return ((org.eclipse.etrice.core.room.TrPoint)this).getName();");
+ _builder_2.newLine();
+ _builder_2.append("else if (this instanceof org.eclipse.etrice.core.room.ChoicePoint)");
+ _builder_2.newLine();
+ _builder_2.append("\t");
+ _builder_2.append("return ((org.eclipse.etrice.core.room.ChoicePoint)this).getName();");
+ _builder_2.newLine();
+ _builder_2.append("else if (this instanceof org.eclipse.etrice.core.room.Transition)");
+ _builder_2.newLine();
+ _builder_2.append("\t");
+ _builder_2.append("return ((org.eclipse.etrice.core.room.Transition)this).getName();");
+ _builder_2.newLine();
+ _builder_2.append("return \"\";");
+ _builder_2.newLine();
+ PostprocessingHelpers.addOperation(stateGraphItem, "getName", _eClassifier_2, Integer.valueOf(1), _builder_2.toString());
+ EClass interfaceItem = PostprocessingHelpers.getClass(roomPackage, "InterfaceItem");
+ EClassifier _eClassifier_3 = roomPackage.getEClassifier("GeneralProtocolClass");
+ StringConcatenation _builder_3 = new StringConcatenation();
+ _builder_3.append("if (this instanceof org.eclipse.etrice.core.room.Port)");
+ _builder_3.newLine();
+ _builder_3.append("\t");
+ _builder_3.append("return ((org.eclipse.etrice.core.room.Port) this).getProtocol();");
+ _builder_3.newLine();
+ _builder_3.append("else if (this instanceof org.eclipse.etrice.core.room.SAPRef)");
+ _builder_3.newLine();
+ _builder_3.append("\t");
+ _builder_3.append("return ((org.eclipse.etrice.core.room.SAPRef) this).getProtocol();");
+ _builder_3.newLine();
+ _builder_3.append("else if (this instanceof org.eclipse.etrice.core.room.SPPRef)");
+ _builder_3.newLine();
+ _builder_3.append("\t");
+ _builder_3.append("return ((org.eclipse.etrice.core.room.SPPRef) this).getProtocol();");
+ _builder_3.newLine();
+ _builder_3.append("return null;");
+ _builder_3.newLine();
+ boolean _addOperation = PostprocessingHelpers.addOperation(interfaceItem, "getGeneralProtocol", _eClassifier_3, Integer.valueOf(1), _builder_3.toString());
+ _xblockexpression = (_addOperation);
+ }
+ return _xblockexpression;
+ }
+}
diff --git a/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/PostprocessingHelpers.java b/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/PostprocessingHelpers.java
new file mode 100644
index 0000000..24237f3
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/xtend-gen/org/eclipse/etrice/core/postprocessing/PostprocessingHelpers.java
@@ -0,0 +1,54 @@
+package org.eclipse.etrice.core.postprocessing;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EOperation;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+
+@SuppressWarnings("all")
+public class PostprocessingHelpers {
+ public static EClass getClass(final EPackage pckg, final String name) {
+ EClassifier _eClassifier = pckg.getEClassifier(name);
+ return ((EClass) _eClassifier);
+ }
+
+ public static EAttribute getAttribute(final EClass cls, final String name) {
+ EList<EAttribute> _eAllAttributes = cls.getEAllAttributes();
+ final Function1<EAttribute,Boolean> _function = new Function1<EAttribute,Boolean>() {
+ public Boolean apply(final EAttribute a) {
+ String _name = a.getName();
+ boolean _equals = _name.equals(name);
+ return Boolean.valueOf(_equals);
+ }
+ };
+ EAttribute _findFirst = IterableExtensions.<EAttribute>findFirst(_eAllAttributes, _function);
+ return _findFirst;
+ }
+
+ public static boolean addOperation(final EClass owner, final String name, final EClassifier type, final Integer upperBound, final String body) {
+ boolean _xblockexpression = false;
+ {
+ EOperation op = EcoreFactory.eINSTANCE.createEOperation();
+ op.setName(name);
+ op.setEType(type);
+ op.setUpperBound((upperBound).intValue());
+ EAnnotation anno = EcoreFactory.eINSTANCE.createEAnnotation();
+ anno.setSource("http://www.eclipse.org/emf/2002/GenModel");
+ EMap<String,String> _details = anno.getDetails();
+ _details.put("body", body);
+ EList<EAnnotation> _eAnnotations = op.getEAnnotations();
+ _eAnnotations.add(anno);
+ EList<EOperation> _eOperations = owner.getEOperations();
+ boolean _add = _eOperations.add(op);
+ _xblockexpression = (_add);
+ }
+ return _xblockexpression;
+ }
+}