ATL: Atlas Transformation Language Specification of the ... - Eclipse
ATL: Atlas Transformation Language Specification of the ... - Eclipse
ATL: Atlas Transformation Language Specification of the ... - Eclipse
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Specification</strong> <strong>of</strong> <strong>the</strong> <strong>ATL</strong> Virtual Machine<br />
Type Name Type Encoding<br />
Sequence Q<br />
Bag G<br />
Set E<br />
OrderedSet O<br />
Table 2. asm encoding <strong>of</strong> OCL implementations <strong>of</strong> <strong>the</strong> collection type<br />
The four collection types defined within OCL provide all combinations between ordered/non-ordered and<br />
with/without duplicates:<br />
• The bag type. It defines non-ordered collections with duplicates.<br />
• The set type. It defines non-ordered collections without duplicates.<br />
• The sequence type. It defines ordered collections with duplicates.<br />
• The orderedset type. It defines ordered collections without duplicates.<br />
Whatever <strong>the</strong>ir type, collection types are encoded in asm by <strong>the</strong>ir own encoding followed by <strong>the</strong> encoding <strong>of</strong><br />
<strong>the</strong> contained elements. As an example, a sequence <strong>of</strong> integral numerical value is encoded as QI. In <strong>the</strong><br />
same way, an ordered set <strong>of</strong> Node elements (defined within <strong>the</strong> XML metamodel) is encoded as<br />
QMXML!Node;.<br />
Besides collection types, OCL defines two additional data types. Table 3 lists <strong>the</strong>se remaining OCL-based<br />
types along with <strong>the</strong>ir respective asm encoding.<br />
Type Name Type Encoding<br />
Tuple(, …, ) T…<br />
EnumLiteral Z<br />
Table 3. asm encoding <strong>of</strong> OCL types<br />
The tuple type defines signatures <strong>of</strong> multi-typed sequences. A tuple is encoded by associating its own<br />
encoding with those <strong>of</strong> elements that compose it (in <strong>the</strong> order <strong>the</strong>y are presented by <strong>the</strong> signature). For<br />
instance, a tuple respectively containing an integral numerical value, a Node model element and a boolean<br />
value is encoded as TIMXML!Node;B.<br />
The EnumLiteral type corresponds to <strong>the</strong> <strong>ATL</strong> enumeration type (see Section 2.1.4). In <strong>the</strong> scope <strong>of</strong> <strong>ATL</strong>,<br />
enumerations are specified in source and target metamodels, and <strong>the</strong> properties <strong>the</strong>y define can be referred<br />
within <strong>the</strong> <strong>ATL</strong> code.<br />
The <strong>ATL</strong> transformation language also defines some specific types that do not belong to <strong>the</strong> set <strong>of</strong> types<br />
required by <strong>the</strong> <strong>ATL</strong> virtual machine to run. These types are listed in Table 4 with <strong>the</strong>ir encoding in <strong>the</strong> asm<br />
file format.<br />
Type Name Type Encoding<br />
Model L<br />
<strong>ATL</strong> context module A<br />
Transient Link NTransientLink;<br />
Transient Link Set NTransientLinkSet;<br />
Table 4. asm encoding <strong>of</strong> custom <strong>ATL</strong> types<br />
The model type is associated with models. An <strong>ATL</strong> transformation mainly deals with its input and output<br />
models. The <strong>ATL</strong> context module type is associated with <strong>the</strong> transformation itself. For each <strong>ATL</strong><br />
transformation execution, <strong>the</strong>re exists a one and only instance <strong>of</strong> <strong>ATL</strong> context module. This element<br />
makes it possible for a transformation being executed to access elements <strong>of</strong> <strong>the</strong> transformation module<br />
(such as <strong>the</strong> transformation fields).<br />
Finally, compilation <strong>of</strong> <strong>ATL</strong> code for <strong>the</strong> asm file format also takes advantage <strong>of</strong> <strong>the</strong> transient link type<br />
(encoded as NTransientLink;). This last type does not belong <strong>of</strong> <strong>the</strong> <strong>ATL</strong> language definition. This<br />
means that <strong>ATL</strong> programmers cannot define transient link variables within <strong>the</strong>ir <strong>ATL</strong> transformations. The<br />
Page 42 / 62