COP 5621 - Homework 4 - Type Checker
Due Wednesday, November 13
My /homes/smithg/javatools/tiger/chap5 directory contains
much of the needed type checker code:
- Semant/ contains Env.java, Entry.java,
FunEntry.java, and VarEntry.java.
- Semant/Semant.java contains an outline of the type checker
itself; this is the only file that you must modify.
- Translate/ is a dummy package for now.
- Types/ contains all the semantic types classes.
These classes include a toString(depth) method to display
the type to the specified depth.
(We need the depth because otherwise recursive types would be infinite!)
- Main/ contains the main program, which now accepts two
command line options: -v for verbose output, and -dn
to set the print depth to n; the default is 3.
- test1.tig and test1.out give some tests; see also
You must handle mutually recursive function definitions.
But the following are all completely optional:
Some examples of these are included in test2.tig and
- Recursive type definitions.
- Checking for improperly nested breaks.
- Checking for assignments to a for loop index.
- Empty records.