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).
|Lecture||Tech LG52; TTh 12:30-2pm|
|Text||Modern 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
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.
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 Language||Students 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.
|Tiger||Tiger 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
|Number||Due (always before class)|| |
|5||June 4th||Code generation 5.pdf|
|4||May 26th||Linearize 4.pdf|
|3||May 14th||Translate to IL 3.pdf|
|2B||April 30th||Type checker 2b.pdf|
Parser adjustments (fields based on indicies not names) 1a-revised.pdf
|2A||April 23th||Type checker test cases 2a.pdf|
|1B||April 21st||Parser 1b.pdf Code from class: parse.ss|
|1A||April 9th||Parser test cases 1a.pdf|