Usually a compiler deals with just one language but DML encompasses two types of languages keyed to each other by variable id. The compiler walks the syntax tree of the diagram template and produces another symbol table containing presentational variables, their type, and corresponding initialized presentational object. Here is the presentational markup corresponding to the logical primitives in the previous example and the resultant presentational symbol table.
... <!-- presentation for 'o', a tlg1799.tlg001:point and tlg0552.tlg008:center_of_earth --> <diapre:value> <epix:point id='o' diapre:param_id='0'> <epix:x>0</epix:x> <!-- world coordinates --> <epix:y>0</epix:y> </epix:point> </diapre:value> ... <diapre:value> <!-- Notice the elliptical_arc depends upon 'a', 'd' and 'ul_abcd' to be defined --> <epix:elliptical_arc id='abcd'> <epix:circle ref='ul_abcd'/> <epix:point ref='d'/> <epix:point ref='a'/> </epix:elliptical_arc> </diapre:value> ...
name | type | object |
o | epix:point | 0.0 0.0 0.0 |
a | epix:point | -2.49 -2.49 0.0 |
d | epix:point | 2.49 2.49 0.0 |
abcd | epix:elliptical_arc | EllipticalArc: ... |
During this time, the dmlc
also parses the diapre:view
information and stores this for the next step in the pipeline. In addition,
the diapre:styles
are also parsed and put into a table. This table is useful because it records any diagramming conventions in a nice tabular format. Here is some styling markup along with the corresponding code for the primitives in the symbol table above.
<diapre:style ref='o'> <!-- Label styling --> <diapre:label_text>O</diapre:label_text> <diapre:label_x_pos>0</diapre:label_x_pos> <diapre:label_y_pos>10</diapre:label_y_pos> <diapre:label_size>8pt</diapre:label_size> <diapre:label_triplet>eng-La26</diapre:label_triplet> </diapre:style> ... <!-- similar styling for 'a' and 'd' -->
name | labelXPos | labelYPos | labelSize | labelTriplet | color |
o | 0.0 | 10.0 | 8pt | eng-La26 | None |
a | 0.0 | 10.0 | 8pt | eng-La26 | None |
d | 0.0 | 10.0 | 8pt | eng-La26 | None |