Generate source code from Class diagrams and Statemachine diagrams to any lanauage you want. Sample templates for C++ (GR-SAKURA) included.
1. Templates | Create a set of configurations to generate the code. [Add] creates a new configuration and [Remove] will delete one. |
2. Template Dir | Specify the directory where template files are installed. To create plural sets of configurations, create a folder to hold them in the directory below. – Windows: C:/Users/{username}/.astah/plugins/m2t/templates/ – Mac: UserHome/.astah/plugins/m2t/templates/ |
3. Destination Path | Specify the directory where you want to source code files to be exported to. |
4. Template Mapping | ap the template files. There are three categories to set the template files to.
DefaultThis sets how to export classes that do not have stereotypes. Specify file extension and template file. Code will be exported in {Class name}.{File Extension}. GlobalGeneral setting. Specify the file name and template file. The code will be exported with {File name}. StereotypeOutput setting for classes with specific stereotypes. Specify the stereotype, file extension, and template file. Code will be exported in {Class name}.{File Extension}. |
Ref. | How to create template files |
2. Open the file you want to generate the source code of, then go to [Tools] – [m2t] – [Generate].
3.”Code Generation is complete” message appears when it completes successfully.