COS 320, Spring 2000. Programming Assignment
Programming Assignment 5: Type Checker
Described in Modern Compiler
Implementation, Chapter 5.
(Only part a, the non-recursive part, is required.)
Type checking
- Copy /u/cos320/chap5/* into a new directory
as5.
- Copy your working tiger.lex and
tiger.grm from assignment 4. If you don't have
working versions, then don't copy them! CM will automatically
use versions that are provided.
- Edit the file semant.sml to implement the
function transProg. You don't have to handle
recursive type definitions or recursive functions. (But it is not
that much more work to handle them anyway.)
- For this assignment, your type checker does not have to but might
as well make sure that all
break statements occur within some loop.
- As usual, compile by invoking CM.make();.
- You can test your code by running Test.typecheck
"file".
- Submit by running submit 5 semant.sml.
Extra credit
- Implement mutually recursive functions.
- Implement recursive type definitions.
- Detect cyclic type definitions.
- Check for proper nesting of break expressions.