tasks.textile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <link href="../../css/bootstrap.css" rel="stylesheet" />
  2. <link href="../../css/custom.css" rel="stylesheet" />
  3. h1. Tasks
  4. h2. Generating Code
  5. For configuring the code generation process, YAKINDU Statechart Tools uses a textual generator model called *SGen*. It can be created either by using the provided wizard *Yakindu Statechart Generator Model* or by creating a new text file with the file extension '.sgen'.
  6. To create a generator model with the wizard,
  7. # Click *File* > *New* > *Other...* > *Yakindu Statechart Generator Model*
  8. # Type a name and click *Next*
  9. # Choose the desired generator, i.e. *YAKINDU Java Code Generator*
  10. # Check the model(s) to generate code from and click *Finish*
  11. !images/genmodelwizardchooselanguage.jpg!
  12. The result is an .sgen file of the following format:
  13. bc..
  14. GeneratorModel for [GeneratorId] {
  15. statechart [StatechartReference] {
  16. feature [Feature] {
  17. [ParameterName] = [ParameterValue]
  18. }
  19. }
  20. }
  21. p. The [GeneratorId] is the unique id of the Generator. Currently, the following Generators are supported out of the box:
  22. # yakindu::java - Generator ID for the Java Code Generator
  23. # yakindu::c - Generator ID for the C Code Generator
  24. # yakindu::cpp - Generator ID for the C++ Code Generator
  25. # yakindu::xpand - Generator ID for custom Xpand based Code Generators
  26. # yakindu::generic - Generator ID for custom Java based Code Generators
  27. One GeneratorModel can contain several [StatechartReference]s. These are cross references to statechart models for which the code should be generated. For each reference, the generator process can be configured with [Feature]s. Each Feature consists of several parameters. These parameters can be configured with [ParameterName] = [ParameterValue].
  28. The Generator Model is executed by a builder. Thus, the artifacts are generated automatically if *Project* > *Build Automatically* is checked. If you want to execute your Generator Model by hand, select *Generate Statechart Artifacts* from the *Package Explorer's* context menu.