Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2019-04-15 13:00:47 -0400
committerJuergen Haug2019-04-15 13:03:58 -0400
commit636465baf602e2bc9ea0b6ae89c2bb255306eaaf (patch)
tree82a2822a601acf79e3672df256f237e4051c5dae /plugins
parentc4fc914e0870f96b996033a92ba515d54c21da0c (diff)
downloadorg.eclipse.etrice-636465baf602e2bc9ea0b6ae89c2bb255306eaaf.tar.gz
org.eclipse.etrice-636465baf602e2bc9ea0b6ae89c2bb255306eaaf.tar.xz
org.eclipse.etrice-636465baf602e2bc9ea0b6ae89c2bb255306eaaf.zip
Bug 546443 - [c.gen] Support special user code for library elements
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
index 3edaff61e..185b0eb8a 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/NodeGen.xtend
@@ -22,6 +22,7 @@ import java.util.Collection
import java.util.HashMap
import java.util.HashSet
import org.eclipse.etrice.core.common.base.LiteralType
+import org.eclipse.etrice.core.common.base.StringLiteral
import org.eclipse.etrice.core.common.converter.TimeConverter
import org.eclipse.etrice.core.etmap.util.ETMapUtil
import org.eclipse.etrice.core.etphys.eTPhys.ExecMode
@@ -407,7 +408,9 @@ class NodeGen {
«genActorInstanceInitializer(root, ai)»
«ENDIF»
«ENDFOR»
-
+
+ /* special user codes from annotation SubSystemUserCode */
+ «ssi.generateSubSystemUserCodes»
'''
}
@@ -890,4 +893,10 @@ class NodeGen {
}
}
}
+
+ private def generateSubSystemUserCodes(SubSystemInstance ssi) {
+ val acs = ssi.allContainedInstances.map[actorClass].toSet
+ val annotations = acs.map[annotations.filter[type.name == 'SubSystemUserCode']].flatten
+ annotations.map[attributes].flatten.map[value].filter(StringLiteral).map[value].join(NEWLINE)
+ }
}

Back to the top