CS 412/413
Introduction to Compilers
Spring 2003

Course Overview

Course Description

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 which is a simplified version of Java.


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.


Optional: (Dragon Book) Compilers -- Principles, Techniques and Tools. Aho, Sethi and Ullman. Addison-Wesley, 1988. ISBN 0-201-10088-6.

Optional: (Tiger Book) Modern Compiler Implementation in Java (Second Edition). Andrew Appel. Cambridge University Press, 2002. ISBN 0-521-82060-X.

Copies of these books will be on reserve in the Engineering library. 

Assignments and Grading

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, etc.  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. 

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
Prelim 2 18
  Homework: 20%     Homework 1 5
Homework 2 5
Homework 3 5
Homework 4 5
  Project: 45% Programming assignment 1 5
Programming assignment 2 9
Programming assignment 3 9
Programming assignment 4 9
Programming assignment 5 9
Project Demo 4
Total 100


The preliminary exams will cover material from the lectures. Both prelims will be evening exams 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.