Due : February 23 (part 1) and March 1 (part2).
This assignment is part of the class project. It involves the use of the
GNAT compiler and the tree-walking procedures that are basis for semantic
analysis, intermediate code generation, optimization, and final code
generation. The example tree-walking routine
shows a program that can process the intermediate representation of an
Ada program for any of the above purposes. Test_Walker is a generic top-down
tree traversal procedure, which is guided by the syntatic structure of the
tree, and performs some specified actions at each node.
a) The first part of the assignment, due in a week, is to test the example
as given, and to modify the tree_walker routine to display the names of all
the identifiers appearing in object declarations throughtout a program,
including those in nested scopes. As a test, show the output of the program
when applied to test_walker.adb itself.
b) The second part of the assignment, due in two weeks, is to construct a
simple symbol table. Entries in the symbol table correspond to the identifiers
appearing in object declarations (not type declarations). This symbol table
will hold information useful to the code generator later on. For now, assume
that each entry hold the Entity_Id for the entity in question, an integer which
denotes the size of the entity, and an indication of the register in which the
variable currently resides. For now, these two fields are empty.