next up previous
Next: String constants Up: An Analyzer for ANSI Previous: Phrase.init


The Abstract Syntax Tree

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:

C.lido[1]:

RULE: Source ::= program END;
AST nodes[2]
This macro is attached to a product file.



Subsections
next up previous
Next: String constants Up: An Analyzer for ANSI Previous: Phrase.init
2008-08-30