Genna is a source code generator for UML 1.4 models. Genna is written in Python, and uses the Cheetah Template Engine for source code generation. The input format for UML models is XMI 1.2.
ArgoUML is recommended for creating the input models, as it supports UML 1.4, and exports in XMI 1.2.
Genna supports code generation for static structure and dynamic behavior present in UML models. It currently supports code generation for class hierarchies, state machines in the context of classes, and activity graphs in the context of class operations. For state machine triggers, only Call Events and Time Events are currently supported. At the time, Genna does not validate the correctness of the input models.
The target languages for code generation are C++, and Java.
Genna is written in Python. Genna requires the Cheetah Template Engine 0.9.16 or superior, and libraries: PyXML 0.8.4 and 4Suite-XML 1.0.2. Code generated in C++ might need QT library 4.1.2 or superior.
Appropriate versions of those libraries are contained with the project under folder externals
. Sample models in XMI 1.2 format
are provided within folder sample_models
.
Run sudo ./install.sh
. This will install PyXML, 4Suite-XML, and generate a run script genna.sh
that will execute the generator.
Run ./genna.sh sample_models/Tetris_java.xmi -l java -v -o .
A directory Tetris
will be created in the current directory. It will contain the source code for the model. Now compile the code, and
run it:
cd Tetris
javac *.java __smbase/*.java
java TetrisWindow