In DSM, modi?¬?cations are made to
the models, not to the generated code, which can be treated simply as an intermediate
by-product. That has been the recipe of success for compilers, and code generators can
achieve the same objective. How to specify these generators as a part of your DSM
solution is described in Chapter 11.
4.4.1 Generator Principle
Basically, a code generator is an automaton that accesses models, extracts information
from them, and transforms it into output in a speci?¬?c syntax. This process depends on
and is guided by the metamodel, the modeling language with its concepts, semantics
and rules, and the input syntax required by the domain framework and target
environment. We introduce the role of domain framework and target environment
later in Section 4.5.
Accessing Data in Models Generators access the models based on the
metamodel of the language. They can start navigation based on a certain root element,
seek for certain object types, or be dependent on the various relationship types and
connection types the models have. Even more navigation choices are available if the
generator uses instance values, like choosing based on a certain value which model
elements to access next. A generator can further navigate connections or submodels,
depth- or breadth-?¬?rst, or apply some order for navigation and access.
Pages:
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174