ATC Expressions. A class identified as an atom type represents a particular atomic
transformation semantic unit. Each atom type inherits from a base class named Ex-
pression, which contains an abstract method with the following signature:
AtcExpression act(TransformationContext tc)
in the reference VTE implementation, which encloses the particular semantic infor-
mation that makes atom types distinct from each other. It usually comprises no more
than twenty lines of code. The tc parameter keeps track of contextual information,
which includes the local variable registry, the calling stack, as well as parameters and
additional runtime information the engine needs to execute the transformation accord-
ingly.
Execution Flow. A list of expressions related with the execution flow include, but is
not limited to: AssignVars, Block, ExceptionThrow, FlowOpReturn, ForEach, GetOb-
jectsOfType, If, InvokeOp, InvokeTransformation, While. For instance, a Block atom
simply encloses a list of atoms to be executed sequentially. ForEach takes a data
collection as source, usually containing model elements, and traverses it to apply
certain actions (which can in turn be an InvokeOp or a Block carrying further atoms).
FlowOpReturn works similar to a return statement but its effect on execution flow is
indirect.
Model Transformation. Atom types dealing with model handling and modification
include: CloneModelObject, CreateDataType, CreateModelObject, CreateModel,
GetStructuralFeature, SetStructuralFeature, and those that deal with the contents of
lists or other collection types, which are relevant for attributes with multiplicity > 1.
Query and Pattern Matching. Atom types for queries provide us with means to
organize data on models and reach particular model types: GetAllModelElements,
GetObjectsOfType, GetModelExtent. The last one delivers the root elements that form
a model fragment. Its state information includes the local variable identifier that refers
to the piece of model to be queried. Pattern matching is performed explicitly in ATC.
It can be achieved if we have means to apply reflectivity over model elements. ATC
comes with IsOfType, which can be programmed to either perform exact type match
or to detect subclasses of a particular model type.
ATC Specific Types. ATC comes with: Bool, Float, Int, String. Types in ATC also
subclass Expression, so their instances are also atoms, and as such, can become the
return value of an atom’s act execution. String atoms come enhanced to support com-
mon string operations. Among them we find upperization of selective parts, length
delivery and substring support. Null is a special ATC type that does nothing on its
own but can help us detect null assignments in local variables.
Arithmetic and Logical Expressions. Many atom types are built around the ATC
specific types. Most of them give support to arithmetics: Add, Subtract, Multiply,
Divide and Modulus, and logics: And, Or, XOr, Negate, Equals. These atoms deal
transparently with both the ATC types and the primitive types of the native language
in which the engine is programmed. Thanks to the Expression nature of ATC types
and this transparency, these operations can be chained to provide a single final result
from a group of combined operations without having to store partial results.
68