An introduction to the specification and implementation of modern compilers. Topics covered include lexical scanning, parsing, type checking, code generation and translation, an introduction to optimization, and compile-time and run-time support for modern programming languages. As part of the course, students will build a working compiler for an object-oriented language.
Computer Science 312, 314. The practicum (CS 413) is a required co-requisite. You may not take CS 412 without taking CS 413 too. The reason for this is that the group project is part of the grade for both 412 and 413. Familiarity with programming in Java is also expected.
Required: (Tiger Book) Modern Compiler Implementation in Java. Andrew Appel. Cambridge University Press, 1997. ISBN 0-521-58388-8.
Optional: (Dragon Book) Compilers -- Principles, Techniques and Tools. Aho, Sethi and Ullman. Addison-Wesley, 1988. ISBN 0-201-10088-6.
Optional: (Whale Book) Advanced Compiler Design and Implementation. Steve Muchnick. Morgan Kaufmann Publishers. ISBN 1-558-60320-4.
Copies of these books will be on reserve in the Engineering library.
There are four written homework assignments. They must be done on an individual basis.
The compiler project is divided up into six programming assignments that are due at various points throughout the term. Compiler projects will be performed by groups of three or four students. Groups will be created by the course staff, but taking into account student preferences. The same groups will be maintained throughout the semester if possible.
Homework and programming assignments will be accepted up to 4 days late, but at a penalty. When assignments are turned in late, the penalty increases by 10% each day: 10% for one day late, 20% for two days late, 30% for 3 days late, 40% for 4 days late, 50% for 5 or more days late. These penalties may be avoided by obtaining an extension on the assignment, but any extensions must be approved by the instructor at least two days before the due date -- last-minute extensions will not be granted. Both homework assignments and programming assignments are due at the beginning of class on the due date. Programming assignments will be treated similarly: you will turn in the report for that assignment in class, and make the associated files available in a standard place before class on the due date so that we can test your code. If either the report or the programming assignment arrives after class on a particular day, it will be considered to have arrived a day later for the purpose of late penalties.
Except in unusual circumstances, you will receive the same grade in CS 412 and CS 413 and all members of a group will receive the same grade on programming assignments. Exceptions to these rules are dealt with on a case-by-case basis.
The breakdown of points per assignment is as follows:
|Prelims: 35%||Prelim 1||17|
|Homework: 20%||Homework 1||5|
|Project: 45%||Programming assignment 1||5|
|Programming assignment 2||8|
|Programming assignment 3||8|
|Programming assignment 4||8|
|Programming assignment 5||12|
The preliminary exams will cover material from the lectures. Both prelims will be in-class and both will be closed-book exams. There will be no final exam, but your final report and demo will be due on the first day of finals.