An abstract syntax tree reflects the semantic structure of a program. Computations over the abstract syntax tree are used to verify context conditions, and to provide information for translating or interpreting the program. The abstract syntax tree should be designed to facilitate these computations.
Eli provides a number of library modules that embody computations useful in the semantic analysis of a variety of languages. These modules are often coupled to an abstract syntax tree by having tree symbols inherit computational roles provided by the module. One aspect of the design of the tree is to ensure that symbols appropriate to these roles are available.
The abstract syntax tree structure is defined by a set of rules written in LIDO. Each rule describes a particular context that could appear in an abstract syntax tree representing a C program. It is convenient to have a tree root that is distinguished from the root of the subtree representing the program: