Define Code Options

When modifying code generation templates for an existing programming language, or defining a new programming language, there are additional options which are only available when building an MDG Technology.  These additional options can affect how Enterprise Architect handles code generation and reverse-engineering for this language.  These options are specified using an XML file, created using your preferred text editor.

The root node in the XML document is named CodeOptions. The child nodes are named CodeOption.  Each CodeOption contains a name attribute corresponding to the name of one of the available code options.  The body of each node contains the option value. For example:


<CodeOption name="DefaultExtension">.h</CodeOption>

<CodeOption name="HasImplementation">true</CodeOption>

<CodeOption name="ImplementationExtension">.cpp</CodeOption>

<CodeOption name="Editor">C:\Windows\notepad.exe</CodeOption>



Supported code options

Code Option



The name of a function used as a constructor. Used by the classHasConstructor code template macro.



The name of a function used as a copy constructor. Used by the classHasCopyConstructor code template macro.



The default extension when generating code.



The default path to which Enterprise Architect generates new files.



The name of a function used as a destructor. Used by the classHasDestructor code template macro.



The external editor used for editing source of this language.




Specifies if code generation for this language generates both a source file and implementation file.



The extension used by Enterprise Architect to generate an implementation file.



The relative path from the source file to generate the implementation file.



The delimiter used to separate Package names when using the packagePath macro from the code templates.



·Once a language is available for use in a model (by importing and activating the MDG Technology), you can display and edit the code options on the Options dialog (Tools | Options)

Learn more