Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-02-20 14:39:26 +0000
committerHenrik Rentz-Reichert2012-02-20 14:39:26 +0000
commit82ccdad95b178e017ff657e7c8dbd5492639b3d0 (patch)
tree63d554999681d87005d8d18456f515596a9ed1a1 /plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator
parent75040cb3a48b029271bd431075fbee68f03b40de (diff)
downloadorg.eclipse.etrice-82ccdad95b178e017ff657e7c8dbd5492639b3d0.tar.gz
org.eclipse.etrice-82ccdad95b178e017ff657e7c8dbd5492639b3d0.tar.xz
org.eclipse.etrice-82ccdad95b178e017ff657e7c8dbd5492639b3d0.zip
[generator, generator.c] some fixes, added actor attributes
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator')
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend3
-rw-r--r--plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend3
2 files changed, 6 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
index ebee5db5e..cc9dd459c 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend
@@ -80,6 +80,8 @@ class ActorClassGen extends GenericActorClassGenerator {
«generateIncludeGuardBegin(xpac.name)»
#include "etDatatypes.h"
+ #include "etMessage.h"
+
«FOR dataClass : root.getReferencedDataClasses(ac)»
#include "«dataClass.name».h"
«ENDFOR»
@@ -103,6 +105,7 @@ class ActorClassGen extends GenericActorClassGenerator {
/* variable part of ActorClass (RAM) */
struct «xpac.name» {
const «xpac.name»_const* constData;
+ «helpers.attributes(ac.attributes)»
«IF xpac.hasNonEmptyStateMachine»
«stateMachineGen.genDataMembers(xpac, ac)»
«ENDIF»
diff --git a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
index f6c264741..bea5bdd0a 100644
--- a/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
+++ b/plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/CExtensions.xtend
@@ -108,6 +108,9 @@ class CExtensions implements ILanguageExtension {
}
override String genEnumeration(String name, List<Pair<String, String>> entries) {
+ if (entries.empty)
+ return "/* empty enum not generated */"
+
'''
enum «name» {
«FOR entry: entries SEPARATOR ","»

Back to the top