Next: To Do for Each
Up: Projects on gcc
Intermediate Previous: Basic
gcc Intermediate Representation
The source language level sequence we use is roughly as:
- Level 0: An extremely trimmed down version of C is used. It
is expression oriented, uses only integer addition, uses
variables. Assignment operation is required.
- Level 1: To the language in Level 0, add other arithmetic
operators (-,
, / and %) and boolean operators (!,
, &&). Bitwise operators are not to be
added. Unary `-' is also required as is the conditional
(aka ternary) : ``?:''.
- Level 2: Add basic data types: character, integer arrays and
single precision floating point to Level 1.
- Level 3: Add a simple branch - if-then-else, a for
and while loop to the language at Level 2.
- Level 4: Add function definition, call and return mechanism to
the language in Level 3.
Sample programs
and corresponding IR dumps
2006-01-08