CSE 423 Lab #7: Adding Type Info to Trees and Symbol Tables
Turnin: your drafty compiler... on canvas.
Due Sunday 3/23, 11:59pm
In this week's lab you should add a data structure
representation for k0 types, and add
types to your knowledge about variables in your symbol table. Turn in as far
as you get by Sunday evening after spring break; you will be graded as having
done the lab
as long as it looks like you did two or more hours of work.
Look at these modules, modify them as needed in order for them to fit
k0. Minimally, you gotta figure out how to
build type information from
syntax tree nodes. We should probably be able to figure out what changes are
needed during the lab period. Compile and link them in
to your k0 compiler.
makefile
Add dependencies for compiling and linking in type.o
Finishing up and turning in
Demonstrate your type information being constructed by printing out type
information in two places:
- in the symbol table printout (as originally implied by the HW#4
example output), and
- from a syntax tree printout in which
you print identifers' types when you print out their leaves in the
executable code expressions found within the compound statements of your
function bodies.