Prev Next

Developing Programming Languages

You can make use of a range of established programming languages in Enterprise Architect, but if these are not suitable to your needs you can develop your own. You would then apply it to your models through an MDG Technology that you might develop just for this purpose, or for broader purposes. After developing the language, you could also write MDA Transformation templates to convert a Platform Independent Model or a model in another language into a model for your new language, or vice-versa.

Access

Ribbon

Code > Configure > Options > Edit Code Templates

Keyboard Shortcuts

Ctrl+Shift+P

Develop a Programming Language

Step

Description

See also

1

In the Code Template Editor, click on the New Language button and, on the 'Programming Languages Datatypes' dialog, click on the Add Product button.

Enter your new programming language name and define the datatypes for it. You cannot access the new language in the Code Template Editor until at least one datatype has been added to the language.

Data Types

2

After you have defined all the datatypes you need, click on the Close button, select the language in the 'Language' field of the Code Template Editor, and start to edit or create the code templates for the new language.

The code templates define how the system should perform:

  • Forward code engineering of your models in the new language
  • Behavioral Code generation (if this is appropriate)
Code Template Framework Code and Transform Templates Create Custom Templates Customize Base Templates

3

If you prefer, you can also define source code options for your new language. These are additional settings for the language that are not provided by the data types or code templates, and that help define how the system handles that language when generating and reverse-engineering code.

The code options are made available to your models only through an MDG Technology.

Define Code Options

4

Defining a grammar for your language is an optional step that provides two primary benefits:

  • Reverse engineering of existing code into your model
  • Synchronization during code generation so that changes made to the file since it was last generated are not lost.

To access the grammar editor select the 'Code > Schema > Grammars' ribbon option.

Grammar Framework

5

If you intend MDA transformations to be made to (or from) your new programming language, you can also edit and create transformation templates for it. The process of creating transformation templates is very similar to that for creating code templates.

Edit Transformation Templates Write Transformations

6

Having created the datatypes, code templates, code options, grammar and transformation templates for your new language, you can incorporate and distribute them in an MDG Technology.

Create MDG Technologies Add Code Modules Add MDA Transforms Deploy An MDG Technology