Object Members

An object member can be a standard property, an extended attribute, a template or a volatile attribute. There can be three types of standard property: boolean, string or object. The value of a standard property can be:

The value of a template is the result of its translation (note that a template may be defined in terms of itself, that is to say recursively).

The value of an extended attribute may itself be a template, in which case it is translated. This allows for the definition of templates on a per object (instance) basis instead of a per metaclass basis.

To avoid name collisions when a template evaluation spans multiple targets, one may prefix both extended attributes and templates by their parent target code. For example: %Java::strictfp% or %C++::definition%

Template names may also be prefixed by their parent metaclass name. This allows for the invocation of an overridden template, actually bypassing the standard dynamic template resolution mechanism. For example : %Classifier::definition%

A parameter list can optionally be specified. Parameter values should not contain any % characters and should be separated by commas. Parameters are passed as local variables @1, @2, @3... defined in the translation scope of the template.

If the template MyTemplate is defined as:

Parameter1 = %@1%
Parameter2 = %@2%

Then the evaluation of %MyTemplate(MyParam1, MyParam2)% will yield:

Parameter1 = MyParam1
Parameter2 = MyParam2