Repository navigation
Expand Syntax and Enter Symbols
For implementation, see
ExpandSyntaxAndEnterSymbols.scala.
This algorithm enters the symbols of a source model and expands all syntax in the source model. In general, entering symbols requires expanding templates and vice versa.
-
An analysis data structure a.
-
A list tul of translation units.
-
If the algorithm succeeds, then
-
An updated analysis data structure a with symbols entered, the use-def map filled in for template names, and the template expansion map filled in.
-
An updated list tul of translation units with all syntax expanded.
-
-
Otherwise an error and no output.
-
Recursively resolve include specifiers. Check for include cycles. Upon detecting an include cycle, halt with an error message.
-
Add state enums for tul, yielding a new list of translation units tul in which each state machine definition that has a body has a state enum definition.
-
Enter symbols for a and tul.
-
Check template definitions for a and tul.
-
Check template expansions for a and tul.
-
Check template uses for a and tul.
-
Expand templates for a and tul, yielding a new list of translation units tul in which each template expansion specifier carries the members that it expands.
-
Enter template expansion symbols for a and tul.