Compiler Design (COMP 520)


The course will teach modern compiler techniques applied to both general-purpose and domain-specific languages. The examples chosen will also convey a detailed knowledge of state-of-the-art based WWW technology such as Java and CGI-based interactive services.


Deterministic parsing: LR parsers and the flex/bison tools.
Semantic analysis: abstract syntax trees, symbol tables, type checking, resource allocation.
Virtual machines and run-time environments: stacks, heaps, objects.
Code generation: resources, templates, optimizations.
Surveys on: garbage collection, native code generation, static analysis.


Lectures: 3 hours/week. MWF 11:35-12:25, ENGTR 2100


Officially Required: COMP-273, COMP-302.

Other: COMP-330 (or familiarize yourself with regular and context-free languages), a familiarity with programming in C or Java.

Detailed Course Schedule and Links:

The course web page contains a detailed course schedule, links to the course notes and links to relevant software. You should visit this page weekly to get the most recent information.

Marking Scheme:

Assignments and Course Project (60%), Midterm (15%), Final Exam (25%)
For the assignments marks, they will be allocated as follows:
  • 5 marks for each of the first three JOOS deliverables
  • 10 marks for the JOOS peephole optimizer
  • 5 points for meeting deadlines and milestones
  • 30 points for the WIG compiler/report
Marks for the final WIG compiler/report may be different for different members of a group if the contributions of group members varies substantially.


Nomair A. Naeem, McConnell 234, Office Hours MW 12:30-13:30

Teaching Assistants:



4 credits

Academic Integrity at McGill University

McGill University values academic integrity. Therefore all students must understand the meaning and consequences of cheating, plagiarism and other academic offences under the Code of Student Conduct and Disciplinary Procedures (see for more information). A helpful article on how to avoid plagiarism can be found at:

In terms of this course, part of your responsibility is to ensure that you put the name of the author on all code that is submitted. By putting your name on the code you are indicating that it is completely your own work. If you use some third-party code you must have permission to use it and you must clearly indicate the source of the code.