Bläddra i källkod

Add ITypeSystemAccess for TypeSpecifier #975 (#976)

* Add ITypeSystemAccess for TypeSpecifier #975
This is required for PRO to derive pointer base types

* added null check for declarations without type #975
Andreas Mülder 8 år sedan
förälder
incheckning
b7343ae0af
21 ändrade filer med 142 tillägg och 86 borttagningar
  1. 1 1
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Naming.xtend
  2. 6 6
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineHeader.xtend
  3. 1 1
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineRequiredHeader.xtend
  4. 4 4
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineSource.xtend
  5. 5 0
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/types/CTypeSystemAccess.xtend
  6. 3 0
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/types/ICodegenTypeSystemAccess.java
  7. 2 2
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/Naming.xtend
  8. 5 5
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/StatemachineHeader.xtend
  9. 8 8
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/StatemachineImplementation.xtend
  10. 4 4
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RunnableWrapper.xtend
  11. 15 15
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Statemachine.xtend
  12. 8 8
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/StatemachineInterface.xtend
  13. 6 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/types/CSharpTypeSystemAccess.xtend
  14. 5 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/types/OldCSharpTypeSystemAccess.xtend
  15. 4 4
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/CycleBasedSynchronizedWrapper.xtend
  16. 1 1
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/EventBasedRunnableWrapper.xtend
  17. 19 19
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/Statemachine.xtend
  18. 8 8
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/StatemachineInterface.xtend
  19. 5 0
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/types/JavaTypeSystemAccess.xtend
  20. 5 0
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/types/OldJavaTypeSystemAccess.xtend
  21. 27 0
      test-plugins/org.yakindu.sct.generator.c.test/log4j.properties

+ 1 - 1
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/Naming.xtend

@@ -237,7 +237,7 @@ class Naming {
 	def scHandle() { 'handle' }
 
 	def valueParams(EventDefinition it) {
-		if(hasValue) ', ' + type.targetLanguageName + ' value' else ''
+		if(hasValue) ', ' + typeSpecifier.targetLanguageName + ' value' else ''
 	}
 
 	def dispatch access(VariableDefinition it) {

+ 6 - 6
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineHeader.xtend

@@ -132,7 +132,7 @@ class StatemachineHeader implements IContentTemplate {
 
 	def dispatch scopeTypeDeclMember(EventDefinition it) '''
 		sc_boolean «name.asIdentifier»_raised;
-		«IF type != null && type.name != 'void'»«type.targetLanguageName» «name.asIdentifier»_value;«ENDIF»
+		«IF type != null && type.name != 'void'»«typeSpecifier.targetLanguageName» «name.asIdentifier»_value;«ENDIF»
 	'''
 
 	def dispatch scopeTypeDeclMember(TimeEvent it) '''
@@ -140,7 +140,7 @@ class StatemachineHeader implements IContentTemplate {
 	'''
 
 	def dispatch scopeTypeDeclMember(VariableDefinition it) '''
-		«IF type.name != 'void' && !isConst»«type.targetLanguageName» «name.asEscapedIdentifier»;«ENDIF»
+		«IF type.name != 'void' && !isConst»«typeSpecifier.targetLanguageName» «name.asEscapedIdentifier»;«ENDIF»
 	'''
 	
 	def dispatch scopeTypeDeclMember(Declaration it) ''''''
@@ -163,7 +163,7 @@ class StatemachineHeader implements IContentTemplate {
 		«IF !(scope instanceof InternalScope) && !scope.constDeclarations.empty»
 			/* Declaration of constants for scope «scope.type». */
 			«FOR d : scope.constDeclarations AFTER newLine»
-				«IF d.type.name != 'void'»extern const «d.type.targetLanguageName» «d.constantName»;«ENDIF»
+				«IF d.type.name != 'void'»extern const «d.typeSpecifier.targetLanguageName» «d.constantName»;«ENDIF»
 			«ENDFOR»
 		«ENDIF»
 	'''
@@ -220,7 +220,7 @@ class StatemachineHeader implements IContentTemplate {
 			
 			«IF hasValue»
 				/*! Gets the value of the out event '«name»' that is defined in the «scope.scopeDescription». */ 
-				extern «type.targetLanguageName» «asGetter»(const «scHandleDecl»);
+				extern «typeSpecifier.targetLanguageName» «asGetter»(const «scHandleDecl»);
 				
 			«ENDIF»
 		«ENDIF»
@@ -228,10 +228,10 @@ class StatemachineHeader implements IContentTemplate {
 
 	def dispatch functionPrototypes(VariableDefinition it) '''
 		/*! Gets the value of the variable '«name»' that is defined in the «scope.scopeDescription». */ 
-		extern «IF const»const «ENDIF»«type.targetLanguageName» «it.asGetter»(const «scHandleDecl»);
+		extern «IF const»const «ENDIF»«typeSpecifier.targetLanguageName» «it.asGetter»(const «scHandleDecl»);
 		«IF !readonly && !const»
 			/*! Sets the value of the variable '«name»' that is defined in the «scope.scopeDescription». */ 
-			extern void «asSetter»(«scHandleDecl», «type.targetLanguageName» value);
+			extern void «asSetter»(«scHandleDecl», «typeSpecifier.targetLanguageName» value);
 		«ENDIF»
 	'''
 }

+ 1 - 1
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineRequiredHeader.xtend

@@ -126,7 +126,7 @@ class StatemachineRequiredHeader implements IContentTemplate {
 	def dispatch functionPrototypes(Declaration it) ''''''
 
 	def dispatch functionPrototypes(OperationDefinition it) '''
-		extern «type.targetLanguageName» «asFunction»(const «scHandleDecl»«FOR p : parameters BEFORE ', ' SEPARATOR ', '»const «p.type.targetLanguageName» «p.name.asIdentifier»«ENDFOR»);
+		extern «typeSpecifier.targetLanguageName» «asFunction»(const «scHandleDecl»«FOR p : parameters BEFORE ', ' SEPARATOR ', '»const «p.typeSpecifier.targetLanguageName» «p.name.asIdentifier»«ENDFOR»);
 	'''
 
 }

+ 4 - 4
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineSource.xtend

@@ -276,7 +276,7 @@ class StatemachineSource implements IContentTemplate {
 					return «event.access»;
 				}
 				«IF event.hasValue» 
-					«event.type.targetLanguageName» «event.asGetter»(const «scHandleDecl»)
+					«event.typeSpecifier.targetLanguageName» «event.asGetter»(const «scHandleDecl»)
 					{
 						return «event.valueAccess»;
 					}
@@ -284,12 +284,12 @@ class StatemachineSource implements IContentTemplate {
 			«ENDFOR»
 			
 			«FOR variable : scope.variableDefinitions»
-				«IF variable.const»const «ENDIF»«variable.type.targetLanguageName» «variable.asGetter»(const «scHandleDecl»)
+				«IF variable.const»const «ENDIF»«variable.typeSpecifier.targetLanguageName» «variable.asGetter»(const «scHandleDecl»)
 				{
 					return «variable.access»;
 				}
 				«IF !variable.readonly && !variable.const»
-				void «variable.asSetter»(«scHandleDecl», «variable.type.targetLanguageName» value)
+				void «variable.asSetter»(«scHandleDecl», «variable.typeSpecifier.targetLanguageName» value)
 				{
 					«variable.access» = value;
 				}
@@ -319,7 +319,7 @@ class StatemachineSource implements IContentTemplate {
 	def constantDefinitions(ExecutionFlow it) '''
 		«FOR scope : scopes.filter(typeof(StatechartScope))»
 			«FOR d : scope.declarations.filter(typeof(VariableDefinition)).filter[const]»
-				«IF d.type.name != 'void'»const «d.type.targetLanguageName» «d.access» = «d.initialValue.resolveConstants»;«ENDIF»
+				«IF d.type.name != 'void'»const «d.typeSpecifier.targetLanguageName» «d.access» = «d.initialValue.resolveConstants»;«ENDIF»
 			«ENDFOR»
 		«ENDFOR»
 	'''

+ 5 - 0
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/types/CTypeSystemAccess.xtend

@@ -12,6 +12,7 @@ package org.yakindu.sct.generator.c.types
 
 import com.google.inject.Inject
 import org.yakindu.base.types.Type
+import org.yakindu.base.types.TypeSpecifier
 import org.yakindu.base.types.typesystem.ITypeSystem
 import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
 
@@ -35,6 +36,10 @@ class CTypeSystemAccess implements ICodegenTypeSystemAccess {
 			case ts.isSame(originialType, getType(STRING)): 'sc_string'
 			default: throw new IllegalArgumentException("Target language name could not be inferred for type " + type)
 		}
+	}
+	
+	override getTargetLanguageName(TypeSpecifier typeSpecifier) {
+		return getTargetLanguageName(typeSpecifier?.type)
 	}
 
 }

+ 3 - 0
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/types/ICodegenTypeSystemAccess.java

@@ -11,8 +11,11 @@
 package org.yakindu.sct.generator.core.types;
 
 import org.yakindu.base.types.Type;
+import org.yakindu.base.types.TypeSpecifier;
 
 public interface ICodegenTypeSystemAccess {
 
 	public String getTargetLanguageName(Type type);
+	
+	public String getTargetLanguageName(TypeSpecifier typeSpecifier);
 }

+ 2 - 2
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/Naming.xtend

@@ -69,7 +69,7 @@ class Naming extends org.yakindu.sct.generator.c.Naming {
 	}
 
 	def protected signature(OperationDefinition it) '''
-	«type.targetLanguageName» «name.asEscapedIdentifier»(«FOR parameter : parameters SEPARATOR ', '»«parameter.type.
+	«typeSpecifier.targetLanguageName» «name.asEscapedIdentifier»(«FOR parameter : parameters SEPARATOR ', '»«parameter.typeSpecifier.
 		targetLanguageName» «parameter.identifier»«ENDFOR»)'''
 
 	def protected OCB_InterfaceSetterDeclaration(StatechartScope scope, boolean fqn) '''
@@ -187,7 +187,7 @@ class Naming extends org.yakindu.sct.generator.c.Naming {
 
 	override valueParams(EventDefinition it) {
 		if (hasValue)
-			type.targetLanguageName + ' value'
+			typeSpecifier.targetLanguageName + ' value'
 		else
 			''
 	}

+ 5 - 5
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/StatemachineHeader.xtend

@@ -156,7 +156,7 @@ class StatemachineHeader extends org.yakindu.sct.generator.c.StatemachineHeader
 	'''
 
 	override dispatch scopeTypeDeclMember(VariableDefinition it) '''
-		«IF type.name != 'void'»«IF const»static const «ENDIF»«type.targetLanguageName» «name.asEscapedIdentifier»;«ENDIF»
+		«IF type.name != 'void'»«IF const»static const «ENDIF»«typeSpecifier.targetLanguageName» «name.asEscapedIdentifier»;«ENDIF»
 	'''
 
 	def createOCBInterface(StatechartScope scope) {
@@ -256,7 +256,7 @@ class StatemachineHeader extends org.yakindu.sct.generator.c.StatemachineHeader
 			
 			«IF hasValue»
 				/*! Gets the value of the out event '«name»' that is defined in the «scope.scopeDescription». */
-				«type.targetLanguageName» «asGetter»();
+				«typeSpecifier.targetLanguageName» «asGetter»();
 				
 			«ENDIF»
 		«ELSEIF direction == Direction::IN»
@@ -269,7 +269,7 @@ class StatemachineHeader extends org.yakindu.sct.generator.c.StatemachineHeader
 			
 			«IF hasValue»
 				/*! Gets the value of the out event '«name»' that is defined in the «scope.scopeDescription». */
-				«type.targetLanguageName» «asGetter»();
+				«typeSpecifier.targetLanguageName» «asGetter»();
 				
 			«ENDIF»
 		«ENDIF»
@@ -277,11 +277,11 @@ class StatemachineHeader extends org.yakindu.sct.generator.c.StatemachineHeader
 
 	override dispatch functionPrototypes(VariableDefinition it) '''
 		/*! Gets the value of the variable '«name»' that is defined in the «scope.scopeDescription». */
-		«IF const»const «ENDIF»«type.targetLanguageName» «it.asGetter»();
+		«IF const»const «ENDIF»«typeSpecifier.targetLanguageName» «it.asGetter»();
 
 		«IF !readonly && !const»
 			/*! Sets the value of the variable '«name»' that is defined in the «scope.scopeDescription». */
-			void «asSetter»(«type.targetLanguageName» value);
+			void «asSetter»(«typeSpecifier.targetLanguageName» value);
 			
 		«ENDIF»
 	'''

+ 8 - 8
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/StatemachineImplementation.xtend

@@ -274,7 +274,7 @@ class StatemachineImplementation implements IContentTemplate {
 	def constantDefinitions(ExecutionFlow it) '''
 		«FOR scope : statechartScopes»
 			«FOR d : scope.declarations.filter(typeof(VariableDefinition)).filter[const] AFTER newLine»
-				«IF d.type.name != 'void'»const «d.type.targetLanguageName» «d.access» = «d.initialValue.code»;«ENDIF»
+				«IF d.type.name != 'void'»const «d.typeSpecifier.targetLanguageName» «d.access» = «d.initialValue.code»;«ENDIF»
 			«ENDFOR»
 		«ENDFOR»
 	'''
@@ -323,13 +323,13 @@ class StatemachineImplementation implements IContentTemplate {
 					
 				«ENDIF»
 				«IF event.hasValue»
-					«event.type.targetLanguageName» «module»::«scope.interfaceName»::«event.asGetter»()
+					«event.typeSpecifier.targetLanguageName» «module»::«scope.interfaceName»::«event.asGetter»()
 					{
 						return «event.localValueAccess»;
 					}
 					
 					«IF scope.defaultInterface»
-						«event.type.targetLanguageName» «module»::«event.asGetter»()
+						«event.typeSpecifier.targetLanguageName» «module»::«event.asGetter»()
 						{
 							return «scope.instance».«event.asGetter»();
 						}
@@ -353,7 +353,7 @@ class StatemachineImplementation implements IContentTemplate {
 				}
 				
 				«IF event.hasValue» 
-					«event.type.targetLanguageName» «module»::«scope.interfaceName»::«event.asGetter»()
+					«event.typeSpecifier.targetLanguageName» «module»::«scope.interfaceName»::«event.asGetter»()
 					{
 						return «event.localValueAccess»;
 					}
@@ -361,26 +361,26 @@ class StatemachineImplementation implements IContentTemplate {
 				«ENDIF»
 			«ENDFOR»
 			«FOR variable : scope.variableDefinitions»
-				«IF variable.const»const «ENDIF»«variable.type.targetLanguageName» «module»::«scope.interfaceName»::«variable.asGetter»()
+				«IF variable.const»const «ENDIF»«variable.typeSpecifier.targetLanguageName» «module»::«scope.interfaceName»::«variable.asGetter»()
 				{
 					return «variable.localAccess»;
 				}
 				
 				«IF scope.defaultInterface»
-					«IF variable.const»const «ENDIF»«variable.type.targetLanguageName» «module»::«variable.asGetter»()
+					«IF variable.const»const «ENDIF»«variable.typeSpecifier.targetLanguageName» «module»::«variable.asGetter»()
 					{
 						return «variable.access»;
 					}
 					
 				«ENDIF»
 				«IF !variable.readonly && !variable.const»
-					void «module»::«scope.interfaceName»::«variable.asSetter»(«variable.type.targetLanguageName» value)
+					void «module»::«scope.interfaceName»::«variable.asSetter»(«variable.typeSpecifier.targetLanguageName» value)
 					{
 						«variable.localAccess» = value;
 					}
 					
 					«IF scope.defaultInterface»
-						void «module»::«variable.asSetter»(«variable.type.targetLanguageName» value)
+						void «module»::«variable.asSetter»(«variable.typeSpecifier.targetLanguageName» value)
 						{
 							«variable.access» = value;
 						}

+ 4 - 4
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RunnableWrapper.xtend

@@ -196,7 +196,7 @@ class RunnableWrapper {
 		«FOR event : scope.eventDefinitions»
 			«IF event.direction == Direction::IN»
 				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-					public void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+					public void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value) {
 						
 						eventQueue.Add( new Runnable() {
 							
@@ -232,7 +232,7 @@ class RunnableWrapper {
 				}
 				
 				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-					public «event.type.targetLanguageName» get«event.name.asName»Value() {
+					public «event.typeSpecifier.targetLanguageName» get«event.name.asName»Value() {
 						lock(statemachine) {
 							return statemachine.get«scope.interfaceName»().get«event.name.asName»Value();
 						}
@@ -241,14 +241,14 @@ class RunnableWrapper {
 			«ENDIF»
 		«ENDFOR»
 		«FOR variable : scope.variableDefinitions»
-			public «variable.type.targetLanguageName» «variable.getter» {
+			public «variable.typeSpecifier.targetLanguageName» «variable.getter» {
 				lock(statemachine) {
 					return statemachine.get«scope.interfaceName»().«variable.getter»;
 				}
 			}
 			
 			«IF !variable.readonly && !variable.const»
-				public void «variable.setter»(«variable.type.targetLanguageName» value) {
+				public void «variable.setter»(«variable.typeSpecifier.targetLanguageName» value) {
 					lock(statemachine) {
 						statemachine.get«scope.interfaceName»().«variable.setter»(value);
 					}

+ 15 - 15
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/Statemachine.xtend

@@ -104,7 +104,7 @@ class Statemachine {
 		private bool «event.symbol»;
 		
 		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-			private «event.type.targetLanguageName» «event.valueIdentifier»;
+			private «event.typeSpecifier.targetLanguageName» «event.valueIdentifier»;
 		«ENDIF»
 		«ENDFOR»
 		«IF flow.timed»
@@ -149,7 +149,7 @@ class Statemachine {
 	'''
 	
 	def protected writeableFieldDeclaration(VariableDefinition variable){
-		'''public	 «variable.type.targetLanguageName» «variable.symbol»;'''
+		'''public	 «variable.typeSpecifier.targetLanguageName» «variable.symbol»;'''
 	}
 	
 	
@@ -378,12 +378,12 @@ class Statemachine {
 		«IF !variable.const»
 			«variable.writeableFieldDeclaration»
 		«ENDIF»
-		public «variable.type.targetLanguageName» «variable.getter» {
+		public «variable.typeSpecifier.targetLanguageName» «variable.getter» {
 			return «variable.symbol»;
 		}
 		
 		«IF !variable.readonly && !variable.const»
-			public void «variable.setter»(«variable.type.targetLanguageName» value) {
+			public void «variable.setter»(«variable.typeSpecifier.targetLanguageName» value) {
 				this.«variable.symbol» = value;
 			}
 		«ENDIF»
@@ -393,7 +393,7 @@ class Statemachine {
 		public bool «event.symbol»;
 		
 		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-			public «event.type.targetLanguageName» «event.valueIdentifier»;
+			public «event.typeSpecifier.targetLanguageName» «event.valueIdentifier»;
 		«ENDIF»
 		
 		«IF event.direction == Direction::IN»
@@ -412,7 +412,7 @@ class Statemachine {
 		}
 		
 		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-			private void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+			private void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value) {
 				«event.symbol» = true;
 				«event.valueIdentifier» = value;
 				«IF entry.createInterfaceObserver»
@@ -422,7 +422,7 @@ class Statemachine {
 				«ENDIF»
 			}
 			
-			public «event.type.targetLanguageName» get«event.name.asName»Value() {
+			public «event.typeSpecifier.targetLanguageName» get«event.name.asName»Value() {
 				«event.getIllegalAccessValidation()»
 				return «event.valueIdentifier»;
 			}
@@ -440,12 +440,12 @@ class Statemachine {
 
 	protected def generateInEventDefinition(EventDefinition event) '''
 		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-			public void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+			public void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value) {
 				«event.symbol» = true;
 				«event.valueIdentifier» = value;
 			}
 			
-			private «event.type.targetLanguageName» get«event.name.asName»Value() {
+			private «event.typeSpecifier.targetLanguageName» get«event.name.asName»Value() {
 				«event.getIllegalAccessValidation()»
 				return «event.valueIdentifier»;
 			}
@@ -485,12 +485,12 @@ class Statemachine {
 	def protected internalScopeFunctions (ExecutionFlow flow) '''
 		«FOR event : flow.internalScopeEvents»
 			«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-				private void raise«event.name.asEscapedName»(«event.type.targetLanguageName» value) {
+				private void raise«event.name.asEscapedName»(«event.typeSpecifier.targetLanguageName» value) {
 					«event.valueIdentifier» = value;
 					«event.symbol» = true;
 				}
 				
-				private «event.type.targetLanguageName» get«event.name.asEscapedName»Value() {
+				private «event.typeSpecifier.targetLanguageName» get«event.name.asEscapedName»Value() {
 					«event.getIllegalAccessValidation()»
 					return «event.valueIdentifier»;
 				}
@@ -519,7 +519,7 @@ class Statemachine {
 			«FOR event : scope.eventDefinitions»
 				«IF event.direction == Direction::IN»
 					«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-					public void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+					public void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value) {
 						«scope.interfaceName.asEscapedIdentifier».raise«event.name.asName»(value);
 					}
 					«ELSE»
@@ -533,7 +533,7 @@ class Statemachine {
 						return «scope.interfaceName.asEscapedIdentifier».isRaised«event.name.asName»();
 					}
 					«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-						public «event.type.targetLanguageName» get«event.name.asName»Value() {
+						public «event.typeSpecifier.targetLanguageName» get«event.name.asName»Value() {
 							return «scope.interfaceName.asEscapedIdentifier».get«event.name.asName»Value();
 						}
 					«ENDIF»
@@ -541,12 +541,12 @@ class Statemachine {
 			«ENDFOR»
 			
 			«FOR variable : scope.variableDefinitions»
-					public «variable.type.targetLanguageName» «variable.getter()» {
+					public «variable.typeSpecifier.targetLanguageName» «variable.getter()» {
 						return «scope.interfaceName.asEscapedIdentifier».«variable.getter()»;
 					}
 					
 					«IF !variable.const && !variable.readonly»
-						public void «variable.setter»(«variable.type.targetLanguageName» value) {
+						public void «variable.setter»(«variable.typeSpecifier.targetLanguageName» value) {
 						«scope.interfaceName.asEscapedIdentifier».«variable.setter»(value);
 						}	
 					«ENDIF»

+ 8 - 8
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/StatemachineInterface.xtend

@@ -80,7 +80,7 @@ class StatemachineInterface {
 	}
 	
 	def protected constantFieldDeclaration(VariableDefinition variable){
-		'''static readonly «variable.type.targetLanguageName» «variable.symbol» = «variable.initialValue.code»;'''
+		'''static readonly «variable.typeSpecifier.targetLanguageName» «variable.symbol» = «variable.initialValue.code»;'''
 	}
 
 	def protected createScope(Scope scope, GeneratorEntry entry) {
@@ -140,7 +140,7 @@ class StatemachineInterface {
 					«FOR event : scope.eventDefinitions»
 						«IF event.direction == Direction::OUT»
 							«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-								void on«event.name.toFirstUpper()»Raised(«event.type.targetLanguageName» value);
+								void on«event.name.toFirstUpper()»Raised(«event.typeSpecifier.targetLanguageName» value);
 							«ELSE»
 								void on«event.name.toFirstUpper()»Raised();
 							«ENDIF»	
@@ -169,7 +169,7 @@ class StatemachineInterface {
 			«FOR event : scope.eventDefinitions»
 				«IF event.direction == Direction::IN»
 				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-						void raise«event.name.asName»(«event.type.targetLanguageName» value);
+						void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value);
 					«ELSE»
 						void raise«event.name.asName»();
 					«ENDIF»
@@ -177,7 +177,7 @@ class StatemachineInterface {
 					bool isRaised«event.name.asName»();
 					««« IMPORTANT: An event not specifying a type is regarded to have a void type
 				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-						«event.type.targetLanguageName» get«event.name.asName»Value();
+						«event.typeSpecifier.targetLanguageName» get«event.name.asName»Value();
 					«ENDIF»	
 				«ENDIF»
 			«ENDFOR»
@@ -186,9 +186,9 @@ class StatemachineInterface {
 
 	def protected variableAccessors(InterfaceScope scope) '''
 		«FOR variable : scope.variableDefinitions»
-			«variable.type.targetLanguageName» «variable.getter»;
+			«variable.typeSpecifier.targetLanguageName» «variable.getter»;
 			«IF !variable.readonly && !variable.const»
-				void «variable.setter»(«variable.type.targetLanguageName» value);	
+				void «variable.setter»(«variable.typeSpecifier.targetLanguageName» value);	
 			«ENDIF»
 		«ENDFOR»
 	'''
@@ -208,8 +208,8 @@ class StatemachineInterface {
 
 	def protected operationSignature(OperationDefinition it) {
 		'''
-			«type.targetLanguageName» «name.asEscapedIdentifier»(«FOR parameter : parameters SEPARATOR ', '»«parameter.
-				type.targetLanguageName» «parameter.identifier»«ENDFOR»);
+			«typeSpecifier.targetLanguageName» «name.asEscapedIdentifier»(«FOR parameter : parameters SEPARATOR ', '»«parameter.
+				typeSpecifier.targetLanguageName» «parameter.identifier»«ENDFOR»);
 		'''
 	}
 

+ 6 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/types/CSharpTypeSystemAccess.xtend

@@ -16,6 +16,7 @@ import org.yakindu.base.types.typesystem.ITypeSystem
 import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
 
 import static org.yakindu.base.types.typesystem.ITypeSystem.*
+import org.yakindu.base.types.TypeSpecifier
 
 /**
  * @author andreas muelder
@@ -35,4 +36,9 @@ class CSharpTypeSystemAccess implements ICodegenTypeSystemAccess {
 			default: "//" + this
 		};
 	}
+	
+	override getTargetLanguageName(TypeSpecifier typeSpecifier) {
+		return getTargetLanguageName(typeSpecifier?.type)
+	}
+	
 }

+ 5 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/types/OldCSharpTypeSystemAccess.xtend

@@ -12,6 +12,7 @@ package org.yakindu.sct.generator.csharp.types
 
 import com.google.inject.Inject
 import org.yakindu.base.types.Type
+import org.yakindu.base.types.TypeSpecifier
 import org.yakindu.base.types.typesystem.ITypeSystem
 import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
 
@@ -36,4 +37,8 @@ class OldCSharpTypeSystemAccess implements ICodegenTypeSystemAccess {
 			default: "//" + this
 		};
 	}
+	
+	override getTargetLanguageName(TypeSpecifier typeSpecifier) {
+		return getTargetLanguageName(typeSpecifier?.type)
+	}
 }

+ 4 - 4
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/CycleBasedSynchronizedWrapper.xtend

@@ -178,7 +178,7 @@ class CycleBasedSynchronizedWrapper {
 		«FOR event : scope.eventDefinitions»
 			«IF event.direction == Direction::IN»
 				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-					public void raise«event.name.asName»(final «event.type.targetLanguageName» value) {
+					public void raise«event.name.asName»(final «event.typeSpecifier.targetLanguageName» value) {
 						
 						synchronized (statemachine) {
 							statemachine.get«scope.interfaceName»().raise«event.name.asName»(value);
@@ -205,7 +205,7 @@ class CycleBasedSynchronizedWrapper {
 				}
 				
 				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-					public «event.type.targetLanguageName» get«event.name.asName»Value() {
+					public «event.typeSpecifier.targetLanguageName» get«event.name.asName»Value() {
 						synchronized(statemachine) {
 							return statemachine.get«scope.interfaceName»().get«event.name.asName»Value();
 						}
@@ -214,14 +214,14 @@ class CycleBasedSynchronizedWrapper {
 			«ENDIF»
 		«ENDFOR»
 		«FOR variable : scope.variableDefinitions»
-			public «variable.type.targetLanguageName» «variable.getter» {
+			public «variable.typeSpecifier.targetLanguageName» «variable.getter» {
 				synchronized(statemachine) {
 					return statemachine.get«scope.interfaceName»().«variable.getter»;
 				}
 			}
 			
 			«IF !variable.readonly && !variable.const»
-				public void «variable.setter»(final «variable.type.targetLanguageName» value) {
+				public void «variable.setter»(final «variable.typeSpecifier.targetLanguageName» value) {
 					synchronized(statemachine) {
 						statemachine.get«scope.interfaceName»().«variable.setter»(value);
 					}

+ 1 - 1
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/EventBasedRunnableWrapper.xtend

@@ -119,7 +119,7 @@ class EventBasedRunnableWrapper {
 		«FOR event : scope.eventDefinitions»
 			«IF event.direction == Direction::IN»
 				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-					public void raise«event.name.asName»(final «event.type.targetLanguageName» value) {
+					public void raise«event.name.asName»(final «event.typeSpecifier.targetLanguageName» value) {
 						
 						eventQueue.add( new Runnable() {
 							

+ 19 - 19
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/Statemachine.xtend

@@ -113,23 +113,23 @@ class Statemachine {
 			private boolean «event.identifier»;
 			
 			«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-				private «event.type.targetLanguageName» «event.valueIdentifier»;
+				private «event.typeSpecifier.targetLanguageName» «event.valueIdentifier»;
 
 			«ENDIF»
 		«ENDFOR»
 		«FOR variable : flow.internalScopeVariables SEPARATOR newLine AFTER newLine»
 			«IF !variable.const»
 				«variable.fieldDeclaration»
-				protected void «variable.setter»(«variable.type.targetLanguageName» value) {
+				protected void «variable.setter»(«variable.typeSpecifier.targetLanguageName» value) {
 					«variable.identifier» = value;
 				}
 
 			«ENDIF»
-			protected «variable.type.targetLanguageName» «variable.getter» {
+			protected «variable.typeSpecifier.targetLanguageName» «variable.getter» {
 				return «variable.identifier»;
 			}
 			«IF variable.needsAssignMethod»
-				protected «variable.type.targetLanguageName» «variable.assign»(«variable.type.targetLanguageName» value) {
+				protected «variable.typeSpecifier.targetLanguageName» «variable.assign»(«variable.typeSpecifier.targetLanguageName» value) {
 					return this.«variable.identifier» = value;
 				}
 
@@ -143,7 +143,7 @@ class Statemachine {
 	'''
 	//reused by interfaces
 	def protected fieldDeclaration(VariableDefinition variable) {
-		'''private «variable.type.targetLanguageName» «variable.identifier»;
+		'''private «variable.typeSpecifier.targetLanguageName» «variable.identifier»;
 
 		'''
 	}
@@ -369,18 +369,18 @@ class Statemachine {
 			«IF !variable.const»
 				«variable.fieldDeclaration»
 			«ENDIF»
-			public «variable.type.targetLanguageName» «variable.getter» {
+			public «variable.typeSpecifier.targetLanguageName» «variable.getter» {
 				return «variable.identifier»;
 			}
 
 			«IF !variable.const»
-			«IF variable.readonly»protected«ELSE»public«ENDIF» void «variable.setter»(«variable.type.targetLanguageName» value) {
+			«IF variable.readonly»protected«ELSE»public«ENDIF» void «variable.setter»(«variable.typeSpecifier.targetLanguageName» value) {
 				this.«variable.identifier» = value;
 			}
 
 			«ENDIF»
 			«IF variable.needsAssignMethod»
-			protected «variable.type.targetLanguageName» «variable.assign»(«variable.type.targetLanguageName» value) {
+			protected «variable.typeSpecifier.targetLanguageName» «variable.assign»(«variable.typeSpecifier.targetLanguageName» value) {
 				return this.«variable.identifier» = value;
 			}
 
@@ -391,7 +391,7 @@ class Statemachine {
 		private boolean «event.identifier»;
 
 		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-			private «event.type.targetLanguageName» «event.valueIdentifier»;
+			private «event.typeSpecifier.targetLanguageName» «event.valueIdentifier»;
 
 		«ENDIF»
 		«IF event.direction == Direction::IN»
@@ -408,7 +408,7 @@ class Statemachine {
 		}
 		
 		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-			protected void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+			protected void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value) {
 				«event.identifier» = true;
 				«event.valueIdentifier» = value;
 				«IF entry.createInterfaceObserver»
@@ -418,7 +418,7 @@ class Statemachine {
 				«ENDIF»
 			}
 			
-			public «event.type.targetLanguageName» get«event.name.asName»Value() {
+			public «event.typeSpecifier.targetLanguageName» get«event.name.asName»Value() {
 				«event.getIllegalAccessValidation()»
 				return «event.valueIdentifier»;
 			}
@@ -438,12 +438,12 @@ class Statemachine {
 
 	protected def generateInEventDefinition(EventDefinition event) '''
 		«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-			public void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+			public void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value) {
 				«event.identifier» = true;
 				«event.valueIdentifier» = value;
 			}
 			
-			protected «event.type.targetLanguageName» get«event.name.asName»Value() {
+			protected «event.typeSpecifier.targetLanguageName» get«event.name.asName»Value() {
 				«event.getIllegalAccessValidation()»
 				return «event.valueIdentifier»;
 			}
@@ -482,12 +482,12 @@ class Statemachine {
 	def protected internalScopeFunctions (ExecutionFlow flow) '''
 		«FOR event : flow.internalScopeEvents»
 			«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-				private void raise«event.name.asEscapedName»(«event.type.targetLanguageName» value) {
+				private void raise«event.name.asEscapedName»(«event.typeSpecifier.targetLanguageName» value) {
 					«event.valueIdentifier» = value;
 					«event.identifier» = true;
 				}
 				
-				private «event.type.targetLanguageName» get«event.name.asEscapedName»Value() {
+				private «event.typeSpecifier.targetLanguageName» get«event.name.asEscapedName»Value() {
 					«event.getIllegalAccessValidation()»
 					return «event.valueIdentifier»;
 				}
@@ -516,7 +516,7 @@ class Statemachine {
 			«FOR event : scope.eventDefinitions»
 				«IF event.direction == Direction::IN»
 					«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-					public void raise«event.name.asName»(«event.type.targetLanguageName» value) {
+					public void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value) {
 						«scope.interfaceName.asEscapedIdentifier».raise«event.name.asName»(value);
 					}
 					«ELSE»
@@ -532,7 +532,7 @@ class Statemachine {
 					}
 
 					«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-						public «event.type.targetLanguageName» get«event.name.asName»Value() {
+						public «event.typeSpecifier.targetLanguageName» get«event.name.asName»Value() {
 							return «scope.interfaceName.asEscapedIdentifier».get«event.name.asName»Value();
 						}
 
@@ -540,12 +540,12 @@ class Statemachine {
 				«ENDIF»
 			«ENDFOR»
 			«FOR variable : scope.variableDefinitions»
-					public «variable.type.targetLanguageName» «variable.getter()» {
+					public «variable.typeSpecifier.targetLanguageName» «variable.getter()» {
 						return «scope.interfaceName.asEscapedIdentifier».«variable.getter()»;
 					}
 					
 					«IF !variable.const && !variable.readonly»
-						public void «variable.setter»(«variable.type.targetLanguageName» value) {
+						public void «variable.setter»(«variable.typeSpecifier.targetLanguageName» value) {
 							«scope.interfaceName.asEscapedIdentifier».«variable.setter»(value);
 						}
 

+ 8 - 8
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/StatemachineInterface.xtend

@@ -79,7 +79,7 @@ class StatemachineInterface {
 
 	def protected constantFieldDeclaration(
 		VariableDefinition variable) {
-		'''	public static final «variable.type.targetLanguageName» «variable.identifier» = «variable.initialValue.code»;
+		'''	public static final «variable.typeSpecifier.targetLanguageName» «variable.identifier» = «variable.initialValue.code»;
 
 		'''
 	}
@@ -148,7 +148,7 @@ class StatemachineInterface {
 					«FOR event : scope.eventDefinitions»
 						«IF event.direction == Direction::OUT»
 							«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-								public void on«event.name.toFirstUpper()»Raised(«event.type.targetLanguageName» value);
+								public void on«event.name.toFirstUpper()»Raised(«event.typeSpecifier.targetLanguageName» value);
 							«ELSE»
 								public void on«event.name.toFirstUpper()»Raised();
 							«ENDIF»	
@@ -178,7 +178,7 @@ class StatemachineInterface {
 			«FOR event : scope.eventDefinitions»
 				«IF event.direction == Direction::IN»
 					«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-						public void raise«event.name.asName»(«event.type.targetLanguageName» value);
+						public void raise«event.name.asName»(«event.typeSpecifier.targetLanguageName» value);
 						
 					«ELSE»
 						public void raise«event.name.asName»();
@@ -189,7 +189,7 @@ class StatemachineInterface {
 					
 					««« IMPORTANT: An event not specifying a type is regarded to have a void type
 				«IF event.type != null && !isSame(event.type, getType(GenericTypeSystem.VOID))»
-						public «event.type.targetLanguageName» «event.getter»;
+						public «event.typeSpecifier.targetLanguageName» «event.getter»;
 						
 					«ENDIF»	
 				«ENDIF»
@@ -199,10 +199,10 @@ class StatemachineInterface {
 
 	def protected variableAccessors(InterfaceScope scope) '''
 		«FOR variable : scope.variableDefinitions»
-			public «variable.type.targetLanguageName» «variable.getter»;
+			public «variable.typeSpecifier.targetLanguageName» «variable.getter»;
 			
 			«IF !variable.readonly && !variable.const»
-				public void «variable.setter »(«variable.type.targetLanguageName» value);
+				public void «variable.setter »(«variable.typeSpecifier.targetLanguageName» value);
 				
 			«ENDIF»
 		«ENDFOR»
@@ -223,8 +223,8 @@ class StatemachineInterface {
 
 	def protected operationSignature(OperationDefinition it) {
 		'''
-			public «type.targetLanguageName» «name.asEscapedIdentifier»(«FOR parameter : parameters SEPARATOR ', '»«parameter.
-				type.targetLanguageName» «parameter.identifier»«ENDFOR»);
+			public «typeSpecifier.targetLanguageName» «name.asEscapedIdentifier»(«FOR parameter : parameters SEPARATOR ', '»«parameter.
+				typeSpecifier.targetLanguageName» «parameter.identifier»«ENDFOR»);
 			
 		'''
 	}

+ 5 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/types/JavaTypeSystemAccess.xtend

@@ -12,6 +12,7 @@ package org.yakindu.sct.generator.java.types
 
 import com.google.inject.Inject
 import org.yakindu.base.types.Type
+import org.yakindu.base.types.TypeSpecifier
 import org.yakindu.base.types.typesystem.ITypeSystem
 import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
 
@@ -35,5 +36,9 @@ class JavaTypeSystemAccess implements ICodegenTypeSystemAccess {
 			case ts.isSame(originalType, getType(STRING)): "String"
 			default: "//" + this
 		};
+	}
+	
+	override getTargetLanguageName(TypeSpecifier typeSpecifier) {
+		return getTargetLanguageName(typeSpecifier?.type)
 	}
 }

+ 5 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/types/OldJavaTypeSystemAccess.xtend

@@ -12,6 +12,7 @@ package org.yakindu.sct.generator.java.types
 
 import com.google.inject.Inject
 import org.yakindu.base.types.Type
+import org.yakindu.base.types.TypeSpecifier
 import org.yakindu.base.types.typesystem.ITypeSystem
 import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
 
@@ -35,5 +36,9 @@ class OldJavaTypeSystemAccess implements ICodegenTypeSystemAccess {
 			case ts.isSame(type, getType(STRING)): "String"
 			default: "//" + this
 		};
+	}
+	
+	override getTargetLanguageName(TypeSpecifier typeSpecifier) {
+		return getTargetLanguageName(typeSpecifier?.type)
 	}
 }

+ 27 - 0
test-plugins/org.yakindu.sct.generator.c.test/log4j.properties

@@ -0,0 +1,27 @@
+# Log configuration for Xtext logging.
+# This log configuration will be used for the UI parts of Xtext.
+#
+# For your convenience: valid log levels are (from least to most significant):
+# TRACE, DEBUG, INFO, WARN, ERROR and FATAL
+# Log4J manual: http://logging.apache.org/log4j/1.2/manual.html
+# Xtext log configuration info: http://wiki.eclipse.org/Xtext_Project_Plan/Features/Logging
+
+# Root logger configuration. Don't change this.
+log4j.rootLogger=DEBUG, default
+
+# This appender will write to the stdout console
+log4j.appender.default=org.apache.log4j.ConsoleAppender
+log4j.appender.default.layout=org.apache.log4j.PatternLayout
+log4j.appender.default.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
+# This appender will write to the Eclipse error log. It will ONLY log ERROR and FATAL messages.
+log4j.appender.eclipse=org.eclipse.xtext.logging.EclipseLogAppender
+log4j.appender.eclipse.layout=org.apache.log4j.PatternLayout
+log4j.appender.eclipse.layout.ConversionPattern=%c %x - %m%n
+
+# Configure your log categories below:
+log4j.logger.org.eclipse=WARN
+log4j.logger.org.eclipse.xtext=WARN
+log4j.logger.org.eclipse.xtext.ui.editor.outline=WARN
+log4j.logger.org.eclipse.xtext.ui.editor.contentassist.antlr.internal=WARN
+