COMP3002: Compiler Construction

Always looking to improve, our TA, Sander, asked me to post a link to the newly-created TA feedback form so that you can offer any constructive criticism you might have.
Assignment 4 is now available (see below).
Here are the Assignment 1, 2, and 3 marks. To compute your secret ID, enter your student number in the form below:
(Note: Sander has some updated marks for Assignments 1 and 2. The updates are not in this spreadsheet yet.) (Note 2: Assignment 3 was marked out of 45. The last question was treated as a bonus question.)

Office hours

The TAs/office hours for this course are:
Pat MorinTue 9:00-10:005177 HP
Pat MorinTue 13:30-14:305177 HP
Sander VerdonschottFri 13:00-14:001175 HP
The TAs' office hours will be posted here as soon as we get some TAs. If you need to see me outside of my office hours you can always try dropping by my office. Send me an email in advance if you really need me to be there.
The CCSS COMP3002 Forum is now up. Please post any questions you have about the assignment or course material there.

Course outline

This course is about how to build a compiler. The main areas covered are:

Assignments and software

The CCSS COMP 3002 Forum will be a good place to ask and answer questions about assignments. I'll be monitoring the forum. Students are encouraged to help each other by sharing test code (but not assignment code) on the forum.

Assignments will be posted here when they are ready. For now, these are the due dates for the assignments:

Assignments in this course will be programming assignments in Java. For the first assignment you will be asked to make modifications to a simple interpreter that I have hand-coded in Java. For subsequent assignments, you will be working with JavaCC, an automated parser generator system.

The following are sites at which you can download software and documentation you will need for this course. All of this software is sufficiently well-documented, so I don't offer any installation support.

Course notes

Most of the material I will teach is taken from the famous Red Dragon Book:

This book has been updated with a second edition and is now available as These are both very good books for compiler front-end theory. Unfortunately, even the second edition is lacking when it comes to modern compiler work. I don't recommend buying either book unless you can pick up a used copy cheap.

The in-class slides are here. These are constantly being updated. In particular, before each class I will revise the slides for that class.

Grading scheme

Grades will be assigned using the following grading scheme.

Assignment 120%
Assignment 220%
Assignment 320%
Assignment 420%
End-of-term exam20%

I may, at my discretion, increase the grades of certain students to raise the class average or change the distribution. This will never cause a student's grade to go down, nor will it change the relative rankings of students so, e.g., it is not possible for a student who earned an 80% to receive a lower grade than a student who earned a 75%.

Policy regarding unoriginal work

Students are encouraged to collaborate on assignments, but at the level of discussion only. That is, they may work together to solve problems and discuss their solutions, but when writing code should do so on their own. No student should show another student his or her source code.

Any student who is caught submitting work that they did not do themselves will have all relevant material sent to the Dean, who will determine the students fate. Possibilities punishments include receiving reduced marks, no marks, expulsion from the course, suspension and/or expulsion from Carleton University, and so on, at the discretion of the Dean.

Students with Special Needs

Students with special needs should obtain documentation from the Paul-Menton Center and notify me as soon as possible.