Table of Contents

CMPU 331: Compiler Design (Spring 2018)

This is the syllabus page for the Compiler Design class. It will evolve over the course of the semester, so check back regularly. You are responsible for keeping up-to-date with any changes here.

An online discussion group will be set up in due course.





Aho, Alfred V., Lam, Monica S., Sethi, Ravi & Ullman, Jeffrey D., Compilers: Principles, Techniques, and Tools (2nd edition).

Course Requirements

  1. Weekly readings.
  2. Written examination. (40%)
  3. A significant programming project. (60%)


The examination will be scheduled later in the semester.


The project consists of implementing a compiler front-end, in four parts: lexical analysis routines, a parser, symbol table management routines, and semantic routines. Each piece must be integrated with what has been completed previously.

The project should be implemented in either Java or Python.

All of the IDEs named above are available on the CS department Linux systems. Downloads are available here.

Class Schedule

This schedule is provisional and subject to change. You are responsible for keeping yourself apprised of the current status of this schedule.

It is expected that you will have completed the appropriate readings before the corresponding class(es). You are responsible for keeping up with the readings and for ensuring that you have adequate notes of material covered in class, some of which may not be in the textbook: this includes lectures, assignments, hand-outs, additional reading, and so forth.

If you miss a class, it is your responsibility to make arrangements with classmates to acquire information presented.

Topics and Readings

Week Beginning Topic Reading Slides
1 22nd January Introduction Ch. 1, 2.1-2.5. Full Handout
2 29th January Lexical analysis. Ch. 2.6, 3.1-3.5, 3.8. Full Handout
3 5th February Languages, syntax and parsing. Ch. 4.1-4.3. Full Handout
4 12th February Top-down parsing. Ch. 4.4. Full Handout
5 19th February Bottom-up parsing. Ch. 4.5-4.6.
6 26th February More powerful bottom-up parsing. Ch. 4.7.
7 5th March Symbol tables. Ch. 2.7, 7.1-7.3.
Spring Break
8 26th March Syntax-directed translation. Ch. 5.
9 2nd April Intermediate code generation. Ch. 2.8, 6.1-6.3.
10 9th April Runtime environments. The Vassar Interpreter.
11 16th April Arithmetic expressions. Ch. 6.4-6.5, 7.1-7.4.
12 23rd April Relational expressions and control flow. Ch. 6.6-6.7.
13 30th April Optimisation and code generation. Ch. 9.1-9.4, 8.4-8.5, 8.7-8.8.
14 7th May Procedure and function declaration and calls. Ch. 7.1-7.3.
15 14th May
16 21st May End of class – happy vacation!


Component Specification Date released Date due Weighting
Lexical analyser (lexer) Lexical analyser (lexer) Thursday, 1st February Thursday, 15th February 10%
Parser Parser Tuesday, 20th February Tuesday, 6th March 7.5%
Symbol table routines 2.5%
Semantic actions (part 1) 5%
Semantic actions (part 2) 7.5%
Semantic actions (part 3) 12.5%
Complete compiler Tuesday, 15th May 17.5%
Test files

Test files are available in the directories listed here.

To upload a test file, use the following command:

331upload [lexer|parser|code] <filename>

Submission policy

All components are due by 11.59:59 pm on the date specified. See the submission guidelines for further information.

The grading rubric used for project submissions is available here.

Late work will be subject to the late policy as described.

Please note that the due date for the complete system is the latest time possible under Vassar College legislation.


This will likely be a 48-hour take-home exam scheduled towards the end of the semester, not in the final exam block.

Policies & Procedures

I support wholeheartedly and implement all the general policies of Vassar College, including but not limited to those relevant to students with disabilities, plagiarism, and respectful classroom etiquette.

Academic accommodations are available for students registered with the Office for Accessibility and Educational Opportunity (AEO). Students in need of disability (ADA/504) accommodations should schedule an appointment with me early in the semester to discuss any accommodations for this course that have been approved by the Office for Accessibility and Educational Opportunity, as indicated in your AEO accommodation letter.

Classroom Policy


Attendance is not required, but it is strongly recommended: in-class discussions and explanations will likely not be posted online.


While most of this class takes the form of lectures, I welcome and encourage discussion and questions on the subject under discussion. If you are unsure about something, if you are just curious, if you want to play “Devil's advocate” (within reason) — please ask questions.

"Failure-Okay Zone"

I endeavor to foster an atmosphere in which it feels safe to fail. My classroom is a failure-okay zone: in fact, I welcome failure, since we frequently learn more by failure than by success.

Mobile phones

Please set your mobile telephone to silent and put it away.


I prefer students not to use laptops in class, if possible. Please bring [(paper)+] and [(pen)+|(pencil)+|(stylus)+] to make notes.

Late Policy

Work submitted late will be subject to an incremental 10% penalty per day or part day late. Work received more than 96 hours (four days) late will automatically receive a grade of 0.

Exceptions to this policy may be made in the case of extenuating circumstances.

Extenuating Circumstances

I accept and recognise that there may be occasions where significant problems occur. I am more than willing to work with students who are having genuine difficulties with their work because of life events beyond their control (e.g. illness or bereavement). However, I ask that you make me aware of such situations as soon as possible, and I require documentary evidence of some form in order to be able to make any accommodation.

Backup Policy (a.k.a. "The Internet Ate My Homework")

The compiler is a significant programming project and should be treated like any other major piece of work. It is expected that you will make regular backups of your work and develop your code incrementally: together, these steps will increase the likelihood of you being able to recover from a significant loss of work.

As it is expected that you will make backups, the excuse, “I couldn't submit my work because [computer-related reason],” is no longer generally acceptable.