Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2013-11-11 10:44:28 -0500
committerHenrik Rentz-Reichert2013-11-11 12:53:09 -0500
commit7fa326c0c31af895cb6ff9005ad8c466a73f112e (patch)
tree59cafe2464863fca023ef66ddd7ec97c7d2f7826
parentf1d6c4fc810a726a950cad6ef6871d5e1b5f47b7 (diff)
downloadorg.eclipse.etrice-7fa326c0c31af895cb6ff9005ad8c466a73f112e.tar.gz
org.eclipse.etrice-7fa326c0c31af895cb6ff9005ad8c466a73f112e.tar.xz
org.eclipse.etrice-7fa326c0c31af895cb6ff9005ad8c466a73f112e.zip
[*] added pom
-rw-r--r--plugins/org.eclipse.etrice.core.common/.classpath4
-rw-r--r--plugins/org.eclipse.etrice.core.common/.gitignore3
-rw-r--r--plugins/org.eclipse.etrice.core.common/.project6
-rw-r--r--plugins/org.eclipse.etrice.core.common/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.etrice.core.common/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.core.common/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.etrice.core.common/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.core.config/.gitignore3
-rw-r--r--plugins/org.eclipse.etrice.core.config/.project6
-rw-r--r--plugins/org.eclipse.etrice.core.config/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.core.config/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.core.config/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/.gitignore1
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/.project6
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.core.etmap/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/.gitignore1
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/.project6
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.core.etphys/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/.gitignore1
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/.project6
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.core.genmodel/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.core.room/.gitignore1
-rw-r--r--plugins/org.eclipse.etrice.core.room/.project6
-rw-r--r--plugins/org.eclipse.etrice.core.room/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.core.room/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.core.room/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.generator.config/.gitignore1
-rw-r--r--plugins/org.eclipse.etrice.generator.config/.project6
-rw-r--r--plugins/org.eclipse.etrice.generator.config/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.generator.config/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.generator.config/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.etrice.generator.config/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java54
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/.gitignore1
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/.project6
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java953
-rw-r--r--plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/InstanceDiagramGen.java161
-rw-r--r--plugins/org.eclipse.etrice.generator.java.mvn/install_org.eclipse.etrice.generator.java.mvn.launch1
-rw-r--r--plugins/org.eclipse.etrice.generator.java.mvn/pom.xml35
-rw-r--r--plugins/org.eclipse.etrice.generator.java/.gitignore1
-rw-r--r--plugins/org.eclipse.etrice.generator.java/.project6
-rw-r--r--plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.core.resources.prefs1
-rw-r--r--plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.etrice.generator.java/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java1655
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java435
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/DataClassGen.java415
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/JavaExtensions.java35
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java788
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.java56
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java156
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java207
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java1152
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java162
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java702
-rw-r--r--plugins/org.eclipse.etrice.generator/.gitignore1
-rw-r--r--plugins/org.eclipse.etrice.generator/.project6
-rw-r--r--plugins/org.eclipse.etrice.generator/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.etrice.generator/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.etrice.generator/pom.xml15
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java1821
-rw-r--r--plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java413
-rw-r--r--releng/org.eclipse.etrice.parent/.project11
-rw-r--r--releng/org.eclipse.etrice.parent/pom.xml203
-rw-r--r--runtime/org.eclipse.etrice.modellib.java/jgen_modellib.launch2
-rw-r--r--runtime/org.eclipse.etrice.runtime.java/jgen_java_runtime.launch2
78 files changed, 3800 insertions, 5928 deletions
diff --git a/plugins/org.eclipse.etrice.core.common/.classpath b/plugins/org.eclipse.etrice.core.common/.classpath
index 406ca4abd..9389ddb61 100644
--- a/plugins/org.eclipse.etrice.core.common/.classpath
+++ b/plugins/org.eclipse.etrice.core.common/.classpath
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="xtend-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.etrice.core.common/.gitignore b/plugins/org.eclipse.etrice.core.common/.gitignore
index 180012497..64a194f49 100644
--- a/plugins/org.eclipse.etrice.core.common/.gitignore
+++ b/plugins/org.eclipse.etrice.core.common/.gitignore
@@ -1,3 +1,4 @@
bin
*._trace
-.antlr-generator-3.2.0.jar \ No newline at end of file
+.antlr-generator-3.2.0.jar
+target
diff --git a/plugins/org.eclipse.etrice.core.common/.project b/plugins/org.eclipse.etrice.core.common/.project
index 4d3d5fcae..6508448f2 100644
--- a/plugins/org.eclipse.etrice.core.common/.project
+++ b/plugins/org.eclipse.etrice.core.common/.project
@@ -25,8 +25,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/plugins/org.eclipse.etrice.core.common/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.etrice.core.common/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..c537b6306
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.common/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/org.eclipse.etrice.core.common/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.core.common/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.common/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.core.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.core.common/META-INF/MANIFEST.MF
index b2f7e19e8..c2dc4b240 100644
--- a/plugins/org.eclipse.etrice.core.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.core.common/META-INF/MANIFEST.MF
@@ -19,7 +19,7 @@ Require-Bundle: org.eclipse.xtext;visibility:=reexport,
org.eclipse.xtext.common.types
Import-Package: org.apache.log4j,
org.eclipse.xtext.xbase.lib
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.etrice.core.common,
org.eclipse.etrice.core.common.base,
org.eclipse.etrice.core.common.base.impl,
diff --git a/plugins/org.eclipse.etrice.core.common/pom.xml b/plugins/org.eclipse.etrice.core.common/pom.xml
new file mode 100644
index 000000000..f559ef97e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.common/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.core.common</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.core.config/.gitignore b/plugins/org.eclipse.etrice.core.config/.gitignore
index 180012497..64a194f49 100644
--- a/plugins/org.eclipse.etrice.core.config/.gitignore
+++ b/plugins/org.eclipse.etrice.core.config/.gitignore
@@ -1,3 +1,4 @@
bin
*._trace
-.antlr-generator-3.2.0.jar \ No newline at end of file
+.antlr-generator-3.2.0.jar
+target
diff --git a/plugins/org.eclipse.etrice.core.config/.project b/plugins/org.eclipse.etrice.core.config/.project
index 6bde47b31..2bfdfa809 100644
--- a/plugins/org.eclipse.etrice.core.config/.project
+++ b/plugins/org.eclipse.etrice.core.config/.project
@@ -25,8 +25,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/plugins/org.eclipse.etrice.core.config/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.core.config/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.core.config/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.core.config/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.core.config/pom.xml b/plugins/org.eclipse.etrice.core.config/pom.xml
new file mode 100644
index 000000000..27edf8b9e
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.config/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.core.config</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.core.etmap/.gitignore b/plugins/org.eclipse.etrice.core.etmap/.gitignore
index 8bc068991..463e8521b 100644
--- a/plugins/org.eclipse.etrice.core.etmap/.gitignore
+++ b/plugins/org.eclipse.etrice.core.etmap/.gitignore
@@ -2,3 +2,4 @@ bin
*._trace
*.smap
/.antlr-generator-3.2.0.jar
+target
diff --git a/plugins/org.eclipse.etrice.core.etmap/.project b/plugins/org.eclipse.etrice.core.etmap/.project
index 33ff632b6..556c7e47a 100644
--- a/plugins/org.eclipse.etrice.core.etmap/.project
+++ b/plugins/org.eclipse.etrice.core.etmap/.project
@@ -25,8 +25,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/plugins/org.eclipse.etrice.core.etmap/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.core.etmap/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.core.etmap/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.core.etmap/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.core.etmap/pom.xml b/plugins/org.eclipse.etrice.core.etmap/pom.xml
new file mode 100644
index 000000000..2d2f968cb
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.core.etmap</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.core.etphys/.gitignore b/plugins/org.eclipse.etrice.core.etphys/.gitignore
index 34eb7add5..97d097999 100644
--- a/plugins/org.eclipse.etrice.core.etphys/.gitignore
+++ b/plugins/org.eclipse.etrice.core.etphys/.gitignore
@@ -1,3 +1,4 @@
bin
*._trace
/.antlr-generator-3.2.0.jar
+target
diff --git a/plugins/org.eclipse.etrice.core.etphys/.project b/plugins/org.eclipse.etrice.core.etphys/.project
index 4ee1f2897..a1c2e806e 100644
--- a/plugins/org.eclipse.etrice.core.etphys/.project
+++ b/plugins/org.eclipse.etrice.core.etphys/.project
@@ -25,8 +25,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/plugins/org.eclipse.etrice.core.etphys/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.core.etphys/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etphys/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.core.etphys/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.core.etphys/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etphys/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.core.etphys/pom.xml b/plugins/org.eclipse.etrice.core.etphys/pom.xml
new file mode 100644
index 000000000..1f02eecbe
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etphys/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.core.etphys</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.core.genmodel/.gitignore b/plugins/org.eclipse.etrice.core.genmodel/.gitignore
index ba077a403..d567ba01e 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/.gitignore
+++ b/plugins/org.eclipse.etrice.core.genmodel/.gitignore
@@ -1 +1,2 @@
bin
+target
diff --git a/plugins/org.eclipse.etrice.core.genmodel/.project b/plugins/org.eclipse.etrice.core.genmodel/.project
index a81f635b8..163a755a1 100644
--- a/plugins/org.eclipse.etrice.core.genmodel/.project
+++ b/plugins/org.eclipse.etrice.core.genmodel/.project
@@ -20,8 +20,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
diff --git a/plugins/org.eclipse.etrice.core.genmodel/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.core.genmodel/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.core.genmodel/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.core.genmodel/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.core.genmodel/pom.xml b/plugins/org.eclipse.etrice.core.genmodel/pom.xml
new file mode 100644
index 000000000..c75d19a84
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.genmodel/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.core.genmodel</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.core.room/.gitignore b/plugins/org.eclipse.etrice.core.room/.gitignore
index ba5b43e4c..d62903623 100644
--- a/plugins/org.eclipse.etrice.core.room/.gitignore
+++ b/plugins/org.eclipse.etrice.core.room/.gitignore
@@ -1,3 +1,4 @@
bin
.antlr-generator-3.2.0.jar
*._trace
+target
diff --git a/plugins/org.eclipse.etrice.core.room/.project b/plugins/org.eclipse.etrice.core.room/.project
index caf0a76f7..93b7fb958 100644
--- a/plugins/org.eclipse.etrice.core.room/.project
+++ b/plugins/org.eclipse.etrice.core.room/.project
@@ -30,8 +30,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/plugins/org.eclipse.etrice.core.room/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.core.room/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.core.room/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.core.room/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.core.room/pom.xml b/plugins/org.eclipse.etrice.core.room/pom.xml
new file mode 100644
index 000000000..3822bf3a3
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.room/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.core.room</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.generator.config/.gitignore b/plugins/org.eclipse.etrice.generator.config/.gitignore
index 65847a73f..550486865 100644
--- a/plugins/org.eclipse.etrice.generator.config/.gitignore
+++ b/plugins/org.eclipse.etrice.generator.config/.gitignore
@@ -1,2 +1,3 @@
bin
*._trace
+target
diff --git a/plugins/org.eclipse.etrice.generator.config/.project b/plugins/org.eclipse.etrice.generator.config/.project
index 7734f8673..3c5e6873f 100644
--- a/plugins/org.eclipse.etrice.generator.config/.project
+++ b/plugins/org.eclipse.etrice.generator.config/.project
@@ -25,8 +25,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/plugins/org.eclipse.etrice.generator.config/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.generator.config/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.config/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.generator.config/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.generator.config/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.config/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.generator.config/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.config/META-INF/MANIFEST.MF
index f648b8236..436339476 100644
--- a/plugins/org.eclipse.etrice.generator.config/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.config/META-INF/MANIFEST.MF
@@ -6,13 +6,13 @@ Bundle-Version: 0.4.0.qualifier
Bundle-Vendor: Eclipse eTrice (Incubation)
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.etrice.core.room;bundle-version="0.4.0",
+Require-Bundle: org.eclipse.etrice.core.common;bundle-version="0.4.0",
+ org.eclipse.etrice.core.room;bundle-version="0.4.0",
org.eclipse.etrice.core.config;bundle-version="0.4.0",
- org.eclipse.etrice.generator;bundle-version="0.4.0",
org.eclipse.etrice.core.genmodel;bundle-version="0.4.0",
+ org.eclipse.etrice.generator;bundle-version="0.4.0",
org.eclipse.xtend.lib,
com.google.guava,
- org.eclipse.xtext.xbase.lib,
- org.eclipse.etrice.core.common;bundle-version="0.4.0"
+ org.eclipse.xtext.xbase.lib
Export-Package: org.eclipse.etrice.generator.config
diff --git a/plugins/org.eclipse.etrice.generator.config/pom.xml b/plugins/org.eclipse.etrice.generator.config/pom.xml
new file mode 100644
index 000000000..fdd5cc858
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.config/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.generator.config</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java b/plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java
index 84ed90e41..4dc041132 100644
--- a/plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java
+++ b/plugins/org.eclipse.etrice.generator.config/xtend-gen/org/eclipse/etrice/generator/config/DataConfiguration.java
@@ -110,12 +110,7 @@ public class DataConfiguration implements IDataConfiguration {
AttrClassConfig _xblockexpression = null;
{
StringConcatenation _builder = new StringConcatenation();
- _builder.append("/");
- String _name = actor.getName();
- _builder.append(_name, "");
- _builder.append("/");
- String _stringPath = this.toStringPath(path);
- _builder.append(_stringPath, "");
+ _builder.append("/�actor.name�/�path.toStringPath�");
String id = _builder.toString();
AttrClassConfig _get = DataConfigurationHelper.actorClassAttrMap.get(id);
_xblockexpression = (_get);
@@ -127,20 +122,7 @@ public class DataConfiguration implements IDataConfiguration {
String _xblockexpression = null;
{
StringConcatenation _builder = new StringConcatenation();
- _builder.append("/");
- String _name = pc.getName();
- _builder.append(_name, "");
- _builder.append("/");
- {
- if (regular) {
- _builder.append("regular");
- } else {
- _builder.append("conjugated");
- }
- }
- _builder.append("/");
- String _stringPath = this.toStringPath(path);
- _builder.append(_stringPath, "");
+ _builder.append("/�pc.name�/�IF regular�regular�ELSE�conjugated�ENDIF�/�path.toStringPath�");
String id = _builder.toString();
String _stringExpr = null;
AttrClassConfig _get = DataConfigurationHelper.protocolClassAttrMap.get(id);
@@ -158,18 +140,7 @@ public class DataConfiguration implements IDataConfiguration {
private String toStringPath(final List<Attribute> path) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasElements = false;
- for(final Attribute a : path) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate("/", "");
- }
- String _name = a.getName();
- _builder.append(_name, "");
- }
- }
+ _builder.append("�FOR a : path SEPARATOR \'/\'��a.name��ENDFOR�");
String _string = _builder.toString();
return _string;
}
@@ -274,10 +245,7 @@ public class DataConfiguration implements IDataConfiguration {
boolean _notEquals = (!Objects.equal(_filePath, null));
if (_notEquals) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("new ConfigSourceFile(\"");
- String _filePath_1 = dynConfig.getFilePath();
- _builder.append(_filePath_1, "");
- _builder.append("\")");
+ _builder.append("new ConfigSourceFile(\"�dynConfig.filePath�\")");
_xifexpression = _builder.toString();
} else {
String _userCode2 = null;
@@ -342,19 +310,7 @@ public class DataConfiguration implements IDataConfiguration {
private String toStringExpr(final LiteralArray literal) {
StringConcatenation _builder = new StringConcatenation();
- {
- EList<Literal> _literals = literal.getLiterals();
- boolean _hasElements = false;
- for(final Literal l : _literals) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(",", "");
- }
- String _stringExpr = this.toStringExpr(l);
- _builder.append(_stringExpr, "");
- }
- }
+ _builder.append("�FOR l : literal.literals SEPARATOR \',\'��l.toStringExpr��ENDFOR�");
String _string = _builder.toString();
return _string;
}
diff --git a/plugins/org.eclipse.etrice.generator.doc/.gitignore b/plugins/org.eclipse.etrice.generator.doc/.gitignore
index d7b296e23..1e316c551 100644
--- a/plugins/org.eclipse.etrice.generator.doc/.gitignore
+++ b/plugins/org.eclipse.etrice.generator.doc/.gitignore
@@ -1,3 +1,4 @@
bin
*._trace
*.smap
+target
diff --git a/plugins/org.eclipse.etrice.generator.doc/.project b/plugins/org.eclipse.etrice.generator.doc/.project
index ddfc7dc9c..508e2f5aa 100644
--- a/plugins/org.eclipse.etrice.generator.doc/.project
+++ b/plugins/org.eclipse.etrice.generator.doc/.project
@@ -35,8 +35,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/plugins/org.eclipse.etrice.generator.doc/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.generator.doc/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.doc/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.generator.doc/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.generator.doc/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.doc/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.generator.doc/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.doc/META-INF/MANIFEST.MF
index e21dc250d..78b77eea9 100644
--- a/plugins/org.eclipse.etrice.generator.doc/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.doc/META-INF/MANIFEST.MF
@@ -5,8 +5,7 @@ Bundle-Vendor: Eclipse eTrice (Incubation)
Bundle-Version: 0.4.0.qualifier
Bundle-SymbolicName: org.eclipse.etrice.generator.doc;singleton:=true
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.etrice.core.room.ui;bundle-version="0.4.0",
- org.eclipse.etrice.core.genmodel;bundle-version="0.4.0",
+Require-Bundle: org.eclipse.etrice.core.genmodel;bundle-version="0.4.0",
org.eclipse.etrice.generator;bundle-version="0.4.0",
org.eclipse.etrice.core.etmap;bundle-version="0.4.0",
org.eclipse.etrice.core.etphys;bundle-version="0.4.0",
diff --git a/plugins/org.eclipse.etrice.generator.doc/pom.xml b/plugins/org.eclipse.etrice.generator.doc/pom.xml
new file mode 100644
index 000000000..a76e97eca
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.doc/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.generator.doc</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java b/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java
index c8b2b354b..b82d431d1 100644
--- a/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java
+++ b/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/DocGen.java
@@ -10,7 +10,6 @@
*/
package org.eclipse.etrice.generator.doc.gen;
-import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.io.File;
@@ -22,29 +21,20 @@ import org.eclipse.etrice.core.genmodel.base.ILogger;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
-import org.eclipse.etrice.core.room.ChoicePoint;
import org.eclipse.etrice.core.room.CompoundProtocolClass;
import org.eclipse.etrice.core.room.DataClass;
-import org.eclipse.etrice.core.room.DataType;
import org.eclipse.etrice.core.room.GeneralProtocolClass;
import org.eclipse.etrice.core.room.LogicalSystem;
-import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.core.room.ProtocolClass;
-import org.eclipse.etrice.core.room.RefableType;
import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.etrice.core.room.StandardOperation;
import org.eclipse.etrice.core.room.State;
-import org.eclipse.etrice.core.room.StateGraph;
-import org.eclipse.etrice.core.room.SubProtocol;
import org.eclipse.etrice.core.room.SubSystemClass;
-import org.eclipse.etrice.core.room.VarDecl;
-import org.eclipse.etrice.core.room.util.RoomHelpers;
import org.eclipse.etrice.generator.base.CodegenHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
@Singleton
@SuppressWarnings("all")
@@ -221,11 +211,8 @@ public class DocGen {
_builder.newLine();
_builder.newLine();
_builder.newLine();
- _builder.append("\\title{");
- String _name = model.getName();
- _builder.append(_name, "");
- _builder.append(" Model Documentation}");
- _builder.newLineIfNotEmpty();
+ _builder.append("\\title{�model.name� Model Documentation}");
+ _builder.newLine();
_builder.append("\\date{\\today}");
_builder.newLine();
_builder.append("\\author{generated by eTrice}");
@@ -248,35 +235,28 @@ public class DocGen {
_builder.newLine();
_builder.append("\\section{Model Description}");
_builder.newLine();
- Documentation _docu = model.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu);
- _builder.append(_generateDocText, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�model.docu.generateDocText�");
+ _builder.newLine();
_builder.append("\\section{Logical System Description}");
_builder.newLine();
- CharSequence _generateAllLogicalSystemDocs = this.generateAllLogicalSystemDocs(root, model);
- _builder.append(_generateAllLogicalSystemDocs, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�root.generateAllLogicalSystemDocs(model)�");
+ _builder.newLine();
_builder.append("\\section{Subsystem Description}");
_builder.newLine();
- CharSequence _generateAllSubSysClassDocs = this.generateAllSubSysClassDocs(root, model);
- _builder.append(_generateAllSubSysClassDocs, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�root.generateAllSubSysClassDocs(model)�");
+ _builder.newLine();
_builder.append("\\section{Protocol Class Description}");
_builder.newLine();
- CharSequence _generateAllProtocolClassDocs = this.generateAllProtocolClassDocs(root, model);
- _builder.append(_generateAllProtocolClassDocs, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�root.generateAllProtocolClassDocs(model)�");
+ _builder.newLine();
_builder.append("\\section{Data Class Description}");
_builder.newLine();
- CharSequence _generateAllDataClassDocs = this.generateAllDataClassDocs(root, model);
- _builder.append(_generateAllDataClassDocs, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�root.generateAllDataClassDocs(model)�");
+ _builder.newLine();
_builder.append("\\section{Actor Class Description}");
_builder.newLine();
- CharSequence _generateAllActorClassDocs = this.generateAllActorClassDocs(root, model);
- _builder.append(_generateAllActorClassDocs, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�root.generateAllActorClassDocs(model)�");
+ _builder.newLine();
_builder.append("\\end{document}");
_builder.newLine();
return _builder;
@@ -284,14 +264,13 @@ public class DocGen {
private CharSequence generateAllLogicalSystemDocs(final Root root, final RoomModel model) {
StringConcatenation _builder = new StringConcatenation();
- {
- EList<LogicalSystem> _systems = model.getSystems();
- for(final LogicalSystem sys : _systems) {
- CharSequence _generateLogicalSystemDoc = this.generateLogicalSystemDoc(root, model, sys);
- _builder.append(_generateLogicalSystemDoc, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR sys : model.systems�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�root.generateLogicalSystemDoc(model, sys)�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -307,28 +286,19 @@ public class DocGen {
filenamei = _replaceAll;
String latexFilenamei = filenamei.replaceAll("/", "//");
StringConcatenation _builder = new StringConcatenation();
- _builder.append("\\level{2}{");
- String _name_1 = system.getName();
- _builder.append(_name_1, "");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
- Documentation _docu = system.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu);
- _builder.append(_generateDocText, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("\\level{2}{�system.name�}");
+ _builder.newLine();
+ _builder.append("�system.docu.generateDocText�");
+ _builder.newLine();
_builder.append("\\level{3}{Instance Tree}");
_builder.newLine();
- {
- String _fileExists = this.fileExists(filenamei);
- boolean _equals = _fileExists.equals("true");
- if (_equals) {
- String _name_2 = system.getName();
- String _plus_2 = (_name_2 + " Instance Tree");
- CharSequence _includeGraphics = this.includeGraphics(latexFilenamei, "0.5", _plus_2);
- _builder.append(_includeGraphics, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF fileExists(filenamei).equals(\"true\")�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�includeGraphics(latexFilenamei,\"0.5\",system.name + \" Instance Tree\")�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -336,14 +306,13 @@ public class DocGen {
private CharSequence generateAllSubSysClassDocs(final Root root, final RoomModel model) {
StringConcatenation _builder = new StringConcatenation();
- {
- EList<SubSystemClass> _subSystemClasses = model.getSubSystemClasses();
- for(final SubSystemClass ssc : _subSystemClasses) {
- CharSequence _generateSubSysClassDoc = this.generateSubSysClassDoc(root, model, ssc);
- _builder.append(_generateSubSysClassDoc, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR ssc : model.subSystemClasses�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�root.generateSubSysClassDoc(model, ssc)�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -359,28 +328,19 @@ public class DocGen {
filename = _replaceAll;
String latexFilename = filename.replaceAll("/", "//");
StringConcatenation _builder = new StringConcatenation();
- _builder.append("\\level{2}{");
- String _name_1 = ssc.getName();
- _builder.append(_name_1, "");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
- Documentation _docu = ssc.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu);
- _builder.append(_generateDocText, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("\\level{2}{�ssc.name�}");
+ _builder.newLine();
+ _builder.append("�ssc.docu.generateDocText�");
+ _builder.newLine();
_builder.append("\\level{3}{Structure}");
_builder.newLine();
- {
- String _fileExists = this.fileExists(filename);
- boolean _equals = _fileExists.equals("true");
- if (_equals) {
- String _name_2 = ssc.getName();
- String _plus_2 = (_name_2 + " Structure");
- CharSequence _includeGraphics = this.includeGraphics(latexFilename, "0.4", _plus_2);
- _builder.append(_includeGraphics, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF fileExists(filename).equals(\"true\")�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�includeGraphics(latexFilename,\"0.4\",ssc.name + \" Structure\")�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -388,165 +348,97 @@ public class DocGen {
private CharSequence generateAllDataClassDocs(final Root root, final RoomModel model) {
StringConcatenation _builder = new StringConcatenation();
- {
- EList<DataClass> _dataClasses = model.getDataClasses();
- for(final DataClass dc : _dataClasses) {
- CharSequence _generateDataClassDoc = this.generateDataClassDoc(root, dc);
- _builder.append(_generateDataClassDoc, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR dc : model.dataClasses�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�root.generateDataClassDoc(dc)�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�\t\t");
+ _builder.newLine();
return _builder;
}
private CharSequence generateDataClassDoc(final Root root, final DataClass dc) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("\\level{2} {");
- String _name = dc.getName();
- _builder.append(_name, "");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
- Documentation _docu = dc.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu);
- _builder.append(_generateDocText, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("\\level{2} {�dc.name�}");
+ _builder.newLine();
+ _builder.append("�dc.docu.generateDocText�");
+ _builder.newLine();
_builder.append("\\level{3}{Attributes}");
_builder.newLine();
- EList<Attribute> _attributes = dc.getAttributes();
- CharSequence _generateAttributesDoc = this.generateAttributesDoc(_attributes);
- _builder.append(_generateAttributesDoc, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�dc.attributes.generateAttributesDoc�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\\level{3}{Operations}");
_builder.newLine();
- EList<StandardOperation> _operations = dc.getOperations();
- CharSequence _generateOperationsDoc = this.generateOperationsDoc(_operations);
- _builder.append(_generateOperationsDoc, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�dc.operations.generateOperationsDoc�");
+ _builder.newLine();
return _builder;
}
private CharSequence generateAllProtocolClassDocs(final Root root, final RoomModel model) {
StringConcatenation _builder = new StringConcatenation();
- {
- EList<GeneralProtocolClass> _protocolClasses = model.getProtocolClasses();
- for(final GeneralProtocolClass pc : _protocolClasses) {
- CharSequence _generateProtocolClassDoc = this.generateProtocolClassDoc(root, pc);
- _builder.append(_generateProtocolClassDoc, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR pc : model.protocolClasses�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�root.generateProtocolClassDoc(pc)�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
private CharSequence _generateProtocolClassDoc(final Root root, final ProtocolClass pc) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("\t");
- _builder.append("\\level{2} {");
- String _name = pc.getName();
- _builder.append(_name, " ");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- Documentation _docu = pc.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu);
- _builder.append(_generateDocText, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\\level{3}{Incoming Messages}");
+ _builder.append("\\level{2} {�pc.name�}");
_builder.newLine();
+ _builder.append("�pc.docu.generateDocText�");
+ _builder.newLine();
+ _builder.append("\\level{3}{Incoming Messages}");
_builder.newLine();
_builder.append("\t");
+ _builder.newLine();
_builder.append("\\begin{tabular}[ht]{|l|l|l|}");
_builder.newLine();
- _builder.append("\t");
_builder.append("\\hline");
_builder.newLine();
- _builder.append("\t");
_builder.append("Message & Data & Description\\\\");
_builder.newLine();
- {
- List<Message> _allIncomingMessages = RoomHelpers.getAllIncomingMessages(pc);
- for(final Message ims : _allIncomingMessages) {
- _builder.append("\t");
- _builder.append("\\hline");
- _builder.newLine();
- _builder.append("\t");
- String _name_1 = ims.getName();
- _builder.append(_name_1, " ");
- _builder.append(" & ");
- {
- VarDecl _data = ims.getData();
- boolean _notEquals = (!Objects.equal(_data, null));
- if (_notEquals) {
- _builder.append(" ");
- VarDecl _data_1 = ims.getData();
- String _name_2 = _data_1.getName();
- _builder.append(_name_2, " ");
- _builder.append(" ");
- }
- }
- _builder.append(" & ");
- Documentation _docu_1 = ims.getDocu();
- CharSequence _generateDocText_1 = this.generateDocText(_docu_1);
- _builder.append(_generateDocText_1, " ");
- _builder.append("\\\\");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR ims : pc.allIncomingMessages�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("\\hline");
_builder.newLine();
_builder.append("\t");
+ _builder.append("�ims.name� & �IF ims.data != null� �ims.data.name� �ENDIF� & �ims.docu.generateDocText�\\\\");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\\hline");
+ _builder.newLine();
_builder.append("\\end{tabular}");
_builder.newLine();
- _builder.append("\t");
_builder.newLine();
- _builder.append("\t");
_builder.append("\\level{3}{Outgoing Messages}");
_builder.newLine();
- _builder.append("\t");
_builder.append("\\begin{tabular}[ht]{|l|l|l|}");
_builder.newLine();
- _builder.append("\t");
_builder.append("\\hline");
_builder.newLine();
- _builder.append("\t");
_builder.append("Message & Data & Description\\\\");
_builder.newLine();
- {
- List<Message> _allOutgoingMessages = RoomHelpers.getAllOutgoingMessages(pc);
- for(final Message oms : _allOutgoingMessages) {
- _builder.append("\t");
- _builder.append("\\hline");
- _builder.newLine();
- _builder.append("\t");
- String _name_3 = oms.getName();
- _builder.append(_name_3, " ");
- _builder.append(" & ");
- {
- VarDecl _data_2 = oms.getData();
- boolean _notEquals_1 = (!Objects.equal(_data_2, null));
- if (_notEquals_1) {
- _builder.append(" ");
- VarDecl _data_3 = oms.getData();
- String _name_4 = _data_3.getName();
- _builder.append(_name_4, " ");
- _builder.append(" ");
- }
- }
- _builder.append(" & ");
- Documentation _docu_2 = oms.getDocu();
- CharSequence _generateDocText_2 = this.generateDocText(_docu_2);
- _builder.append(_generateDocText_2, " ");
- _builder.append("\\\\");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR oms : pc.allOutgoingMessages�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("\\hline");
_builder.newLine();
_builder.append("\t");
+ _builder.append("�oms.name� & �IF oms.data != null� �oms.data.name� �ENDIF� & �oms.docu.generateDocText�\\\\");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\\hline");
+ _builder.newLine();
_builder.append("\\end{tabular}\t\t\t");
_builder.newLine();
return _builder;
@@ -554,15 +446,10 @@ public class DocGen {
private CharSequence _generateProtocolClassDoc(final Root root, final CompoundProtocolClass pc) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("\\level{2} {");
- String _name = pc.getName();
- _builder.append(_name, "");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
- Documentation _docu = pc.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu);
- _builder.append(_generateDocText, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("\\level{2} {�pc.name�}");
+ _builder.newLine();
+ _builder.append("�pc.docu.generateDocText�");
+ _builder.newLine();
_builder.append("\\level{3}{Sub Protocols}");
_builder.newLine();
_builder.newLine();
@@ -572,21 +459,16 @@ public class DocGen {
_builder.newLine();
_builder.append("Name & Protocol\\\\");
_builder.newLine();
- {
- EList<SubProtocol> _subProtocols = pc.getSubProtocols();
- for(final SubProtocol sub : _subProtocols) {
- _builder.append("\\hline");
- _builder.newLine();
- String _name_1 = sub.getName();
- _builder.append(_name_1, "");
- _builder.append(" & ");
- GeneralProtocolClass _protocol = sub.getProtocol();
- String _name_2 = _protocol.getName();
- _builder.append(_name_2, "");
- _builder.append("\\\\");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR sub : pc.subProtocols�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\hline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�sub.name� & �sub.protocol.name�\\\\");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\\hline");
_builder.newLine();
_builder.append("\\end{tabular}");
@@ -596,14 +478,13 @@ public class DocGen {
private CharSequence generateAllActorClassDocs(final Root root, final RoomModel model) {
StringConcatenation _builder = new StringConcatenation();
- {
- EList<ActorClass> _actorClasses = model.getActorClasses();
- for(final ActorClass ac : _actorClasses) {
- CharSequence _generateActorClassDoc = this.generateActorClassDoc(root, model, ac);
- _builder.append(_generateActorClassDoc, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR ac : model.actorClasses�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�root.generateActorClassDoc(model,ac)�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�\t\t\t");
+ _builder.newLine();
return _builder;
}
@@ -619,53 +500,40 @@ public class DocGen {
filename = _replaceAll;
String latexFilename = filename.replaceAll("/", "//");
StringConcatenation _builder = new StringConcatenation();
- _builder.append("\\level{2}{");
- String _name_1 = ac.getName();
- _builder.append(_name_1, "");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
- Documentation _docu = ac.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu);
- _builder.append(_generateDocText, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("\\level{2}{�ac.name�}");
+ _builder.newLine();
+ _builder.append("�ac.docu.generateDocText�");
+ _builder.newLine();
_builder.append("\\level{3}{Structure}");
_builder.newLine();
_builder.newLine();
- {
- String _fileExists = this.fileExists(filename);
- boolean _equals = _fileExists.equals("true");
- if (_equals) {
- String _name_2 = ac.getName();
- String _plus_2 = (_name_2 + " Structure");
- CharSequence _includeGraphics = this.includeGraphics(latexFilename, "0.4", _plus_2);
- _builder.append(_includeGraphics, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF fileExists(filename).equals(\"true\")�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�includeGraphics(latexFilename,\"0.4\",ac.name + \" Structure\")�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\\level{3}{Attributes}");
_builder.newLine();
- EList<Attribute> _attributes = ac.getAttributes();
- CharSequence _generateAttributesDoc = this.generateAttributesDoc(_attributes);
- _builder.append(_generateAttributesDoc, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�ac.attributes.generateAttributesDoc�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\\level{3}{Operations}");
_builder.newLine();
- EList<StandardOperation> _operations = ac.getOperations();
- CharSequence _generateOperationsDoc = this.generateOperationsDoc(_operations);
- _builder.append(_generateOperationsDoc, "");
- _builder.newLineIfNotEmpty();
- {
- boolean _hasNonEmptyStateMachine = RoomHelpers.hasNonEmptyStateMachine(ac);
- if (_hasNonEmptyStateMachine) {
- _builder.append("\\level{3}{Statemachine}");
- _builder.newLine();
- CharSequence _generateFsmDoc = this.generateFsmDoc(model, ac);
- _builder.append(_generateFsmDoc, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�ac.operations.generateOperationsDoc�");
+ _builder.newLine();
+ _builder.append("�IF ac.hasNonEmptyStateMachine�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\level{3}{Statemachine}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�generateFsmDoc(model, ac)�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -685,90 +553,77 @@ public class DocGen {
StringConcatenation _builder = new StringConcatenation();
_builder.append("\\level{4}{Top Level}");
_builder.newLine();
- {
- String _fileExists = this.fileExists(filename);
- boolean _equals = _fileExists.equals("true");
- if (_equals) {
- String _name_1 = ac.getName();
- String _plus_2 = (_name_1 + " Top State");
- CharSequence _includeGraphics = this.includeGraphics(latexFilename, "0.4", _plus_2);
- _builder.append(_includeGraphics, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF fileExists(filename).equals(\"true\")�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�includeGraphics(latexFilename,\"0.4\",ac.name + \" Top State\")�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\\begin{par}");
_builder.newLine();
- {
- StateGraph _stateMachine = ac.getStateMachine();
- EList<State> _states = _stateMachine.getStates();
- for(final State s : _states) {
- {
- Documentation _docu = s.getDocu();
- boolean _notEquals = (!Objects.equal(_docu, null));
- if (_notEquals) {
- _builder.append("\\textbf{State description} \\textit{");
- String _genStatePathName = CodegenHelpers.getGenStatePathName(s);
- String _replaceAll_1 = _genStatePathName.replaceAll("_", "\\\\_");
- _builder.append(_replaceAll_1, "");
- _builder.append("}:");
- _builder.newLineIfNotEmpty();
- _builder.append("\\newline");
- _builder.newLine();
- Documentation _docu_1 = s.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu_1);
- _builder.append(_generateDocText, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\\newline\\newline");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("�FOR s : ac.stateMachine.states�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF s.docu != null�\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\textbf{State description} \\textit{�s.genStatePathName.replaceAll(\"_\",\"\\\\\\\\_\")�}:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\newline");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�generateDocText(s.docu)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\newline\\newline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�FOR c : ac.stateMachine.chPoints�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF c.docu != null�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\textbf{Choicepoint description} \\textit{�c.name�}:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\newline");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�generateDocText(c.docu)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\newline\\newline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
_builder.newLine();
- {
- StateGraph _stateMachine_1 = ac.getStateMachine();
- EList<ChoicePoint> _chPoints = _stateMachine_1.getChPoints();
- for(final ChoicePoint c : _chPoints) {
- {
- Documentation _docu_2 = c.getDocu();
- boolean _notEquals_1 = (!Objects.equal(_docu_2, null));
- if (_notEquals_1) {
- _builder.append("\\textbf{Choicepoint description} \\textit{");
- String _name_2 = c.getName();
- _builder.append(_name_2, "");
- _builder.append("}:");
- _builder.newLineIfNotEmpty();
- _builder.append("\\newline");
- _builder.newLine();
- Documentation _docu_3 = c.getDocu();
- CharSequence _generateDocText_1 = this.generateDocText(_docu_3);
- _builder.append(_generateDocText_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\\newline\\newline");
- _builder.newLine();
- }
- }
- }
- }
_builder.append("\\end{par}");
_builder.newLine();
_builder.newLine();
- {
- StateGraph _stateMachine_2 = ac.getStateMachine();
- EList<State> _states_1 = _stateMachine_2.getStates();
- for(final State s_1 : _states_1) {
- {
- boolean _isLeaf = RoomHelpers.isLeaf(s_1);
- boolean _not = (!_isLeaf);
- if (_not) {
- String _generateStateDoc = this.generateStateDoc(model, ac, s_1);
- _builder.append(_generateStateDoc, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�FOR s : ac.stateMachine.states�\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF !s.isLeaf�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�generateStateDoc(model, ac, s)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�\t\t");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -791,99 +646,80 @@ public class DocGen {
String _plus_4 = ("Gen Filename: " + filename);
this.logger.logInfo(_plus_4);
StringConcatenation _builder = new StringConcatenation();
- _builder.append("\\level{4}{Subgraph ");
- String _genStatePathName_1 = CodegenHelpers.getGenStatePathName(state);
- String _replaceAll_1 = _genStatePathName_1.replaceAll("_", "\\\\_");
- _builder.append(_replaceAll_1, "");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
- {
- String _fileExists = this.fileExists(filename);
- boolean _equals = _fileExists.equals("true");
- if (_equals) {
- String _name_1 = ac.getName();
- String _plus_5 = (_name_1 + "_");
- String _genStatePathName_2 = CodegenHelpers.getGenStatePathName(state);
- String _plus_6 = (_plus_5 + _genStatePathName_2);
- CharSequence _includeGraphics = this.includeGraphics(latexFilename, "0.4", _plus_6);
- _builder.append(_includeGraphics, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\\level{4}{Subgraph �state.genStatePathName.replaceAll(\"_\",\"\\\\\\\\_\")�}");
+ _builder.newLine();
+ _builder.append("�IF fileExists(filename).equals(\"true\")�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�includeGraphics(latexFilename,\"0.4\",ac.name + \"_\" + state.genStatePathName)�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\\begin{par}");
_builder.newLine();
- {
- StateGraph _subgraph = state.getSubgraph();
- EList<State> _states = _subgraph.getStates();
- for(final State s : _states) {
- {
- Documentation _docu = s.getDocu();
- boolean _notEquals = (!Objects.equal(_docu, null));
- if (_notEquals) {
- _builder.append("\\textbf{State description} \\textit{");
- String _genStatePathName_3 = CodegenHelpers.getGenStatePathName(s);
- String _replaceAll_2 = _genStatePathName_3.replaceAll("_", "\\\\_");
- _builder.append(_replaceAll_2, "");
- _builder.append("}:");
- _builder.newLineIfNotEmpty();
- _builder.append("\\newline");
- _builder.newLine();
- Documentation _docu_1 = s.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu_1);
- _builder.append(_generateDocText, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\\newline\\newline");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("�FOR s : state.subgraph.states�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF s.docu != null�\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\textbf{State description} \\textit{�s.genStatePathName.replaceAll(\"_\",\"\\\\\\\\_\")�}:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\newline");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�generateDocText(s.docu)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\newline\\newline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�FOR c : state.subgraph.chPoints�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF c.docu != null�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\textbf{Choicepoint description} \\textit{�c.name�}:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\newline");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�generateDocText(c.docu)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\newline\\newline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
_builder.newLine();
- {
- StateGraph _subgraph_1 = state.getSubgraph();
- EList<ChoicePoint> _chPoints = _subgraph_1.getChPoints();
- for(final ChoicePoint c : _chPoints) {
- {
- Documentation _docu_2 = c.getDocu();
- boolean _notEquals_1 = (!Objects.equal(_docu_2, null));
- if (_notEquals_1) {
- _builder.append("\\textbf{Choicepoint description} \\textit{");
- String _name_2 = c.getName();
- _builder.append(_name_2, "");
- _builder.append("}:");
- _builder.newLineIfNotEmpty();
- _builder.append("\\newline");
- _builder.newLine();
- Documentation _docu_3 = c.getDocu();
- CharSequence _generateDocText_1 = this.generateDocText(_docu_3);
- _builder.append(_generateDocText_1, "");
- _builder.newLineIfNotEmpty();
- _builder.append("\\newline\\newline");
- _builder.newLine();
- }
- }
- }
- }
_builder.append("\\end{par}");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
- {
- StateGraph _subgraph_2 = state.getSubgraph();
- EList<State> _states_1 = _subgraph_2.getStates();
- for(final State s_1 : _states_1) {
- {
- boolean _isLeaf = RoomHelpers.isLeaf(s_1);
- boolean _not = (!_isLeaf);
- if (_not) {
- String _generateStateDoc = this.generateStateDoc(model, ac, s_1);
- _builder.append(_generateStateDoc, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�FOR s : state.subgraph.states�\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF !s.isLeaf�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�generateStateDoc(model, ac, s)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�\t\t");
+ _builder.newLine();
_xblockexpression = (_builder.toString());
}
return _xblockexpression;
@@ -891,157 +727,112 @@ public class DocGen {
private CharSequence generateAttributesDoc(final List<Attribute> attributes) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _isEmpty = attributes.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- _builder.append("\\begin{tabular}[ht]{|l|l|l|}");
- _builder.newLine();
- _builder.append("\\hline");
- _builder.newLine();
- _builder.append("Name & Type & Description\\\\");
- _builder.newLine();
- {
- for(final Attribute at : attributes) {
- _builder.append("\\hline");
- _builder.newLine();
- String _name = at.getName();
- _builder.append(_name, "");
- _builder.append(" & ");
- RefableType _type = at.getType();
- DataType _type_1 = _type.getType();
- String _name_1 = _type_1.getName();
- _builder.append(_name_1, "");
- _builder.append(" & ");
- Documentation _docu = at.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu);
- _builder.append(_generateDocText, "");
- _builder.append("\\\\");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\\hline");
- _builder.newLine();
- _builder.append("\\end{tabular}");
- _builder.newLine();
- }
- }
+ _builder.append("�IF !attributes.empty�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\begin{tabular}[ht]{|l|l|l|}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\hline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("Name & Type & Description\\\\");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�FOR at : attributes�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\hline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�at.name� & �at.type.type.name� & �generateDocText(at.docu)�\\\\");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\hline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\end{tabular}");
+ _builder.newLine();
+ _builder.append("�ENDIF�\t");
+ _builder.newLine();
return _builder;
}
private CharSequence generateOperationsDoc(final List<StandardOperation> operations) {
StringConcatenation _builder = new StringConcatenation();
- {
- for(final StandardOperation op : operations) {
- _builder.append("\\begin{tabular}[ht]{|l|l|}");
- _builder.newLine();
- _builder.append("\\hline\t\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("Name: & ");
- String _name = op.getName();
- _builder.append(_name, " ");
- _builder.append("\\\\");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\\hline");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("ReturnType: & ");
- {
- RefableType _returnType = op.getReturnType();
- boolean _notEquals = (!Objects.equal(_returnType, null));
- if (_notEquals) {
- RefableType _returnType_1 = op.getReturnType();
- DataType _type = _returnType_1.getType();
- String _name_1 = _type.getName();
- _builder.append(_name_1, " ");
- } else {
- _builder.append("void");
- }
- }
- _builder.append("\\\\");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\\hline");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("Arguments: & ");
- {
- EList<VarDecl> _arguments = op.getArguments();
- boolean _hasElements = false;
- for(final VarDecl pa : _arguments) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(", ", " ");
- }
- String _name_2 = pa.getName();
- _builder.append(_name_2, " ");
- _builder.append(":");
- RefableType _refType = pa.getRefType();
- DataType _type_1 = _refType.getType();
- String _name_3 = _type_1.getName();
- _builder.append(_name_3, " ");
- }
- }
- _builder.append("\\\\");
- _builder.newLineIfNotEmpty();
- {
- Documentation _docu = op.getDocu();
- boolean _notEquals_1 = (!Objects.equal(_docu, null));
- if (_notEquals_1) {
- _builder.append("\t");
- _builder.append("\\hline");
- _builder.newLine();
- {
- Documentation _docu_1 = op.getDocu();
- String _string = _docu_1.toString();
- int _length = _string.length();
- boolean _greaterThan = (_length > 85);
- if (_greaterThan) {
- _builder.append("\t");
- _builder.append("\\multicolumn{2} {|p{13cm}|} {");
- Documentation _docu_2 = op.getDocu();
- CharSequence _generateDocText = this.generateDocText(_docu_2);
- _builder.append(_generateDocText, " ");
- _builder.append("}\\\\");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t");
- _builder.append("\\multicolumn{2} {|l|} {");
- Documentation _docu_3 = op.getDocu();
- CharSequence _generateDocText_1 = this.generateDocText(_docu_3);
- _builder.append(_generateDocText_1, " ");
- _builder.append("}\\\\");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.append("\t");
- _builder.append("\\hline");
- _builder.newLine();
- _builder.append("\\end{tabular}");
- _builder.newLine();
- _builder.append("\\newline\\newline\\newline");
- _builder.newLine();
- }
- }
+ _builder.append("�FOR op : operations�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\begin{tabular}[ht]{|l|l|}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\hline\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("Name: & �op.name�\\\\");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\hline");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("ReturnType: & �IF op.returnType != null��op.returnType.type.name��ELSE�void�ENDIF�\\\\");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\hline");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("Arguments: & �FOR pa : op.arguments SEPARATOR \", \"��pa.name�:�pa.refType.type.name��ENDFOR�\\\\");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF op.docu != null�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("\\hline");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF op.docu.toString.length > 85�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("\\multicolumn{2} {|p{13cm}|} {�generateDocText(op.docu)�}\\\\");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("\\multicolumn{2} {|l|} {�generateDocText(op.docu)�}\\\\");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\\hline");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\end{tabular}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("\\newline\\newline\\newline");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
private CharSequence generateDocText(final Documentation doc) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _notEquals = (!Objects.equal(doc, null));
- if (_notEquals) {
- EList<String> _lines = doc.getLines();
- String _join = IterableExtensions.join(_lines);
- _builder.append(_join, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF doc!=null�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�doc.lines.join()�");
+ _builder.newLine();
+ _builder.append("�ENDIF�\t\t");
+ _builder.newLine();
return _builder;
}
@@ -1068,16 +859,10 @@ public class DocGen {
StringConcatenation _builder = new StringConcatenation();
_builder.append("\\begin{center}");
_builder.newLine();
- _builder.append("\\includegraphics[scale=");
- _builder.append(scale, "");
- _builder.append("]{");
- _builder.append(filename, "");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
- _builder.append("\\figcaption{");
- _builder.append(latexCaption, "");
- _builder.append("}");
- _builder.newLineIfNotEmpty();
+ _builder.append("\\includegraphics[scale=�scale�]{�filename�}");
+ _builder.newLine();
+ _builder.append("\\figcaption{�latexCaption�}");
+ _builder.newLine();
_builder.append("\\end{center}");
_builder.newLine();
_xblockexpression = (_builder);
diff --git a/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/InstanceDiagramGen.java b/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/InstanceDiagramGen.java
index f4aa63dc7..403bbb422 100644
--- a/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/InstanceDiagramGen.java
+++ b/plugins/org.eclipse.etrice.generator.doc/xtend-gen/org/eclipse/etrice/generator/doc/gen/InstanceDiagramGen.java
@@ -26,11 +26,9 @@ import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance;
import org.eclipse.etrice.core.genmodel.etricegen.ActorInterfaceInstance;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.genmodel.etricegen.StructureInstance;
-import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
import org.eclipse.etrice.core.genmodel.etricegen.SystemInstance;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.RoomModel;
-import org.eclipse.etrice.core.room.SubSystemClass;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
@@ -82,29 +80,20 @@ public class InstanceDiagramGen {
private CharSequence generate2jpg(final Root root) {
StringConcatenation _builder = new StringConcatenation();
- {
- EList<SystemInstance> _systemInstances = root.getSystemInstances();
- for(final SystemInstance sys : _systemInstances) {
- _builder.append("dot -Tjpg -o ");
- String _name = sys.getName();
- _builder.append(_name, "");
- _builder.append("_instanceTree.jpg ");
- String _name_1 = sys.getName();
- _builder.append(_name_1, "");
- _builder.append("_instanceTree.dot");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR sys : root.systemInstances�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("dot -Tjpg -o �sys.name�_instanceTree.jpg �sys.name�_instanceTree.dot");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
private CharSequence generate(final Root root, final SystemInstance sys) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("digraph ");
- String _name = sys.getName();
- _builder.append(_name, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
+ _builder.append("digraph �sys.name� {");
+ _builder.newLine();
_builder.append("\t");
_builder.append("rankdir=TD;");
_builder.newLine();
@@ -112,54 +101,29 @@ public class InstanceDiagramGen {
_builder.append("node [shape=box];");
_builder.newLine();
_builder.append("\t");
- String _path = sys.getPath();
- String _pathName = this.roomExt.getPathName(_path);
- _builder.append(_pathName, " ");
- _builder.append(" [label=\"");
- String _name_1 = sys.getName();
- _builder.append(_name_1, " ");
- _builder.append("\\n(");
- String _name_2 = sys.getName();
- _builder.append(_name_2, " ");
- _builder.append(")\" style=filled color=red];");
- _builder.newLineIfNotEmpty();
- {
- EList<SubSystemInstance> _instances = sys.getInstances();
- for(final SubSystemInstance ssi : _instances) {
- _builder.append("\t");
- String _path_1 = ssi.getPath();
- String _pathName_1 = this.roomExt.getPathName(_path_1);
- _builder.append(_pathName_1, " ");
- _builder.append(" [label=\"");
- String _name_3 = ssi.getName();
- _builder.append(_name_3, " ");
- _builder.append("\\n(");
- SubSystemClass _subSystemClass = ssi.getSubSystemClass();
- String _name_4 = _subSystemClass.getName();
- _builder.append(_name_4, " ");
- _builder.append(")\" style=filled color=yellow];");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- String _path_2 = sys.getPath();
- String _pathName_2 = this.roomExt.getPathName(_path_2);
- _builder.append(_pathName_2, " ");
- _builder.append(" -> ");
- String _path_3 = ssi.getPath();
- String _pathName_3 = this.roomExt.getPathName(_path_3);
- _builder.append(_pathName_3, " ");
- _builder.append("; ");
- _builder.newLineIfNotEmpty();
- {
- EList<AbstractInstance> _instances_1 = ssi.getInstances();
- for(final AbstractInstance ai : _instances_1) {
- _builder.append("\t");
- String _instance = this.instance(ai);
- _builder.append(_instance, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�sys.path.getPathName()� [label=\"�sys.name�\\n(�sys.name�)\" style=filled color=red];");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�FOR ssi : sys.instances�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ssi.path.getPathName()� [label=\"�ssi.name�\\n(�ssi.subSystemClass.name�)\" style=filled color=yellow];");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�sys.path.getPathName()� -> �ssi.path.getPathName()�; ");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR ai : ssi.instances�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�instance(ai)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
return _builder;
@@ -216,50 +180,23 @@ public class InstanceDiagramGen {
}
final String clsname = _xifexpression_3;
StringConcatenation _builder = new StringConcatenation();
- String _path = ai.getPath();
- String _pathName = this.roomExt.getPathName(_path);
- _builder.append(_pathName, "");
- _builder.append(" [label=\"");
- _builder.append(optional, "");
- String _name_4 = ai.getName();
- _builder.append(_name_4, "");
- _builder.append("\\n(");
- _builder.append(clsname, "");
- _builder.append(")\\n@");
- _builder.append(nname, "");
- _builder.append(":");
- _builder.append(tname, "");
- _builder.append("\"");
- {
- boolean _isEmpty = optional.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- _builder.append(" color=blue style=dashed");
- }
- }
- _builder.append("];");
- _builder.newLineIfNotEmpty();
- String _path_1 = parent.getPath();
- String _pathName_1 = this.roomExt.getPathName(_path_1);
- _builder.append(_pathName_1, "");
- _builder.append(" -> ");
- String _path_2 = ai.getPath();
- String _pathName_2 = this.roomExt.getPathName(_path_2);
- _builder.append(_pathName_2, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- {
- if ((ai instanceof StructureInstance)) {
- {
- EList<AbstractInstance> _instances = ((StructureInstance) ai).getInstances();
- for(final AbstractInstance sub_ai : _instances) {
- String _instance = this.instance(sub_ai);
- _builder.append(_instance, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�ai.path.getPathName()� [label=\"�optional��ai.name�\\n(�clsname�)\\n@�nname�:�tname�\"�IF !optional.empty� color=blue style=dashed�ENDIF�];");
+ _builder.newLine();
+ _builder.append("�parent.path.getPathName()� -> �ai.path.getPathName()�;");
+ _builder.newLine();
+ _builder.append("�IF ai instanceof StructureInstance�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�FOR sub_ai : (ai as StructureInstance).instances�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�instance(sub_ai)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("�ENDIF� ");
+ _builder.newLine();
_xblockexpression = (_builder.toString());
}
return _xblockexpression;
diff --git a/plugins/org.eclipse.etrice.generator.java.mvn/install_org.eclipse.etrice.generator.java.mvn.launch b/plugins/org.eclipse.etrice.generator.java.mvn/install_org.eclipse.etrice.generator.java.mvn.launch
index 72034c097..49a6e1e2b 100644
--- a/plugins/org.eclipse.etrice.generator.java.mvn/install_org.eclipse.etrice.generator.java.mvn.launch
+++ b/plugins/org.eclipse.etrice.generator.java.mvn/install_org.eclipse.etrice.generator.java.mvn.launch
@@ -11,5 +11,6 @@
<intAttribute key="M2_THREADS" value="1"/>
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512m -XX:MaxPermSize=256m"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:/org.eclipse.etrice.generator.java.mvn}"/>
</launchConfiguration>
diff --git a/plugins/org.eclipse.etrice.generator.java.mvn/pom.xml b/plugins/org.eclipse.etrice.generator.java.mvn/pom.xml
index d8a3b31bb..56eb649bc 100644
--- a/plugins/org.eclipse.etrice.generator.java.mvn/pom.xml
+++ b/plugins/org.eclipse.etrice.generator.java.mvn/pom.xml
@@ -1,23 +1,22 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.eclipse.etrice</groupId>
+
<artifactId>org.eclipse.etrice.generator.java.mvn</artifactId>
<packaging>maven-plugin</packaging>
- <version>0.0.4</version>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
<name>org.eclipse.etrice.generator.java.mvn eTrice Java generator</name>
<url>http://eclipse.org/etrice</url>
<build>
<plugins>
<plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<executions>
@@ -34,22 +33,6 @@
</descriptorRefs>
</configuration>
</plugin>
- <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>
- <version>2.1</version> <executions> <execution> <phase>package</phase> <goals>
- <goal>shade</goal> </goals> <configuration> <filters> <filter> <artifact>org.eclipse.emf.common:org.eclipse.emf.common</artifact>
- <includes> <include>**</include> </includes> </filter> </filters> </configuration>
- </execution> </executions> </plugin> --> <!-- <plugin> <groupId>com.googlecode.addjars-maven-plugin</groupId> <artifactId>addjars-maven-plugin</artifactId>
- <version>1.0.2</version> <executions> <execution> <goals> <goal>add-jars</goal>
- </goals> <configuration> <resources> <resource> <directory>${project.basedir}</directory>
- <includes> <include>src/lib/org.eclipse.emf.ecore_2.9.1.v20130827-0309.jar</include>
- <include>src/lib/org.eclipse.emf.common_2.9.1.v20130827-0309.jar</include>
- </includes> </resource> </resources> </configuration> </execution> </executions>
- </plugin> -->
- <!-- <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions>
- <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution>
- </executions> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs> <archive> <manifest> <mainClass>HeWo7.Node_nodeRef1_subSysRef1Runner</mainClass>
- </manifest> </archive> </configuration> </plugin> -->
</plugins>
<pluginManagement>
<plugins>
diff --git a/plugins/org.eclipse.etrice.generator.java/.gitignore b/plugins/org.eclipse.etrice.generator.java/.gitignore
index d7b296e23..1e316c551 100644
--- a/plugins/org.eclipse.etrice.generator.java/.gitignore
+++ b/plugins/org.eclipse.etrice.generator.java/.gitignore
@@ -1,3 +1,4 @@
bin
*._trace
*.smap
+target
diff --git a/plugins/org.eclipse.etrice.generator.java/.project b/plugins/org.eclipse.etrice.generator.java/.project
index 2842ea23e..b88e23b7d 100644
--- a/plugins/org.eclipse.etrice.generator.java/.project
+++ b/plugins/org.eclipse.etrice.generator.java/.project
@@ -35,8 +35,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
diff --git a/plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.core.resources.prefs
index a8f686765..6454d3670 100644
--- a/plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.core.resources.prefs
@@ -1,2 +1,3 @@
eclipse.preferences.version=1
encoding//src/org/eclipse/etrice/generator/java/gen/Initialization.xtend=ISO-8859-1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.java/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF
index e3dd7a6b9..5ea413bf8 100644
--- a/plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.java/META-INF/MANIFEST.MF
@@ -5,8 +5,7 @@ Bundle-Vendor: Eclipse eTrice (Incubation)
Bundle-Version: 0.4.0.qualifier
Bundle-SymbolicName: org.eclipse.etrice.generator.java;singleton:=true
Bundle-ActivationPolicy: lazy
-Require-Bundle: org.eclipse.etrice.core.room.ui;bundle-version="0.4.0",
- org.eclipse.etrice.core.genmodel;bundle-version="0.4.0",
+Require-Bundle: org.eclipse.etrice.core.genmodel;bundle-version="0.4.0",
org.eclipse.etrice.core.etphys;bundle-version="0.4.0",
org.eclipse.etrice.core.etmap;bundle-version="0.4.0",
org.eclipse.etrice.generator;bundle-version="0.4.0",
diff --git a/plugins/org.eclipse.etrice.generator.java/pom.xml b/plugins/org.eclipse.etrice.generator.java/pom.xml
new file mode 100644
index 000000000..7c00e90ea
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.java/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.generator.java</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
index 5c86c05c6..622fb866c 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java
@@ -14,34 +14,19 @@ import com.google.common.base.Objects;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.HashMap;
-import java.util.List;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.etrice.core.genmodel.builder.GenmodelConstants;
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.etricegen.Wire;
import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass;
import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass;
import org.eclipse.etrice.core.room.ActorClass;
-import org.eclipse.etrice.core.room.ActorRef;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.DataType;
-import org.eclipse.etrice.core.room.DetailCode;
-import org.eclipse.etrice.core.room.InterfaceItem;
-import org.eclipse.etrice.core.room.Message;
-import org.eclipse.etrice.core.room.Port;
import org.eclipse.etrice.core.room.PrimitiveType;
-import org.eclipse.etrice.core.room.ProtocolClass;
import org.eclipse.etrice.core.room.RefableType;
-import org.eclipse.etrice.core.room.ReferenceType;
import org.eclipse.etrice.core.room.RoomModel;
-import org.eclipse.etrice.core.room.SAP;
-import org.eclipse.etrice.core.room.SPP;
-import org.eclipse.etrice.core.room.ServiceImplementation;
import org.eclipse.etrice.core.room.StandardOperation;
-import org.eclipse.etrice.core.room.VarDecl;
import org.eclipse.etrice.core.room.util.RoomHelpers;
-import org.eclipse.etrice.generator.base.AbstractGenerator;
import org.eclipse.etrice.generator.base.IDataConfiguration;
import org.eclipse.etrice.generator.base.IGeneratorFileIo;
import org.eclipse.etrice.generator.generic.GenericActorClassGenerator;
@@ -213,45 +198,40 @@ public class ActorClassGen extends GenericActorClassGenerator {
}
final String baseClassImport = _xifexpression_4;
StringConcatenation _builder = new StringConcatenation();
- _builder.append("package ");
- String _package = this._roomExtensions.getPackage(ac);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �ac.getPackage�;");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�IF !dataConfigExt.getDynConfigReadAttributes(ac).empty�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import org.eclipse.etrice.runtime.java.config.DynConfigLock;");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�IF Main::settings.generatePersistenceInterface�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import org.eclipse.etrice.runtime.java.modelbase.IPersistable;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import java.io.IOException;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import java.io.ObjectInput;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import java.io.ObjectOutput;");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
_builder.newLine();
- {
- List<Attribute> _dynConfigReadAttributes = this.dataConfigExt.getDynConfigReadAttributes(ac);
- boolean _isEmpty_2 = _dynConfigReadAttributes.isEmpty();
- boolean _not = (!_isEmpty_2);
- if (_not) {
- _builder.append("import org.eclipse.etrice.runtime.java.config.DynConfigLock;");
- _builder.newLine();
- }
- }
- {
- GlobalSettings _settings_1 = Main.getSettings();
- boolean _isGeneratePersistenceInterface_1 = _settings_1.isGeneratePersistenceInterface();
- if (_isGeneratePersistenceInterface_1) {
- _builder.append("import org.eclipse.etrice.runtime.java.modelbase.IPersistable;");
- _builder.newLine();
- _builder.append("import java.io.IOException;");
- _builder.newLine();
- _builder.append("import java.io.ObjectInput;");
- _builder.newLine();
- _builder.append("import java.io.ObjectOutput;");
- _builder.newLine();
- }
- }
_builder.append("import org.eclipse.etrice.runtime.java.messaging.Address;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.messaging.IRTObject;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver;");
_builder.newLine();
- _builder.append("import ");
- _builder.append(baseClassImport, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("import �baseClassImport�;");
+ _builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.DataPortBase;");
@@ -263,940 +243,632 @@ public class ActorClassGen extends GenericActorClassGenerator {
_builder.append("import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;");
_builder.newLine();
_builder.newLine();
- {
- for(final RoomModel model : models) {
- _builder.append("import ");
- String _name_3 = model.getName();
- _builder.append(_name_3, "");
- _builder.append(".*;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR model : models�");
_builder.newLine();
- {
- EList<ProtocolClass> _referencedProtocolClasses = root.getReferencedProtocolClasses(ac);
- for(final ProtocolClass pc : _referencedProtocolClasses) {
- _builder.append("import ");
- String _package_1 = this._roomExtensions.getPackage(pc);
- _builder.append(_package_1, "");
- _builder.append(".");
- String _name_4 = pc.getName();
- _builder.append(_name_4, "");
- _builder.append(".*;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("import �model.name�.*;");
_builder.newLine();
- {
- EList<ActorRef> _actorRefs = ac.getActorRefs();
- final Function1<ActorRef,Boolean> _function_2 = new Function1<ActorRef,Boolean>() {
- public Boolean apply(final ActorRef r) {
- ReferenceType _refType = r.getRefType();
- boolean _equals = Objects.equal(_refType, ReferenceType.OPTIONAL);
- return Boolean.valueOf(_equals);
- }
- };
- Iterable<ActorRef> _filter_2 = IterableExtensions.<ActorRef>filter(_actorRefs, _function_2);
- for(final ActorRef sub : _filter_2) {
- _builder.append("import ");
- ActorClass _type = sub.getType();
- String _package_2 = this._roomExtensions.getPackage(_type);
- _builder.append(_package_2, "");
- _builder.append(".");
- ActorClass _type_1 = sub.getType();
- String _name_5 = _type_1.getName();
- _builder.append(_name_5, "");
- _builder.append("Interface;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�ENDFOR�");
_builder.newLine();
- CharSequence _userCode = this._procedureHelpers.userCode(ac, 1, true);
- _builder.append(_userCode, "");
- _builder.newLineIfNotEmpty();
_builder.newLine();
+ _builder.append("�FOR pc : root.getReferencedProtocolClasses(ac)�");
_builder.newLine();
- _builder.append("public ");
- {
- boolean _or = false;
- if (manualBehavior) {
- _or = true;
- } else {
- boolean _isAbstract = ac.isAbstract();
- _or = (manualBehavior || _isAbstract);
- }
- if (_or) {
- _builder.append("abstract ");
- }
- }
- _builder.append("class ");
- _builder.append(clsname, "");
- _builder.append(" extends ");
- _builder.append(baseClass, "");
- _builder.append(" ");
- _builder.append(impPersist, "");
- _builder.append("{");
- _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("import �pc.package�.�pc.name�.*;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�FOR sub : ac.actorRefs.filter(r|r.refType==ReferenceType.OPTIONAL)�");
_builder.newLine();
_builder.append("\t");
- CharSequence _userCode_1 = this._procedureHelpers.userCode(ac, 2, false);
- _builder.append(_userCode_1, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("import �sub.type.package�.�sub.type.name�Interface;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�ac.userCode(1, true)�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("public �IF manualBehavior || ac.^abstract�abstract �ENDIF�class �clsname� extends �baseClass� �impPersist�{");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ac.userCode(2, false)�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- ports");
_builder.newLine();
- {
- List<Port> _endPorts = RoomHelpers.getEndPorts(ac);
- for(final Port ep : _endPorts) {
- _builder.append("\t");
- _builder.append("protected ");
- String _portClassName = this._roomExtensions.getPortClassName(ep);
- _builder.append(_portClassName, " ");
- _builder.append(" ");
- String _name_6 = ep.getName();
- _builder.append(_name_6, " ");
- _builder.append(" = null;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR ep : ac.getEndPorts()�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected �ep.getPortClassName()� �ep.name� = null;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- saps");
_builder.newLine();
- {
- EList<SAP> _serviceAccessPoints = ac.getServiceAccessPoints();
- for(final SAP sap : _serviceAccessPoints) {
- _builder.append("\t");
- _builder.append("protected ");
- String _portClassName_1 = this._roomExtensions.getPortClassName(sap);
- _builder.append(_portClassName_1, " ");
- _builder.append(" ");
- String _name_7 = sap.getName();
- _builder.append(_name_7, " ");
- _builder.append(" = null;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR sap : ac.serviceAccessPoints�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected �sap.getPortClassName()� �sap.name� = null;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- services");
_builder.newLine();
- {
- EList<ServiceImplementation> _serviceImplementations = ac.getServiceImplementations();
- for(final ServiceImplementation svc : _serviceImplementations) {
- _builder.append("\t");
- _builder.append("protected ");
- String _portClassName_2 = this._roomExtensions.getPortClassName(svc);
- _builder.append(_portClassName_2, " ");
- _builder.append(" ");
- SPP _spp = svc.getSpp();
- String _name_8 = _spp.getName();
- _builder.append(_name_8, " ");
- _builder.append(" = null;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR svc : ac.serviceImplementations�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected �svc.getPortClassName()� �svc.spp.name� = null;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- optional actors");
_builder.newLine();
- {
- EList<ActorRef> _actorRefs_1 = ac.getActorRefs();
- final Function1<ActorRef,Boolean> _function_3 = new Function1<ActorRef,Boolean>() {
- public Boolean apply(final ActorRef r) {
- ReferenceType _refType = r.getRefType();
- boolean _equals = Objects.equal(_refType, ReferenceType.OPTIONAL);
- return Boolean.valueOf(_equals);
- }
- };
- Iterable<ActorRef> _filter_3 = IterableExtensions.<ActorRef>filter(_actorRefs_1, _function_3);
- for(final ActorRef sub_1 : _filter_3) {
- _builder.append("\t");
- _builder.append("protected ");
- ActorClass _type_2 = sub_1.getType();
- String _name_9 = _type_2.getName();
- _builder.append(_name_9, " ");
- {
- int _multiplicity = sub_1.getMultiplicity();
- boolean _notEquals_1 = (_multiplicity != 1);
- if (_notEquals_1) {
- _builder.append("Replicated");
- }
- }
- _builder.append("Interface ");
- String _name_10 = sub_1.getName();
- _builder.append(_name_10, " ");
- _builder.append(" = null;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR sub : ac.actorRefs.filter(r|r.refType==ReferenceType.OPTIONAL)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected �sub.type.name��IF sub.multiplicity!=1�Replicated�ENDIF�Interface �sub.name� = null;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- interface item IDs");
_builder.newLine();
_builder.append("\t");
- String _genInterfaceItemConstants = this.genInterfaceItemConstants(xpac);
- _builder.append(_genInterfaceItemConstants, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�xpac.genInterfaceItemConstants�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- String _genMinMaxConstants = this.configGenAddon.genMinMaxConstants(ac);
- _builder.append(_genMinMaxConstants, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�configGenAddon.genMinMaxConstants(ac)�");
+ _builder.newLine();
_builder.append("\t");
- EList<Attribute> _attributes = ac.getAttributes();
- CharSequence _attributes_1 = this._procedureHelpers.attributes(_attributes);
- _builder.append(_attributes_1, " ");
- _builder.newLineIfNotEmpty();
- {
- List<Attribute> _dynConfigReadAttributes_1 = this.dataConfigExt.getDynConfigReadAttributes(ac);
- for(final Attribute a : _dynConfigReadAttributes_1) {
- _builder.append("\t");
- _builder.append("private DynConfigLock lock_");
- String _name_11 = a.getName();
- _builder.append(_name_11, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�ac.attributes.attributes�");
+ _builder.newLine();
_builder.append("\t");
- CharSequence _operationsImplementation = this._procedureHelpers.operationsImplementation(ac);
- _builder.append(_operationsImplementation, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�FOR a : dataConfigExt.getDynConfigReadAttributes(ac)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("private DynConfigLock lock_�a.name�;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ac.operationsImplementation�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- construction");
_builder.newLine();
_builder.append("\t");
- _builder.append("public ");
- _builder.append(clsname, " ");
- _builder.append("(IRTObject parent, String name) {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public �clsname�(IRTObject parent, String name) {");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("super(parent, name);");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("setClassName(\"");
- String _name_12 = ac.getName();
- _builder.append(_name_12, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
+ _builder.append("setClassName(\"�ac.name�\");");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
- EList<Attribute> _attributes_2 = ac.getAttributes();
- CharSequence _attributeInitialization = this._initialization.attributeInitialization(_attributes_2, ac, false);
- _builder.append(_attributeInitialization, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�ac.attributes.attributeInitialization(ac, false)�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t\t");
_builder.append("// own ports");
_builder.newLine();
- {
- List<Port> _endPorts_1 = RoomHelpers.getEndPorts(ac);
- for(final Port ep_1 : _endPorts_1) {
- _builder.append("\t\t");
- String _name_13 = ep_1.getName();
- _builder.append(_name_13, " ");
- _builder.append(" = new ");
- String _portClassName_3 = this._roomExtensions.getPortClassName(ep_1);
- _builder.append(_portClassName_3, " ");
- _builder.append("(this, \"");
- String _name_14 = ep_1.getName();
- _builder.append(_name_14, " ");
- _builder.append("\", IFITEM_");
- String _name_15 = ep_1.getName();
- _builder.append(_name_15, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR ep : ac.getEndPorts()�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ep.name� = new �ep.getPortClassName()�(this, \"�ep.name�\", IFITEM_�ep.name�);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// own saps");
_builder.newLine();
- {
- EList<SAP> _serviceAccessPoints_1 = ac.getServiceAccessPoints();
- for(final SAP sap_1 : _serviceAccessPoints_1) {
- _builder.append("\t\t");
- String _name_16 = sap_1.getName();
- _builder.append(_name_16, " ");
- _builder.append(" = new ");
- String _portClassName_4 = this._roomExtensions.getPortClassName(sap_1);
- _builder.append(_portClassName_4, " ");
- _builder.append("(this, \"");
- String _name_17 = sap_1.getName();
- _builder.append(_name_17, " ");
- _builder.append("\", IFITEM_");
- String _name_18 = sap_1.getName();
- _builder.append(_name_18, " ");
- _builder.append(", 0);");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR sap : ac.serviceAccessPoints�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�sap.name� = new �sap.getPortClassName()�(this, \"�sap.name�\", IFITEM_�sap.name�, 0);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// own service implementations");
_builder.newLine();
- {
- EList<ServiceImplementation> _serviceImplementations_1 = ac.getServiceImplementations();
- for(final ServiceImplementation svc_1 : _serviceImplementations_1) {
- _builder.append("\t\t");
- SPP _spp_1 = svc_1.getSpp();
- String _name_19 = _spp_1.getName();
- _builder.append(_name_19, " ");
- _builder.append(" = new ");
- String _portClassName_5 = this._roomExtensions.getPortClassName(svc_1);
- _builder.append(_portClassName_5, " ");
- _builder.append("(this, \"");
- SPP _spp_2 = svc_1.getSpp();
- String _name_20 = _spp_2.getName();
- _builder.append(_name_20, " ");
- _builder.append("\", IFITEM_");
- SPP _spp_3 = svc_1.getSpp();
- String _name_21 = _spp_3.getName();
- _builder.append(_name_21, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR svc : ac.serviceImplementations�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�svc.spp.name� = new �svc.getPortClassName()�(this, \"�svc.spp.name�\", IFITEM_�svc.spp.name�);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// sub actors");
_builder.newLine();
- {
- EList<ActorRef> _actorRefs_2 = ac.getActorRefs();
- for(final ActorRef sub_2 : _actorRefs_2) {
- {
- ReferenceType _refType = sub_2.getRefType();
- boolean _equals = Objects.equal(_refType, ReferenceType.OPTIONAL);
- if (_equals) {
- _builder.append("\t\t");
- String _name_22 = sub_2.getName();
- _builder.append(_name_22, " ");
- _builder.append(" = new ");
- ActorClass _type_3 = sub_2.getType();
- String _name_23 = _type_3.getName();
- _builder.append(_name_23, " ");
- {
- int _multiplicity_1 = sub_2.getMultiplicity();
- boolean _notEquals_2 = (_multiplicity_1 != 1);
- if (_notEquals_2) {
- _builder.append("Replicated");
- }
- }
- _builder.append("Interface(this, \"");
- String _name_24 = sub_2.getName();
- _builder.append(_name_24, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- } else {
- int _multiplicity_2 = sub_2.getMultiplicity();
- boolean _greaterThan = (_multiplicity_2 > 1);
- if (_greaterThan) {
- _builder.append("\t\t");
- _builder.append("for (int i=0; i<");
- int _multiplicity_3 = sub_2.getMultiplicity();
- _builder.append(_multiplicity_3, " ");
- _builder.append("; ++i) {");
- _builder.newLineIfNotEmpty();
- {
- GlobalSettings _settings_2 = Main.getSettings();
- boolean _generateMSCInstrumentation = _settings_2.generateMSCInstrumentation();
- if (_generateMSCInstrumentation) {
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \"");
- String _name_25 = sub_2.getName();
- _builder.append(_name_25, " ");
- _builder.append(GenmodelConstants.INDEX_SEP, " ");
- _builder.append("\"+i);");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("new ");
- ActorClass _type_4 = sub_2.getType();
- String _name_26 = _type_4.getName();
- _builder.append(_name_26, " ");
- _builder.append("(this, \"");
- String _name_27 = sub_2.getName();
- _builder.append(_name_27, " ");
- _builder.append(GenmodelConstants.INDEX_SEP, " ");
- _builder.append("\"+i);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- } else {
- {
- GlobalSettings _settings_3 = Main.getSettings();
- boolean _generateMSCInstrumentation_1 = _settings_3.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_1) {
- _builder.append("\t\t");
- _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \"");
- String _name_28 = sub_2.getName();
- _builder.append(_name_28, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("new ");
- ActorClass _type_5 = sub_2.getType();
- String _name_29 = _type_5.getName();
- _builder.append(_name_29, " ");
- _builder.append("(this, \"");
- String _name_30 = sub_2.getName();
- _builder.append(_name_30, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR sub : ac.actorRefs�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF sub.refType==ReferenceType.OPTIONAL�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�sub.name� = new �sub.type.name��IF sub.multiplicity!=1�Replicated�ENDIF�Interface(this, \"�sub.name�\");");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSEIF sub.multiplicity>1�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("for (int i=0; i<�sub.multiplicity�; ++i) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \"�sub.name��GenmodelConstants::INDEX_SEP�\"+i);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("new �sub.type.name�(this, \"�sub.name��GenmodelConstants::INDEX_SEP�\"+i);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \"�sub.name�\");");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("new �sub.type.name�(this, \"�sub.name�\");");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// wiring");
_builder.newLine();
- {
- EList<Wire> _wires = wired.getWires();
- for(final Wire wire : _wires) {
- _builder.append("\t\t");
- String _xifexpression_5 = null;
- boolean _isDataDriven = wire.isDataDriven();
- if (_isDataDriven) {
- _xifexpression_5 = "DataPortBase";
- } else {
- _xifexpression_5 = "InterfaceItemBase";
- }
- _builder.append(_xifexpression_5, " ");
- _builder.append(".connect(this, \"");
- EList<String> _path1 = wire.getPath1();
- String _join = IterableExtensions.join(_path1, "/");
- _builder.append(_join, " ");
- _builder.append("\", \"");
- EList<String> _path2 = wire.getPath2();
- String _join_1 = IterableExtensions.join(_path2, "/");
- _builder.append(_join_1, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
_builder.append("\t\t");
+ _builder.append("�FOR wire: wired.wires�");
_builder.newLine();
- {
- boolean _notEquals_3 = (!Objects.equal(ctor, null));
- if (_notEquals_3) {
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("// user defined constructor body");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- AbstractGenerator _instance = AbstractGenerator.getInstance();
- DetailCode _detailCode = ctor.getDetailCode();
- String _translatedCode = _instance.getTranslatedCode(_detailCode);
- _builder.append(_translatedCode, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("�if (wire.dataDriven) \"DataPortBase\" else \"InterfaceItemBase\"�.connect(this, \"�wire.path1.join(\'/\')�\", \"�wire.path2.join(\'/\')�\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF ctor!=null�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("// user defined constructor body");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�AbstractGenerator::getInstance().getTranslatedCode(ctor.detailCode)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF !dataConfigExt.getDynConfigReadAttributes(ac).empty || !dataConfigExt.getDynConfigWriteAttributes(ac).empty�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�FOR a : dataConfigExt.getDynConfigReadAttributes(ac)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("lock_�a.name� = new DynConfigLock();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
_builder.newLine();
- {
- boolean _or_1 = false;
- List<Attribute> _dynConfigReadAttributes_2 = this.dataConfigExt.getDynConfigReadAttributes(ac);
- boolean _isEmpty_3 = _dynConfigReadAttributes_2.isEmpty();
- boolean _not_1 = (!_isEmpty_3);
- if (_not_1) {
- _or_1 = true;
- } else {
- List<Attribute> _dynConfigWriteAttributes = this.dataConfigExt.getDynConfigWriteAttributes(ac);
- boolean _isEmpty_4 = _dynConfigWriteAttributes.isEmpty();
- boolean _not_2 = (!_isEmpty_4);
- _or_1 = (_not_1 || _not_2);
- }
- if (_or_1) {
- {
- List<Attribute> _dynConfigReadAttributes_3 = this.dataConfigExt.getDynConfigReadAttributes(ac);
- for(final Attribute a_1 : _dynConfigReadAttributes_3) {
- _builder.append("\t\t");
- _builder.append("lock_");
- String _name_31 = a_1.getName();
- _builder.append(_name_31, " ");
- _builder.append(" = new DynConfigLock();");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- EList<Attribute> _attributes_3 = ac.getAttributes();
- List<Attribute> _dynConfigReadAttributes_4 = this.dataConfigExt.getDynConfigReadAttributes(ac);
- List<Attribute> _minus = this._roomExtensions.<Attribute>minus(_attributes_3, _dynConfigReadAttributes_4);
- String _name_32 = ac.getName();
- CharSequence _attributeSettersGettersImplementation = this._procedureHelpers.attributeSettersGettersImplementation(_minus, _name_32);
- _builder.append(_attributeSettersGettersImplementation, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�attributeSettersGettersImplementation(ac.attributes.minus(dataConfigExt.getDynConfigReadAttributes(ac)), ac.name)�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- CharSequence _genDynConfigGetterSetter = this.configGenAddon.genDynConfigGetterSetter(ac);
- _builder.append(_genDynConfigGetterSetter, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�configGenAddon.genDynConfigGetterSetter(ac)�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- port getters");
_builder.newLine();
- {
- List<Port> _endPorts_2 = RoomHelpers.getEndPorts(ac);
- for(final Port ep_2 : _endPorts_2) {
- _builder.append("\t");
- String _portClassName_6 = this._roomExtensions.getPortClassName(ep_2);
- String _name_33 = ep_2.getName();
- String _name_34 = ac.getName();
- CharSequence _terImplementation = this._procedureHelpers.getterImplementation(_portClassName_6, _name_33, _name_34);
- _builder.append(_terImplementation, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EList<SAP> _serviceAccessPoints_2 = ac.getServiceAccessPoints();
- for(final SAP sap_2 : _serviceAccessPoints_2) {
- _builder.append("\t");
- String _portClassName_7 = this._roomExtensions.getPortClassName(sap_2);
- String _name_35 = sap_2.getName();
- String _name_36 = ac.getName();
- CharSequence _terImplementation_1 = this._procedureHelpers.getterImplementation(_portClassName_7, _name_35, _name_36);
- _builder.append(_terImplementation_1, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EList<ServiceImplementation> _serviceImplementations_2 = ac.getServiceImplementations();
- for(final ServiceImplementation svc_2 : _serviceImplementations_2) {
- _builder.append("\t");
- String _portClassName_8 = this._roomExtensions.getPortClassName(svc_2);
- SPP _spp_4 = svc_2.getSpp();
- String _name_37 = _spp_4.getName();
- String _name_38 = ac.getName();
- CharSequence _terImplementation_2 = this._procedureHelpers.getterImplementation(_portClassName_8, _name_37, _name_38);
- _builder.append(_terImplementation_2, " ");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR ep : ac.getEndPorts()�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ep.portClassName.getterImplementation(ep.name, ac.name)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�FOR sap : ac.serviceAccessPoints�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�sap.portClassName.getterImplementation(sap.name, ac.name)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�FOR svc : ac.serviceImplementations�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�svc.portClassName.getterImplementation(svc.spp.name, ac.name)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- lifecycle functions");
_builder.newLine();
- {
- boolean _overridesStop = this._roomExtensions.overridesStop(ac);
- boolean _not_3 = (!_overridesStop);
- if (_not_3) {
- {
- if (manualBehavior) {
- _builder.append("\t");
- _builder.append("public abstract void stop();");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("public void stop(){");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("stopUser();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("super.stop();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
_builder.append("\t");
+ _builder.append("�IF !ac.overridesStop()�");
_builder.newLine();
- {
- boolean _notEquals_4 = (!Objects.equal(dtor, null));
- if (_notEquals_4) {
- {
- if (manualBehavior) {
- _builder.append("\t");
- _builder.append("public abstract void destroy();");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("public void destroy(){");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- String _name_39 = ac.getName();
- String _destructorCall = this._procedureHelpers.destructorCall(_name_39);
- _builder.append(_destructorCall, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- {
- GlobalSettings _settings_4 = Main.getSettings();
- boolean _generateMSCInstrumentation_2 = _settings_4.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_2) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addMessageActorDestroy(this);");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("super.destroy();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- } else {
- GlobalSettings _settings_5 = Main.getSettings();
- boolean _generateMSCInstrumentation_3 = _settings_5.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_3) {
- _builder.append("\t");
- _builder.append("public void destroy() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addMessageActorDestroy(this);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("super.destroy();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�IF manualBehavior�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public abstract void stop();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public void stop(){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("stopUser();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("super.stop();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF dtor!=null�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF manualBehavior�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public abstract void destroy();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public void destroy(){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ac.name.destructorCall�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageActorDestroy(this);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("super.destroy();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSEIF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public void destroy() {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageActorDestroy(this);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("super.destroy();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF manualBehavior�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�FOR ifitem : ac.allInterfaceItems SEPARATOR \"else \"�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("if (ifitem==�ifitem.name�) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("switch (evt) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�FOR msg: ifitem.incoming�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("case �msg.protocolClass.name�.�if (msg.incoming) \"IN_\" else \"OUT_\"��msg.name�:");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("�IF (msg.data!=null)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t\t");
+ _builder.append("{�msg.typedDataDefinition�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("on_�ifitem.name�_�msg.name�(ifitem�IF (msg.data!=null)�, �msg.data.name��ENDIF�);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("break;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("�IF (msg.data!=null)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR ifitem : ac.allInterfaceItems�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�FOR msg: ifitem.incoming�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("protected void on_�ifitem.name�_�msg.name�(InterfaceItemBase ifitem�IF msg.data!=null��msg.data.generateArglistAndTypedData.get(2)��ENDIF�) {}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public abstract void executeInitTransition();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF ac.hasNonEmptyStateMachine�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�xpac.genStateMachine()�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ELSEIF !xpac.hasStateMachine()�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("//--------------------- no state machine");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("handleSystemEvent(ifitem, evt, data);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public void executeInitTransition() {}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF Main::settings.generatePersistenceInterface�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@Override");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public void saveObject(ObjectOutput output) throws IOException {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF xpac.hasStateMachine()�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("// state and history");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("output.writeInt(getState());");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("for (int h: history) output.writeInt(h);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("saveAttributes(output);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected void saveAttributes(ObjectOutput output) throws IOException {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�xpac.genSaveImpl�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@Override");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public void loadObject(ObjectInput input) throws IOException, ClassNotFoundException {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF xpac.hasStateMachine()�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("// state and history");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("setState(input.readInt());");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("for (int i=0; i<history.length; ++i) history[i] = input.readInt();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("loadAttributes(input);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected void loadAttributes(ObjectInput input) throws IOException, ClassNotFoundException {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�xpac.genLoadImpl�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
_builder.newLine();
- {
- if (manualBehavior) {
- _builder.append("\t");
- _builder.append("public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) {");
- _builder.newLine();
- {
- List<InterfaceItem> _allInterfaceItems = RoomHelpers.getAllInterfaceItems(ac);
- boolean _hasElements = false;
- for(final InterfaceItem ifitem : _allInterfaceItems) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate("else ", " ");
- }
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("if (ifitem==");
- String _name_40 = ifitem.getName();
- _builder.append(_name_40, " ");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("switch (evt) {");
- _builder.newLine();
- {
- List<Message> _incoming = RoomHelpers.getIncoming(ifitem);
- for(final Message msg : _incoming) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("case ");
- ProtocolClass _protocolClass = RoomHelpers.getProtocolClass(msg);
- String _name_41 = _protocolClass.getName();
- _builder.append(_name_41, " ");
- _builder.append(".");
- String _xifexpression_6 = null;
- boolean _isIncoming = this._roomExtensions.isIncoming(msg);
- if (_isIncoming) {
- _xifexpression_6 = "IN_";
- } else {
- _xifexpression_6 = "OUT_";
- }
- _builder.append(_xifexpression_6, " ");
- String _name_42 = msg.getName();
- _builder.append(_name_42, " ");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- {
- VarDecl _data = msg.getData();
- boolean _notEquals_5 = (!Objects.equal(_data, null));
- if (_notEquals_5) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("{");
- String _typedDataDefinition = this._javaExtensions.getTypedDataDefinition(msg);
- _builder.append(_typedDataDefinition, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("on_");
- String _name_43 = ifitem.getName();
- _builder.append(_name_43, " ");
- _builder.append("_");
- String _name_44 = msg.getName();
- _builder.append(_name_44, " ");
- _builder.append("(ifitem");
- {
- VarDecl _data_1 = msg.getData();
- boolean _notEquals_6 = (!Objects.equal(_data_1, null));
- if (_notEquals_6) {
- _builder.append(", ");
- VarDecl _data_2 = msg.getData();
- String _name_45 = _data_2.getName();
- _builder.append(_name_45, " ");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("break;");
- _builder.newLine();
- {
- VarDecl _data_3 = msg.getData();
- boolean _notEquals_7 = (!Objects.equal(_data_3, null));
- if (_notEquals_7) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- {
- List<InterfaceItem> _allInterfaceItems_1 = RoomHelpers.getAllInterfaceItems(ac);
- for(final InterfaceItem ifitem_1 : _allInterfaceItems_1) {
- {
- List<Message> _incoming_1 = RoomHelpers.getIncoming(ifitem_1);
- for(final Message msg_1 : _incoming_1) {
- _builder.append("\t");
- _builder.append("protected void on_");
- String _name_46 = ifitem_1.getName();
- _builder.append(_name_46, " ");
- _builder.append("_");
- String _name_47 = msg_1.getName();
- _builder.append(_name_47, " ");
- _builder.append("(InterfaceItemBase ifitem");
- {
- VarDecl _data_4 = msg_1.getData();
- boolean _notEquals_8 = (!Objects.equal(_data_4, null));
- if (_notEquals_8) {
- VarDecl _data_5 = msg_1.getData();
- String[] _generateArglistAndTypedData = this._javaExtensions.generateArglistAndTypedData(_data_5);
- String _get = _generateArglistAndTypedData[2];
- _builder.append(_get, " ");
- }
- }
- _builder.append(") {}");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public abstract void executeInitTransition();");
- _builder.newLine();
- } else {
- {
- boolean _hasNonEmptyStateMachine = RoomHelpers.hasNonEmptyStateMachine(ac);
- if (_hasNonEmptyStateMachine) {
- _builder.append("\t");
- CharSequence _genStateMachine = this._stateMachineGen.genStateMachine(xpac);
- _builder.append(_genStateMachine, " ");
- _builder.newLineIfNotEmpty();
- } else {
- boolean _hasStateMachine = xpac.hasStateMachine();
- boolean _not_4 = (!_hasStateMachine);
- if (_not_4) {
- _builder.append("\t");
- _builder.append("//--------------------- no state machine");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("handleSystemEvent(ifitem, evt, data);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public void executeInitTransition() {}");
- _builder.newLine();
- }
- }
- }
- }
- }
- {
- GlobalSettings _settings_6 = Main.getSettings();
- boolean _isGeneratePersistenceInterface_2 = _settings_6.isGeneratePersistenceInterface();
- if (_isGeneratePersistenceInterface_2) {
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("@Override");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public void saveObject(ObjectOutput output) throws IOException {");
- _builder.newLine();
- {
- boolean _hasStateMachine_1 = xpac.hasStateMachine();
- if (_hasStateMachine_1) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("// state and history");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("output.writeInt(getState());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("for (int h: history) output.writeInt(h);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("saveAttributes(output);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("protected void saveAttributes(ObjectOutput output) throws IOException {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _genSaveImpl = this.genSaveImpl(xpac);
- _builder.append(_genSaveImpl, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("@Override");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public void loadObject(ObjectInput input) throws IOException, ClassNotFoundException {");
- _builder.newLine();
- {
- boolean _hasStateMachine_2 = xpac.hasStateMachine();
- if (_hasStateMachine_2) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("// state and history");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("setState(input.readInt());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("for (int i=0; i<history.length; ++i) history[i] = input.readInt();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("loadAttributes(input);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("protected void loadAttributes(ObjectInput input) throws IOException, ClassNotFoundException {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _genLoadImpl = this.genLoadImpl(xpac);
- _builder.append(_genLoadImpl, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
_builder.append("};");
_builder.newLine();
_xblockexpression = (_builder);
@@ -1209,59 +881,58 @@ public class ActorClassGen extends GenericActorClassGenerator {
{
final ActorClass ac = xpac.getActorClass();
StringConcatenation _builder = new StringConcatenation();
- {
- ActorClass _base = ac.getBase();
- boolean _notEquals = (!Objects.equal(_base, null));
- if (_notEquals) {
- _builder.append("super.saveAttributes(output);");
- _builder.newLine();
- _builder.newLine();
- }
- }
- {
- EList<Attribute> _attributes = ac.getAttributes();
- boolean _isEmpty = _attributes.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- {
- EList<Attribute> _attributes_1 = ac.getAttributes();
- for(final Attribute att : _attributes_1) {
- {
- RefableType _type = att.getType();
- DataType _type_1 = _type.getType();
- if ((_type_1 instanceof PrimitiveType)) {
- String _genSavePrimitive = this.genSavePrimitive(att);
- _builder.append(_genSavePrimitive, "");
- _builder.newLineIfNotEmpty();
- } else {
- {
- int _size = att.getSize();
- boolean _greaterThan = (_size > 1);
- if (_greaterThan) {
- _builder.append("for (");
- RefableType _type_2 = att.getType();
- DataType _type_3 = _type_2.getType();
- String _name = _type_3.getName();
- _builder.append(_name, "");
- _builder.append(" v: ");
- String _name_1 = att.getName();
- _builder.append(_name_1, "");
- _builder.append(") output.writeObject(v);");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("output.writeObject(");
- String _name_2 = att.getName();
- _builder.append(_name_2, "");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- }
- }
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("�IF ac.base!=null�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("super.saveAttributes(output);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF !ac.attributes.empty�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�FOR att : ac.attributes�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF att.type.type instanceof PrimitiveType�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�genSavePrimitive(att)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("���\t\t\t\t\t\tDataClass and ExternalType (the latter one has to implement Serializable)");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�IF att.size>1�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("for (�att.type.type.name� v: �att.name�) output.writeObject(v);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("output.writeObject(�att.name�);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -1272,66 +943,58 @@ public class ActorClassGen extends GenericActorClassGenerator {
{
final ActorClass ac = xpac.getActorClass();
StringConcatenation _builder = new StringConcatenation();
- {
- ActorClass _base = ac.getBase();
- boolean _notEquals = (!Objects.equal(_base, null));
- if (_notEquals) {
- _builder.append("super.loadAttributes(input);");
- _builder.newLine();
- _builder.newLine();
- }
- }
- {
- EList<Attribute> _attributes = ac.getAttributes();
- boolean _isEmpty = _attributes.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- {
- EList<Attribute> _attributes_1 = ac.getAttributes();
- for(final Attribute att : _attributes_1) {
- {
- RefableType _type = att.getType();
- DataType _type_1 = _type.getType();
- if ((_type_1 instanceof PrimitiveType)) {
- String _genLoadPrimitive = this.genLoadPrimitive(att);
- _builder.append(_genLoadPrimitive, "");
- _builder.newLineIfNotEmpty();
- } else {
- {
- int _size = att.getSize();
- boolean _greaterThan = (_size > 1);
- if (_greaterThan) {
- _builder.append("for (int i=0; i< ");
- String _name = att.getName();
- _builder.append(_name, "");
- _builder.append(".length; ++i) ");
- String _name_1 = att.getName();
- _builder.append(_name_1, "");
- _builder.append("[i] = (");
- RefableType _type_2 = att.getType();
- DataType _type_3 = _type_2.getType();
- String _name_2 = _type_3.getName();
- _builder.append(_name_2, "");
- _builder.append(") input.readObject();");
- _builder.newLineIfNotEmpty();
- } else {
- String _name_3 = att.getName();
- _builder.append(_name_3, "");
- _builder.append(" = (");
- RefableType _type_4 = att.getType();
- DataType _type_5 = _type_4.getType();
- String _name_4 = _type_5.getName();
- _builder.append(_name_4, "");
- _builder.append(") input.readObject();");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- }
- }
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("�IF ac.base!=null�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("super.loadAttributes(input);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF !ac.attributes.empty�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�FOR att : ac.attributes�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF att.type.type instanceof PrimitiveType�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�genLoadPrimitive(att)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("���\t\t\t\t\t\tDataClass and ExternalType (the latter one has to implement Serializable)");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�IF att.size>1�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("for (int i=0; i< �att.name�.length; ++i) �att.name�[i] = (�att.type.type.name�) input.readObject();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("�att.name� = (�att.type.type.name�) input.readObject();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java
index 7364b033d..bbe97bf56 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java
@@ -12,21 +12,15 @@ package org.eclipse.etrice.generator.java.gen;
import com.google.common.base.Objects;
import com.google.inject.Inject;
-import java.util.ArrayList;
import java.util.List;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance;
import org.eclipse.etrice.core.genmodel.etricegen.InstanceBase;
-import org.eclipse.etrice.core.genmodel.etricegen.InterfaceItemInstance;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.DataClass;
import org.eclipse.etrice.core.room.DataType;
-import org.eclipse.etrice.core.room.InterfaceItem;
-import org.eclipse.etrice.core.room.PortClass;
import org.eclipse.etrice.core.room.PrimitiveType;
import org.eclipse.etrice.core.room.RefableType;
-import org.eclipse.etrice.core.room.util.RoomHelpers;
import org.eclipse.etrice.generator.base.IDataConfiguration;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
@@ -36,7 +30,6 @@ import org.eclipse.etrice.generator.java.gen.JavaExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
@SuppressWarnings("all")
public class ConfigGenAddon {
@@ -64,48 +57,35 @@ public class ConfigGenAddon {
public CharSequence genActorInstanceConfig(final ActorInstance ai, final String aiVariableName) {
StringConcatenation _builder = new StringConcatenation();
- {
- ActorClass _actorClass = ai.getActorClass();
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(_actorClass);
- for(final Attribute a : _allAttributes) {
- ArrayList<Attribute> _arrayList = new ArrayList<Attribute>();
- List<Attribute> _union = this._roomExtensions.<Attribute>union(_arrayList, a);
- CharSequence _applyInstanceConfig = this.applyInstanceConfig(ai, aiVariableName, _union);
- _builder.append(_applyInstanceConfig, "");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EList<InterfaceItemInstance> _orderedIfItemInstances = ai.getOrderedIfItemInstances();
- for(final InterfaceItemInstance pi : _orderedIfItemInstances) {
- InterfaceItem _interfaceItem = pi.getInterfaceItem();
- PortClass _portClass = RoomHelpers.getPortClass(_interfaceItem);
- EList<Attribute> _attributes = null;
- if (_portClass!=null) {
- _attributes=_portClass.getAttributes();
- }
- EList<Attribute> attribs = _attributes;
- _builder.newLineIfNotEmpty();
- {
- boolean _notEquals = (!Objects.equal(attribs, null));
- if (_notEquals) {
- {
- for(final Attribute a_1 : attribs) {
- String _plus = (aiVariableName + ".");
- String _name = pi.getName();
- CharSequence _invokeGetter = this.helpers.invokeGetter(_name, null);
- String _plus_1 = (_plus + _invokeGetter);
- ArrayList<Attribute> _arrayList_1 = new ArrayList<Attribute>();
- List<Attribute> _union_1 = this._roomExtensions.<Attribute>union(_arrayList_1, a_1);
- CharSequence _applyInstanceConfig_1 = this.applyInstanceConfig(pi, _plus_1, _union_1);
- _builder.append(_applyInstanceConfig_1, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- }
- }
+ _builder.append("�FOR a : ai.actorClass.allAttributes�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�applyInstanceConfig(ai, aiVariableName, new ArrayList<Attribute>().union(a))�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("�FOR pi : ai.orderedIfItemInstances�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�var attribs = RoomHelpers::getPortClass(pi.interfaceItem)?.attributes�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF attribs != null�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR a : attribs�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�applyInstanceConfig(pi, aiVariableName+\".\"+invokeGetter(pi.name, null), new ArrayList<Attribute>().union(a))�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -141,19 +121,13 @@ public class ConfigGenAddon {
final DataClass _dataClass = (DataClass)aType;
_matched=true;
StringConcatenation _builder = new StringConcatenation();
- {
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(((DataClass) _dataClass));
- for(final Attribute e : _allAttributes) {
- String _plus = (invokes + ".");
- String _name = a.getName();
- CharSequence _invokeGetter = this.helpers.invokeGetter(_name, null);
- String _plus_1 = (_plus + _invokeGetter);
- List<Attribute> _union = this._roomExtensions.<Attribute>union(path, e);
- CharSequence _applyInstanceConfig = this.applyInstanceConfig(instance, _plus_1, _union);
- _builder.append(_applyInstanceConfig, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR e : (aType as DataClass).allAttributes�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�applyInstanceConfig(instance, invokes+\".\"+a.name.invokeGetter(null), path.union(e))�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_switchResult = _builder;
}
}
@@ -164,197 +138,95 @@ public class ConfigGenAddon {
public CharSequence genDynConfigGetterSetter(final ActorClass ac) {
StringConcatenation _builder = new StringConcatenation();
- {
- List<Attribute> _dynConfigReadAttributes = this.dataConfigExt.getDynConfigReadAttributes(ac);
- for(final Attribute a : _dynConfigReadAttributes) {
- _builder.append("public ");
- RefableType _type = a.getType();
- DataType _type_1 = _type.getType();
- String _typeName = this.typeHelpers.typeName(_type_1);
- _builder.append(_typeName, "");
- {
- int _size = a.getSize();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("[]");
- }
- }
- _builder.append(" get");
- String _name = a.getName();
- String _firstUpper = StringExtensions.toFirstUpper(_name);
- _builder.append(_firstUpper, "");
- _builder.append("(){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if(lock_");
- String _name_1 = a.getName();
- _builder.append(_name_1, " ");
- _builder.append(" == null)");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("return ");
- String _name_2 = a.getName();
- _builder.append(_name_2, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("else");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("synchronized(lock_");
- String _name_3 = a.getName();
- _builder.append(_name_3, " ");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("return ");
- String _name_4 = a.getName();
- _builder.append(_name_4, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("public void set");
- String _name_5 = a.getName();
- String _firstUpper_1 = StringExtensions.toFirstUpper(_name_5);
- _builder.append(_firstUpper_1, "");
- _builder.append("(");
- RefableType _type_2 = a.getType();
- DataType _type_3 = _type_2.getType();
- String _typeName_1 = this.typeHelpers.typeName(_type_3);
- _builder.append(_typeName_1, "");
- {
- int _size_1 = a.getSize();
- boolean _greaterThan_1 = (_size_1 > 0);
- if (_greaterThan_1) {
- _builder.append("[]");
- }
- }
- _builder.append(" ");
- String _name_6 = a.getName();
- _builder.append(_name_6, "");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if(lock_");
- String _name_7 = a.getName();
- _builder.append(_name_7, " ");
- _builder.append(" == null)");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("this.");
- String _name_8 = a.getName();
- _builder.append(_name_8, " ");
- _builder.append(" = ");
- String _name_9 = a.getName();
- _builder.append(_name_9, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("else");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("synchronized(lock_");
- String _name_10 = a.getName();
- _builder.append(_name_10, " ");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("this.");
- String _name_11 = a.getName();
- _builder.append(_name_11, " ");
- _builder.append(" = ");
- String _name_12 = a.getName();
- _builder.append(_name_12, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("public DynConfigLock get");
- String _name_13 = a.getName();
- String _firstUpper_2 = StringExtensions.toFirstUpper(_name_13);
- _builder.append(_firstUpper_2, "");
- _builder.append("Lock(){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return lock_");
- String _name_14 = a.getName();
- _builder.append(_name_14, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("}\t");
- _builder.newLine();
- }
- }
- {
- List<Attribute> _dynConfigWriteAttributes = this.dataConfigExt.getDynConfigWriteAttributes(ac);
- for(final Attribute a_1 : _dynConfigWriteAttributes) {
- _builder.append("public void setAndWrite");
- String _name_15 = a_1.getName();
- String _firstUpper_3 = StringExtensions.toFirstUpper(_name_15);
- _builder.append(_firstUpper_3, "");
- _builder.append("(");
- RefableType _type_4 = a_1.getType();
- DataType _type_5 = _type_4.getType();
- String _typeName_2 = this.typeHelpers.typeName(_type_5);
- _builder.append(_typeName_2, "");
- {
- int _size_2 = a_1.getSize();
- boolean _greaterThan_2 = (_size_2 > 0);
- if (_greaterThan_2) {
- _builder.append("[]");
- }
- }
- _builder.append(" ");
- String _name_16 = a_1.getName();
- _builder.append(_name_16, "");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("set");
- String _name_17 = a_1.getName();
- String _firstUpper_4 = StringExtensions.toFirstUpper(_name_17);
- _builder.append(_firstUpper_4, " ");
- _builder.append("(");
- String _name_18 = a_1.getName();
- _builder.append(_name_18, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("getVariableService().write(this.getInstancePath()+\"/");
- String _name_19 = a_1.getName();
- _builder.append(_name_19, " ");
- _builder.append("\", ");
- String _name_20 = a_1.getName();
- _builder.append(_name_20, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("�FOR a : dataConfigExt.getDynConfigReadAttributes(ac)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public �a.type.type.typeName��IF a.size>0�[]�ENDIF� get�a.name.toFirstUpper�(){");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if(lock_�a.name� == null)");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return �a.name�;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("else");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("synchronized(lock_�a.name�){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("return �a.name�;");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public void set�a.name.toFirstUpper�(�a.type.type.typeName��IF a.size>0�[]�ENDIF� �a.name�){");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if(lock_�a.name� == null)");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("this.�a.name� = �a.name�;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("else");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("synchronized(lock_�a.name�){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("this.�a.name� = �a.name�;");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public DynConfigLock get�a.name.toFirstUpper�Lock(){");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("return lock_�a.name�;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}\t");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("�FOR a : dataConfigExt.getDynConfigWriteAttributes(ac)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public void setAndWrite�a.name.toFirstUpper�(�a.type.type.typeName��IF a.size>0�[]�ENDIF� �a.name�){");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("set�a.name.toFirstUpper�(�a.name�);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("getVariableService().write(this.getInstancePath()+\"/�a.name�\", �a.name�);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
public String genMinMaxConstants(final ActorClass ac) {
StringConcatenation _builder = new StringConcatenation();
- {
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(ac);
- for(final Attribute a : _allAttributes) {
- String _name = a.getName();
- ArrayList<Attribute> _arrayList = new ArrayList<Attribute>();
- List<Attribute> _union = this._roomExtensions.<Attribute>union(_arrayList, a);
- CharSequence _genMinMaxConstantsRec = this.genMinMaxConstantsRec(ac, _name, _union);
- _builder.append(_genMinMaxConstantsRec, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR a : ac.allAttributes�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�genMinMaxConstantsRec(ac, a.name, new ArrayList<Attribute>().union(a))�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
String result = _builder.toString();
int _length = result.length();
boolean _notEquals = (_length != 0);
@@ -380,18 +252,13 @@ public class ConfigGenAddon {
final DataClass _dataClass = (DataClass)aType;
_matched=true;
StringConcatenation _builder = new StringConcatenation();
- {
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(((DataClass) _dataClass));
- for(final Attribute e : _allAttributes) {
- String _plus = (varNamePath + "_");
- String _name = e.getName();
- String _plus_1 = (_plus + _name);
- List<Attribute> _union = this._roomExtensions.<Attribute>union(path, e);
- CharSequence _genMinMaxConstantsRec = this.genMinMaxConstantsRec(ac, _plus_1, _union);
- _builder.append(_genMinMaxConstantsRec, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR e : (aType as DataClass).allAttributes�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�genMinMaxConstantsRec(ac, varNamePath+\"_\"+e.name, path.union(e))�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_switchResult = _builder;
}
}
@@ -403,40 +270,20 @@ public class ConfigGenAddon {
{
String temp = ((String) null);
StringConcatenation _builder = new StringConcatenation();
- {
- String _attrClassConfigMinValue = this.dataConfigExt.getAttrClassConfigMinValue(ac, path);
- String _temp = temp = _attrClassConfigMinValue;
- boolean _notEquals = (!Objects.equal(_temp, null));
- if (_notEquals) {
- _builder.append("public static ");
- String _minMaxType = this.getMinMaxType(_primitiveType);
- _builder.append(_minMaxType, "");
- _builder.append(" MIN_");
- _builder.append(varNamePath, "");
- _builder.append(" = ");
- String _valueLiteral = this.stdExt.toValueLiteral(_primitiveType, temp);
- _builder.append(_valueLiteral, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- String _attrClassConfigMaxValue = this.dataConfigExt.getAttrClassConfigMaxValue(ac, path);
- String _temp_1 = temp = _attrClassConfigMaxValue;
- boolean _notEquals_1 = (!Objects.equal(_temp_1, null));
- if (_notEquals_1) {
- _builder.append("public static ");
- String _minMaxType_1 = this.getMinMaxType(_primitiveType);
- _builder.append(_minMaxType_1, "");
- _builder.append(" MAX_");
- _builder.append(varNamePath, "");
- _builder.append(" = ");
- String _valueLiteral_1 = this.stdExt.toValueLiteral(_primitiveType, temp);
- _builder.append(_valueLiteral_1, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF (temp = dataConfigExt.getAttrClassConfigMinValue(ac, path)) != null�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public static �aType.minMaxType� MIN_�varNamePath� = �aType.toValueLiteral(temp)�;");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�IF (temp = dataConfigExt.getAttrClassConfigMaxValue(ac, path)) != null�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public static �aType.minMaxType� MAX_�varNamePath� = �aType.toValueLiteral(temp)�;");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression_1 = (_builder);
}
_switchResult = _xblockexpression_1;
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/DataClassGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/DataClassGen.java
index e84952584..62118b00b 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/DataClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/DataClassGen.java
@@ -17,12 +17,7 @@ import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.room.Attribute;
-import org.eclipse.etrice.core.room.ComplexType;
import org.eclipse.etrice.core.room.DataClass;
-import org.eclipse.etrice.core.room.DataType;
-import org.eclipse.etrice.core.room.DetailCode;
-import org.eclipse.etrice.core.room.RefableType;
-import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.etrice.core.room.StandardOperation;
import org.eclipse.etrice.core.room.util.RoomHelpers;
import org.eclipse.etrice.generator.base.IGeneratorFileIo;
@@ -87,137 +82,94 @@ public class DataClassGen {
Iterable<StandardOperation> _filter = IterableExtensions.<StandardOperation>filter(_operations, _function);
final StandardOperation ctor = IterableExtensions.<StandardOperation>head(_filter);
StringConcatenation _builder = new StringConcatenation();
- _builder.append("package ");
- String _package = this._roomExtensions.getPackage(dc);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �dc.getPackage()�;");
+ _builder.newLine();
_builder.newLine();
_builder.append("import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;");
_builder.newLine();
_builder.append("import java.io.Serializable;");
_builder.newLine();
_builder.newLine();
- EList<RoomModel> models = root.getReferencedModels(dc);
- _builder.newLineIfNotEmpty();
- {
- for(final RoomModel model : models) {
- _builder.append("import ");
- String _name = model.getName();
- _builder.append(_name, "");
- _builder.append(".*;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�var models = root.getReferencedModels(dc)�");
_builder.newLine();
- CharSequence _userCode = this._procedureHelpers.userCode(dc, 1);
- _builder.append(_userCode, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�FOR model : models�import �model.name�.*;");
_builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�dc.userCode(1)�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("public class �dc.name��IF dc.base!=null� extends �dc.base.name��ENDIF� implements Serializable {");
_builder.newLine();
- _builder.append("public class ");
- String _name_1 = dc.getName();
- _builder.append(_name_1, "");
- {
- DataClass _base = dc.getBase();
- boolean _notEquals = (!Objects.equal(_base, null));
- if (_notEquals) {
- _builder.append(" extends ");
- DataClass _base_1 = dc.getBase();
- String _name_2 = _base_1.getName();
- _builder.append(_name_2, "");
- }
- }
- _builder.append(" implements Serializable {");
- _builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- _builder.append("private static final long serialVersionUID = ");
- String _package_1 = this._roomExtensions.getPackage(dc);
- String _name_3 = dc.getName();
- String _plus = (_package_1 + _name_3);
- int _hashCode = _plus.hashCode();
- _builder.append(_hashCode, " ");
- _builder.append("L;");
- _builder.newLineIfNotEmpty();
+ _builder.append("private static final long serialVersionUID = �(dc.package+dc.name).hashCode�L;");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- CharSequence _userCode_1 = this._procedureHelpers.userCode(dc, 2);
- _builder.append(_userCode_1, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�dc.userCode(2)�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- EList<Attribute> _attributes = dc.getAttributes();
- CharSequence _attributes_1 = this._procedureHelpers.attributes(_attributes);
- _builder.append(_attributes_1, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�dc.attributes.attributes�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- EList<Attribute> _attributes_2 = dc.getAttributes();
- String _name_4 = dc.getName();
- CharSequence _attributeSettersGettersImplementation = this._procedureHelpers.attributeSettersGettersImplementation(_attributes_2, _name_4);
- _builder.append(_attributeSettersGettersImplementation, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�dc.attributes.attributeSettersGettersImplementation(dc.name)�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- EList<StandardOperation> _operations_1 = dc.getOperations();
- String _name_5 = dc.getName();
- CharSequence _operationsImplementation = this._procedureHelpers.operationsImplementation(_operations_1, _name_5);
- _builder.append(_operationsImplementation, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�dc.operations.operationsImplementation(dc.name)�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("// default constructor");
_builder.newLine();
_builder.append("\t");
- _builder.append("public ");
- String _name_6 = dc.getName();
- _builder.append(_name_6, " ");
- _builder.append("() {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public �dc.name�() {");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("super();");
_builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
- EList<Attribute> _attributes_3 = dc.getAttributes();
- CharSequence _attributeInitialization = this._initialization.attributeInitialization(_attributes_3, dc, true);
- _builder.append(_attributeInitialization, " ");
- _builder.newLineIfNotEmpty();
- {
- boolean _notEquals_1 = (!Objects.equal(ctor, null));
- if (_notEquals_1) {
- _builder.append("\t\t");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("// user defined constructor body");
- _builder.newLine();
- {
- DetailCode _detailCode = ctor.getDetailCode();
- EList<String> _lines = _detailCode.getLines();
- for(final String l : _lines) {
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append(l, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("�dc.attributes.attributeInitialization(dc, true)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF ctor!=null�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("// user defined constructor body");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�FOR l : ctor.detailCode.lines�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�l�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -227,47 +179,34 @@ public class DataClassGen {
_builder.append("// constructor using fields");
_builder.newLine();
_builder.append("\t");
- _builder.append("public ");
- String _name_7 = dc.getName();
- _builder.append(_name_7, " ");
- _builder.append("(");
- String _argList = this.argList(dc);
- _builder.append(_argList, " ");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- {
- DataClass _base_2 = dc.getBase();
- boolean _notEquals_2 = (!Objects.equal(_base_2, null));
- if (_notEquals_2) {
- _builder.append("\t\t");
- _builder.append("super(");
- DataClass _base_3 = dc.getBase();
- String _paramList = this.paramList(_base_3);
- _builder.append(_paramList, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t\t");
- _builder.append("super();");
- _builder.newLine();
- }
- }
+ _builder.append("public �dc.name�(�dc.argList�) {");
+ _builder.newLine();
_builder.append("\t\t");
+ _builder.append("�IF dc.base!=null�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("super(�dc.base.paramList�);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("super();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR a : dc.attributes�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("this.�a.name� = �a.name�;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
_builder.newLine();
- {
- EList<Attribute> _attributes_4 = dc.getAttributes();
- for(final Attribute a : _attributes_4) {
- _builder.append("\t\t");
- _builder.append("this.");
- String _name_8 = a.getName();
- _builder.append(_name_8, " ");
- _builder.append(" = ");
- String _name_9 = a.getName();
- _builder.append(_name_9, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -277,23 +216,14 @@ public class DataClassGen {
_builder.append("// deep copy");
_builder.newLine();
_builder.append("\t");
- _builder.append("public ");
- String _name_10 = dc.getName();
- _builder.append(_name_10, " ");
- _builder.append(" deepCopy() {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public �dc.name� deepCopy() {");
+ _builder.newLine();
_builder.append("\t\t");
- String _name_11 = dc.getName();
- _builder.append(_name_11, " ");
- _builder.append(" copy = new ");
- String _name_12 = dc.getName();
- _builder.append(_name_12, " ");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
+ _builder.append("�dc.name� copy = new �dc.name�();");
+ _builder.newLine();
_builder.append("\t\t");
- String _deepCopy = this.deepCopy(dc);
- _builder.append(_deepCopy, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�deepCopy(dc)�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("return copy;");
_builder.newLine();
@@ -335,18 +265,7 @@ public class DataClassGen {
private CharSequence paramList(final List<Attribute> attributes) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasElements = false;
- for(final Attribute a : attributes) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(", ", "");
- }
- String _name = a.getName();
- _builder.append(_name, "");
- }
- }
+ _builder.append("�FOR a: attributes SEPARATOR \", \"��a.name��ENDFOR�");
return _builder;
}
@@ -399,103 +318,73 @@ public class DataClassGen {
private CharSequence deepCopy(final List<Attribute> attributes) {
StringConcatenation _builder = new StringConcatenation();
- {
- for(final Attribute a : attributes) {
- {
- RefableType _type = a.getType();
- boolean _isRef = _type.isRef();
- if (_isRef) {
- _builder.append("copy.");
- String _name = a.getName();
- _builder.append(_name, "");
- _builder.append(" = ");
- String _name_1 = a.getName();
- _builder.append(_name_1, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- } else {
- RefableType _type_1 = a.getType();
- DataType _type_2 = _type_1.getType();
- if ((_type_2 instanceof ComplexType)) {
- _builder.append("if (");
- String _name_2 = a.getName();
- _builder.append(_name_2, "");
- _builder.append("!=null) {");
- _builder.newLineIfNotEmpty();
- {
- int _size = a.getSize();
- boolean _lessEqualsThan = (_size <= 1);
- if (_lessEqualsThan) {
- _builder.append("\t");
- _builder.append("copy.");
- String _name_3 = a.getName();
- _builder.append(_name_3, " ");
- _builder.append(" = ");
- String _name_4 = a.getName();
- _builder.append(_name_4, " ");
- _builder.append(".deepCopy();");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t");
- _builder.append("for (int i=0;i<");
- String _name_5 = a.getName();
- _builder.append(_name_5, " ");
- _builder.append(".length;i++){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("copy.");
- String _name_6 = a.getName();
- _builder.append(_name_6, " ");
- _builder.append("[i] = ");
- String _name_7 = a.getName();
- _builder.append(_name_7, " ");
- _builder.append("[i].deepCopy();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- } else {
- {
- int _size_1 = a.getSize();
- boolean _equals = (_size_1 == 0);
- if (_equals) {
- _builder.append("copy.");
- String _name_8 = a.getName();
- _builder.append(_name_8, "");
- _builder.append(" = ");
- String _name_9 = a.getName();
- _builder.append(_name_9, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("for (int i=0;i<");
- String _name_10 = a.getName();
- _builder.append(_name_10, "");
- _builder.append(".length;i++){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("copy.");
- String _name_11 = a.getName();
- _builder.append(_name_11, " ");
- _builder.append("[i] = ");
- String _name_12 = a.getName();
- _builder.append(_name_12, " ");
- _builder.append("[i];");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
- }
- }
- }
+ _builder.append("�FOR a : attributes�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF a.type.ref�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("copy.�a.name� = �a.name�;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSEIF a.type.type instanceof ComplexType�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (�a.name�!=null) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF a.size<=1�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("copy.�a.name� = �a.name�.deepCopy();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("for (int i=0;i<�a.name�.length;i++){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("copy.�a.name�[i] = �a.name�[i].deepCopy();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF a.size==0�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("copy.�a.name� = �a.name�;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("for (int i=0;i<�a.name�.length;i++){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("copy.�a.name�[i] = �a.name�[i];");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
}
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/JavaExtensions.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/JavaExtensions.java
index 0a062b2ba..ba4d7370e 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/JavaExtensions.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/JavaExtensions.java
@@ -222,18 +222,13 @@ public class JavaExtensions implements ILanguageExtension {
public String genEnumeration(final String name, final List<Pair<String,String>> entries) {
StringConcatenation _builder = new StringConcatenation();
- {
- for(final Pair<String, String> entry : entries) {
- _builder.append("public static final int ");
- String _first = entry.getFirst();
- _builder.append(_first, "");
- _builder.append(" = ");
- String _second = entry.getSecond();
- _builder.append(_second, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR entry: entries�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public static final int �entry.first� = �entry.second�;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
String _string = _builder.toString();
return _string;
}
@@ -311,21 +306,7 @@ public class JavaExtensions implements ILanguageExtension {
String _trim = _replace_1.trim();
String[] singleValues = _trim.split(",");
StringConcatenation _builder = new StringConcatenation();
- _builder.append("{ ");
- {
- boolean _hasElements = false;
- for(final String v : singleValues) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(", ", "");
- }
- String _trim_1 = v.trim();
- String _castValue = this.castValue(type, _trim_1);
- _builder.append(_castValue, "");
- }
- }
- _builder.append(" }");
+ _builder.append("{ �FOR v: singleValues SEPARATOR \', \'��castValue(type, v.trim)��ENDFOR� }");
String _string = _builder.toString();
_xblockexpression = (_string);
}
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
index cd82793f5..ea1809aad 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeGen.java
@@ -21,33 +21,26 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
-import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.etrice.core.etmap.util.ETMapUtil;
import org.eclipse.etrice.core.etmap.util.ETMapUtil.MappedThread;
-import org.eclipse.etrice.core.etphys.eTPhys.ExecMode;
import org.eclipse.etrice.core.etphys.eTPhys.NodeClass;
import org.eclipse.etrice.core.etphys.eTPhys.NodeRef;
import org.eclipse.etrice.core.etphys.eTPhys.PhysicalThread;
-import org.eclipse.etrice.core.genmodel.etricegen.AbstractInstance;
import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance;
import org.eclipse.etrice.core.genmodel.etricegen.ActorInterfaceInstance;
import org.eclipse.etrice.core.genmodel.etricegen.IDiagnostician;
-import org.eclipse.etrice.core.genmodel.etricegen.InstanceBase;
import org.eclipse.etrice.core.genmodel.etricegen.InterfaceItemInstance;
import org.eclipse.etrice.core.genmodel.etricegen.OptionalActorInstance;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.genmodel.etricegen.ServiceImplInstance;
import org.eclipse.etrice.core.genmodel.etricegen.StructureInstance;
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
-import org.eclipse.etrice.core.genmodel.etricegen.Wire;
import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass;
import org.eclipse.etrice.core.genmodel.etricegen.WiredSubSystemClass;
import org.eclipse.etrice.core.room.ActorClass;
-import org.eclipse.etrice.core.room.ActorRef;
import org.eclipse.etrice.core.room.CommunicationType;
import org.eclipse.etrice.core.room.InterfaceItem;
import org.eclipse.etrice.core.room.ProtocolClass;
@@ -55,13 +48,9 @@ import org.eclipse.etrice.core.room.RoomModel;
import org.eclipse.etrice.core.room.SubSystemClass;
import org.eclipse.etrice.generator.base.IDataConfiguration;
import org.eclipse.etrice.generator.base.IGeneratorFileIo;
-import org.eclipse.etrice.generator.base.Indexed;
-import org.eclipse.etrice.generator.base.IntelligentSeparator;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
-import org.eclipse.etrice.generator.java.Main;
import org.eclipse.etrice.generator.java.gen.ConfigGenAddon;
-import org.eclipse.etrice.generator.java.gen.GlobalSettings;
import org.eclipse.etrice.generator.java.gen.JavaExtensions;
import org.eclipse.etrice.generator.java.gen.VariableServiceGen;
import org.eclipse.xtend2.lib.StringConcatenation;
@@ -228,22 +217,18 @@ public class NodeGen {
final Iterable<PhysicalThread> threads = IterableExtensions.<PhysicalThread>filter(_threads, _function);
final HashSet<ActorClass> opt = this.getOptionalActorClasses(root, comp);
StringConcatenation _builder = new StringConcatenation();
- _builder.append("package ");
- String _package = this._roomExtensions.getPackage(cc);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �cc.getPackage()�;");
+ _builder.newLine();
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.config.IVariableService;");
_builder.newLine();
- {
- GlobalSettings _settings = Main.getSettings();
- boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation();
- if (_generateMSCInstrumentation) {
- _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
- _builder.newLine();
- }
- }
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.messaging.IRTObject;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.messaging.IMessageService;");
@@ -269,53 +254,39 @@ public class NodeGen {
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;");
_builder.newLine();
_builder.newLine();
- {
- for(final RoomModel model : models) {
- _builder.append("import ");
- String _name = model.getName();
- _builder.append(_name, "");
- _builder.append(".*;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR model : models�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import �model.name�.*;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
- CharSequence _userCode = this._procedureHelpers.userCode(cc, 1, false);
- _builder.append(_userCode, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�cc.userCode(1, false)�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("public class �clsname� extends SubSystemClassBase {");
_builder.newLine();
- _builder.append("public class ");
- _builder.append(clsname, "");
- _builder.append(" extends SubSystemClassBase {");
- _builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.newLine();
- {
- Iterable<Indexed<PhysicalThread>> _indexed = Indexed.<PhysicalThread>indexed(threads);
- for(final Indexed<PhysicalThread> thread : _indexed) {
- _builder.append("\t");
- _builder.append("public static final int ");
- PhysicalThread _value = thread.getValue();
- String _threadId = this.getThreadId(_value);
- _builder.append(_threadId, " ");
- _builder.append(" = ");
- int _index0 = thread.getIndex0();
- _builder.append(_index0, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR thread : threads.indexed�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public static final int �thread.value.threadId� = �thread.index0�;");
_builder.newLine();
_builder.append("\t");
- CharSequence _userCode_1 = this._procedureHelpers.userCode(cc, 2, false);
- _builder.append(_userCode_1, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.newLine();
_builder.append("\t");
+ _builder.append("�cc.userCode(2, false)�");
_builder.newLine();
_builder.append("\t");
- _builder.append("public ");
- _builder.append(clsname, " ");
- _builder.append("(IRTObject parent, String name) {");
- _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("public �clsname�(IRTObject parent, String name) {");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("super(parent, name);");
_builder.newLine();
@@ -346,57 +317,30 @@ public class NodeGen {
_builder.append("\t\t");
_builder.append("IMessageService msgService;");
_builder.newLine();
- {
- for(final PhysicalThread thread_1 : threads) {
- {
- boolean _or = false;
- ExecMode _execmode = thread_1.getExecmode();
- boolean _equals = Objects.equal(_execmode, ExecMode.POLLED);
- if (_equals) {
- _or = true;
- } else {
- ExecMode _execmode_1 = thread_1.getExecmode();
- boolean _equals_1 = Objects.equal(_execmode_1, ExecMode.MIXED);
- _or = (_equals || _equals_1);
- }
- if (_or) {
- _builder.append("\t\t");
- _builder.append("msgService = new MessageService(this, MessageService.ExecMode.");
- ExecMode _execmode_2 = thread_1.getExecmode();
- String _name_1 = _execmode_2.name();
- _builder.append(_name_1, " ");
- _builder.append(", ");
- int _time = thread_1.getTime();
- _builder.append(_time, " ");
- _builder.append(", 0, ");
- String _threadId_1 = this.getThreadId(thread_1);
- _builder.append(_threadId_1, " ");
- _builder.append(", \"MessageService_");
- String _name_2 = thread_1.getName();
- _builder.append(_name_2, " ");
- _builder.append("\" /*, thread_prio */);");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t\t");
- _builder.append("msgService = new MessageService(this, MessageService.ExecMode.");
- ExecMode _execmode_3 = thread_1.getExecmode();
- String _name_3 = _execmode_3.name();
- _builder.append(_name_3, " ");
- _builder.append(", 0, ");
- String _threadId_2 = this.getThreadId(thread_1);
- _builder.append(_threadId_2, " ");
- _builder.append(", \"MessageService_");
- String _name_4 = thread_1.getName();
- _builder.append(_name_4, " ");
- _builder.append("\" /*, thread_prio */);");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(msgService);");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR thread: threads�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF thread.execmode==ExecMode::POLLED || thread.execmode==ExecMode::MIXED�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("msgService = new MessageService(this, MessageService.ExecMode.�thread.execmode.name�, �thread.time�, 0, �thread.threadId�, \"MessageService_�thread.name�\" /*, thread_prio */);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("msgService = new MessageService(this, MessageService.ExecMode.�thread.execmode.name�, 0, �thread.threadId�, \"MessageService_�thread.name�\" /*, thread_prio */);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(msgService);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -412,250 +356,157 @@ public class NodeGen {
_builder.append("\t\t");
_builder.append("// thread mappings");
_builder.newLine();
- {
- EList<ActorInstance> _allContainedInstances = comp.getAllContainedInstances();
- for(final ActorInstance ai : _allContainedInstances) {
- _builder.append("\t\t");
- final MappedThread mapped = ETMapUtil.getMappedThread(ai);
- _builder.newLineIfNotEmpty();
- {
- boolean _or_1 = false;
- boolean _isImplicit = mapped.isImplicit();
- if (_isImplicit) {
- _or_1 = true;
- } else {
- boolean _isAsParent = mapped.isAsParent();
- _or_1 = (_isImplicit || _isAsParent);
- }
- boolean _not = (!_or_1);
- if (_not) {
- _builder.append("\t\t");
- _builder.append("addPathToThread(\"");
- String _path = ai.getPath();
- _builder.append(_path, " ");
- _builder.append("\", ");
- PhysicalThread _thread = mapped.getThread();
- String _threadId_3 = this.getThreadId(_thread);
- _builder.append(_threadId_3, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR ai : comp.allContainedInstances�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�val mapped = ETMapUtil::getMappedThread(ai)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF !(mapped.implicit || mapped.asParent)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("addPathToThread(\"�ai.path�\", �mapped.thread.threadId�);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t\t");
_builder.append("// sub actors");
_builder.newLine();
- {
- EList<ActorRef> _actorRefs = cc.getActorRefs();
- for(final ActorRef sub : _actorRefs) {
- {
- int _multiplicity = sub.getMultiplicity();
- boolean _greaterThan = (_multiplicity > 1);
- if (_greaterThan) {
- _builder.append("\t\t");
- _builder.append("for (int i=0; i<");
- int _multiplicity_1 = sub.getMultiplicity();
- _builder.append(_multiplicity_1, " ");
- _builder.append("; ++i) {");
- _builder.newLineIfNotEmpty();
- {
- GlobalSettings _settings_1 = Main.getSettings();
- boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_1) {
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \"");
- String _name_5 = sub.getName();
- _builder.append(_name_5, " ");
- _builder.append("_\"+i);");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("new ");
- ActorClass _type_1 = sub.getType();
- String _name_6 = _type_1.getName();
- _builder.append(_name_6, " ");
- _builder.append("(this, \"");
- String _name_7 = sub.getName();
- _builder.append(_name_7, " ");
- _builder.append("_\"+i);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- } else {
- {
- GlobalSettings _settings_2 = Main.getSettings();
- boolean _generateMSCInstrumentation_2 = _settings_2.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_2) {
- _builder.append("\t\t");
- _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \"");
- String _name_8 = sub.getName();
- _builder.append(_name_8, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("new ");
- ActorClass _type_2 = sub.getType();
- String _name_9 = _type_2.getName();
- _builder.append(_name_9, " ");
- _builder.append("(this, \"");
- String _name_10 = sub.getName();
- _builder.append(_name_10, " ");
- _builder.append("\"); ");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR sub : cc.actorRefs�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF sub.multiplicity>1�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("for (int i=0; i<�sub.multiplicity�; ++i) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \"�sub.name�_\"+i);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("new �sub.type.name�(this, \"�sub.name�_\"+i);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, \"�sub.name�\");");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("new �sub.type.name�(this, \"�sub.name�\"); ");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// create service brokers in optional actor interfaces");
_builder.newLine();
- {
- BasicEList<AbstractInstance> _allSubInstances = this._roomExtensions.getAllSubInstances(comp);
- final Function1<AbstractInstance,Boolean> _function_1 = new Function1<AbstractInstance,Boolean>() {
- public Boolean apply(final AbstractInstance inst) {
- return Boolean.valueOf((inst instanceof ActorInterfaceInstance));
- }
- };
- Iterable<AbstractInstance> _filter = IterableExtensions.<AbstractInstance>filter(_allSubInstances, _function_1);
- final Function1<AbstractInstance,ActorInterfaceInstance> _function_2 = new Function1<AbstractInstance,ActorInterfaceInstance>() {
- public ActorInterfaceInstance apply(final AbstractInstance inst) {
- return ((ActorInterfaceInstance) inst);
- }
- };
- Iterable<ActorInterfaceInstance> _map = IterableExtensions.<AbstractInstance, ActorInterfaceInstance>map(_filter, _function_2);
- for(final ActorInterfaceInstance aii : _map) {
- _builder.append("\t\t");
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject(\"");
- String _path_1 = aii.getPath();
- _builder.append(_path_1, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- {
- EList<ServiceImplInstance> _providedServices = aii.getProvidedServices();
- for(final ServiceImplInstance svc : _providedServices) {
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("new InterfaceItemBroker(oai, \"");
- ProtocolClass _protocol = svc.getProtocol();
- String _fullyQualifiedName = this._roomExtensions.getFullyQualifiedName(_protocol);
- _builder.append(_fullyQualifiedName, " ");
- _builder.append("\", 0);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("InterfaceItemBase.connect(this, \"");
- String _path_2 = svc.getPath();
- _builder.append(_path_2, " ");
- _builder.append("\", \"");
- String _path_3 = aii.getPath();
- String _plus = (_path_3 + Character.valueOf(InstanceBase.pathDelim));
- ProtocolClass _protocol_1 = svc.getProtocol();
- String _fullyQualifiedName_1 = this._roomExtensions.getFullyQualifiedName(_protocol_1);
- String _plus_1 = (_plus + _fullyQualifiedName_1);
- _builder.append(_plus_1, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR aii: comp.allSubInstances.filter(inst|inst instanceof ActorInterfaceInstance).map(inst|inst as ActorInterfaceInstance)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("OptionalActorInterfaceBase oai = (OptionalActorInterfaceBase) getObject(\"�aii.getPath()�\");");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�FOR svc: aii.providedServices�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("new InterfaceItemBroker(oai, \"�svc.protocol.fullyQualifiedName�\", 0);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("InterfaceItemBase.connect(this, \"�svc.path�\", \"�aii.getPath()+InstanceBase::pathDelim+svc.protocol.fullyQualifiedName�\");");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// wiring");
_builder.newLine();
- {
- EList<Wire> _wires = wired.getWires();
- for(final Wire wire : _wires) {
- _builder.append("\t\t");
- String _xifexpression = null;
- boolean _isDataDriven = wire.isDataDriven();
- if (_isDataDriven) {
- _xifexpression = "DataPortBase";
- } else {
- _xifexpression = "InterfaceItemBase";
- }
- _builder.append(_xifexpression, " ");
- _builder.append(".connect(this, \"");
- EList<String> _path1 = wire.getPath1();
- String _join = IterableExtensions.join(_path1, "/");
- _builder.append(_join, " ");
- _builder.append("\", \"");
- EList<String> _path2 = wire.getPath2();
- String _join_1 = IterableExtensions.join(_path2, "/");
- _builder.append(_join_1, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR wire: wired.wires�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�if (wire.dataDriven) \"DataPortBase\" else \"InterfaceItemBase\"�.connect(this, \"�wire.path1.join(\'/\')�\", \"�wire.path2.join(\'/\')�\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// apply instance attribute configurations");
_builder.newLine();
- {
- EList<ActorInstance> _allContainedInstances_1 = comp.getAllContainedInstances();
- for(final ActorInstance ai_1 : _allContainedInstances_1) {
- _builder.append("\t\t");
- final CharSequence cfg = this.configGenAddon.genActorInstanceConfig(ai_1, "inst");
- _builder.newLineIfNotEmpty();
- {
- int _length = cfg.length();
- boolean _greaterThan_1 = (_length > 0);
- if (_greaterThan_1) {
- _builder.append("\t\t");
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- ActorClass _actorClass = ai_1.getActorClass();
- String _name_11 = _actorClass.getName();
- _builder.append(_name_11, " ");
- _builder.append(" inst = (");
- ActorClass _actorClass_1 = ai_1.getActorClass();
- String _name_12 = _actorClass_1.getName();
- _builder.append(_name_12, " ");
- _builder.append(") getObject(\"");
- String _path_4 = ai_1.getPath();
- _builder.append(_path_4, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("if (inst!=null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t\t");
- _builder.append(cfg, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR ai: comp.allContainedInstances�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�val cfg = configGenAddon.genActorInstanceConfig(ai, \"inst\")�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF cfg.length>0�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ai.actorClass.name� inst = (�ai.actorClass.name�) getObject(\"�ai.path�\");");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("if (inst!=null) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�cfg�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -667,45 +518,45 @@ public class NodeGen {
_builder.append("\t");
_builder.append("public void init(){");
_builder.newLine();
- {
- GlobalSettings _settings_3 = Main.getSettings();
- boolean _generateMSCInstrumentation_3 = _settings_3.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_3) {
- _builder.append("\t\t");
- _builder.append("DebuggingService.getInstance().addVisibleComment(\"begin sub system initialization\");");
- _builder.newLine();
- }
- }
- {
- boolean _hasVariableService = this.dataConfigExt.hasVariableService(comp);
- if (_hasVariableService) {
- _builder.append("\t\t");
- _builder.append("variableService = new ");
- _builder.append(clsname, " ");
- _builder.append("VariableService(this);");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("DebuggingService.getInstance().addVisibleComment(\"begin sub system initialization\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF dataConfigExt.hasVariableService(comp)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("variableService = new �clsname�VariableService(this);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("super.init();");
_builder.newLine();
- {
- boolean _hasVariableService_1 = this.dataConfigExt.hasVariableService(comp);
- if (_hasVariableService_1) {
- _builder.append("\t\t");
- _builder.append("variableService.init();");
- _builder.newLine();
- }
- }
- {
- GlobalSettings _settings_4 = Main.getSettings();
- boolean _generateMSCInstrumentation_4 = _settings_4.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_4) {
- _builder.append("\t\t");
- _builder.append("DebuggingService.getInstance().addVisibleComment(\"done sub system initialization\");");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�IF dataConfigExt.hasVariableService(comp)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("variableService.init();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("DebuggingService.getInstance().addVisibleComment(\"done sub system initialization\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -720,123 +571,96 @@ public class NodeGen {
_builder.append("\t\t");
_builder.append("super.stop();");
_builder.newLine();
- {
- boolean _hasVariableService_2 = this.dataConfigExt.hasVariableService(comp);
- if (_hasVariableService_2) {
- _builder.append("\t\t");
- _builder.append("variableService.stop();");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�IF dataConfigExt.hasVariableService(comp)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("variableService.stop();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
- {
- GlobalSettings _settings_5 = Main.getSettings();
- boolean _generateMSCInstrumentation_5 = _settings_5.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_5) {
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("@Override");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public boolean hasGeneratedMSCInstrumentation() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return true;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("@Override");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public void destroy() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addVisibleComment(\"begin sub system destruction\");");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("super.destroy();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addVisibleComment(\"done sub system destruction\");");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@Override");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public boolean hasGeneratedMSCInstrumentation() {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return true;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@Override");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public void destroy() {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("DebuggingService.getInstance().addVisibleComment(\"begin sub system destruction\");");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("super.destroy();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("DebuggingService.getInstance().addVisibleComment(\"done sub system destruction\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("public IOptionalActorFactory getFactory(String optionalActorClass, String actorClass) {");
_builder.newLine();
_builder.append("\t\t");
- IntelligentSeparator _intelligentSeparator = new IntelligentSeparator("else ");
- final IntelligentSeparator else1 = _intelligentSeparator;
- _builder.newLineIfNotEmpty();
- {
- for(final ActorClass oa : opt) {
- _builder.append("\t\t");
- _builder.append(else1, " ");
- _builder.append("if (optionalActorClass.equals(\"");
- String _name_13 = oa.getName();
- _builder.append(_name_13, " ");
- _builder.append("\")) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- IntelligentSeparator _intelligentSeparator_1 = new IntelligentSeparator("else ");
- final IntelligentSeparator else2 = _intelligentSeparator_1;
- _builder.newLineIfNotEmpty();
- {
- EList<ActorClass> _subClasses = root.getSubClasses(oa);
- List<ActorClass> _union = this._roomExtensions.<ActorClass>union(_subClasses, oa);
- final Function1<ActorClass,Boolean> _function_3 = new Function1<ActorClass,Boolean>() {
- public Boolean apply(final ActorClass s) {
- boolean _isAbstract = s.isAbstract();
- boolean _not = (!_isAbstract);
- return Boolean.valueOf(_not);
- }
- };
- Iterable<ActorClass> _filter_1 = IterableExtensions.<ActorClass>filter(_union, _function_3);
- for(final ActorClass subcls : _filter_1) {
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append(else2, " ");
- _builder.append("if (\"");
- String _name_14 = subcls.getName();
- _builder.append(_name_14, " ");
- _builder.append("\".equals(actorClass)) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("return new ");
- String _javaFactoryName = this._javaExtensions.getJavaFactoryName(subcls);
- _builder.append(_javaFactoryName, " ");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("�val else1 = new IntelligentSeparator(\"else \")�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR oa : opt�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�else1�if (optionalActorClass.equals(\"�oa.name�\")) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�val else2 = new IntelligentSeparator(\"else \")�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�FOR subcls : root.getSubClasses(oa).union(oa).filter(s|!s.abstract)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�else2�if (\"�subcls.name�\".equals(actorClass)) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("return new �subcls.javaFactoryName�();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.java
index 91a78a189..5572b8b88 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.java
@@ -14,13 +14,11 @@ import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.Collection;
import java.util.List;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.etmap.util.ETMapUtil;
import org.eclipse.etrice.core.etphys.eTPhys.NodeRef;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.genmodel.etricegen.StructureInstance;
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
-import org.eclipse.etrice.core.genmodel.etricegen.SystemInstance;
import org.eclipse.etrice.core.room.SubSystemClass;
import org.eclipse.etrice.generator.base.IGeneratorFileIo;
import org.eclipse.etrice.generator.generic.RoomExtensions;
@@ -85,36 +83,25 @@ public class NodeRunnerGen {
_builder.append("*");
_builder.newLine();
_builder.append(" ");
- _builder.append("* this class contains the main function running component ");
- String _name = ssc.getName();
- _builder.append(_name, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("* this class contains the main function running component �ssc.name�");
+ _builder.newLine();
_builder.append(" ");
- _builder.append("* it instantiates ");
- String _name_1 = ssc.getName();
- _builder.append(_name_1, " ");
- _builder.append(" and starts and ends the lifecycle");
- _builder.newLineIfNotEmpty();
+ _builder.append("* it instantiates �ssc.name� and starts and ends the lifecycle");
+ _builder.newLine();
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
_builder.newLine();
- _builder.append("package ");
- String _package = this.roomExt.getPackage(cc);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �cc.getPackage()�;");
+ _builder.newLine();
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.RTSystem;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.SubSystemRunnerBase;");
_builder.newLine();
_builder.newLine();
- _builder.append("class ");
- String _plus = (clsname + "Runner");
- _builder.append(_plus, "");
- _builder.append(" extends SubSystemRunnerBase {");
- _builder.newLineIfNotEmpty();
+ _builder.append("class �clsname+\"Runner\"� extends SubSystemRunnerBase {");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("/**");
@@ -135,30 +122,11 @@ public class NodeRunnerGen {
_builder.append("// instantiate the main component");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("RTSystem sys = ");
- {
- EObject _eContainer = ssc.eContainer();
- if ((_eContainer instanceof SystemInstance)) {
- _builder.append("new RTSystem(\"");
- EObject _eContainer_1 = ssc.eContainer();
- String _name_2 = ((SystemInstance) _eContainer_1).getName();
- _builder.append(_name_2, " ");
- _builder.append("\")");
- } else {
- _builder.append("null");
- }
- }
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("RTSystem sys = �IF ssc.eContainer instanceof SystemInstance�new RTSystem(\"�(ssc.eContainer as SystemInstance).name�\")�ELSE�null�ENDIF�;");
+ _builder.newLine();
_builder.append("\t\t");
- _builder.append(clsname, " ");
- _builder.append(" main_component = new ");
- _builder.append(clsname, " ");
- _builder.append("(sys, \"");
- String _name_3 = ssc.getName();
- _builder.append(_name_3, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
+ _builder.append("�clsname� main_component = new �clsname�(sys, \"�ssc.name�\");");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
index 871cbb72e..fbb599471 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorFactoryGen.java
@@ -1,22 +1,14 @@
package org.eclipse.etrice.generator.java.gen;
-import com.google.common.base.Objects;
import com.google.inject.Inject;
import java.util.HashMap;
-import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.genmodel.etricegen.InterfaceItemInstance;
-import org.eclipse.etrice.core.genmodel.etricegen.OpenBinding;
-import org.eclipse.etrice.core.genmodel.etricegen.OpenServiceConnection;
import org.eclipse.etrice.core.genmodel.etricegen.OptionalActorInstance;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.genmodel.etricegen.WiredActorClass;
import org.eclipse.etrice.core.genmodel.etricegen.WiredStructureClass;
import org.eclipse.etrice.core.room.ActorClass;
-import org.eclipse.etrice.core.room.CommunicationType;
-import org.eclipse.etrice.core.room.Port;
-import org.eclipse.etrice.core.room.ProtocolClass;
-import org.eclipse.etrice.core.room.util.RoomHelpers;
import org.eclipse.etrice.generator.base.IGeneratorFileIo;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.java.gen.JavaExtensions;
@@ -80,20 +72,11 @@ public class OptionalActorFactoryGen {
final ActorClass ac = oi.getActorClass();
final String clsname = this._javaExtensions.getJavaFactoryName(ac);
StringConcatenation _builder = new StringConcatenation();
- _builder.append("package ");
- String _package = this._roomExtensions.getPackage(ac);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("import ");
- String _package_1 = this._roomExtensions.getPackage(ac);
- _builder.append(_package_1, "");
- _builder.append(".");
- String _name = ac.getName();
- _builder.append(_name, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �ac.package�;");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("import �ac.package�.�ac.name�;");
+ _builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.OptionalActorInterfaceBase;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.IOptionalActorFactory;");
@@ -101,114 +84,51 @@ public class OptionalActorFactoryGen {
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase;");
_builder.newLine();
_builder.newLine();
- _builder.append("public class ");
- _builder.append(clsname, "");
- _builder.append(" implements IOptionalActorFactory {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public class �clsname� implements IOptionalActorFactory {");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- _builder.append("public ");
- String _name_1 = ac.getName();
- _builder.append(_name_1, " ");
- _builder.append(" create(OptionalActorInterfaceBase ai, String name) {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public �ac.name� create(OptionalActorInterfaceBase ai, String name) {");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("// instantiate sub tree");
_builder.newLine();
_builder.append("\t\t");
- String _name_2 = ac.getName();
- _builder.append(_name_2, " ");
- _builder.append(" actor = new ");
- String _name_3 = ac.getName();
- _builder.append(_name_3, " ");
- _builder.append("(ai, name);");
- _builder.newLineIfNotEmpty();
+ _builder.append("�ac.name� actor = new �ac.name�(ai, name);");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// wiring");
_builder.newLine();
- {
- List<Port> _allEndPorts = RoomHelpers.getAllEndPorts(ac);
- final Function1<Port,Boolean> _function = new Function1<Port,Boolean>() {
- public Boolean apply(final Port p) {
- boolean _isExternal = RoomHelpers.isExternal(p);
- return Boolean.valueOf(_isExternal);
- }
- };
- Iterable<Port> _filter = IterableExtensions.<Port>filter(_allEndPorts, _function);
- for(final Port port : _filter) {
- _builder.append("\t\t");
- String _xifexpression = null;
- boolean _isDataDriven = RoomHelpers.isDataDriven(port);
- if (_isDataDriven) {
- _xifexpression = "DataPortBase";
- } else {
- _xifexpression = "InterfaceItemBase";
- }
- _builder.append(_xifexpression, " ");
- _builder.append(".connect(ai, \"");
- String _name_4 = port.getName();
- _builder.append(_name_4, " ");
- _builder.append("\", name+\"/");
- String _name_5 = port.getName();
- _builder.append(_name_5, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EList<OpenBinding> _openBindings = wired.getOpenBindings();
- for(final OpenBinding open : _openBindings) {
- _builder.append("\t\t");
- String _xifexpression_1 = null;
- Port _port = open.getPort();
- boolean _isDataDriven_1 = RoomHelpers.isDataDriven(_port);
- if (_isDataDriven_1) {
- _xifexpression_1 = "DataPortBase";
- } else {
- _xifexpression_1 = "InterfaceItemBase";
- }
- _builder.append(_xifexpression_1, " ");
- _builder.append(".connect(ai, \"");
- Port _port_1 = open.getPort();
- String _name_6 = _port_1.getName();
- _builder.append(_name_6, " ");
- _builder.append("\", name+\"/");
- EList<String> _path = open.getPath();
- String _join = IterableExtensions.join(_path, "/");
- _builder.append(_join, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EList<OpenServiceConnection> _requiredServices = wired.getRequiredServices();
- for(final OpenServiceConnection req : _requiredServices) {
- _builder.append("\t\t");
- String _xifexpression_2 = null;
- ProtocolClass _protocol = req.getProtocol();
- CommunicationType _commType = _protocol.getCommType();
- boolean _equals = Objects.equal(_commType, CommunicationType.DATA_DRIVEN);
- if (_equals) {
- _xifexpression_2 = "DataPortBase";
- } else {
- _xifexpression_2 = "InterfaceItemBase";
- }
- _builder.append(_xifexpression_2, " ");
- _builder.append(".connect(ai, \"");
- ProtocolClass _protocol_1 = req.getProtocol();
- String _fullyQualifiedName = this._roomExtensions.getFullyQualifiedName(_protocol_1);
- _builder.append(_fullyQualifiedName, " ");
- _builder.append("\", name+\"/");
- EList<String> _path_1 = req.getPath();
- String _join_1 = IterableExtensions.join(_path_1, "/");
- _builder.append(_join_1, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR port: RoomHelpers::getAllEndPorts(ac).filter(p|RoomHelpers::isExternal(p))�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�if (RoomHelpers::isDataDriven(port)) \"DataPortBase\" else \"InterfaceItemBase\"�.connect(ai, \"�port.name�\", name+\"/�port.name�\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR open: wired.openBindings�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�if (RoomHelpers::isDataDriven(open.port)) \"DataPortBase\" else \"InterfaceItemBase\"�.connect(ai, \"�open.port.name�\", name+\"/�open.path.join(\'/\')�\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR req: wired.requiredServices�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�if (req.protocol.commType==CommunicationType::DATA_DRIVEN) \"DataPortBase\" else \"InterfaceItemBase\"�.connect(ai, \"�req.protocol.fullyQualifiedName�\", name+\"/�req.path.join(\'/\')�\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java
index 779682baf..4fac98784 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/OptionalActorInterfaceGen.java
@@ -12,17 +12,12 @@ package org.eclipse.etrice.generator.java.gen;
import com.google.inject.Inject;
import com.google.inject.Singleton;
-import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
import org.eclipse.etrice.core.room.ActorClass;
-import org.eclipse.etrice.core.room.Port;
-import org.eclipse.etrice.core.room.util.RoomHelpers;
import org.eclipse.etrice.generator.base.IGeneratorFileIo;
import org.eclipse.etrice.generator.generic.GenericActorClassGenerator;
import org.eclipse.etrice.generator.generic.RoomExtensions;
-import org.eclipse.etrice.generator.java.Main;
-import org.eclipse.etrice.generator.java.gen.GlobalSettings;
import org.eclipse.etrice.generator.java.gen.JavaExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Extension;
@@ -73,149 +68,115 @@ public class OptionalActorInterfaceGen extends GenericActorClassGenerator {
}
final String baseClass = _xifexpression;
StringConcatenation _builder = new StringConcatenation();
- _builder.append("package ");
- String _package = this._roomExtensions.getPackage(ac);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �ac.getPackage�;");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
_builder.newLine();
- {
- GlobalSettings _settings = Main.getSettings();
- boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation();
- if (_generateMSCInstrumentation) {
- _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
- _builder.newLine();
- }
- }
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.IEventReceiver;");
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBroker;");
_builder.newLine();
- _builder.append("import org.eclipse.etrice.runtime.java.modelbase.");
- _builder.append(baseClass, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("class ");
- String _javaInterfaceName = this._javaExtensions.getJavaInterfaceName(ac, replicated);
- _builder.append(_javaInterfaceName, "");
- _builder.append(" extends ");
- _builder.append(baseClass, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
+ _builder.append("import org.eclipse.etrice.runtime.java.modelbase.�baseClass�;");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("class �ac.getJavaInterfaceName(replicated)� extends �baseClass� {");
+ _builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- brokers for ports on the interface");
_builder.newLine();
- {
- List<Port> _allInterfacePorts = RoomHelpers.getAllInterfacePorts(ac);
- for(final Port ep : _allInterfacePorts) {
- _builder.append("\t");
- _builder.append("protected InterfaceItemBroker ");
- String _name = ep.getName();
- _builder.append(_name, " ");
- _builder.append(" = null;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR ep : ac.allInterfacePorts�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected InterfaceItemBroker �ep.name� = null;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- interface item IDs");
_builder.newLine();
_builder.append("\t");
- String _genInterfaceItemConstantsForOptionalActor = this.genInterfaceItemConstantsForOptionalActor(ac);
- _builder.append(_genInterfaceItemConstantsForOptionalActor, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�ac.genInterfaceItemConstantsForOptionalActor�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("//--------------------- construction");
_builder.newLine();
_builder.append("\t");
- _builder.append("public ");
- String _javaInterfaceName_1 = this._javaExtensions.getJavaInterfaceName(ac, replicated);
- _builder.append(_javaInterfaceName_1, " ");
- _builder.append(" (IEventReceiver parent, String name) {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public �ac.getJavaInterfaceName(replicated)� (IEventReceiver parent, String name) {");
+ _builder.newLine();
_builder.append("\t\t");
- _builder.append("super(parent, name, \"");
- String _name_1 = ac.getName();
- _builder.append(_name_1, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
+ _builder.append("super(parent, name, \"�ac.name�\");");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
- {
- List<Port> _allInterfacePorts_1 = RoomHelpers.getAllInterfacePorts(ac);
- for(final Port ep_1 : _allInterfacePorts_1) {
- {
- boolean _isReplicated = ep_1.isReplicated();
- if (_isReplicated) {
- _builder.append("\t\t");
- String _name_2 = ep_1.getName();
- _builder.append(_name_2, " ");
- _builder.append(" = new ReplicatedInterfaceItemBroker(this, \"");
- String _name_3 = ep_1.getName();
- _builder.append(_name_3, " ");
- _builder.append("\", IFITEM_");
- String _name_4 = ep_1.getName();
- _builder.append(_name_4, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t\t");
- String _name_5 = ep_1.getName();
- _builder.append(_name_5, " ");
- _builder.append(" = new InterfaceItemBroker(this, \"");
- String _name_6 = ep_1.getName();
- _builder.append(_name_6, " ");
- _builder.append("\", IFITEM_");
- String _name_7 = ep_1.getName();
- _builder.append(_name_7, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR ep : ac.allInterfacePorts�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF ep.replicated�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ep.name� = new ReplicatedInterfaceItemBroker(this, \"�ep.name�\", IFITEM_�ep.name�);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ep.name� = new InterfaceItemBroker(this, \"�ep.name�\", IFITEM_�ep.name�);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
- {
- GlobalSettings _settings_1 = Main.getSettings();
- boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_1) {
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("@Override");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("protected void logCreation(String actorClass, String name) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("@Override");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("protected void logDeletion(String name) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addMessageActorDestroy(this, name);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@Override");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected void logCreation(String actorClass, String name) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageActorCreate(this, actorClass, name);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@Override");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected void logDeletion(String name) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageActorDestroy(this, name);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_xblockexpression = (_builder);
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java
index 3ccec30ae..f49454354 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java
@@ -17,16 +17,12 @@ import java.util.List;
import org.eclipse.emf.common.util.EList;
import org.eclipse.etrice.core.genmodel.base.ILogger;
import org.eclipse.etrice.core.genmodel.etricegen.Root;
-import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.CommunicationType;
import org.eclipse.etrice.core.room.DataClass;
import org.eclipse.etrice.core.room.DataType;
-import org.eclipse.etrice.core.room.DetailCode;
import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.core.room.MessageHandler;
import org.eclipse.etrice.core.room.PortClass;
-import org.eclipse.etrice.core.room.PortOperation;
-import org.eclipse.etrice.core.room.PrimitiveType;
import org.eclipse.etrice.core.room.ProtocolClass;
import org.eclipse.etrice.core.room.RefableType;
import org.eclipse.etrice.core.room.RoomModel;
@@ -37,9 +33,7 @@ import org.eclipse.etrice.generator.generic.GenericProtocolClassGenerator;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.generic.TypeHelpers;
-import org.eclipse.etrice.generator.java.Main;
import org.eclipse.etrice.generator.java.gen.DataClassGen;
-import org.eclipse.etrice.generator.java.gen.GlobalSettings;
import org.eclipse.etrice.generator.java.gen.Initialization;
import org.eclipse.etrice.generator.java.gen.JavaExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
@@ -129,11 +123,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
public CharSequence generate(final Root root, final ProtocolClass pc) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("package ");
- String _package = this._roomExtensions.getPackage(pc);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �pc.getPackage()�;");
+ _builder.newLine();
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.messaging.Message;");
_builder.newLine();
@@ -149,74 +140,42 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.modelbase.ReplicatedPortBase;");
_builder.newLine();
- {
- GlobalSettings _settings = Main.getSettings();
- boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation();
- if (_generateMSCInstrumentation) {
- _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
- _builder.newLine();
- }
- }
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import org.eclipse.etrice.runtime.java.debugging.DebuggingService;");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;");
_builder.newLine();
_builder.newLine();
- CharSequence _userCode = this._procedureHelpers.userCode(pc, 1);
- _builder.append(_userCode, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�pc.userCode(1)�");
_builder.newLine();
- EList<RoomModel> models = root.getReferencedModels(pc);
- _builder.newLineIfNotEmpty();
- {
- for(final RoomModel model : models) {
- _builder.append("import ");
- String _name = model.getName();
- _builder.append(_name, "");
- _builder.append(".*;");
- _builder.newLineIfNotEmpty();
- }
- }
_builder.newLine();
- _builder.append("public class ");
- String _name_1 = pc.getName();
- _builder.append(_name_1, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
+ _builder.append("�var models = root.getReferencedModels(pc)�");
+ _builder.newLine();
+ _builder.append("�FOR model : models�import �model.name�.*;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("public class �pc.name� {");
+ _builder.newLine();
_builder.append("\t");
_builder.append("// message IDs");
_builder.newLine();
_builder.append("\t");
- String _genMessageIDs = this.genMessageIDs(pc);
- _builder.append(_genMessageIDs, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�genMessageIDs(pc)�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t");
- CharSequence _userCode_1 = this._procedureHelpers.userCode(pc, 2);
- _builder.append(_userCode_1, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�pc.userCode(2)�");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t");
- _builder.append("private static String messageStrings[] = {\"MIN\", ");
- {
- List<Message> _allOutgoingMessages = RoomHelpers.getAllOutgoingMessages(pc);
- for(final Message m : _allOutgoingMessages) {
- _builder.append("\"");
- String _name_2 = m.getName();
- _builder.append(_name_2, " ");
- _builder.append("\",");
- }
- }
- _builder.append(" ");
- {
- List<Message> _allIncomingMessages = RoomHelpers.getAllIncomingMessages(pc);
- for(final Message m_1 : _allIncomingMessages) {
- _builder.append("\"");
- String _name_3 = m_1.getName();
- _builder.append(_name_3, " ");
- _builder.append("\",");
- }
- }
- _builder.append("\"MAX\"};");
- _builder.newLineIfNotEmpty();
+ _builder.append("private static String messageStrings[] = {\"MIN\", �FOR m : pc.getAllOutgoingMessages()�\"�m.name�\",�ENDFOR� �FOR m : pc.getAllIncomingMessages()�\"�m.name�\",�ENDFOR�\"MAX\"};");
+ _builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("public String getMessageString(int msg_id) {");
@@ -247,13 +206,11 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.newLine();
_builder.newLine();
_builder.append("\t");
- CharSequence _portClass = this.portClass(pc, Boolean.valueOf(false));
- _builder.append(_portClass, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�portClass(pc, false)�");
+ _builder.newLine();
_builder.append("\t");
- CharSequence _portClass_1 = this.portClass(pc, Boolean.valueOf(true));
- _builder.append(_portClass_1, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�portClass(pc, true)�");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
return _builder;
@@ -266,371 +223,363 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
String portClassName = this._roomExtensions.getPortClassName(pc, (conj).booleanValue());
String replPortClassName = this._roomExtensions.getPortClassName(pc, (conj).booleanValue(), true);
StringConcatenation _builder = new StringConcatenation();
+ _builder.append("\t\t");
_builder.newLine();
+ _builder.append("\t\t");
_builder.append("// port class");
_builder.newLine();
- _builder.append("static public class ");
- _builder.append(portClassName, "");
- _builder.append(" extends PortBase {");
- _builder.newLineIfNotEmpty();
- {
- boolean _notEquals = (!Objects.equal(pclass, null));
- if (_notEquals) {
- _builder.append("\t");
- DetailCode _userCode = pclass.getUserCode();
- CharSequence _userCode_1 = this._procedureHelpers.userCode(_userCode);
- _builder.append(_userCode_1, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
+ _builder.append("\t\t");
+ _builder.append("static public class �portClassName� extends PortBase {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF pclass!=null�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�pclass.userCode.userCode�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("// constructors");
_builder.newLine();
- _builder.append("\t");
- _builder.append("public ");
- _builder.append(portClassName, " ");
- _builder.append("(IInterfaceItemOwner actor, String name, int localId) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
+ _builder.append("\t\t\t");
+ _builder.append("public �portClassName�(IInterfaceItemOwner actor, String name, int localId) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
_builder.append("this(actor, name, localId, 0);");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
- _builder.append("\t");
- _builder.append("public ");
- _builder.append(portClassName, " ");
- _builder.append("(IInterfaceItemOwner actor, String name, int localId, int idx) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
+ _builder.append("\t\t\t");
+ _builder.append("public �portClassName�(IInterfaceItemOwner actor, String name, int localId, int idx) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
_builder.append("super(actor, name, localId, idx);");
_builder.newLine();
- {
- boolean _notEquals_1 = (!Objects.equal(pclass, null));
- if (_notEquals_1) {
- _builder.append("\t\t");
- EList<Attribute> _attributes = pclass.getAttributes();
- CharSequence _attributeInitialization = this._initialization.attributeInitialization(_attributes, pclass, true);
- _builder.append(_attributeInitialization, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- GlobalSettings _settings = Main.getSettings();
- boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation();
- if (_generateMSCInstrumentation) {
- _builder.append("\t\t");
- _builder.append("DebuggingService.getInstance().addPortInstance(this);");
- _builder.newLine();
- }
- }
- _builder.append("\t");
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF pclass!=null�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�pclass.attributes.attributeInitialization(pclass, true)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().addPortInstance(this);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
- {
- GlobalSettings _settings_1 = Main.getSettings();
- boolean _generateMSCInstrumentation_1 = _settings_1.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_1) {
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("public void destroy() {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().removePortInstance(this);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("super.destroy();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("public void destroy() {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().removePortInstance(this);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("super.destroy();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("@Override");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.append("public void receive(Message m) {");
_builder.newLine();
- _builder.append("\t\t");
+ _builder.append("\t\t\t\t");
_builder.append("if (!(m instanceof EventMessage))");
_builder.newLine();
- _builder.append("\t\t\t");
+ _builder.append("\t\t\t\t\t");
_builder.append("return;");
_builder.newLine();
- _builder.append("\t\t");
+ _builder.append("\t\t\t\t");
_builder.append("EventMessage msg = (EventMessage) m;");
_builder.newLine();
- _builder.append("\t\t");
+ _builder.append("\t\t\t\t");
_builder.append("if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) {");
_builder.newLine();
- {
- GlobalSettings _settings_2 = Main.getSettings();
- boolean _generateMSCInstrumentation_2 = _settings_2.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_2) {
- _builder.append("\t\t\t");
- _builder.append("DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);");
- _builder.newLine();
- }
- }
- {
- boolean _handlesReceive = this._roomExtensions.handlesReceive(pc, (conj).booleanValue());
- if (_handlesReceive) {
- _builder.append("\t\t\t");
- _builder.append("switch (msg.getEvtId()) {");
- _builder.newLine();
- {
- List<MessageHandler> _receiveHandlers = this._roomExtensions.getReceiveHandlers(pc, (conj).booleanValue());
- for(final MessageHandler hdlr : _receiveHandlers) {
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("case ");
- Message _msg = hdlr.getMsg();
- String _codeName = this._roomExtensions.getCodeName(_msg);
- _builder.append(_codeName, " ");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("{");
- _builder.newLine();
- {
- DetailCode _detailCode = hdlr.getDetailCode();
- EList<String> _lines = _detailCode.getLines();
- for(final String command : _lines) {
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("\t");
- _builder.append(command, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("default:");
- _builder.newLine();
- }
- }
- _builder.append("\t\t\t");
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF pc.handlesReceive(conj)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("switch (msg.getEvtId()) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�FOR hdlr : pc.getReceiveHandlers(conj)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("case �hdlr.msg.getCodeName()�:");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("�FOR command : hdlr.detailCode.lines�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t\t");
+ _builder.append("�command�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("break;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("default:");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
_builder.append("if (msg instanceof EventWithDataMessage)");
_builder.newLine();
- _builder.append("\t\t\t\t");
+ _builder.append("\t\t\t\t\t\t");
_builder.append("getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData());");
_builder.newLine();
- _builder.append("\t\t\t");
+ _builder.append("\t\t\t\t\t");
_builder.append("else");
_builder.newLine();
- _builder.append("\t\t\t\t");
+ _builder.append("\t\t\t\t\t\t");
_builder.append("getActor().receiveEvent(this, msg.getEvtId(), null);");
_builder.newLine();
- {
- boolean _handlesReceive_1 = this._roomExtensions.handlesReceive(pc, (conj).booleanValue());
- if (_handlesReceive_1) {
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t\t");
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF pc.handlesReceive(conj)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
_builder.append("}");
_builder.newLine();
+ _builder.append("\t\t");
_builder.append("}");
_builder.newLine();
+ _builder.append("\t\t");
_builder.newLine();
- {
- boolean _notEquals_2 = (!Objects.equal(pclass, null));
- if (_notEquals_2) {
- _builder.append("\t");
- EList<Attribute> _attributes_1 = pclass.getAttributes();
- CharSequence _attributes_2 = this._procedureHelpers.attributes(_attributes_1);
- _builder.append(_attributes_2, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- EList<Attribute> _attributes_3 = pclass.getAttributes();
- CharSequence _attributeSettersGettersImplementation = this._procedureHelpers.attributeSettersGettersImplementation(_attributes_3, null);
- _builder.append(_attributeSettersGettersImplementation, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- EList<PortOperation> _operations = pclass.getOperations();
- CharSequence _operationsImplementation = this._procedureHelpers.operationsImplementation(_operations, portClassName);
- _builder.append(_operationsImplementation, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
+ _builder.append("\t\t\t");
+ _builder.append("�IF pclass!=null�");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t\t");
+ _builder.append("�pclass.attributes.attributes�");
+ _builder.newLine();
+ _builder.append("���\t\t\t\t// TODO JH: Avoid collision attr getters/setter <-> user operations");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�attributeSettersGettersImplementation(pclass.attributes, null)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�pclass.operations.operationsImplementation(portClassName)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("// sent messages");
_builder.newLine();
- {
- List<Message> _allMessages = RoomHelpers.getAllMessages(pc, (conj).booleanValue());
- for(final Message m : _allMessages) {
- _builder.append("\t");
- CharSequence _sendMessage = this.sendMessage(m, (conj).booleanValue());
- _builder.append(_sendMessage, " ");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("�FOR m : pc.getAllMessages(conj)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�sendMessage(m, conj)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
_builder.append("}");
_builder.newLine();
+ _builder.append("\t\t");
_builder.newLine();
+ _builder.append("\t\t");
_builder.append("// replicated port class");
_builder.newLine();
- _builder.append("static public class ");
- _builder.append(replPortClassName, "");
- _builder.append(" extends ReplicatedPortBase {");
- _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("static public class �replPortClassName� extends ReplicatedPortBase {");
_builder.newLine();
- _builder.append("\t");
- _builder.append("public ");
- _builder.append(replPortClassName, " ");
- _builder.append("(IInterfaceItemOwner actor, String name, int localId) {");
- _builder.newLineIfNotEmpty();
_builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public �replPortClassName�(IInterfaceItemOwner actor, String name, int localId) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
_builder.append("super(actor, name, localId);");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.append("public int getReplication() {");
_builder.newLine();
- _builder.append("\t\t");
+ _builder.append("\t\t\t\t");
_builder.append("return getNInterfaceItems();");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.append("public int getIndexOf(InterfaceItemBase ifitem){");
_builder.newLine();
- _builder.append("\t\t\t");
+ _builder.append("\t\t\t\t\t");
_builder.append("return ifitem.getIdx();");
_builder.newLine();
- _builder.append("\t\t");
+ _builder.append("\t\t\t\t");
_builder.append("}");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.newLine();
- _builder.append("\t");
- _builder.append("public ");
- _builder.append(portClassName, " ");
- _builder.append(" get(int idx) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("return (");
- _builder.append(portClassName, " ");
- _builder.append(") getInterfaceItem(idx);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
+ _builder.append("\t\t\t");
+ _builder.append("public �portClassName� get(int idx) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("return (�portClassName�) getInterfaceItem(idx);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.append("protected InterfaceItemBase createInterfaceItem(IInterfaceItemOwner rcv, String name, int lid, int idx) {");
_builder.newLine();
- _builder.append("\t\t");
- _builder.append("return new ");
- _builder.append(portClassName, " ");
- _builder.append("(rcv, name, lid, idx);");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
+ _builder.append("\t\t\t\t");
+ _builder.append("return new �portClassName�(rcv, name, lid, idx);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t\t");
_builder.newLine();
- {
- if ((conj).booleanValue()) {
- _builder.append("\t");
- _builder.append("// incoming messages");
- _builder.newLine();
- {
- List<Message> _allIncomingMessages = RoomHelpers.getAllIncomingMessages(pc);
- for(final Message m_1 : _allIncomingMessages) {
- _builder.append("\t");
- CharSequence _messageSignature = this.messageSignature(m_1);
- _builder.append(_messageSignature, " ");
- _builder.append("{");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("for (InterfaceItemBase item : getItems()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("((");
- _builder.append(portClassName, " ");
- _builder.append(")item).");
- CharSequence _messageCall = this.messageCall(m_1);
- _builder.append(_messageCall, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- } else {
- _builder.append("\t");
- _builder.append("// outgoing messages");
- _builder.newLine();
- {
- List<Message> _allOutgoingMessages = RoomHelpers.getAllOutgoingMessages(pc);
- for(final Message m_2 : _allOutgoingMessages) {
- _builder.append("\t");
- CharSequence _messageSignature_1 = this.messageSignature(m_2);
- _builder.append(_messageSignature_1, " ");
- _builder.append("{");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("for (InterfaceItemBase item : getItems()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("((");
- _builder.append(portClassName, " ");
- _builder.append(")item).");
- CharSequence _messageCall_1 = this.messageCall(m_2);
- _builder.append(_messageCall_1, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("�IF conj�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("// incoming messages");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�FOR m : pc.getAllIncomingMessages()�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�messageSignature(m)�{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("for (InterfaceItemBase item : getItems()) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("((�portClassName�)item).�messageCall(m)�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("// outgoing messages");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�FOR m : pc.getAllOutgoingMessages()�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�messageSignature(m)�{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("for (InterfaceItemBase item : getItems()) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("((�portClassName�)item).�messageCall(m)�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
_builder.append("}");
_builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("���\t\t// interface for port class");
+ _builder.newLine();
+ _builder.append("���\t\tpublic interface I�name�{");
+ _builder.newLine();
+ _builder.append("���\t\t\t�IF conj�");
+ _builder.newLine();
+ _builder.append("���\t\t\t// outgoing messages");
+ _builder.newLine();
+ _builder.append("���\t\t\t�FOR m : pc.getAllOutgoingMessages()� �messageSignature(m)�;");
+ _builder.newLine();
+ _builder.append("���\t\t\t�ENDFOR�");
+ _builder.newLine();
+ _builder.append("���\t\t\t�ELSE�");
+ _builder.newLine();
+ _builder.append("���\t\t\t// incoming messages");
+ _builder.newLine();
+ _builder.append("���\t\t\t�FOR m : pc.getAllIncomingMessages()� �messageSignature(m)�;");
+ _builder.newLine();
+ _builder.append("���\t\t\t�ENDFOR�");
+ _builder.newLine();
+ _builder.append("���\t\t\t�ENDIF�");
+ _builder.newLine();
+ _builder.append("���\t\t}");
_builder.newLine();
_xblockexpression = (_builder);
}
@@ -639,34 +588,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
public CharSequence messageSignature(final Message m) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _isPriv = m.isPriv();
- if (_isPriv) {
- _builder.append("private");
- } else {
- _builder.append("public");
- }
- }
- _builder.append(" void ");
- String _name = m.getName();
- _builder.append(_name, "");
- _builder.append("(");
- {
- VarDecl _data = m.getData();
- boolean _notEquals = (!Objects.equal(_data, null));
- if (_notEquals) {
- VarDecl _data_1 = m.getData();
- RefableType _refType = _data_1.getRefType();
- DataType _type = _refType.getType();
- String _typeName = this._typeHelpers.typeName(_type);
- _builder.append(_typeName, "");
- _builder.append(" ");
- VarDecl _data_2 = m.getData();
- String _name_1 = _data_2.getName();
- _builder.append(_name_1, "");
- }
- }
- _builder.append(")");
+ _builder.append("�IF m.priv�private�ELSE�public�ENDIF� void �m.name�(�IF m.data!=null��m.data.refType.type.typeName� �m.data.name��ENDIF�)");
return _builder;
}
@@ -678,13 +600,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
DataType _type = _refType.getType();
DataClass dc = ((DataClass) _type);
StringConcatenation _builder = new StringConcatenation();
- _builder.append("public void ");
- String _name = m.getName();
- _builder.append(_name, "");
- _builder.append("(");
- String _argList = this._dataClassGen.argList(dc);
- _builder.append(_argList, "");
- _builder.append(")");
+ _builder.append("public void �m.name�(�dc.argList�)");
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -692,20 +608,7 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
public CharSequence messageCall(final Message m) {
StringConcatenation _builder = new StringConcatenation();
- String _name = m.getName();
- _builder.append(_name, "");
- _builder.append("(");
- {
- VarDecl _data = m.getData();
- boolean _notEquals = (!Objects.equal(_data, null));
- if (_notEquals) {
- _builder.append(" ");
- VarDecl _data_1 = m.getData();
- String _name_1 = _data_1.getName();
- _builder.append(_name_1, "");
- }
- }
- _builder.append(")");
+ _builder.append("�m.name�(�IF m.data!=null� �m.data.name��ENDIF�)");
return _builder;
}
@@ -721,131 +624,65 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
String dir = _xifexpression;
MessageHandler hdlr = this._roomExtensions.getSendHandler(m, conj);
StringConcatenation _builder = new StringConcatenation();
- CharSequence _messageSignature = this.messageSignature(m);
- _builder.append(_messageSignature, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- {
- boolean _notEquals = (!Objects.equal(hdlr, null));
- if (_notEquals) {
- _builder.append("\t");
- {
- DetailCode _detailCode = hdlr.getDetailCode();
- EList<String> _lines = _detailCode.getLines();
- for(final String command : _lines) {
- _builder.append("\t");
- _builder.append(command, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- } else {
- {
- GlobalSettings _settings = Main.getSettings();
- boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation();
- if (_generateMSCInstrumentation) {
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[");
- _builder.append(dir, " ");
- _builder.append("_");
- String _name = m.getName();
- _builder.append(_name, " ");
- _builder.append("]);");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("if (getPeerAddress()!=null)");
- _builder.newLine();
- {
- VarDecl _data = m.getData();
- boolean _equals = Objects.equal(_data, null);
- if (_equals) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), ");
- _builder.append(dir, " ");
- _builder.append("_");
- String _name_1 = m.getName();
- _builder.append(_name_1, " ");
- _builder.append("));");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), ");
- _builder.append(dir, " ");
- _builder.append("_");
- String _name_2 = m.getName();
- _builder.append(_name_2, " ");
- _builder.append(", ");
- VarDecl _data_1 = m.getData();
- String _name_3 = _data_1.getName();
- _builder.append(_name_3, " ");
- {
- boolean _and = false;
- VarDecl _data_2 = m.getData();
- RefableType _refType = _data_2.getRefType();
- boolean _isRef = _refType.isRef();
- boolean _not = (!_isRef);
- if (!_not) {
- _and = false;
- } else {
- VarDecl _data_3 = m.getData();
- RefableType _refType_1 = _data_3.getRefType();
- DataType _type = _refType_1.getType();
- boolean _not_1 = (!(_type instanceof PrimitiveType));
- _and = (_not && _not_1);
- }
- if (_and) {
- _builder.append(".deepCopy()");
- }
- }
- _builder.append("));");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�messageSignature(m)� {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF hdlr!=null�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR command : hdlr.detailCode.lines�\t�command�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[�dir�_�m.name�]);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (getPeerAddress()!=null)");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF m.data==null�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), �dir�_�m.name�));");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), �dir�_�m.name�, �m.data.name��IF (!m.data.refType.ref && !(m.data.refType.type instanceof PrimitiveType))�.deepCopy()�ENDIF�));");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
- {
- boolean _and_1 = false;
- VarDecl _data_4 = m.getData();
- boolean _notEquals_1 = (!Objects.equal(_data_4, null));
- if (!_notEquals_1) {
- _and_1 = false;
- } else {
- VarDecl _data_5 = m.getData();
- RefableType _refType_2 = _data_5.getRefType();
- DataType _type_1 = _refType_2.getType();
- _and_1 = (_notEquals_1 && (_type_1 instanceof DataClass));
- }
- if (_and_1) {
- CharSequence _messageSignatureExplicit = this.messageSignatureExplicit(m);
- _builder.append(_messageSignatureExplicit, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- String _name_4 = m.getName();
- _builder.append(_name_4, " ");
- _builder.append("(new ");
- VarDecl _data_6 = m.getData();
- RefableType _refType_3 = _data_6.getRefType();
- DataType _type_2 = _refType_3.getType();
- String _name_5 = _type_2.getName();
- _builder.append(_name_5, " ");
- _builder.append("(");
- VarDecl _data_7 = m.getData();
- RefableType _refType_4 = _data_7.getRefType();
- DataType _type_3 = _refType_4.getType();
- String _paramList = this._dataClassGen.paramList(((DataClass) _type_3));
- _builder.append(_paramList, " ");
- _builder.append("));");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("�IF m.data!=null && m.data.refType.type instanceof DataClass�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�messageSignatureExplicit(m)� {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�m.name�(new �m.data.refType.type.name�(�(m.data.refType.type as DataClass).paramList�));");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -865,11 +702,8 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
final Iterable<Message> sentMsgs = IterableExtensions.<Message>filter(_allIncomingMessages, _function);
final EList<RoomModel> models = root.getReferencedModels(pc);
StringConcatenation _builder = new StringConcatenation();
- _builder.append("package ");
- String _package = this._roomExtensions.getPackage(pc);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �pc.getPackage()�;");
+ _builder.newLine();
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.messaging.IRTObject;");
_builder.newLine();
@@ -880,69 +714,49 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*;");
_builder.newLine();
_builder.newLine();
- CharSequence _userCode = this._procedureHelpers.userCode(pc, 1);
- _builder.append(_userCode, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�pc.userCode(1)�");
_builder.newLine();
- {
- for(final RoomModel model : models) {
- _builder.append("import ");
- String _name = model.getName();
- _builder.append(_name, "");
- _builder.append(".*;");
- _builder.newLineIfNotEmpty();
- }
- }
_builder.newLine();
- _builder.append("public class ");
- String _name_1 = pc.getName();
- _builder.append(_name_1, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
+ _builder.append("�FOR model : models�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import �model.name�.*;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("public class �pc.name� {");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- CharSequence _userCode_1 = this._procedureHelpers.userCode(pc, 2);
- _builder.append(_userCode_1, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�pc.userCode(2)�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("// send port holds data");
_builder.newLine();
_builder.append("\t");
- _builder.append("static public class ");
- String _portClassName = this._roomExtensions.getPortClassName(pc, true);
- _builder.append(_portClassName, " ");
- _builder.append(" extends DataSendPort {");
- _builder.newLineIfNotEmpty();
- {
- for(final Message msg : sentMsgs) {
- _builder.append("\t\t");
- _builder.append("private ");
- VarDecl _data = msg.getData();
- RefableType _refType = _data.getRefType();
- DataType _type = _refType.getType();
- String _typeName = this._typeHelpers.typeName(_type);
- _builder.append(_typeName, " ");
- _builder.append(" ");
- String _name_2 = msg.getName();
- _builder.append(_name_2, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("static public class �pc.getPortClassName(true)� extends DataSendPort {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR msg : sentMsgs�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("private �msg.data.refType.type.typeName� �msg.name�;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// constructor");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("public ");
- String _portClassName_1 = this._roomExtensions.getPortClassName(pc, true);
- _builder.append(_portClassName_1, " ");
- _builder.append("(IRTObject parent, String name, int localId) {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public �pc.getPortClassName(true)�(IRTObject parent, String name, int localId) {");
+ _builder.newLine();
_builder.append("\t\t\t");
_builder.append("super(parent, name, localId);");
_builder.newLine();
@@ -954,60 +768,30 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t\t");
_builder.append("// getters and setters");
_builder.newLine();
- {
- for(final Message msg_1 : sentMsgs) {
- _builder.append("\t\t");
- _builder.append("public void ");
- String _name_3 = msg_1.getName();
- _builder.append(_name_3, " ");
- _builder.append("(");
- VarDecl _data_1 = msg_1.getData();
- RefableType _refType_1 = _data_1.getRefType();
- DataType _type_1 = _refType_1.getType();
- String _typeName_1 = this._typeHelpers.typeName(_type_1);
- _builder.append(_typeName_1, " ");
- _builder.append(" ");
- String _name_4 = msg_1.getName();
- _builder.append(_name_4, " ");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("this.");
- String _name_5 = msg_1.getName();
- _builder.append(_name_5, " ");
- _builder.append(" = ");
- String _name_6 = msg_1.getName();
- _builder.append(_name_6, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("public ");
- VarDecl _data_2 = msg_1.getData();
- RefableType _refType_2 = _data_2.getRefType();
- DataType _type_2 = _refType_2.getType();
- String _typeName_2 = this._typeHelpers.typeName(_type_2);
- _builder.append(_typeName_2, " ");
- _builder.append(" ");
- String _name_7 = msg_1.getName();
- _builder.append(_name_7, " ");
- _builder.append("() {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("return ");
- String _name_8 = msg_1.getName();
- _builder.append(_name_8, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR msg : sentMsgs�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public void �msg.name�(�msg.data.refType.type.typeName� �msg.name�) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("this.�msg.name� = �msg.name�;");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public �msg.data.refType.type.typeName� �msg.name�() {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("return �msg.name�;");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -1017,28 +801,19 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("// receive port accesses send port");
_builder.newLine();
_builder.append("\t");
- _builder.append("static public class ");
- String _portClassName_2 = this._roomExtensions.getPortClassName(pc, false);
- _builder.append(_portClassName_2, " ");
- _builder.append(" extends DataReceivePort {");
- _builder.newLineIfNotEmpty();
+ _builder.append("static public class �pc.getPortClassName(false)� extends DataReceivePort {");
+ _builder.newLine();
_builder.append("\t\t");
- _builder.append("private ");
- String _portClassName_3 = this._roomExtensions.getPortClassName(pc, true);
- _builder.append(_portClassName_3, " ");
- _builder.append(" peer;");
- _builder.newLineIfNotEmpty();
+ _builder.append("private �pc.getPortClassName(true)� peer;");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("// constructor");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("public ");
- String _portClassName_4 = this._roomExtensions.getPortClassName(pc, false);
- _builder.append(_portClassName_4, " ");
- _builder.append("(IRTObject parent, String name, int localId) {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public �pc.getPortClassName(false)�(IRTObject parent, String name, int localId) {");
+ _builder.newLine();
_builder.append("\t\t\t");
_builder.append("super(parent, name, localId);");
_builder.newLine();
@@ -1050,63 +825,38 @@ public class ProtocolClassGen extends GenericProtocolClassGenerator {
_builder.append("\t\t");
_builder.append("// getters");
_builder.newLine();
- {
- for(final Message msg_2 : sentMsgs) {
- _builder.append("\t\t");
- _builder.append("public ");
- VarDecl _data_3 = msg_2.getData();
- RefableType _refType_3 = _data_3.getRefType();
- DataType _type_3 = _refType_3.getType();
- String _typeName_3 = this._typeHelpers.typeName(_type_3);
- _builder.append(_typeName_3, " ");
- _builder.append(" ");
- String _name_9 = msg_2.getName();
- _builder.append(_name_9, " ");
- _builder.append("() {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("if (peer==null)");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t\t");
- _builder.append("return ");
- VarDecl _data_4 = msg_2.getData();
- RefableType _refType_4 = _data_4.getRefType();
- DataType _type_4 = _refType_4.getType();
- String _defaultValue = this._javaExtensions.defaultValue(_type_4);
- _builder.append(_defaultValue, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("return peer.");
- String _name_10 = msg_2.getName();
- _builder.append(_name_10, " ");
- _builder.append("();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR msg : sentMsgs�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("public �msg.data.refType.type.typeName� �msg.name�() {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("if (peer==null)");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("return �msg.data.refType.type.defaultValue�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("return peer.�msg.name�();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
_builder.append("protected void connect(DataSendPort dataSendPort) {");
_builder.newLine();
_builder.append("\t\t\t");
- _builder.append("if (dataSendPort instanceof ");
- String _portClassName_5 = this._roomExtensions.getPortClassName(pc, true);
- _builder.append(_portClassName_5, " ");
- _builder.append(")");
- _builder.newLineIfNotEmpty();
+ _builder.append("if (dataSendPort instanceof �pc.getPortClassName(true)�)");
+ _builder.newLine();
_builder.append("\t\t\t\t");
- _builder.append("peer = (");
- String _portClassName_6 = this._roomExtensions.getPortClassName(pc, true);
- _builder.append(_portClassName_6, " ");
- _builder.append(")dataSendPort;");
- _builder.newLineIfNotEmpty();
+ _builder.append("peer = (�pc.getPortClassName(true)�)dataSendPort;");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java
index 76a5e5430..0f353ae33 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java
@@ -18,10 +18,7 @@ import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.State;
import org.eclipse.etrice.core.room.util.RoomHelpers;
-import org.eclipse.etrice.generator.base.CodegenHelpers;
import org.eclipse.etrice.generator.generic.GenericStateMachineGenerator;
-import org.eclipse.etrice.generator.java.Main;
-import org.eclipse.etrice.generator.java.gen.GlobalSettings;
import org.eclipse.xtend2.lib.StringConcatenation;
@Singleton
@@ -47,95 +44,90 @@ public class StateMachineGen extends GenericStateMachineGenerator {
_while = _notEquals_1;
}
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _or = false;
- GlobalSettings _settings = Main.getSettings();
- boolean _generateMSCInstrumentation = _settings.generateMSCInstrumentation();
- if (_generateMSCInstrumentation) {
- _or = true;
- } else {
- GlobalSettings _settings_1 = Main.getSettings();
- boolean _generateWithVerboseOutput = _settings_1.generateWithVerboseOutput();
- _or = (_generateMSCInstrumentation || _generateWithVerboseOutput);
- }
- if (_or) {
- _builder.append("// state names");
- _builder.newLine();
- _builder.append("protected static final String stateStrings[] = {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\"<no state>\",");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\"<top>\",");
- _builder.newLine();
- {
- boolean _hasElements = false;
- for(final State state : states) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(",", " ");
- }
- _builder.append("\t");
- _builder.append("\"");
- String _genStatePathName = CodegenHelpers.getGenStatePathName(state);
- _builder.append(_genStatePathName, " ");
- _builder.append("\"");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("};");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- }
- }
- _builder.append("// history");
+ _builder.append("\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation || Main::settings.generateWithVerboseOutput�");
_builder.newLine();
- _builder.append("protected int history[] = {NO_STATE, NO_STATE");
- {
- for(final State state_1 : states) {
- _builder.append(", NO_STATE");
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("// state names");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("protected static final String stateStrings[] = {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("\"<no state>\",");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("\"<top>\",");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�FOR state : states SEPARATOR \",\"�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("\"�state.genStatePathName�\"");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("};");
- _builder.newLineIfNotEmpty();
_builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("���\t \tTODOHRR: history defined in ActorClassBase, init in constructor");
+ _builder.newLine();
+ _builder.append("���\t\t\thistory = new int[5];");
+ _builder.newLine();
+ _builder.append("���\t\t\tfor (int i = 0; i < history.length; i++) {");
+ _builder.newLine();
+ _builder.append("���\t\t\t\thistory[i] = NO_STATE;");
+ _builder.newLine();
+ _builder.append("���\t\t\t}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("// history");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("protected int history[] = {NO_STATE, NO_STATE�FOR state : states�, NO_STATE�ENDFOR�};");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
_builder.append("private void setState(int new_state) {");
_builder.newLine();
- {
- GlobalSettings _settings_2 = Main.getSettings();
- boolean _generateMSCInstrumentation_1 = _settings_2.generateMSCInstrumentation();
- if (_generateMSCInstrumentation_1) {
- _builder.append("\t");
- _builder.append("DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);");
- _builder.newLine();
- }
- }
- {
- GlobalSettings _settings_3 = Main.getSettings();
- boolean _generateWithVerboseOutput_1 = _settings_3.generateWithVerboseOutput();
- if (_generateWithVerboseOutput_1) {
- _builder.append("\t");
- _builder.append("if (stateStrings[new_state]!=\"Idle\") {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("System.out.println(\"state switch of \"+getInstancePath() + \": \"");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t\t\t");
- _builder.append("+ stateStrings[this.state] + \" -> \" + stateStrings[new_state]);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}\t");
- _builder.newLine();
- }
- }
- _builder.append("\t");
+ _builder.append("\t\t\t");
+ _builder.append("�IF Main::settings.generateMSCInstrumentation�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("DebuggingService.getInstance().addActorState(this,stateStrings[new_state]);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF Main::settings.generateWithVerboseOutput�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("if (stateStrings[new_state]!=\"Idle\") {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("System.out.println(\"state switch of \"+getInstancePath() + \": \"");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("+ stateStrings[this.state] + \" -> \" + stateStrings[new_state]);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("this.state = new_state;");
_builder.newLine();
+ _builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_xblockexpression = (_builder);
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java
index 21026709d..34f53f9c0 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/VariableServiceGen.java
@@ -14,13 +14,11 @@ import com.google.common.base.Objects;
import com.google.common.collect.Iterables;
import com.google.inject.Inject;
import com.google.inject.Singleton;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
-import java.util.Set;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.etmap.util.ETMapUtil;
@@ -43,11 +41,9 @@ import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.generic.TypeHelpers;
import org.eclipse.etrice.generator.java.gen.JavaExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Conversions;
import org.eclipse.xtext.xbase.lib.Extension;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
@Singleton
@SuppressWarnings("all")
@@ -114,12 +110,8 @@ public class VariableServiceGen {
IterableExtensions.<ActorInstance>forEach(_allContainedInstances, _function);
StringConcatenation _builder = new StringConcatenation();
_builder.newLine();
- _builder.append("package ");
- SubSystemClass _subSystemClass = comp.getSubSystemClass();
- String _package = this.roomExt.getPackage(_subSystemClass);
- _builder.append(_package, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("package �comp.subSystemClass.getPackage()�;");
+ _builder.newLine();
_builder.newLine();
_builder.append("import java.util.Arrays;");
_builder.newLine();
@@ -129,68 +121,46 @@ public class VariableServiceGen {
_builder.newLine();
_builder.append("import org.eclipse.etrice.runtime.java.config.AbstractVariableService;");
_builder.newLine();
- String _userCode1 = this.configExt.getUserCode1(comp);
- _builder.append(_userCode1, "");
- _builder.newLineIfNotEmpty();
- {
- Set<ActorInstance> _keySet = aisAttrMap.keySet();
- HashSet<RoomModel> _roomModels = this.getRoomModels(_keySet);
- for(final RoomModel model : _roomModels) {
- _builder.append("import ");
- String _name = model.getName();
- _builder.append(_name, "");
- _builder.append(".*;");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�configExt.getUserCode1(comp)�");
+ _builder.newLine();
+ _builder.append("�FOR model : aisAttrMap.keySet.roomModels�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("import �model.name�.*;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
_builder.newLine();
- _builder.append("public class ");
- _builder.append(clsname, "");
- _builder.append("VariableService extends AbstractVariableService{");
- _builder.newLineIfNotEmpty();
+ _builder.append("public class �clsname�VariableService extends AbstractVariableService{");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- _builder.append("private ");
- _builder.append(clsname, " ");
- _builder.append(" subSystem;");
- _builder.newLineIfNotEmpty();
+ _builder.append("private �clsname� subSystem;");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("// Actor instances");
_builder.newLine();
- {
- Set<ActorInstance> _keySet_1 = aisAttrMap.keySet();
- for(final ActorInstance ai : _keySet_1) {
- _builder.append("\t");
- _builder.append("private ");
- ActorClass _actorClass = ai.getActorClass();
- String _name_1 = _actorClass.getName();
- _builder.append(_name_1, " ");
- _builder.append(" ");
- CharSequence _varName = this.getVarName(ai);
- _builder.append(_varName, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR ai : aisAttrMap.keySet�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("private �ai.actorClass.name� �ai.varName�;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
- _builder.append("public ");
- _builder.append(clsname, " ");
- _builder.append("VariableService(");
- _builder.append(clsname, " ");
- _builder.append(" subSystem) {");
- _builder.newLineIfNotEmpty();
+ _builder.append("public �clsname�VariableService(�clsname� subSystem) {");
+ _builder.newLine();
_builder.append("\t\t");
- _builder.append("super(");
- String _userCode2 = this.configExt.getUserCode2(comp);
- _builder.append(_userCode2, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("super(�configExt.getUserCode2(comp)�);");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("this.subSystem = subSystem;");
_builder.newLine();
@@ -205,23 +175,15 @@ public class VariableServiceGen {
_builder.append("\t");
_builder.append("protected void initInstances(){");
_builder.newLine();
- {
- Set<ActorInstance> _keySet_2 = aisAttrMap.keySet();
- for(final ActorInstance ai_1 : _keySet_2) {
- _builder.append("\t\t");
- CharSequence _varName_1 = this.getVarName(ai_1);
- _builder.append(_varName_1, " ");
- _builder.append(" = (");
- ActorClass _actorClass_1 = ai_1.getActorClass();
- String _name_2 = _actorClass_1.getName();
- _builder.append(_name_2, " ");
- _builder.append(")subSystem.getInstance(\"");
- String _path = ai_1.getPath();
- _builder.append(_path, " ");
- _builder.append("\");");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR ai : aisAttrMap.keySet�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ai.varName� = (�ai.actorClass.name�)subSystem.getInstance(\"�ai.path�\");");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -242,83 +204,54 @@ public class VariableServiceGen {
_builder.newLine();
_builder.append("\t\t");
_builder.newLine();
- {
- Set<ActorInstance> _keySet_3 = aisAttrMap.keySet();
- for(final ActorInstance ai_2 : _keySet_3) {
- {
- List<Attribute> _get = aisAttrMap.get(ai_2);
- for(final Attribute a : _get) {
- _builder.append("\t\t");
- _builder.append("try{");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("boolean changed = false;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- ArrayList<Attribute> _arrayList = new ArrayList<Attribute>();
- List<Attribute> _union = this.roomExt.<Attribute>union(_arrayList, a);
- CharSequence _genSetAttributeValues1 = this.genSetAttributeValues1(_union, ai_2);
- _builder.append(_genSetAttributeValues1, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("if(changed)");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t\t");
- _builder.append("synchronized(");
- CharSequence _varName_2 = this.getVarName(ai_2);
- _builder.append(_varName_2, " ");
- _builder.append(".");
- String _name_3 = a.getName();
- String _plus = (_name_3 + "Lock");
- CharSequence _invokeGetter = this.helpers.invokeGetter(_plus, null);
- _builder.append(_invokeGetter, " ");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t\t\t");
- _builder.append("if(");
- CharSequence _varName_3 = this.getVarName(ai_2);
- _builder.append(_varName_3, " ");
- _builder.append(".");
- String _name_4 = a.getName();
- String _plus_1 = (_name_4 + "Lock");
- CharSequence _invokeGetter_1 = this.helpers.invokeGetter(_plus_1, null);
- _builder.append(_invokeGetter_1, " ");
- _builder.append(".isUpdate()){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t\t\t\t");
- ArrayList<Attribute> _arrayList_1 = new ArrayList<Attribute>();
- List<Attribute> _union_1 = this.roomExt.<Attribute>union(_arrayList_1, a);
- CharSequence _genSetAttributeValues2 = this.genSetAttributeValues2(_union_1, ai_2);
- _builder.append(_genSetAttributeValues2, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}catch(IllegalArgumentException e){");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("error(id, e);");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR ai : aisAttrMap.keySet�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�FOR a : aisAttrMap.get(ai)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("try{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("boolean changed = false;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�genSetAttributeValues1(new ArrayList<Attribute>.union(a), ai)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("if(changed)");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("synchronized(�ai.varName�.�invokeGetter(a.name+\"Lock\", null)�){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("if(�ai.varName�.�invokeGetter(a.name+\"Lock\", null)�.isUpdate()){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t\t");
+ _builder.append("�genSetAttributeValues2(new ArrayList<Attribute>.union(a), ai)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}catch(IllegalArgumentException e){");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("error(id, e);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -333,22 +266,21 @@ public class VariableServiceGen {
_builder.append("\t\t");
_builder.append("Map<String, Object> values = new HashMap<String, Object>();");
_builder.newLine();
- {
- Set<ActorInstance> _keySet_4 = aisAttrMap.keySet();
- for(final ActorInstance ai_3 : _keySet_4) {
- {
- List<Attribute> _get_1 = aisAttrMap.get(ai_3);
- for(final Attribute a_1 : _get_1) {
- _builder.append("\t\t");
- ArrayList<Attribute> _arrayList_2 = new ArrayList<Attribute>();
- List<Attribute> _union_2 = this.roomExt.<Attribute>union(_arrayList_2, a_1);
- CharSequence _genGetAttributeValues = this.genGetAttributeValues(_union_2, ai_3);
- _builder.append(_genGetAttributeValues, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("\t\t");
+ _builder.append("�FOR ai : aisAttrMap.keySet�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�FOR a : aisAttrMap.get(ai)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�genGetAttributeValues(new ArrayList<Attribute>.union(a), ai)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t");
_builder.newLine();
_builder.append("\t\t");
@@ -366,26 +298,20 @@ public class VariableServiceGen {
_builder.append("public void writeDataClass(String id, Object dcObject, Map<String, Object> writeMap) {");
_builder.newLine();
_builder.append("\t\t");
- Set<ActorInstance> _keySet_5 = aisAttrMap.keySet();
- HashSet<DataClass> dataClasses = this.getDynConfigDataClasses(_keySet_5);
- _builder.newLineIfNotEmpty();
- {
- for(final DataClass dc : dataClasses) {
- _builder.append("\t\t");
- _builder.append("if(dcObject.getClass().equals(");
- String _typeName = this._typeHelpers.typeName(dc);
- _builder.append(_typeName, " ");
- _builder.append(".class))");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("\t");
- _builder.append("writeDataClass(id, (");
- String _typeName_1 = this._typeHelpers.typeName(dc);
- _builder.append(_typeName_1, " ");
- _builder.append(") dcObject, writeTasks);");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�var dataClasses = aisAttrMap.keySet.dynConfigDataClasses�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR dc : dataClasses�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("if(dcObject.getClass().equals(�dc.typeName�.class))");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("writeDataClass(id, (�dc.typeName�) dcObject, writeTasks);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -396,70 +322,39 @@ public class VariableServiceGen {
_builder.newLine();
_builder.append("\t");
_builder.newLine();
- {
- HashSet<DataClass> _allDataClasses = this.getAllDataClasses(dataClasses);
- for(final DataClass dc_1 : _allDataClasses) {
- _builder.append("\t");
- _builder.append("private void writeDataClass(String id, ");
- String _typeName_2 = this._typeHelpers.typeName(dc_1);
- _builder.append(_typeName_2, " ");
- _builder.append(" object, Map<String, Object> map){");
- _builder.newLineIfNotEmpty();
- {
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(dc_1);
- for(final Attribute a_2 : _allAttributes) {
- {
- RefableType _type = a_2.getType();
- DataType _type_1 = _type.getType();
- boolean _isPrimitive = this._typeHelpers.isPrimitive(_type_1);
- if (_isPrimitive) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("map.put(id+\"/");
- String _name_5 = a_2.getName();
- _builder.append(_name_5, " ");
- _builder.append("\", ");
- {
- int _size = a_2.getSize();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("toObjectArray(");
- }
- }
- _builder.append("object.");
- String _name_6 = a_2.getName();
- CharSequence _invokeGetter_2 = this.helpers.invokeGetter(_name_6, null);
- _builder.append(_invokeGetter_2, " ");
- {
- int _size_1 = a_2.getSize();
- boolean _greaterThan_1 = (_size_1 > 0);
- if (_greaterThan_1) {
- _builder.append(")");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("writeDataClass(id+\"/");
- String _name_7 = a_2.getName();
- _builder.append(_name_7, " ");
- _builder.append("\", object.");
- String _name_8 = a_2.getName();
- CharSequence _invokeGetter_3 = this.helpers.invokeGetter(_name_8, null);
- _builder.append(_invokeGetter_3, " ");
- _builder.append(", map);");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("\t");
+ _builder.append("�FOR dc : getAllDataClasses(dataClasses)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("private void writeDataClass(String id, �dc.typeName� object, Map<String, Object> map){");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�FOR a : dc.allAttributes�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF a.type.type.primitive�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("map.put(id+\"/�a.name�\", �IF a.size>0�toObjectArray(�ENDIF�object.�invokeGetter(a.name, null)��IF a.size>0�)�ENDIF�);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("writeDataClass(id+\"/�a.name�\", object.�invokeGetter(a.name, null)�, map);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
@@ -469,11 +364,8 @@ public class VariableServiceGen {
_builder.append("protected int getPollingTimerUser(){");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("return ");
- int _pollingTimerUser = this.configExt.getPollingTimerUser(comp);
- _builder.append(_pollingTimerUser, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("return �configExt.getPollingTimerUser(comp)�;");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -504,56 +396,11 @@ public class VariableServiceGen {
}
if (_or) {
StringConcatenation _builder = new StringConcatenation();
- {
- int _size = a.getSize();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("for(");
- RefableType _type = a.getType();
- DataType _type_1 = _type.getType();
- String _typeName = this._typeHelpers.typeName(_type_1);
- _builder.append(_typeName, "");
- _builder.append(" e : ");
- _builder.append(aVarName, "");
- _builder.append(")");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- }
- }
- _builder.append("checkMinMax(");
- {
- int _size_1 = a.getSize();
- boolean _greaterThan_1 = (_size_1 > 0);
- if (_greaterThan_1) {
- _builder.append("e");
- } else {
- _builder.append(aVarName, "");
- }
- }
- _builder.append(", ");
- {
- if (min) {
- String _name = ac.getName();
- _builder.append(_name, "");
- _builder.append(".MIN");
- _builder.append(aVarName, "");
- } else {
- _builder.append("null");
- }
- }
- _builder.append(", ");
- {
- if (max) {
- String _name_1 = ac.getName();
- _builder.append(_name_1, "");
- _builder.append(".MAX");
- _builder.append(aVarName, "");
- } else {
- _builder.append("null");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("�IF a.size>0�for(�a.type.type.typeName� e : �aVarName�)");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�checkMinMax(�IF a.size>0�e�ELSE��aVarName��ENDIF�, �IF min��ac.name�.MIN�aVarName��ELSE�null�ENDIF�, �IF max��ac.name�.MAX�aVarName��ELSE�null�ENDIF�);");
+ _builder.newLine();
_xifexpression = _builder;
}
_xblockexpression = (_xifexpression);
@@ -637,33 +484,14 @@ public class VariableServiceGen {
private String toAbsolutePath(final List<Attribute> path, final String pathDelim) {
StringConcatenation _builder = new StringConcatenation();
- {
- for(final Attribute p : path) {
- _builder.append(pathDelim, "");
- String _name = p.getName();
- _builder.append(_name, "");
- }
- }
+ _builder.append("�FOR p : path��pathDelim��p.name��ENDFOR�");
String _string = _builder.toString();
return _string;
}
private CharSequence getVarName(final ActorInstance ai) {
StringConcatenation _builder = new StringConcatenation();
- {
- String _path = ai.getPath();
- String[] _split = _path.split("/");
- Iterable<String> _drop = IterableExtensions.<String>drop(((Iterable<String>)Conversions.doWrapArray(_split)), 2);
- boolean _hasElements = false;
- for(final String p : _drop) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate("_", "");
- }
- _builder.append(p, "");
- }
- }
+ _builder.append("�FOR p : ai.path.split(\'/\').drop(2) SEPARATOR \'_\'��p��ENDFOR�");
return _builder;
}
@@ -677,33 +505,8 @@ public class VariableServiceGen {
boolean _isPrimitive = this._typeHelpers.isPrimitive(_type_1);
if (_isPrimitive) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("values.put(\"");
- String _path = ai.getPath();
- _builder.append(_path, "");
- String _absolutePath = this.toAbsolutePath(path, "/");
- _builder.append(_absolutePath, "");
- _builder.append("\", ");
- {
- int _size = a.getSize();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("toObjectArray(");
- }
- }
- CharSequence _varName = this.getVarName(ai);
- _builder.append(_varName, "");
- _builder.append(".");
- CharSequence _invokeGetters = this.helpers.invokeGetters(path, null);
- _builder.append(_invokeGetters, "");
- {
- int _size_1 = a.getSize();
- boolean _greaterThan_1 = (_size_1 > 0);
- if (_greaterThan_1) {
- _builder.append(")");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("values.put(\"�ai.path��path.toAbsolutePath(\'/\')�\", �IF a.size>0�toObjectArray(�ENDIF��ai.varName�.�path.invokeGetters(null)��IF a.size>0�)�ENDIF�);");
+ _builder.newLine();
_xifexpression = _builder;
} else {
CharSequence _xifexpression_1 = null;
@@ -717,15 +520,13 @@ public class VariableServiceGen {
DataType _type_5 = _type_4.getType();
DataClass dataClass = ((DataClass) _type_5);
StringConcatenation _builder_1 = new StringConcatenation();
- {
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(dataClass);
- for(final Attribute at : _allAttributes) {
- List<Attribute> _union = this.roomExt.<Attribute>union(path, at);
- CharSequence _genGetAttributeValues = this.genGetAttributeValues(_union, ai);
- _builder_1.append(_genGetAttributeValues, "");
- _builder_1.newLineIfNotEmpty();
- }
- }
+ _builder_1.append("�FOR at : dataClass.allAttributes�");
+ _builder_1.newLine();
+ _builder_1.append("\t");
+ _builder_1.append("�genGetAttributeValues(path.union(at), ai)�");
+ _builder_1.newLine();
+ _builder_1.append("�ENDFOR�");
+ _builder_1.newLine();
_xblockexpression_1 = (_builder_1);
}
_xifexpression_1 = _xblockexpression_1;
@@ -748,104 +549,23 @@ public class VariableServiceGen {
boolean _isPrimitive = this._typeHelpers.isPrimitive(_type_1);
if (_isPrimitive) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("id = \"");
- String _path = ai.getPath();
- _builder.append(_path, "");
- String _absolutePath = this.toAbsolutePath(path, "/");
- _builder.append(_absolutePath, "");
- _builder.append("\";");
- _builder.newLineIfNotEmpty();
- {
- int _size = a.getSize();
- boolean _equals = (_size == 0);
- if (_equals) {
- RefableType _type_2 = a.getType();
- DataType _type_3 = _type_2.getType();
- String _typeName = this._typeHelpers.typeName(_type_3);
- String _wrapper = this.stdExt.toWrapper(_typeName);
- _builder.append(_wrapper, "");
- } else {
- RefableType _type_4 = a.getType();
- DataType _type_5 = _type_4.getType();
- String _typeName_1 = this._typeHelpers.typeName(_type_5);
- _builder.append(_typeName_1, "");
- _builder.append("[]");
- }
- }
- _builder.append(" ");
- _builder.append(aVarName, "");
- _builder.append(" = null;");
- _builder.newLineIfNotEmpty();
+ _builder.append("id = \"�ai.path��path.toAbsolutePath(\"/\")�\";");
+ _builder.newLine();
+ _builder.append("�IF a.size==0��a.type.type.typeName.toWrapper��ELSE��a.type.type.typeName�[]�ENDIF� �aVarName� = null;");
+ _builder.newLine();
_builder.append("object = values.get(id);");
_builder.newLine();
_builder.append("if(object != null){");
_builder.newLine();
_builder.append("\t");
- _builder.append(aVarName, " ");
- _builder.append(" = ensure");
- RefableType _type_6 = a.getType();
- DataType _type_7 = _type_6.getType();
- String _typeName_2 = this._typeHelpers.typeName(_type_7);
- String _firstUpper = StringExtensions.toFirstUpper(_typeName_2);
- _builder.append(_firstUpper, " ");
- {
- int _size_1 = a.getSize();
- boolean _greaterThan = (_size_1 > 0);
- if (_greaterThan) {
- _builder.append("Array");
- }
- }
- _builder.append("(object");
- {
- int _size_2 = a.getSize();
- boolean _greaterThan_1 = (_size_2 > 0);
- if (_greaterThan_1) {
- _builder.append(", ");
- int _size_3 = a.getSize();
- _builder.append(_size_3, " ");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("�aVarName� = ensure�a.type.type.typeName.toFirstUpper��IF a.size>0�Array�ENDIF�(object�IF a.size>0�, �a.size��ENDIF�);");
+ _builder.newLine();
_builder.append("\t");
- ActorClass _actorClass = ai.getActorClass();
- CharSequence _genMinMaxCheck = this.genMinMaxCheck(path, _actorClass);
- _builder.append(_genMinMaxCheck, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�genMinMaxCheck(path, ai.actorClass)�");
+ _builder.newLine();
_builder.append("\t");
- _builder.append("if(!");
- {
- int _size_4 = a.getSize();
- boolean _equals_1 = (_size_4 == 0);
- if (_equals_1) {
- _builder.append(aVarName, " ");
- _builder.append(".equals(");
- } else {
- _builder.append("Arrays.equals(");
- _builder.append(aVarName, " ");
- _builder.append(", ");
- }
- }
- _builder.append("(");
- {
- int _size_5 = a.getSize();
- boolean _equals_2 = (_size_5 == 0);
- if (_equals_2) {
- RefableType _type_8 = a.getType();
- DataType _type_9 = _type_8.getType();
- String _typeName_3 = this._typeHelpers.typeName(_type_9);
- String _wrapper_1 = this.stdExt.toWrapper(_typeName_3);
- _builder.append(_wrapper_1, " ");
- } else {
- RefableType _type_10 = a.getType();
- DataType _type_11 = _type_10.getType();
- String _typeName_4 = this._typeHelpers.typeName(_type_11);
- _builder.append(_typeName_4, " ");
- _builder.append("[]");
- }
- }
- _builder.append(")getDiffMap().get(id)))");
- _builder.newLineIfNotEmpty();
+ _builder.append("if(!�IF a.size==0��aVarName�.equals(�ELSE�Arrays.equals(�aVarName�, �ENDIF�(�IF a.size==0��a.type.type.typeName.toWrapper��ELSE��a.type.type.typeName�[]�ENDIF�)getDiffMap().get(id)))");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("changed = true;");
_builder.newLine();
@@ -857,25 +577,23 @@ public class VariableServiceGen {
_xifexpression = _builder;
} else {
CharSequence _xifexpression_1 = null;
- RefableType _type_12 = a.getType();
- DataType _type_13 = _type_12.getType();
- boolean _isDataClass = this._typeHelpers.isDataClass(_type_13);
+ RefableType _type_2 = a.getType();
+ DataType _type_3 = _type_2.getType();
+ boolean _isDataClass = this._typeHelpers.isDataClass(_type_3);
if (_isDataClass) {
CharSequence _xblockexpression_1 = null;
{
- RefableType _type_14 = a.getType();
- DataType _type_15 = _type_14.getType();
- DataClass dataClass = ((DataClass) _type_15);
+ RefableType _type_4 = a.getType();
+ DataType _type_5 = _type_4.getType();
+ DataClass dataClass = ((DataClass) _type_5);
StringConcatenation _builder_1 = new StringConcatenation();
- {
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(dataClass);
- for(final Attribute at : _allAttributes) {
- List<Attribute> _union = this.roomExt.<Attribute>union(path, at);
- CharSequence _genSetAttributeValues1 = this.genSetAttributeValues1(_union, ai);
- _builder_1.append(_genSetAttributeValues1, "");
- _builder_1.newLineIfNotEmpty();
- }
- }
+ _builder_1.append("�FOR at : dataClass.allAttributes�");
+ _builder_1.newLine();
+ _builder_1.append("\t");
+ _builder_1.append("�genSetAttributeValues1(path.union(at), ai)�");
+ _builder_1.newLine();
+ _builder_1.append("�ENDFOR�");
+ _builder_1.newLine();
_xblockexpression_1 = (_builder_1);
}
_xifexpression_1 = _xblockexpression_1;
@@ -914,30 +632,14 @@ public class VariableServiceGen {
}
final String getters = _xifexpression_1;
StringConcatenation _builder = new StringConcatenation();
- _builder.append("if(");
- _builder.append(aVarName, "");
- _builder.append(" != null){");
- _builder.newLineIfNotEmpty();
+ _builder.append("if(�aVarName� != null){");
+ _builder.newLine();
_builder.append("\t");
- CharSequence _varName = this.getVarName(ai);
- _builder.append(_varName, " ");
- _builder.append(".");
- _builder.append(getters, " ");
- String _name = a.getName();
- CharSequence _invokeSetter = this.helpers.invokeSetter(_name, null, aVarName);
- _builder.append(_invokeSetter, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("�ai.varName�.�getters��invokeSetter(a.name, null, aVarName)�;");
+ _builder.newLine();
_builder.append("\t");
- _builder.append("getDiffMap().put(\"");
- String _path = ai.getPath();
- _builder.append(_path, " ");
- String _absolutePath = this.toAbsolutePath(path, "/");
- _builder.append(_absolutePath, " ");
- _builder.append("\", ");
- _builder.append(aVarName, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("getDiffMap().put(\"�ai.path��path.toAbsolutePath(\"/\")�\", �aVarName�);");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_xblockexpression_1 = (_builder);
@@ -955,15 +657,13 @@ public class VariableServiceGen {
DataType _type_5 = _type_4.getType();
final DataClass dataClass = ((DataClass) _type_5);
StringConcatenation _builder = new StringConcatenation();
- {
- List<Attribute> _allAttributes = RoomHelpers.getAllAttributes(dataClass);
- for(final Attribute at : _allAttributes) {
- List<Attribute> _union = this.roomExt.<Attribute>union(path, at);
- CharSequence _genSetAttributeValues2 = this.genSetAttributeValues2(_union, ai);
- _builder.append(_genSetAttributeValues2, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR at : dataClass.allAttributes�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�genSetAttributeValues2(path.union(at), ai)�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_xblockexpression_2 = (_builder);
}
_xifexpression_1 = _xblockexpression_2;
diff --git a/plugins/org.eclipse.etrice.generator/.gitignore b/plugins/org.eclipse.etrice.generator/.gitignore
index 65847a73f..550486865 100644
--- a/plugins/org.eclipse.etrice.generator/.gitignore
+++ b/plugins/org.eclipse.etrice.generator/.gitignore
@@ -1,2 +1,3 @@
bin
*._trace
+target
diff --git a/plugins/org.eclipse.etrice.generator/.project b/plugins/org.eclipse.etrice.generator/.project
index b0bc92dc2..b81cd7c49 100644
--- a/plugins/org.eclipse.etrice.generator/.project
+++ b/plugins/org.eclipse.etrice.generator/.project
@@ -30,8 +30,14 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature>
diff --git a/plugins/org.eclipse.etrice.generator/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.etrice.generator/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 000000000..99f26c020
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.etrice.generator/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.etrice.generator/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 000000000..f897a7f1c
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF
index 9cdc57aff..ef827ef33 100644
--- a/plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator/META-INF/MANIFEST.MF
@@ -9,7 +9,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.etrice.generator.base,
org.eclipse.etrice.generator.generic
Require-Bundle: org.eclipse.etrice.core.room;bundle-version="0.4.0",
- org.eclipse.etrice.core.room.ui;bundle-version="0.4.0",
org.eclipse.etrice.core.genmodel;bundle-version="0.4.0",
org.eclipse.ui.ide;bundle-version="3.9.1",
org.eclipse.core.runtime;bundle-version="3.6.0",
diff --git a/plugins/org.eclipse.etrice.generator/pom.xml b/plugins/org.eclipse.etrice.generator/pom.xml
new file mode 100644
index 000000000..bd1242e01
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator/pom.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <relativePath>../../releng/org.eclipse.etrice.parent/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.etrice.generator</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
index 9fb716c72..1f66443e8 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java
@@ -16,21 +16,15 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.etrice.core.genmodel.etricegen.ActiveTrigger;
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedActorClass;
import org.eclipse.etrice.core.genmodel.etricegen.ExpandedRefinedState;
import org.eclipse.etrice.core.genmodel.etricegen.TransitionChain;
-import org.eclipse.etrice.core.genmodel.etricegen.util.ETriceGenUtil;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.ActorCommunicationType;
import org.eclipse.etrice.core.room.DetailCode;
-import org.eclipse.etrice.core.room.Guard;
-import org.eclipse.etrice.core.room.GuardedTransition;
import org.eclipse.etrice.core.room.InterfaceItem;
-import org.eclipse.etrice.core.room.Message;
import org.eclipse.etrice.core.room.MessageFromIf;
-import org.eclipse.etrice.core.room.NonInitialTransition;
import org.eclipse.etrice.core.room.State;
import org.eclipse.etrice.core.room.StateGraph;
import org.eclipse.etrice.core.room.TrPoint;
@@ -300,130 +294,71 @@ public class GenericStateMachineGenerator {
final String constIfItemPtr = _xifexpression_4;
final boolean usesHdlr = this.usesHandlerTrPoints(xpac);
StringConcatenation _builder = new StringConcatenation();
- {
- if (shallGenerateOneFile) {
- _builder.append("/* state IDs */");
- _builder.newLine();
- String _genStateIdConstants = this.genStateIdConstants(xpac);
- _builder.append(_genStateIdConstants, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("/* transition chains */");
- _builder.newLine();
- String _genTransitionChainConstants = this.genTransitionChainConstants(xpac);
- _builder.append(_genTransitionChainConstants, "");
- _builder.newLineIfNotEmpty();
- _builder.newLine();
- _builder.append("/* triggers */");
- _builder.newLine();
- String _genTriggerConstants = this.genTriggerConstants(xpac);
- _builder.append(_genTriggerConstants, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF shallGenerateOneFile�");
+ _builder.newLine();
+ _builder.append("/* state IDs */");
+ _builder.newLine();
+ _builder.append("�xpac.genStateIdConstants�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("/* transition chains */");
+ _builder.newLine();
+ _builder.append("�xpac.genTransitionChainConstants�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("/* triggers */");
+ _builder.newLine();
+ _builder.append("�xpac.genTriggerConstants�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�genExtra(xpac)�");
_builder.newLine();
- CharSequence _genExtra = this.genExtra(xpac);
- _builder.append(_genExtra, "");
- _builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("/* Entry and Exit Codes */");
_builder.newLine();
- {
- StateGraph _stateMachine = xpac.getStateMachine();
- List<State> _stateList = RoomHelpers.getStateList(_stateMachine);
- for(final State state : _stateList) {
- {
- boolean _or_1 = false;
- boolean _usesInheritance_3 = this.langExt.usesInheritance();
- boolean _not = (!_usesInheritance_3);
- if (_not) {
- _or_1 = true;
- } else {
- boolean _isOwnObject = xpac.isOwnObject(state);
- _or_1 = (_not || _isOwnObject);
- }
- if (_or_1) {
- CharSequence _genActionCodeMethods = this.genActionCodeMethods(xpac, state);
- _builder.append(_genActionCodeMethods, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�FOR state : xpac.stateMachine.getStateList()�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF !langExt.usesInheritance || xpac.isOwnObject(state)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�xpac.genActionCodeMethods(state)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
_builder.append("/* Action Codes */");
_builder.newLine();
- {
- StateGraph _stateMachine_1 = xpac.getStateMachine();
- List<Transition> _allTransitionsRecursive = RoomHelpers.getAllTransitionsRecursive(_stateMachine_1);
- for(final Transition tr : _allTransitionsRecursive) {
- {
- boolean _and = false;
- boolean _or_2 = false;
- boolean _usesInheritance_4 = this.langExt.usesInheritance();
- boolean _not_1 = (!_usesInheritance_4);
- if (_not_1) {
- _or_2 = true;
- } else {
- boolean _isOwnObject_1 = xpac.isOwnObject(tr);
- _or_2 = (_not_1 || _isOwnObject_1);
- }
- if (!_or_2) {
- _and = false;
- } else {
- DetailCode _action = tr.getAction();
- boolean _hasDetailCode = RoomHelpers.hasDetailCode(_action);
- _and = (_or_2 && _hasDetailCode);
- }
- if (_and) {
- TransitionChain _chain = xpac.getChain(tr);
- Transition _transition = null;
- if (_chain!=null) {
- _transition=_chain.getTransition();
- }
- Transition start = _transition;
- _builder.newLineIfNotEmpty();
- boolean _and_1 = false;
- if (!(start instanceof NonInitialTransition)) {
- _and_1 = false;
- } else {
- boolean _not_2 = (!(start instanceof GuardedTransition));
- _and_1 = ((start instanceof NonInitialTransition) && _not_2);
- }
- boolean hasArgs = _and_1;
- _builder.newLineIfNotEmpty();
- String _accessLevelProtected = this.langExt.accessLevelProtected();
- _builder.append(_accessLevelProtected, "");
- _builder.append("void ");
- _builder.append(opScopePriv, "");
- String _actionCodeOperationName = CodegenHelpers.getActionCodeOperationName(tr);
- _builder.append(_actionCodeOperationName, "");
- _builder.append("(");
- String _name_3 = ac.getName();
- String _selfPointer = this.langExt.selfPointer(_name_3, hasArgs);
- _builder.append(_selfPointer, "");
- {
- if (hasArgs) {
- _builder.append(constIfItemPtr, "");
- _builder.append(" ifitem");
- String _generateArgumentList = this.transitionChainGenerator.generateArgumentList(xpac, tr);
- _builder.append(_generateArgumentList, "");
- }
- }
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- AbstractGenerator _instance = AbstractGenerator.getInstance();
- DetailCode _action_1 = tr.getAction();
- String _translatedCode = _instance.getTranslatedCode(_action_1);
- _builder.append(_translatedCode, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("�FOR tr : xpac.stateMachine.allTransitionsRecursive�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF (!langExt.usesInheritance || xpac.isOwnObject(tr)) && tr.action.hasDetailCode�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�var start = xpac.getChain(tr)?.transition�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�var hasArgs = start instanceof NonInitialTransition && !(start instanceof GuardedTransition)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�langExt.accessLevelProtected�void �opScopePriv��tr.getActionCodeOperationName()�(�langExt.selfPointer(ac.name, hasArgs)��IF hasArgs��constIfItemPtr� ifitem�transitionChainGenerator.generateArgumentList(xpac, tr)��ENDIF�) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�AbstractGenerator::getInstance().getTranslatedCode(tr.action)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
_builder.append("/**");
_builder.newLine();
@@ -439,93 +374,47 @@ public class GenericStateMachineGenerator {
_builder.append(" ");
_builder.append("* @param to - the final parent state");
_builder.newLine();
- {
- if (usesHdlr) {
- _builder.append(" ");
- _builder.append("* @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)");
- _builder.newLine();
- }
- }
+ _builder.append(" ");
+ _builder.append("�IF usesHdlr�");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
- _builder.append(privAccess, "");
- _builder.append("void ");
- _builder.append(opScopePriv, "");
- _builder.append("exitTo(");
- _builder.append(self, "");
- String _stateType = this.stateType();
- _builder.append(_stateType, "");
- _builder.append(" current, ");
- String _stateType_1 = this.stateType();
- _builder.append(_stateType_1, "");
- _builder.append(" to");
- {
- if (usesHdlr) {
- _builder.append(", ");
- String _boolType = this.boolType();
- _builder.append(_boolType, "");
- _builder.append(" handler");
- }
- }
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
+ _builder.append("�privAccess�void �opScopePriv�exitTo(�self��stateType� current, �stateType� to�IF usesHdlr�, �boolType� handler�ENDIF�) {");
+ _builder.newLine();
_builder.append("\t");
_builder.append("while (current!=to) {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("switch (current) {");
_builder.newLine();
- {
- StateGraph _stateMachine_2 = xpac.getStateMachine();
- List<State> _baseStateList = RoomHelpers.getBaseStateList(_stateMachine_2);
- for(final State state_1 : _baseStateList) {
- _builder.append("\t\t\t");
- _builder.append("case ");
- String _genStateId = CodegenHelpers.getGenStateId(state_1);
- _builder.append(_genStateId, " ");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- {
- boolean _hasExitCode = RoomHelpers.hasExitCode(state_1, true);
- if (_hasExitCode) {
- {
- if (usesHdlr) {
- _builder.append("if (!handler) ");
- }
- }
- String _exitCodeOperationName = CodegenHelpers.getExitCodeOperationName(state_1);
- _builder.append(_exitCodeOperationName, " ");
- _builder.append("(");
- String _selfPointer_1 = this.langExt.selfPointer(false);
- _builder.append(_selfPointer_1, " ");
- _builder.append(");");
- }
- }
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- String _parentStateId = CodegenHelpers.getParentStateId(state_1);
- String _genStateId_1 = CodegenHelpers.getGenStateId(state_1);
- String _setHistory = this.setHistory(_parentStateId, _genStateId_1);
- _builder.append(_setHistory, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("current = ");
- String _parentStateId_1 = CodegenHelpers.getParentStateId(state_1);
- _builder.append(_parentStateId_1, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("�FOR state : xpac.stateMachine.getBaseStateList()�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("case �state.getGenStateId()�:");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF state.hasExitCode(true)��IF usesHdlr�if (!handler) �ENDIF��state.getExitCodeOperationName()�(�langExt.selfPointer(false)�);�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�setHistory(state.getParentStateId(), state.getGenStateId())�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("current = �state.getParentStateId()�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("break;");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t\t");
_builder.append("default:");
_builder.newLine();
@@ -564,53 +453,32 @@ public class GenericStateMachineGenerator {
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
- _builder.append(privAccess, "");
- String _stateType_2 = this.stateType();
- _builder.append(_stateType_2, "");
- _builder.append(" ");
- _builder.append(opScopePriv, "");
- _builder.append("executeTransitionChain(");
- _builder.append(self, "");
- _builder.append("int chain");
- {
- if (handleEvents) {
- _builder.append(", ");
- _builder.append(constIfItemPtr, "");
- _builder.append(" ifitem, ");
- String _voidPointer = this.langExt.voidPointer();
- _builder.append(_voidPointer, "");
- _builder.append(" generic_data");
- }
- }
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
+ _builder.append("�privAccess��stateType� �opScopePriv�executeTransitionChain(�self�int chain�IF handleEvents�, �constIfItemPtr� ifitem, �langExt.voidPointer� generic_data�ENDIF�) {");
+ _builder.newLine();
_builder.append("\t");
_builder.append("switch (chain) {");
_builder.newLine();
_builder.append("\t\t");
- EList<TransitionChain> allchains = xpac.getTransitionChains();
- _builder.newLineIfNotEmpty();
- {
- for(final TransitionChain tc : allchains) {
- _builder.append("\t\t");
- _builder.append("case ");
- String _genChainId = CodegenHelpers.getGenChainId(tc);
- _builder.append(_genChainId, " ");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("\t");
- String _generateExecuteChain = this.transitionChainGenerator.generateExecuteChain(xpac, tc);
- _builder.append(_generateExecuteChain, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("�var allchains = xpac.getTransitionChains()�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR tc : allchains�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("case �tc.genChainId�:");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�transitionChainGenerator.generateExecuteChain(xpac, tc)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t\t");
_builder.append("default:");
_builder.newLine();
@@ -637,228 +505,122 @@ public class GenericStateMachineGenerator {
_builder.append(" ");
_builder.append("* @param state - the state which is entered");
_builder.newLine();
- {
- if (usesHdlr) {
- _builder.append(" ");
- _builder.append("* @param handler - entry code is executed if not handler");
- _builder.newLine();
- }
- }
+ _builder.append(" ");
+ _builder.append("�IF usesHdlr�");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("* @param handler - entry code is executed if not handler");
+ _builder.newLine();
+ _builder.append(" ");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append(" ");
_builder.append("* @return - the ID of the final leaf state");
_builder.newLine();
_builder.append(" ");
_builder.append("*/");
_builder.newLine();
- _builder.append(privAccess, "");
- String _stateType_3 = this.stateType();
- _builder.append(_stateType_3, "");
- _builder.append(" ");
- _builder.append(opScopePriv, "");
- _builder.append("enterHistory(");
- _builder.append(self, "");
- String _stateType_4 = this.stateType();
- _builder.append(_stateType_4, "");
- _builder.append(" state");
- {
- if (usesHdlr) {
- _builder.append(", ");
- String _boolType_1 = this.boolType();
- _builder.append(_boolType_1, "");
- _builder.append(" handler");
- }
- }
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
+ _builder.append("�privAccess��stateType� �opScopePriv�enterHistory(�self��stateType� state�IF usesHdlr�, �boolType� handler�ENDIF�) {");
+ _builder.newLine();
_builder.append("\t");
- String _boolType_2 = this.boolType();
- _builder.append(_boolType_2, " ");
- _builder.append(" skip_entry = ");
- String _booleanConstant = this.langExt.booleanConstant(false);
- _builder.append(_booleanConstant, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("�boolType� skip_entry = �langExt.booleanConstant(false)�;");
+ _builder.newLine();
_builder.append("\t");
_builder.append("if (state >= STATE_MAX) {");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("state = ");
- {
- boolean _usesInheritance_5 = this.langExt.usesInheritance();
- boolean _not_3 = (!_usesInheritance_5);
- if (_not_3) {
- _builder.append("(");
- String _stateType_5 = this.stateType();
- _builder.append(_stateType_5, " ");
- _builder.append(")");
- }
- }
- _builder.append(" (state - STATE_MAX);");
- _builder.newLineIfNotEmpty();
+ _builder.append("state = �IF !langExt.usesInheritance�(�stateType�)�ENDIF� (state - STATE_MAX);");
+ _builder.newLine();
_builder.append("\t\t");
- _builder.append("skip_entry = ");
- String _booleanConstant_1 = this.langExt.booleanConstant(true);
- _builder.append(_booleanConstant_1, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("skip_entry = �langExt.booleanConstant(true)�;");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
- _builder.append("while (");
- String _booleanConstant_2 = this.langExt.booleanConstant(true);
- _builder.append(_booleanConstant_2, " ");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
+ _builder.append("while (�langExt.booleanConstant(true)�) {");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("switch (state) {");
_builder.newLine();
- {
- StateGraph _stateMachine_3 = xpac.getStateMachine();
- List<State> _baseStateList_1 = RoomHelpers.getBaseStateList(_stateMachine_3);
- for(final State state_2 : _baseStateList_1) {
- _builder.append("\t\t\t");
- _builder.append("case ");
- String _genStateId_2 = CodegenHelpers.getGenStateId(state_2);
- _builder.append(_genStateId_2, " ");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- {
- boolean _hasEntryCode = RoomHelpers.hasEntryCode(state_2, true);
- if (_hasEntryCode) {
- _builder.append("if (!(skip_entry");
- {
- if (usesHdlr) {
- _builder.append(" || handler");
- }
- }
- _builder.append(")) ");
- String _entryCodeOperationName = CodegenHelpers.getEntryCodeOperationName(state_2);
- _builder.append(_entryCodeOperationName, " ");
- _builder.append("(");
- String _selfPointer_2 = this.langExt.selfPointer(false);
- _builder.append(_selfPointer_2, " ");
- _builder.append(");");
- }
- }
- _builder.newLineIfNotEmpty();
- {
- boolean _isLeaf = RoomHelpers.isLeaf(state_2);
- if (_isLeaf) {
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("/* in leaf state: return state id */");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("return ");
- String _genStateId_3 = CodegenHelpers.getGenStateId(state_2);
- _builder.append(_genStateId_3, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("/* state has a sub graph */");
- _builder.newLine();
- {
- StateGraph _subgraph = state_2.getSubgraph();
- boolean _hasInitTransition = RoomHelpers.hasInitTransition(_subgraph);
- if (_hasInitTransition) {
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("/* with init transition */");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("if (");
- String _genStateId_4 = CodegenHelpers.getGenStateId(state_2);
- String _history = this.getHistory(_genStateId_4);
- _builder.append(_history, " ");
- _builder.append("==NO_STATE) {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("\t");
- StateGraph _subgraph_1 = state_2.getSubgraph();
- Transition sub_initt = RoomHelpers.getInitTransition(_subgraph_1);
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("state = executeTransitionChain(");
- String _selfPointer_3 = this.langExt.selfPointer(true);
- _builder.append(_selfPointer_3, " ");
- TransitionChain _chain_1 = xpac.getChain(sub_initt);
- String _genChainId_1 = CodegenHelpers.getGenChainId(_chain_1);
- _builder.append(_genChainId_1, " ");
- {
- if (handleEvents) {
- _builder.append(", ");
- String _nullPointer = this.langExt.nullPointer();
- _builder.append(_nullPointer, " ");
- _builder.append(", ");
- String _nullPointer_1 = this.langExt.nullPointer();
- _builder.append(_nullPointer_1, " ");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("else {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("state = ");
- String _genStateId_5 = CodegenHelpers.getGenStateId(state_2);
- String _history_1 = this.getHistory(_genStateId_5);
- _builder.append(_history_1, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- } else {
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("/* without init transition */");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("state = ");
- String _genStateId_6 = CodegenHelpers.getGenStateId(state_2);
- String _history_2 = this.getHistory(_genStateId_6);
- _builder.append(_history_2, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("\t\t\t");
+ _builder.append("�FOR state : xpac.stateMachine.getBaseStateList()�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("case �state.getGenStateId()�:");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF state.hasEntryCode(true)�if (!(skip_entry�IF usesHdlr� || handler�ENDIF�)) �state.getEntryCodeOperationName()�(�langExt.selfPointer(false)�);�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF state.isLeaf()�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("/* in leaf state: return state id */");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("return �state.getGenStateId()�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("/* state has a sub graph */");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�IF state.subgraph.hasInitTransition()�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("/* with init transition */");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("if (�getHistory(state.getGenStateId())�==NO_STATE) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("�var sub_initt = state.subgraph.getInitTransition()�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("state = executeTransitionChain(�langExt.selfPointer(true)��xpac.getChain(sub_initt).genChainId��IF handleEvents�, �langExt.nullPointer�, �langExt.nullPointer��ENDIF�);");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("else {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t\t");
+ _builder.append("state = �getHistory(state.getGenStateId())�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("/* without init transition */");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("state = �getHistory(state.getGenStateId())�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("break;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t\t\t");
_builder.append("case STATE_TOP:");
_builder.newLine();
_builder.append("\t\t\t\t");
- _builder.append("state = ");
- String _history_3 = this.getHistory("STATE_TOP");
- _builder.append(_history_3, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("state = �getHistory(\"STATE_TOP\")�;");
+ _builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("break;");
_builder.newLine();
@@ -875,225 +637,112 @@ public class GenericStateMachineGenerator {
_builder.append("}");
_builder.newLine();
_builder.append("\t\t");
- _builder.append("skip_entry = ");
- String _booleanConstant_3 = this.langExt.booleanConstant(false);
- _builder.append(_booleanConstant_3, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("skip_entry = �langExt.booleanConstant(false)�;");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
- String _unreachableReturn = this.unreachableReturn();
- _builder.append(_unreachableReturn, " ");
- _builder.newLineIfNotEmpty();
+ _builder.append("�unreachableReturn�");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
- _builder.append(publicIf, "");
- _builder.append("void ");
- _builder.append(opScope, "");
- _builder.append("executeInitTransition(");
- _builder.append(selfOnly, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- StateGraph _stateMachine_4 = xpac.getStateMachine();
- Transition initt = RoomHelpers.getInitTransition(_stateMachine_4);
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("int chain = ");
- TransitionChain _chain_2 = xpac.getChain(initt);
- String _genChainId_2 = CodegenHelpers.getGenChainId(_chain_2);
- _builder.append(_genChainId_2, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- String _stateType_6 = this.stateType();
- _builder.append(_stateType_6, " ");
- _builder.append(" next = ");
- _builder.append(opScopePriv, " ");
- _builder.append("executeTransitionChain(");
- String _selfPointer_4 = this.langExt.selfPointer(true);
- _builder.append(_selfPointer_4, " ");
- _builder.append("chain");
- {
- if (handleEvents) {
- _builder.append(", ");
- String _nullPointer_2 = this.langExt.nullPointer();
- _builder.append(_nullPointer_2, " ");
- _builder.append(", ");
- String _nullPointer_3 = this.langExt.nullPointer();
- _builder.append(_nullPointer_3, " ");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("next = ");
- _builder.append(opScopePriv, " ");
- _builder.append("enterHistory(");
- String _selfPointer_5 = this.langExt.selfPointer(true);
- _builder.append(_selfPointer_5, " ");
- _builder.append("next");
- {
- if (usesHdlr) {
- _builder.append(", ");
- String _booleanConstant_4 = this.langExt.booleanConstant(false);
- _builder.append(_booleanConstant_4, " ");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("setState(");
- String _selfPointer_6 = this.langExt.selfPointer(true);
- _builder.append(_selfPointer_6, " ");
- _builder.append("next);");
- _builder.newLineIfNotEmpty();
+ _builder.append("�publicIf�void �opScope�executeInitTransition(�selfOnly�) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�var initt = xpac.stateMachine.getInitTransition()�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("int chain = �xpac.getChain(initt).genChainId�;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�stateType� next = �opScopePriv�executeTransitionChain(�langExt.selfPointer(true)�chain�IF handleEvents�, �langExt.nullPointer�, �langExt.nullPointer��ENDIF�);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("next = �opScopePriv�enterHistory(�langExt.selfPointer(true)�next�IF usesHdlr�, �langExt.booleanConstant(false)��ENDIF�);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("setState(�langExt.selfPointer(true)�next);");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("/* receiveEvent contains the main implementation of the FSM */");
_builder.newLine();
- _builder.append(publicIf, "");
- _builder.append("void ");
- _builder.append(opScope, "");
- _builder.append("receiveEvent(");
- String _name_4 = ac.getName();
- String _selfPointer_7 = this.langExt.selfPointer(_name_4, handleEvents);
- _builder.append(_selfPointer_7, "");
- {
- if (handleEvents) {
- _builder.append(ifItemPtr, "");
- _builder.append(" ifitem, int evt, ");
- String _voidPointer_1 = this.langExt.voidPointer();
- _builder.append(_voidPointer_1, "");
- _builder.append(" generic_data");
- }
- }
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- {
- if (async) {
- _builder.append("\t");
- _builder.append("int trigger = (ifitem==");
- String _nullPointer_4 = this.langExt.nullPointer();
- _builder.append(_nullPointer_4, " ");
- _builder.append(")? POLLING : ifitem");
- _builder.append(getLocalId, " ");
- _builder.append(" + EVT_SHIFT*evt;");
- _builder.newLineIfNotEmpty();
- } else {
- if (eventDriven) {
- _builder.append("\t");
- _builder.append("int trigger = ifitem");
- _builder.append(getLocalId, " ");
- _builder.append(" + EVT_SHIFT*evt;");
- _builder.newLineIfNotEmpty();
- }
- }
- }
+ _builder.append("�publicIf�void �opScope�receiveEvent(�langExt.selfPointer(ac.name, handleEvents)��IF handleEvents��ifItemPtr� ifitem, int evt, �langExt.voidPointer� generic_data�ENDIF�) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF async�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("int trigger = (ifitem==�langExt.nullPointer�)? POLLING : ifitem�getLocalId� + EVT_SHIFT*evt;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSEIF eventDriven�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("int trigger = ifitem�getLocalId� + EVT_SHIFT*evt;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("int chain = NOT_CAUGHT;");
_builder.newLine();
_builder.append("\t");
- String _stateType_7 = this.stateType();
- _builder.append(_stateType_7, " ");
- _builder.append(" catching_state = NO_STATE;");
- _builder.newLineIfNotEmpty();
- {
- if (usesHdlr) {
- _builder.append("\t");
- String _boolType_3 = this.boolType();
- _builder.append(_boolType_3, " ");
- _builder.append(" is_handler = ");
- String _booleanConstant_5 = this.langExt.booleanConstant(false);
- _builder.append(_booleanConstant_5, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�stateType� catching_state = NO_STATE;");
+ _builder.newLine();
_builder.append("\t");
+ _builder.append("�IF usesHdlr�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�boolType� is_handler = �langExt.booleanConstant(false)�;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF handleEvents�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (!handleSystemEvent(ifitem, evt, generic_data)) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�genStateSwitch(xpac, usesHdlr)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�genStateSwitch(xpac, usesHdlr)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
_builder.newLine();
- {
- if (handleEvents) {
- _builder.append("\t");
- _builder.append("if (!handleSystemEvent(ifitem, evt, generic_data)) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _genStateSwitch = this.genStateSwitch(xpac, usesHdlr);
- _builder.append(_genStateSwitch, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- } else {
- _builder.append("\t");
- CharSequence _genStateSwitch_1 = this.genStateSwitch(xpac, usesHdlr);
- _builder.append(_genStateSwitch_1, " ");
- _builder.newLineIfNotEmpty();
- }
- }
_builder.append("\t");
_builder.append("if (chain != NOT_CAUGHT) {");
_builder.newLine();
_builder.append("\t\t");
- _builder.append(opScopePriv, " ");
- _builder.append("exitTo(");
- String _selfPointer_8 = this.langExt.selfPointer(true);
- _builder.append(_selfPointer_8, " ");
- _builder.append("getState(");
- String _selfPointer_9 = this.langExt.selfPointer(false);
- _builder.append(_selfPointer_9, " ");
- _builder.append("), catching_state");
- {
- if (usesHdlr) {
- _builder.append(", is_handler");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("�opScopePriv�exitTo(�langExt.selfPointer(true)�getState(�langExt.selfPointer(false)�), catching_state�IF usesHdlr�, is_handler�ENDIF�);");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("{");
_builder.newLine();
_builder.append("\t\t\t");
- String _stateType_8 = this.stateType();
- _builder.append(_stateType_8, " ");
- _builder.append(" next = ");
- _builder.append(opScopePriv, " ");
- _builder.append("executeTransitionChain(");
- String _selfPointer_10 = this.langExt.selfPointer(true);
- _builder.append(_selfPointer_10, " ");
- _builder.append("chain");
- {
- if (handleEvents) {
- _builder.append(", ifitem, generic_data");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("�stateType� next = �opScopePriv�executeTransitionChain(�langExt.selfPointer(true)�chain�IF handleEvents�, ifitem, generic_data�ENDIF�);");
+ _builder.newLine();
_builder.append("\t\t\t");
- _builder.append("next = ");
- _builder.append(opScopePriv, " ");
- _builder.append("enterHistory(");
- String _selfPointer_11 = this.langExt.selfPointer(true);
- _builder.append(_selfPointer_11, " ");
- _builder.append("next");
- {
- if (usesHdlr) {
- _builder.append(", is_handler");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("next = �opScopePriv�enterHistory(�langExt.selfPointer(true)�next�IF usesHdlr�, is_handler�ENDIF�);");
+ _builder.newLine();
_builder.append("\t\t\t");
- _builder.append("setState(");
- String _selfPointer_12 = this.langExt.selfPointer(true);
- _builder.append(_selfPointer_12, " ");
- _builder.append("next);");
- _builder.newLineIfNotEmpty();
+ _builder.append("setState(�langExt.selfPointer(true)�next);");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
@@ -1129,112 +778,86 @@ public class GenericStateMachineGenerator {
ActorCommunicationType _commType_2 = _actorClass_2.getCommType();
boolean dataDriven = Objects.equal(_commType_2, ActorCommunicationType.DATA_DRIVEN);
StringConcatenation _builder = new StringConcatenation();
- _builder.append("switch (getState(");
- String _selfPointer = this.langExt.selfPointer(false);
- _builder.append(_selfPointer, "");
- _builder.append(")) {");
- _builder.newLineIfNotEmpty();
- {
- StateGraph _stateMachine = xpac.getStateMachine();
- List<State> _leafStateList = RoomHelpers.getLeafStateList(_stateMachine);
- for(final State state : _leafStateList) {
- _builder.append("\t");
- _builder.append("case ");
- String _genStateId = CodegenHelpers.getGenStateId(state);
- _builder.append(_genStateId, " ");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- {
- if (async) {
- _builder.append("\t");
- _builder.append("\t");
- EList<ActiveTrigger> atlist = xpac.getActiveTriggers(state);
- _builder.newLineIfNotEmpty();
- {
- boolean _isEmpty = atlist.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("switch(trigger) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("case POLLING:");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t\t");
- CharSequence _genDataDrivenTriggers = this.genDataDrivenTriggers(xpac, state, usesHdlr);
- _builder.append(_genDataDrivenTriggers, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t\t");
- _builder.append("break;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _genEventDrivenTriggers = this.genEventDrivenTriggers(xpac, state, atlist, usesHdlr);
- _builder.append(_genEventDrivenTriggers, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- } else {
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _genDataDrivenTriggers_1 = this.genDataDrivenTriggers(xpac, state, usesHdlr);
- _builder.append(_genDataDrivenTriggers_1, " ");
- _builder.newLineIfNotEmpty();
- }
- }
- } else {
- if (dataDriven) {
- _builder.append("\t");
- _builder.append("\t");
- CharSequence _genDataDrivenTriggers_2 = this.genDataDrivenTriggers(xpac, state, usesHdlr);
- _builder.append(_genDataDrivenTriggers_2, " ");
- _builder.newLineIfNotEmpty();
- } else {
- if (eventDriven) {
- _builder.append("\t");
- _builder.append("\t");
- EList<ActiveTrigger> atlist_1 = xpac.getActiveTriggers(state);
- _builder.newLineIfNotEmpty();
- {
- boolean _isEmpty_1 = atlist_1.isEmpty();
- boolean _not_1 = (!_isEmpty_1);
- if (_not_1) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("switch(trigger) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("\t\t");
- CharSequence _genEventDrivenTriggers_1 = this.genEventDrivenTriggers(xpac, state, atlist_1, usesHdlr);
- _builder.append(_genEventDrivenTriggers_1, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
- }
- }
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("break;");
- _builder.newLine();
- }
- }
+ _builder.append("switch (getState(�langExt.selfPointer(false)�)) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�FOR state : xpac.stateMachine.getLeafStateList()�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("case �state.getGenStateId()�:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF async�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�var atlist = xpac.getActiveTriggers(state)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF !atlist.isEmpty�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("switch(trigger) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("case POLLING:");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�genDataDrivenTriggers(xpac, state, usesHdlr)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("break;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�genEventDrivenTriggers(xpac, state, atlist, usesHdlr)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("�genDataDrivenTriggers(xpac, state, usesHdlr)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ELSEIF dataDriven�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�genDataDrivenTriggers(xpac, state, usesHdlr)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ELSEIF eventDriven�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�var atlist = xpac.getActiveTriggers(state)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�IF !atlist.isEmpty�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("switch(trigger) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t\t");
+ _builder.append("�genEventDrivenTriggers(xpac, state, atlist, usesHdlr)�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("break;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("\t");
_builder.append("default:");
_builder.newLine();
@@ -1262,70 +885,50 @@ public class GenericStateMachineGenerator {
*/
protected CharSequence genDataDrivenTriggers(final ExpandedActorClass xpac, final State state, final boolean usesHdlr) {
StringConcatenation _builder = new StringConcatenation();
- String _genDoCodes = this.genDoCodes(state);
- _builder.append(_genDoCodes, "");
- _builder.newLineIfNotEmpty();
- List<Transition> _outgoingTransitionsHierarchical = this._roomExtensions.getOutgoingTransitionsHierarchical(xpac, state);
- final Function1<Transition,Boolean> _function = new Function1<Transition,Boolean>() {
- public Boolean apply(final Transition t) {
- return Boolean.valueOf((t instanceof GuardedTransition));
- }
- };
- Iterable<Transition> transitions = IterableExtensions.<Transition>filter(_outgoingTransitionsHierarchical, _function);
- _builder.newLineIfNotEmpty();
- {
- for(final Transition tr : transitions) {
- _builder.append("if (");
- AbstractGenerator _instance = AbstractGenerator.getInstance();
- DetailCode _guard = ((GuardedTransition) tr).getGuard();
- String _translatedCode = _instance.getTranslatedCode(_guard);
- _builder.append(_translatedCode, "");
- _builder.append(")");
- _builder.newLineIfNotEmpty();
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t");
- TransitionChain chain = xpac.getChain(tr);
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("chain = ");
- String _genChainId = CodegenHelpers.getGenChainId(chain);
- _builder.append(_genChainId, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("catching_state = ");
- State _stateContext = chain.getStateContext();
- String _genStateId = CodegenHelpers.getGenStateId(_stateContext);
- _builder.append(_genStateId, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- {
- boolean _and = false;
- boolean _isHandler = chain.isHandler();
- if (!_isHandler) {
- _and = false;
- } else {
- _and = (_isHandler && usesHdlr);
- }
- if (_and) {
- _builder.append("\t");
- _builder.append("is_handler = TRUE;");
- _builder.newLine();
- }
- }
- _builder.append("}");
- _builder.newLine();
- {
- Transition _last = IterableExtensions.<Transition>last(transitions);
- boolean _notEquals = (!Objects.equal(tr, _last));
- if (_notEquals) {
- _builder.append("else ");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("�genDoCodes(state)�");
+ _builder.newLine();
+ _builder.append("�var transitions = xpac.getOutgoingTransitionsHierarchical(state).filter(t|t instanceof GuardedTransition)�");
+ _builder.newLine();
+ _builder.append("�FOR tr : transitions�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if (�AbstractGenerator::getInstance().getTranslatedCode((tr as GuardedTransition).guard)�)");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�var chain = xpac.getChain(tr)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("chain = �chain.genChainId�;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("catching_state = �chain.stateContext.genStateId�;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF chain.isHandler() && usesHdlr�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("is_handler = TRUE;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF tr!=transitions.last�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("else ");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -1341,96 +944,58 @@ public class GenericStateMachineGenerator {
*/
protected CharSequence genEventDrivenTriggers(final ExpandedActorClass xpac, final State state, final List<ActiveTrigger> atlist, final boolean usesHdlr) {
StringConcatenation _builder = new StringConcatenation();
- {
- for(final ActiveTrigger at : atlist) {
- _builder.append("case ");
- String _triggerCodeName = xpac.getTriggerCodeName(at);
- _builder.append(_triggerCodeName, "");
- _builder.append(":");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- boolean needData = ETriceGenUtil.hasGuard(at);
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- {
- if (needData) {
- _builder.append("{ ");
- Message _msg = at.getMsg();
- String _typedDataDefinition = this.langExt.getTypedDataDefinition(_msg);
- _builder.append(_typedDataDefinition, " ");
- }
- }
- _builder.newLineIfNotEmpty();
- {
- EList<TriggeredTransition> _transitions = at.getTransitions();
- boolean _hasElements = false;
- for(final TriggeredTransition tt : _transitions) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(" else ", " ");
- }
- _builder.append("\t");
- TransitionChain chain = xpac.getChain(tt);
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- Transition _transition = chain.getTransition();
- String _trigger = at.getTrigger();
- CharSequence _guard = this.guard(_transition, _trigger, xpac);
- _builder.append(_guard, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("chain = ");
- String _genChainId = CodegenHelpers.getGenChainId(chain);
- _builder.append(_genChainId, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("catching_state = ");
- State _stateContext = chain.getStateContext();
- String _genStateId = CodegenHelpers.getGenStateId(_stateContext);
- _builder.append(_genStateId, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- {
- boolean _and = false;
- boolean _isHandler = chain.isHandler();
- if (!_isHandler) {
- _and = false;
- } else {
- _and = (_isHandler && usesHdlr);
- }
- if (_and) {
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("is_handler = ");
- String _booleanConstant = this.langExt.booleanConstant(true);
- _builder.append(_booleanConstant, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t");
- {
- if (needData) {
- _builder.append("}");
- }
- }
- _builder.newLineIfNotEmpty();
- _builder.append("break;");
- _builder.newLine();
- }
- }
+ _builder.append("�FOR at : atlist�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("case �xpac.getTriggerCodeName(at)�:");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�var needData = at.hasGuard�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF needData�{ �langExt.getTypedDataDefinition(at.msg)��ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�FOR tt : at.transitions SEPARATOR \" else \"�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�var chain = xpac.getChain(tt)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�guard(chain.transition, at.trigger, xpac)�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("chain = �chain.genChainId�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("catching_state = �chain.stateContext.genStateId�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�IF chain.isHandler() && usesHdlr�");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("is_handler = �langExt.booleanConstant(true)�;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�IF needData�}�ENDIF�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("break;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.append("default:");
_builder.newLine();
_builder.append("\t");
@@ -1539,19 +1104,13 @@ public class GenericStateMachineGenerator {
};
final Trigger tr = IterableExtensions.<Trigger>findFirst(_triggers, _function);
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasGuard = RoomHelpers.hasGuard(tr);
- if (_hasGuard) {
- _builder.append("if (");
- AbstractGenerator _instance = AbstractGenerator.getInstance();
- Guard _guard = tr.getGuard();
- DetailCode _guard_1 = _guard.getGuard();
- String _translatedCode = _instance.getTranslatedCode(_guard_1);
- _builder.append(_translatedCode, "");
- _builder.append(")");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF tr.hasGuard()�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if (�AbstractGenerator::getInstance().getTranslatedCode(tr.guard.guard)�)");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -1575,29 +1134,20 @@ public class GenericStateMachineGenerator {
*/
protected String genDoCodes(final State state) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasDoCode = RoomHelpers.hasDoCode(state, true);
- if (_hasDoCode) {
- String _doCodeOperationName = CodegenHelpers.getDoCodeOperationName(state);
- _builder.append(_doCodeOperationName, "");
- _builder.append("(");
- String _selfPointer = this.langExt.selfPointer(false);
- _builder.append(_selfPointer, "");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- {
- EObject _eContainer = state.eContainer();
- EObject _eContainer_1 = _eContainer.eContainer();
- if ((_eContainer_1 instanceof State)) {
- EObject _eContainer_2 = state.eContainer();
- EObject _eContainer_3 = _eContainer_2.eContainer();
- String _genDoCodes = this.genDoCodes(((State) _eContainer_3));
- _builder.append(_genDoCodes, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF state.hasDoCode(true)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�state.getDoCodeOperationName()�(�langExt.selfPointer(false)�);");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�IF state.eContainer.eContainer instanceof State�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�genDoCodes(state.eContainer.eContainer as State)�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
return _builder.toString();
}
@@ -1697,105 +1247,81 @@ public class GenericStateMachineGenerator {
}
}
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _isEmpty = entry.isEmpty();
- boolean _not = (!_isEmpty);
- if (_not) {
- {
- if (generateImplementation) {
- String _accessLevelProtected = this.langExt.accessLevelProtected();
- _builder.append(_accessLevelProtected, "");
- _builder.append("void ");
- _builder.append(opScopePriv, "");
- _builder.append(entryOp, "");
- _builder.append("(");
- _builder.append(selfPtr, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append(entry, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- } else {
- String _accessLevelProtected_1 = this.langExt.accessLevelProtected();
- _builder.append(_accessLevelProtected_1, "");
- _builder.append("void ");
- _builder.append(entryOp, "");
- _builder.append("(");
- _builder.append(selfPtr, "");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- {
- boolean _isEmpty_1 = exit.isEmpty();
- boolean _not_1 = (!_isEmpty_1);
- if (_not_1) {
- {
- if (generateImplementation) {
- String _accessLevelProtected_2 = this.langExt.accessLevelProtected();
- _builder.append(_accessLevelProtected_2, "");
- _builder.append("void ");
- _builder.append(opScopePriv, "");
- _builder.append(exitOp, "");
- _builder.append("(");
- _builder.append(selfPtr, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append(exit, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- } else {
- String _accessLevelProtected_3 = this.langExt.accessLevelProtected();
- _builder.append(_accessLevelProtected_3, "");
- _builder.append("void ");
- _builder.append(exitOp, "");
- _builder.append("(");
- _builder.append(selfPtr, "");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
- {
- boolean _isEmpty_2 = docode.isEmpty();
- boolean _not_2 = (!_isEmpty_2);
- if (_not_2) {
- {
- if (generateImplementation) {
- String _accessLevelProtected_4 = this.langExt.accessLevelProtected();
- _builder.append(_accessLevelProtected_4, "");
- _builder.append(" void ");
- _builder.append(opScopePriv, "");
- _builder.append(doOp, "");
- _builder.append("(");
- _builder.append(selfPtr, "");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append(docode, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- } else {
- String _accessLevelProtected_5 = this.langExt.accessLevelProtected();
- _builder.append(_accessLevelProtected_5, "");
- _builder.append("void ");
- _builder.append(doOp, "");
- _builder.append("(");
- _builder.append(selfPtr, "");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�IF !entry.empty�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF generateImplementation�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�langExt.accessLevelProtected�void �opScopePriv��entryOp�(�selfPtr�) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�entry�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�langExt.accessLevelProtected�void �entryOp�(�selfPtr�);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�IF !exit.empty�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF generateImplementation�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�langExt.accessLevelProtected�void �opScopePriv��exitOp�(�selfPtr�) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�exit�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�langExt.accessLevelProtected�void �exitOp�(�selfPtr�);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�IF !docode.empty�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF generateImplementation�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�langExt.accessLevelProtected� void �opScopePriv��doOp�(�selfPtr�) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�docode�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�langExt.accessLevelProtected�void �doOp�(�selfPtr�);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
@@ -1837,112 +1363,59 @@ public class GenericStateMachineGenerator {
_builder.newLine();
_builder.append("/* state IDs */");
_builder.newLine();
- String _genStateIdConstants = this.genStateIdConstants(xpac);
- _builder.append(_genStateIdConstants, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�xpac.genStateIdConstants�");
+ _builder.newLine();
_builder.newLine();
_builder.append("/* transition chains */");
_builder.newLine();
- String _genTransitionChainConstants = this.genTransitionChainConstants(xpac);
- _builder.append(_genTransitionChainConstants, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�xpac.genTransitionChainConstants�");
+ _builder.newLine();
_builder.newLine();
_builder.append("/* triggers */");
_builder.newLine();
- String _genTriggerConstants = this.genTriggerConstants(xpac);
- _builder.append(_genTriggerConstants, "");
- _builder.newLineIfNotEmpty();
+ _builder.append("�xpac.genTriggerConstants�");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("�genExtraDecl(xpac)�");
_builder.newLine();
- CharSequence _genExtraDecl = this.genExtraDecl(xpac);
- _builder.append(_genExtraDecl, "");
- _builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("/* Entry and Exit Codes */");
_builder.newLine();
- {
- StateGraph _stateMachine = xpac.getStateMachine();
- List<State> _stateList = RoomHelpers.getStateList(_stateMachine);
- for(final State state : _stateList) {
- {
- boolean _or_1 = false;
- boolean _usesInheritance = this.langExt.usesInheritance();
- boolean _not = (!_usesInheritance);
- if (_not) {
- _or_1 = true;
- } else {
- boolean _isOwnObject = xpac.isOwnObject(state);
- _or_1 = (_not || _isOwnObject);
- }
- if (_or_1) {
- CharSequence _genActionCodeMethods = this.genActionCodeMethods(xpac, state, false);
- _builder.append(_genActionCodeMethods, "");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�FOR state : xpac.stateMachine.getStateList()�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF !langExt.usesInheritance || xpac.isOwnObject(state)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�xpac.genActionCodeMethods(state, false)�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
_builder.append("/* Action Codes */");
_builder.newLine();
- {
- StateGraph _stateMachine_1 = xpac.getStateMachine();
- List<Transition> _allTransitionsRecursive = RoomHelpers.getAllTransitionsRecursive(_stateMachine_1);
- for(final Transition tr : _allTransitionsRecursive) {
- {
- boolean _and = false;
- boolean _or_2 = false;
- boolean _usesInheritance_1 = this.langExt.usesInheritance();
- boolean _not_1 = (!_usesInheritance_1);
- if (_not_1) {
- _or_2 = true;
- } else {
- boolean _isOwnObject_1 = xpac.isOwnObject(tr);
- _or_2 = (_not_1 || _isOwnObject_1);
- }
- if (!_or_2) {
- _and = false;
- } else {
- DetailCode _action = tr.getAction();
- boolean _hasDetailCode = RoomHelpers.hasDetailCode(_action);
- _and = (_or_2 && _hasDetailCode);
- }
- if (_and) {
- TransitionChain _chain = xpac.getChain(tr);
- Transition start = _chain.getTransition();
- _builder.newLineIfNotEmpty();
- boolean _and_1 = false;
- if (!(start instanceof NonInitialTransition)) {
- _and_1 = false;
- } else {
- boolean _not_2 = (!(start instanceof GuardedTransition));
- _and_1 = ((start instanceof NonInitialTransition) && _not_2);
- }
- boolean hasArgs = _and_1;
- _builder.newLineIfNotEmpty();
- String _accessLevelProtected = this.langExt.accessLevelProtected();
- _builder.append(_accessLevelProtected, "");
- _builder.append("void ");
- String _actionCodeOperationName = CodegenHelpers.getActionCodeOperationName(tr);
- _builder.append(_actionCodeOperationName, "");
- _builder.append("(");
- String _name_1 = ac.getName();
- String _selfPointer = this.langExt.selfPointer(_name_1, hasArgs);
- _builder.append(_selfPointer, "");
- {
- if (hasArgs) {
- String _constPointer = this.constPointer("etRuntime::InterfaceItemBase");
- _builder.append(_constPointer, "");
- _builder.append(" ifitem");
- String _generateArgumentList = this.transitionChainGenerator.generateArgumentList(xpac, tr);
- _builder.append(_generateArgumentList, "");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�FOR tr : xpac.stateMachine.allTransitionsRecursive�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF (!langExt.usesInheritance || xpac.isOwnObject(tr)) && tr.action.hasDetailCode�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�var start = xpac.getChain(tr).transition�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�var hasArgs = start instanceof NonInitialTransition && !(start instanceof GuardedTransition)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�langExt.accessLevelProtected�void �tr.getActionCodeOperationName()�(�langExt.selfPointer(ac.name, hasArgs)��IF hasArgs��constPointer(\"etRuntime::InterfaceItemBase\")� ifitem�transitionChainGenerator.generateArgumentList(xpac, tr)��ENDIF�);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
_builder.newLine();
_builder.append("private:");
_builder.newLine();
@@ -1961,30 +1434,21 @@ public class GenericStateMachineGenerator {
_builder.append("\t ");
_builder.append("* @param to - the final parent state");
_builder.newLine();
- {
- if (usesHdlr) {
- _builder.append("\t ");
- _builder.append("* @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)");
- _builder.newLine();
- }
- }
+ _builder.append("\t ");
+ _builder.append("�IF usesHdlr�");
+ _builder.newLine();
+ _builder.append("\t ");
+ _builder.append("* @param handler - entry and exit codes are called only if not handler (for handler TransitionPoints)");
+ _builder.newLine();
+ _builder.append("\t ");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("\t ");
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
- _builder.append("void exitTo(");
- _builder.append(self, " ");
- _builder.append("int current, int to");
- {
- if (usesHdlr) {
- _builder.append(", ");
- String _boolType = this.boolType();
- _builder.append(_boolType, " ");
- _builder.append(" handler");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("void exitTo(�self�int current, int to�IF usesHdlr�, �boolType� handler�ENDIF�);");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
@@ -2009,22 +1473,8 @@ public class GenericStateMachineGenerator {
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
- _builder.append("int executeTransitionChain(");
- _builder.append(self, " ");
- _builder.append("int chain");
- {
- if (handleEvents) {
- _builder.append(", ");
- String _constPointer_1 = this.constPointer("etRuntime::InterfaceItemBase");
- _builder.append(_constPointer_1, " ");
- _builder.append(" ifitem, ");
- String _voidPointer = this.langExt.voidPointer();
- _builder.append(_voidPointer, " ");
- _builder.append(" generic_data");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("int executeTransitionChain(�self�int chain�IF handleEvents�, �constPointer(\"etRuntime::InterfaceItemBase\")� ifitem, �langExt.voidPointer� generic_data�ENDIF�);");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
@@ -2036,13 +1486,15 @@ public class GenericStateMachineGenerator {
_builder.append("\t ");
_builder.append("* @param state - the state which is entered");
_builder.newLine();
- {
- if (usesHdlr) {
- _builder.append("\t ");
- _builder.append("* @param handler - entry code is executed if not handler");
- _builder.newLine();
- }
- }
+ _builder.append("\t ");
+ _builder.append("�IF usesHdlr�");
+ _builder.newLine();
+ _builder.append("\t ");
+ _builder.append("* @param handler - entry code is executed if not handler");
+ _builder.newLine();
+ _builder.append("\t ");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
_builder.append("\t ");
_builder.append("* @return - the ID of the final leaf state");
_builder.newLine();
@@ -2050,50 +1502,23 @@ public class GenericStateMachineGenerator {
_builder.append("*/");
_builder.newLine();
_builder.append("\t");
- _builder.append("int enterHistory(");
- _builder.append(self, " ");
- _builder.append("int state");
- {
- if (usesHdlr) {
- _builder.append(", ");
- String _boolType_1 = this.boolType();
- _builder.append(_boolType_1, " ");
- _builder.append(" handler");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("int enterHistory(�self�int state�IF usesHdlr�, �boolType� handler�ENDIF�);");
+ _builder.newLine();
_builder.newLine();
_builder.append("public:");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
- _builder.append("void executeInitTransition(");
- String _name_2 = ac.getName();
- String _selfPointer_1 = this.langExt.selfPointer(_name_2, false);
- _builder.append(_selfPointer_1, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("void executeInitTransition(�langExt.selfPointer(ac.name, false)�);");
+ _builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("/* receiveEvent contains the main implementation of the FSM */");
_builder.newLine();
_builder.append("\t");
- _builder.append("void receiveEvent(");
- String _name_3 = ac.getName();
- String _selfPointer_2 = this.langExt.selfPointer(_name_3, handleEvents);
- _builder.append(_selfPointer_2, " ");
- {
- if (handleEvents) {
- _builder.append("etRuntime::InterfaceItemBase* ifitem, int evt, ");
- String _voidPointer_1 = this.langExt.voidPointer();
- _builder.append(_voidPointer_1, " ");
- _builder.append(" generic_data");
- }
- }
- _builder.append(");");
- _builder.newLineIfNotEmpty();
+ _builder.append("void receiveEvent(�langExt.selfPointer(ac.name, handleEvents)��IF handleEvents�etRuntime::InterfaceItemBase* ifitem, int evt, �langExt.voidPointer� generic_data�ENDIF�);");
+ _builder.newLine();
_xblockexpression = (_builder);
}
return _xblockexpression;
diff --git a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
index 126b66cae..cdf29dea1 100644
--- a/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
+++ b/plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java
@@ -29,13 +29,11 @@ import org.eclipse.etrice.core.room.RefableType;
import org.eclipse.etrice.core.room.StandardOperation;
import org.eclipse.etrice.core.room.VarDecl;
import org.eclipse.etrice.core.room.util.RoomHelpers;
-import org.eclipse.etrice.generator.base.AbstractGenerator;
import org.eclipse.etrice.generator.generic.ILanguageExtension;
import org.eclipse.etrice.generator.generic.TypeHelpers;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Conversions;
import org.eclipse.xtext.xbase.lib.Extension;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
/**
* A collection of methods for generation of user code, attributes with getters and setters
@@ -204,25 +202,19 @@ public class ProcedureHelpers {
private CharSequence userCode(final String code) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _and = false;
- boolean _notEquals = (!Objects.equal(code, null));
- if (!_notEquals) {
- _and = false;
- } else {
- boolean _isEmpty = code.isEmpty();
- boolean _not = (!_isEmpty);
- _and = (_notEquals && _not);
- }
- if (_and) {
- _builder.append("/*--------------------- begin user code ---------------------*/");
- _builder.newLine();
- _builder.append(code, "");
- _builder.newLineIfNotEmpty();
- _builder.append("/*--------------------- end user code ---------------------*/");
- _builder.newLine();
- }
- }
+ _builder.append("�IF code!=null && !code.empty�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("/*--------------------- begin user code ---------------------*/");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�code�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("/*--------------------- end user code ---------------------*/");
+ _builder.newLine();
+ _builder.append("�ENDIF�");
+ _builder.newLine();
return _builder;
}
@@ -234,13 +226,13 @@ public class ProcedureHelpers {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/*--------------------- attributes ---------------------*/");
_builder.newLine();
- {
- for(final Attribute attribute : attribs) {
- CharSequence _attributeDeclaration = this.attributeDeclaration(attribute);
- _builder.append(_attributeDeclaration, "");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR attribute : attribs�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�attributeDeclaration(attribute)�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -250,41 +242,18 @@ public class ProcedureHelpers {
*/
public CharSequence attributeDeclaration(final Attribute attribute) {
StringConcatenation _builder = new StringConcatenation();
- {
- int _size = attribute.getSize();
- boolean _equals = (_size == 0);
- if (_equals) {
- RefableType _type = attribute.getType();
- DataType _type_1 = _type.getType();
- String _typeName = this._typeHelpers.typeName(_type_1);
- _builder.append(_typeName, "");
- {
- RefableType _type_2 = attribute.getType();
- boolean _isRef = _type_2.isRef();
- if (_isRef) {
- String _pointerLiteral = this.languageExt.pointerLiteral();
- _builder.append(_pointerLiteral, "");
- }
- }
- _builder.append(" ");
- String _name = attribute.getName();
- _builder.append(_name, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- } else {
- RefableType _type_3 = attribute.getType();
- DataType _type_4 = _type_3.getType();
- String _typeName_1 = this._typeHelpers.typeName(_type_4);
- int _size_1 = attribute.getSize();
- String _name_1 = attribute.getName();
- RefableType _type_5 = attribute.getType();
- boolean _isRef_1 = _type_5.isRef();
- String _arrayDeclaration = this.languageExt.arrayDeclaration(_typeName_1, _size_1, _name_1, _isRef_1);
- _builder.append(_arrayDeclaration, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�IF attribute.size==0�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�attribute.type.type.typeName��IF attribute.type.ref��languageExt.pointerLiteral()��ENDIF� �attribute.name�;");
+ _builder.newLine();
+ _builder.append("�ELSE�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�languageExt.arrayDeclaration(attribute.type.type.typeName, attribute.size, attribute.name, attribute.type.ref)�;");
+ _builder.newLine();
+ _builder.append("�ENDIF� \t");
+ _builder.newLine();
return _builder;
}
@@ -359,18 +328,16 @@ public class ProcedureHelpers {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/* --------------------- attribute setters and getters */");
_builder.newLine();
- {
- for(final Attribute attribute : attribs) {
- CharSequence _setterHeader = this.setterHeader(attribute, classname);
- _builder.append(_setterHeader, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- CharSequence _terHeader = this.getterHeader(attribute, classname);
- _builder.append(_terHeader, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
+ _builder.append("�FOR attribute : attribs�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�setterHeader(attribute, classname)�;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�getterHeader(attribute, classname)�;");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -383,40 +350,22 @@ public class ProcedureHelpers {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/* --------------------- attribute setters and getters */");
_builder.newLine();
- {
- for(final Attribute attribute : attribs) {
- CharSequence _setterHeader = this.setterHeader(attribute, classname);
- _builder.append(_setterHeader, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t ");
- String _memberAccess = this.languageExt.memberAccess();
- _builder.append(_memberAccess, " ");
- String _name = attribute.getName();
- _builder.append(_name, " ");
- _builder.append(" = ");
- String _name_1 = attribute.getName();
- _builder.append(_name_1, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- CharSequence _terHeader = this.getterHeader(attribute, classname);
- _builder.append(_terHeader, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return ");
- String _memberAccess_1 = this.languageExt.memberAccess();
- _builder.append(_memberAccess_1, " ");
- String _name_2 = attribute.getName();
- _builder.append(_name_2, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
+ _builder.append("�FOR attribute : attribs��setterHeader(attribute, classname)� {");
+ _builder.newLine();
+ _builder.append("\t ");
+ _builder.append("�languageExt.memberAccess()��attribute.name� = �attribute.name�;");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("�getterHeader(attribute, classname)� {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return �languageExt.memberAccess()��attribute.name�;");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -427,30 +376,7 @@ public class ProcedureHelpers {
*/
private CharSequence setterHeader(final Attribute attribute, final String classname) {
StringConcatenation _builder = new StringConcatenation();
- String _accessLevelPublic = this.languageExt.accessLevelPublic();
- _builder.append(_accessLevelPublic, "");
- _builder.append("void set");
- String _name = attribute.getName();
- String _firstUpper = StringExtensions.toFirstUpper(_name);
- _builder.append(_firstUpper, "");
- _builder.append(" (");
- String _selfPointer = this.languageExt.selfPointer(classname, true);
- _builder.append(_selfPointer, "");
- RefableType _type = attribute.getType();
- DataType _type_1 = _type.getType();
- String _typeName = this._typeHelpers.typeName(_type_1);
- _builder.append(_typeName, "");
- {
- int _size = attribute.getSize();
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append("[]");
- }
- }
- _builder.append(" ");
- String _name_1 = attribute.getName();
- _builder.append(_name_1, "");
- _builder.append(")");
+ _builder.append("�languageExt.accessLevelPublic()�void set�attribute.name.toFirstUpper()� (�languageExt.selfPointer(classname, true)��attribute.type.type.typeName��IF attribute.size!=0�[]�ENDIF� �attribute.name�)");
return _builder;
}
@@ -461,27 +387,7 @@ public class ProcedureHelpers {
*/
private CharSequence getterHeader(final Attribute attribute, final String classname) {
StringConcatenation _builder = new StringConcatenation();
- String _accessLevelPublic = this.languageExt.accessLevelPublic();
- _builder.append(_accessLevelPublic, "");
- RefableType _type = attribute.getType();
- DataType _type_1 = _type.getType();
- String _typeName = this._typeHelpers.typeName(_type_1);
- _builder.append(_typeName, "");
- {
- int _size = attribute.getSize();
- boolean _notEquals = (_size != 0);
- if (_notEquals) {
- _builder.append("[]");
- }
- }
- _builder.append(" get");
- String _name = attribute.getName();
- String _firstUpper = StringExtensions.toFirstUpper(_name);
- _builder.append(_firstUpper, "");
- _builder.append(" (");
- String _selfPointer = this.languageExt.selfPointer(classname, false);
- _builder.append(_selfPointer, "");
- _builder.append(")");
+ _builder.append("�languageExt.accessLevelPublic()��attribute.type.type.typeName��IF attribute.size!=0�[]�ENDIF� get�attribute.name.toFirstUpper()� (�languageExt.selfPointer(classname, false)�)");
return _builder;
}
@@ -491,30 +397,7 @@ public class ProcedureHelpers {
*/
public CharSequence argList(final List<Attribute> attributes) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasElements = false;
- for(final Attribute a : attributes) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(", ", "");
- }
- RefableType _type = a.getType();
- DataType _type_1 = _type.getType();
- String _typeName = this._typeHelpers.typeName(_type_1);
- _builder.append(_typeName, "");
- {
- int _size = a.getSize();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("[]");
- }
- }
- _builder.append(" ");
- String _name = a.getName();
- _builder.append(_name, "");
- }
- }
+ _builder.append("�FOR a : attributes SEPARATOR \", \"��a.type.type.typeName��IF a.size>0�[]�ENDIF� �a.name��ENDFOR�");
return _builder;
}
@@ -525,19 +408,7 @@ public class ProcedureHelpers {
*/
public CharSequence invokeGetters(final Iterable<Attribute> path, final String classname) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasElements = false;
- for(final Attribute a : path) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(".", "");
- }
- String _name = a.getName();
- CharSequence _invokeGetter = this.invokeGetter(_name, classname);
- _builder.append(_invokeGetter, "");
- }
- }
+ _builder.append("�FOR a : path SEPARATOR \'.\'��invokeGetter(a.name, classname)��ENDFOR�");
return _builder;
}
@@ -549,24 +420,11 @@ public class ProcedureHelpers {
*/
public CharSequence getterImplementation(final String typeName, final String name, final String classname) {
StringConcatenation _builder = new StringConcatenation();
- String _accessLevelPublic = this.languageExt.accessLevelPublic();
- _builder.append(_accessLevelPublic, "");
- _builder.append(typeName, "");
- _builder.append(" get");
- String _firstUpper = StringExtensions.toFirstUpper(name);
- _builder.append(_firstUpper, "");
- _builder.append(" (");
- String _selfPointer = this.languageExt.selfPointer(classname, false);
- _builder.append(_selfPointer, "");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
+ _builder.append("�languageExt.accessLevelPublic()��typeName� get�name.toFirstUpper()� (�languageExt.selfPointer(classname, false)�){");
+ _builder.newLine();
_builder.append("\t");
- _builder.append("return ");
- String _memberAccess = this.languageExt.memberAccess();
- _builder.append(_memberAccess, " ");
- _builder.append(name, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder.append("return �languageExt.memberAccess()��name�;");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
return _builder;
@@ -579,13 +437,7 @@ public class ProcedureHelpers {
*/
public CharSequence invokeGetter(final String name, final String classname) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("get");
- String _firstUpper = StringExtensions.toFirstUpper(name);
- _builder.append(_firstUpper, "");
- _builder.append("(");
- String _selfPointer = this.languageExt.selfPointer(classname, true);
- _builder.append(_selfPointer, "");
- _builder.append(")");
+ _builder.append("get�name.toFirstUpper�(�languageExt.selfPointer(classname, true)�)");
return _builder;
}
@@ -597,14 +449,7 @@ public class ProcedureHelpers {
*/
public CharSequence invokeSetter(final String name, final String classname, final String value) {
StringConcatenation _builder = new StringConcatenation();
- _builder.append("set");
- String _firstUpper = StringExtensions.toFirstUpper(name);
- _builder.append(_firstUpper, "");
- _builder.append("(");
- String _selfPointer = this.languageExt.selfPointer(classname, true);
- _builder.append(_selfPointer, "");
- _builder.append(value, "");
- _builder.append(")");
+ _builder.append("set�name.toFirstUpper�(�languageExt.selfPointer(classname, true)��value�)");
return _builder;
}
@@ -617,27 +462,19 @@ public class ProcedureHelpers {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/*--------------------- operations ---------------------*/");
_builder.newLine();
- {
- for(final Operation operation : operations) {
- {
- boolean _and = false;
- boolean _usesInheritance = this.languageExt.usesInheritance();
- if (!_usesInheritance) {
- _and = false;
- } else {
- boolean _isConstructor = RoomHelpers.isConstructor(operation);
- _and = (_usesInheritance && _isConstructor);
- }
- boolean _not = (!_and);
- if (_not) {
- CharSequence _operationSignature = this.operationSignature(operation, classname);
- _builder.append(_operationSignature, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- }
- }
- }
- }
+ _builder.append("�FOR operation : operations�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF !(languageExt.usesInheritance && operation.constructor)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�operationSignature(operation, classname)�;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -650,35 +487,25 @@ public class ProcedureHelpers {
StringConcatenation _builder = new StringConcatenation();
_builder.append("/*--------------------- operations ---------------------*/");
_builder.newLine();
- {
- for(final Operation operation : operations) {
- {
- boolean _and = false;
- boolean _usesInheritance = this.languageExt.usesInheritance();
- if (!_usesInheritance) {
- _and = false;
- } else {
- boolean _isConstructor = RoomHelpers.isConstructor(operation);
- _and = (_usesInheritance && _isConstructor);
- }
- boolean _not = (!_and);
- if (_not) {
- CharSequence _operationSignature = this.operationSignature(operation, classname);
- _builder.append(_operationSignature, "");
- _builder.append(" {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- AbstractGenerator _instance = AbstractGenerator.getInstance();
- DetailCode _detailCode = operation.getDetailCode();
- String _translatedCode = _instance.getTranslatedCode(_detailCode);
- _builder.append(_translatedCode, " ");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
- }
- }
- }
+ _builder.append("�FOR operation : operations�");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�IF !(languageExt.usesInheritance && operation.constructor)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("�operationSignature(operation, classname)� {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("�AbstractGenerator::getInstance().getTranslatedCode(operation.detailCode)�");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("�ENDIF�");
+ _builder.newLine();
+ _builder.append("�ENDFOR�");
+ _builder.newLine();
return _builder;
}
@@ -772,49 +599,13 @@ public class ProcedureHelpers {
*/
private CharSequence BuildArgumentList(final EList<VarDecl> arguments) {
StringConcatenation _builder = new StringConcatenation();
- {
- boolean _hasElements = false;
- for(final VarDecl argument : arguments) {
- if (!_hasElements) {
- _hasElements = true;
- } else {
- _builder.appendImmediate(", ", "");
- }
- RefableType _refType = argument.getRefType();
- DataType _type = _refType.getType();
- String _typeName = this._typeHelpers.typeName(_type);
- _builder.append(_typeName, "");
- {
- RefableType _refType_1 = argument.getRefType();
- boolean _isRef = _refType_1.isRef();
- if (_isRef) {
- String _pointerLiteral = this.languageExt.pointerLiteral();
- _builder.append(_pointerLiteral, "");
- }
- }
- _builder.append(" ");
- String _name = argument.getName();
- _builder.append(_name, "");
- }
- }
+ _builder.append("�FOR argument : arguments SEPARATOR \", \"��argument.refType.type.typeName��IF argument.refType.ref��languageExt.pointerLiteral()��ENDIF� �argument.name��ENDFOR�");
return _builder;
}
private CharSequence classOperationSignature(final String classname, final String operationname, final String argumentList, final String returnType) {
StringConcatenation _builder = new StringConcatenation();
- String _accessLevelPublic = this.languageExt.accessLevelPublic();
- _builder.append(_accessLevelPublic, "");
- _builder.append(returnType, "");
- _builder.append(" ");
- String _memberInDeclaration = this.languageExt.memberInDeclaration(classname, operationname);
- _builder.append(_memberInDeclaration, "");
- _builder.append("(");
- boolean _isEmpty = argumentList.isEmpty();
- boolean _not = (!_isEmpty);
- String _selfPointer = this.languageExt.selfPointer(classname, _not);
- _builder.append(_selfPointer, "");
- _builder.append(argumentList, "");
- _builder.append(")");
+ _builder.append("�languageExt.accessLevelPublic()��returnType� �languageExt.memberInDeclaration(classname, operationname)�(�languageExt.selfPointer(classname, !argumentList.empty)��argumentList�)");
return _builder;
}
}
diff --git a/releng/org.eclipse.etrice.parent/.project b/releng/org.eclipse.etrice.parent/.project
new file mode 100644
index 000000000..f80e22c68
--- /dev/null
+++ b/releng/org.eclipse.etrice.parent/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.etrice.parent</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/releng/org.eclipse.etrice.parent/pom.xml b/releng/org.eclipse.etrice.parent/pom.xml
new file mode 100644
index 000000000..932d5874a
--- /dev/null
+++ b/releng/org.eclipse.etrice.parent/pom.xml
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <prerequisites>
+ <maven>3.0</maven>
+ </prerequisites>
+
+ <groupId>org.eclipse.etrice</groupId>
+ <artifactId>java-generator</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>eTrice ROOM Java generator</name>
+ <description>code generator from ROOM (Real-Time Object Oriented Modeling)
+ models to the Java target language</description>
+ <url>http://eclipse.org/etrice</url>
+ <inceptionYear>2010</inceptionYear>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+ <etrice.version>${project.version}</etrice.version>
+
+ <tycho.version>0.19.0</tycho.version>
+ <tycho-extras.version>${tycho.version}</tycho-extras.version>
+
+ <!-- eclipse version etrice is built against -->
+ <eclipse-repo.url>http://download.eclipse.org/releases/kepler</eclipse-repo.url>
+
+ <orbit-site>http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/repository</orbit-site>
+ </properties>
+
+ <organization>
+ <name>Protos Software GmbH</name>
+ <url>http://www.protos.de</url>
+ </organization>
+
+ <licenses>
+ <license>
+ <name>Eclipse Public License - v 1.0</name>
+ <url>http://www.eclipse.org/legal/epl-v10.html</url>
+ </license>
+ </licenses>
+
+ <issueManagement>
+ <url>https://bugs.eclipse.org/bugs/enter_bug.cgi?product=eTrice</url>
+ <system>Bugzilla</system>
+ </issueManagement>
+
+ <repositories>
+ <repository>
+ <id>eclipse</id>
+ <layout>p2</layout>
+ <url>${eclipse-repo.url}</url>
+ </repository>
+ <repository>
+ <id>orbit</id>
+ <layout>p2</layout>
+ <url>${orbit-site}</url>
+ </repository>
+ <!-- <repository> <id>KIELER</id> <layout>p2</layout> <url>http://download.eclipse.org/etrice/KIELER/kieler-0.7.1</url>
+ </repository> <repository> <id>license repo</id> <layout>p2</layout> <url>http://download.eclipse.org/cbi/updates/license</url>
+ </repository> -->
+ </repositories>
+
+ <modules>
+ <module>../../plugins/org.eclipse.etrice.core.common</module>
+ <module>../../plugins/org.eclipse.etrice.core.room</module>
+ <module>../../plugins/org.eclipse.etrice.core.config</module>
+ <module>../../plugins/org.eclipse.etrice.core.etphys</module>
+ <module>../../plugins/org.eclipse.etrice.core.etmap</module>
+ <module>../../plugins/org.eclipse.etrice.core.genmodel</module>
+ <module>../../plugins/org.eclipse.etrice.generator</module>
+ <module>../../plugins/org.eclipse.etrice.generator.config</module>
+ <module>../../plugins/org.eclipse.etrice.generator.doc</module>
+ <module>../../plugins/org.eclipse.etrice.generator.java</module>
+ <module>../../plugins/org.eclipse.etrice.generator.java.mvn</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-maven-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tycho.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-compiler-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <compilerArguments>
+ <enableJavadoc />
+ <encoding>ISO-8859-1</encoding>
+ </compilerArguments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-packaging-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.tycho.extras</groupId>
+ <artifactId>tycho-buildtimestamp-jgit</artifactId>
+ <version>${tycho-extras.version}</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <strictBinIncludes>false</strictBinIncludes>
+ <format>'v'yyyyMMdd-HHmm</format>
+ <timestampProvider>jgit</timestampProvider>
+ <jgit.ignore>
+ </jgit.ignore>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-director-plugin</artifactId>
+ <version>${tycho.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-repository-plugin</artifactId>
+ <version>${tycho.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-plugin</artifactId>
+ <version>${tycho.version}</version>
+ <configuration>
+ <baselineMode>warn</baselineMode>
+ <baselineReplace>none</baselineReplace>
+ <baselineRepositories>
+ <repository>
+ <url>http://download.eclipse.org/eclipse/updates/4.2</url>
+ </repository>
+ </baselineRepositories>
+ </configuration>
+ </plugin>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId></groupId>
+ <artifactId></artifactId>
+ <versionRange>[,)</versionRange>
+ <goals>
+ <goal></goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <id>repo.eclipse.org</id>
+ <name>eTrice Repository - Releases</name>
+ <url>https://repo.eclipse.org/content/repositories/etrice-releases/</url>
+ </repository>
+ <snapshotRepository>
+ <id>repo.eclipse.org</id>
+ <name>eTrice Repository - Snapshots</name>
+ <url>https://repo.eclipse.org/content/repositories/etrice-snapshots/</url>
+ </snapshotRepository>
+ </distributionManagement>
+</project>
diff --git a/runtime/org.eclipse.etrice.modellib.java/jgen_modellib.launch b/runtime/org.eclipse.etrice.modellib.java/jgen_modellib.launch
index 3e6df2d98..77b85d2e3 100644
--- a/runtime/org.eclipse.etrice.modellib.java/jgen_modellib.launch
+++ b/runtime/org.eclipse.etrice.modellib.java/jgen_modellib.launch
@@ -6,7 +6,9 @@
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.etrice.generator.java.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${workspace_loc:org.eclipse.etrice.modellib.java}/model/ALogService.room&#13;&#10;${workspace_loc:org.eclipse.etrice.modellib.java}/model/TimingService.room&#13;&#10;${workspace_loc:org.eclipse.etrice.modellib.java}/model/TcpService.room&#13;&#10;-lib&#13;&#10;-msc_instr"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.generator.java"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>
diff --git a/runtime/org.eclipse.etrice.runtime.java/jgen_java_runtime.launch b/runtime/org.eclipse.etrice.runtime.java/jgen_java_runtime.launch
index abd885f45..e554de86f 100644
--- a/runtime/org.eclipse.etrice.runtime.java/jgen_java_runtime.launch
+++ b/runtime/org.eclipse.etrice.runtime.java/jgen_java_runtime.launch
@@ -6,7 +6,9 @@
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.etrice.generator.java.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="${workspace_loc:org.eclipse.etrice.runtime.java}/models/SystemServices.room&#13;&#10;-lib"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.etrice.generator.java"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
</launchConfiguration>

Back to the top