Next: Level 0
Up: Projects on gcc Intermediate
Previous: Our Choice Levels of
To Do for Each Level of C Source Program
Design a grammar and the corresponding parser using yacc/bison for the
intermediate representation generated by gcc for each level of C source language programs.
This parser has to be augmented further with actions
to interpret the IR. For the Machine Description, an interpreter is not
possible and we will identity some useful activity to be done with the
description. An additional possibility in each case is a syntax directed
editor which reads in the IR and allows the user to change it subject to
following the syntax. This will require separating the organisational
contents (eg. pointer the next node) from the semantic contents (eg. the
data contained in a node). Some preliminary semantic checks may also be
possible.
- Project :. Identify the types of AST nodes that GCC would use to
``compile'' such a language and write an interpreter for it. The
AST interpreter evaluates the tree representation and prints the
resulting value.
- Project 2. Identify the GIMPLE and CFG structures that GCC would use to generate an
intermediate representation and write an interpreter for it. The
GIMPLE interpreter evaluates each statement and returns the
result. The returned result must be the same as what the AST
interpreter would evaluate.
- Project 3. Identify the RTL IR structures that GCC would use to generate an
intermediate representation and write an interpreter for it. The
RTL IR interpreter evaluates each RTX in the list and returns the
result. Obviously this result should be identical to the one
produced by interpreting the AST.
We omit case analysis constructs, explicit type coercion, loop breaks
and continues, unrestricted jump, variable argument lists,
preprocessing, data structuring mechanisms (structs and unions) and
pointers.
Next: Level 0
Up: Projects on gcc Intermediate
Previous: Our Choice Levels of
2006-01-08