Create Templates For Custom Languages

Return to Introduction  Previous page  Next page

Enterprise Architect can forward generate code for languages that it does not specifically support, if the appropriate code generation templates are defined for that language. This topic outlines the steps required to define templates for custom languages.

Define a Template for a Custom Language

1.Create the custom language as a new product. To do this:
·Select the Settings | Code Datatypes menu option. The Programming Languages Datatypes dialog displays.
·In the Product Name field type the name of the new language, and in the Datatype field type a datatype (one is enough to declare that the new language exists). See Data Types in the Enterprise Architect User Guide for more details.
2.Select the Settings | Code Generation Templates menu option. The Code Templates Editor view displays.
3.In the Language field, click on the drop-down arrow and select the custom language.
4.From the Templates list, select one of the base templates.
5.Define the template using the Code Templates Editor.
6.Click on the Save button. This stores the template in the .EAP file.
7.Repeat steps 1 to 6 for each of the relevant base templates for the custom language.

Note: The File template must be defined for the custom language. The File template can then see the Import Section, Namespace and Class templates.