MC97 Lab 4: Semantic analysis (Spring 1999)

Due: March 22, 1999

For this lab, you are to do the type-checking assignment from page 127 of the textbook. Appel suggests doing the work in two phases, which he lists as Part a and Part b. This is a wise idea, although you may want to introduce even more steps than just those two. In any case, you need not turn in a separate solution for each part, just an end result.

First, copy the chap5 directory of files that Appel provides into the directory you are going to work in and look at them. You can access the chap5 directory off of this web page or copy it from ~max/www-docs/courses/S1999/MC97/tiger/chap5. The simplest way to do this would be using the command

cp -pr ~max/www-docs/courses/S1999/MC97/tiger/chap5 .
which will give you your very own chap5 directory tree, just like mine. Note that this time Appel hasn't provided much code on-line. You will need to type in quite a bit of code from the chapter (correcting it and fleshing it out as you go), and add some original code of your own. For those who are still having problems with the prior labs, I have included in the chap5 directory tree the compiled files Parse/Yylex.class, Parse/Grm.class, Parse/CUP$Grm$actions.class, and Parse/ If you replace these with your own versions from the prior lab, you will of course get more of the experience of building a large system up piece by piece.

Your lab report should include documentation of design and testing as well as your code.

Miscellaneous tips

Instructor: Max Hailperin