EECS 322: Compiler Construction


This course will teach you how to build a compiler for a simple, imperative language. It will explain the standard structuring for a compiler with a front end (parsing, type-checking) and the back end (code generation).

LectureTech LG52; TTh 12:30-2pm

TextModern Compiler Implementation in ML by Andrew W. Appel

More on Packrat parsing. Probably best to start with Brian Ford's master's thesis.

A Tiger Language Specification
A Tiger Intermediate Language Specification

Mailing list


Pair programming

Students are encouraged (but not required) to work in pairs. Pair programming is not team progamming, however. That is, pairs must promise (in writing) that they will always sit together when working on the assignments, never separately. If this is too much of a burden, work alone.

Test Fests

Each assignment is split into two parts: first the design of test cases and second the implementation. Each student's assignment will be run against everyone's test cases. You get 2 points for finding a bug in someone else's implementation with your test suite and you lose 1 point if someone else finds a bug in your implementation with their test suite. Multiple test case failures are (generously) assumed to be just a single bug

The results of the test fests will be public (and will include my code and test suites).

Test Fest results

Programming LanguageStudents are free to use any programming language. As a general guideline, I recommend a programming language that is both safe and has garbage collection. These two features make building software easier (and the second often improves performance). SML (the language of the text book) has both of these properties, so should be your default choice.


Students will be evaluated on their projects in two ways: via the test fests and a private codewalk at the end of the quarter.


Your code will be scruntized for plagarism and other forms of cheating and, if discovered, you will be punished to furthest extent possible.

TigerTiger typing rules, without type declarations, array indexing or field selection

Full Tiger typing rules (well, without functions of course)

Implementation of a Tiger type checker and evaluator


Handin web page

NumberDue (always before class) 
5June 4thCode generation 5.pdf
4May 26thLinearize 4.pdf
3May 14thTranslate to IL 3.pdf
2BApril 30thType checker 2b.pdf
Parser adjustments (fields based on indicies not names) 1a-revised.pdf
2AApril 23thType checker test cases 2a.pdf
1BApril 21stParser 1b.pdf Code from class:
1AApril 9thParser test cases 1a.pdf

Robby Findler