Skip to content

Latest commit

History

101 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Very Simple UML to Python Generator

Very simple Accelo Python generator from UML class diagram. This generator is presented as an example and can be used as work basis but, depending on your purpose, is definitively not enough.

Sources

Model to text (m2t) source is located in simple-python/codegen folder while generator is described by simple-python/generator.xml file.

UML Diagram & Translation

Class diagrams contained in an UML project are used for python code generation. Python compilation choices are reported in the following table.

UMLPython
Packagemodule file
Classclass
Abstract Classabstract class
DataTypeclass
Interfaceclass
Propertyclass attribute
Abstract Operationabstract operation
Class Operationclass operation
Operationinstance method
Enumerationclass
Function Behaviorimplementation of operation
Class Constructordefinition of __init__ method
Generalizationcorresponding import statement
Use (any Dependency)corresponding import statement
Instance SpecificationNamed instanciation without any further initialization

Comments

  • The generated import and inheritance statements are sorted to avoid unintended differences during source code generation. This might interfere with Python's MRO.
  • Function Behavior language needs to be Python to be included
  • User Code areas are located to alter the respective behavior in the most flexible ways

About

Very Simple Python Generator from UML - GenMyModel customgen

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors