|
@@ -465,7 +465,9 @@ p. A local reaction can have a priority value. The latter is defined by appendin
|
|
|
bc(prettyprint#GeneratorFeatures)..
|
|
|
localEvent2 / NamedInterface.variable2 += 3; #1
|
|
|
localEvent3 / NamedInterface.variable4 += 2.0; #2
|
|
|
-h2(#Codegeneration). SGen generator features
|
|
|
+h2(#Codegeneration). Code generation
|
|
|
+
|
|
|
+h3. SGen generator features
|
|
|
|
|
|
All generators can be customized by a generator model. This is a textual model in a file, specifying generator features, i.e. the outlet path. The following screenshot shows an sample configuration for the Java code generator.
|
|
|
|
|
@@ -553,7 +555,7 @@ feature Debug {
|
|
|
}
|
|
|
p. ==<!-- End sgen_feature_debug -->==
|
|
|
|
|
|
-h2(#JavaGeneratorFeatures). Java generator features
|
|
|
+h3(#JavaGeneratorFeatures). Java generator features
|
|
|
|
|
|
==<!-- Start sgen_feature_naming -->==
|
|
|
|
|
@@ -620,7 +622,7 @@ feature GeneralFeatures {
|
|
|
p. ==<!-- End sgen_feature_generalfeatures -->==
|
|
|
|
|
|
|
|
|
-h2(#CGeneratorFeatures). C/C++ generator features
|
|
|
+h3(#CGeneratorFeatures). C/C++ generator features
|
|
|
|
|
|
==<!-- Start sgen_feature_identifiersettings -->==
|
|
|
|
|
@@ -680,11 +682,13 @@ p. ==<!-- End sgen_feature_junitwrapper -->==
|
|
|
|
|
|
|
|
|
|
|
|
-h2(#CreatingCustomCodeGenerators). Creating custom code generators
|
|
|
+h3. Custom code generators
|
|
|
+
|
|
|
+h4(#CreatingCustomCodeGenerators). Creating custom code generators
|
|
|
|
|
|
YAKINDU Statechart Tools provide a rich feature set to support custom code generators out of the box. These code generators can be either written in Java, "Xtend":http://www.eclipse.org/xtend/, or "Xpand":http://www.eclipse.org/modeling/m2t/?project=xpand.
|
|
|
|
|
|
-h3(#WritingacustomcodegeneratorwithXtend2Java). Writing a custom code generator with Xtend2/Java
|
|
|
+h5(#WritingacustomcodegeneratorwithXtend2Java). Writing a custom code generator with Xtend2/Java
|
|
|
|
|
|
First, you have to create a new Xtend2 generator project. Click __File → New → Other... → YAKINDU → YAKINDU Xtend2/Java Generator Project__ to create a new Xtend2 generator project.
|
|
|
|
|
@@ -696,14 +700,14 @@ The check box *Configure for Plugin Export* adds all required extension point re
|
|
|
|
|
|
After clicking on *Finish* a new project is created in your workspace. All required plugin dependencies and extension points are registered and you can start to write your code generator based on the ExecutionFlow meta model [Link].
|
|
|
|
|
|
-h3(#ExecutingacustomXtend2Javacodegenerator). Executing a custom Xtend2/Java code generator
|
|
|
+h4(#ExecutingacustomXtend2Javacodegenerator). Executing a custom Xtend2/Java code generator
|
|
|
|
|
|
YAKINDU Statechart Tools provide a convenient way to execute your generator while you are developing it.
|
|
|
For this, you have to create a new *generator model* with the generator ID *yakindu::generic*, either by using the *New Statechart Generator Model* wizard or by simply creating a new text file with the file extension @.sgen@. The feature described below allows to configure your code generator.
|
|
|
|
|
|
==<!-- Start sgen_feature_generator -->==
|
|
|
|
|
|
-h4(#Generator). Generator
|
|
|
+h5(#Generator). Generator
|
|
|
|
|
|
The *Generator* feature allows to configure a custom code generator located in the workspace and written in Java or in another JVM language. It is a *required* feature and has the following parameters:
|
|
|
|
|
@@ -720,13 +724,13 @@ feature Generator {
|
|
|
}
|
|
|
p. ==<!-- End sgen_feature_generator -->==
|
|
|
|
|
|
-h3(#ExecutingacustomXpandcodegenerator). Executing a custom Xpand code generator
|
|
|
+h4(#ExecutingacustomXpandcodegenerator). Executing a custom Xpand code generator
|
|
|
|
|
|
In order to execute an Xpand-based custom code generator, you have to create a new *Generator Model* with the generator ID *yakindu::xpand*, either by using the *New Statechart Generator Model* wizard or by simply creating a new text file with the file extension *.sgen*. The following feature allows to configure your code generator.
|
|
|
|
|
|
==<!-- Start sgen_feature_template -->==
|
|
|
|
|
|
-h4(#Template). Template
|
|
|
+h5(#Template). Template
|
|
|
|
|
|
The *Generator* feature allows to configure a custom code generator located in the workspace and written in Java or in another JVM language. It is a *required* feature and has the following parameters:
|
|
|
|