CS 444/644 - Compiler Construction (Winter 2020)

Modifications in response to University-wide cancellation of in-person course activity


In-person lectures are cancelled for the remainder of the term.

Two recorded lectures have been posted to Learn and Youtube. Login to Learn or see Piazza for the Youtube links. You may view these lectures at a time of your convenience.

In the remaining two weeks of the term, there will be live video lectures on Learn from 1:00 pm to 2:20 pm each Monday and Wednesday. These lectures will be recorded so you may view them at a time of your convenience, but I encourage you to watch them during the live time slot if possible, since this allows you to interact and ask questions during the lecture. Additional questions about lecture material will be answered on Piazza.

To access the live and recorded lectures on Learn, select Virtual Classroom from the Connect pull-down menu.

Assessment weighting and deadlines

The final exam is cancelled. The weighting of the final exam is distributed to the assignments (Marmoset public tests and secret tests). The deadlines for Assignments 4 (code only, not document) and 5 and the late deadlines for Assignments 1, 2, and 3 are extended to the original date and time of the final exam. The additional weighting on Assignments 1, 2, and 3 is allocated to the late deadline, so that groups that did not finish these assignments by their on-time deadlines are not additionally penalized by the increased weighting.


Mondays and Wednesdays, 10:00 -- 11:20 MC 4040 (section 001) OR 1:00 -- 2:20 on Learn DWE 2527 (section 002)
Ondřej Lhoták (olhotak), DC 2520, Office hours: e-mail for appointment for online meeting
Teaching Assistants:
Xiang Fang, Runsheng Guo, Edward Lee, James You (cs444@student.cs)
Web page:
Handbook description:
Final Exam:
Course Description and Objectives:
The objective of the course is to provide a thorough understanding of the basic structure of compilers for Java-like languages. A major part of the course consists of the implementation of a compiler for a simplified Java-like language. The goal of the course is to acquaint students with software tools and techniques which are applicable both to compilers and the implementation of system utility routines, command interpreters, etc.
Topics covered:
scanning, parsing, abstract syntax trees, scoping and name resolution, type checking, static analysis, runtime organization, code generation.
Acknowledgement: The Joos-related parts of the course are adapted by permission from Michael Schwartzbach's dOvs course at the University of Aarhus.

Web Resources

Recommended References


see top of page

CS 444

Course Project: 75%
- online Marmoset tests: 60%
- written reports: 15%
Final Exam: 25%
You must achieve 50% or more on final exam in order to pass the course. If you do not meet this minimum requirement then your final grade for the course will be at most your final exam mark.

CS 644

Above CS 444 Marking Scheme, scaled: 80%
Literature Survey: 20%

Course Project

The overall project for the course is to write a compiler from Joos 1W, a fairly large subset of Java, to i386 assembly language (the Netwide Assembler dialect). The project will be done in groups of three. The project will be broken up into several assignments with fixed due dates. The assignments must be submitted to the Marmoset on-line submission and testing system. For each assignment, you will submit both your code and a written report (for assignments 1, 4, and 5) to Marmoset. Marks for your code will be reported to you by Marmoset, and your marked written reports will be returned to you by e-mail. See top of page for revised deadlines and weightings. The above assignment marks total 50% 66% of your final mark. An additional 10% 19% will be assigned to secret tests which will be run after the assignment 5 deadline.

Students enrolled in CS 644 are required to complete a literature survey on a topic related to compiler construction.

Resources available in the linux.student.cs environment.

Group Work Marking Policy

When working in a group, disagreements sometimes arise. One of the objectives of this course is for you to resolve such disagreements with sufficient, constructive, and frank communication within the group. Therefore, when disagreements arise, discuss them within the group before asking the instructor to intervene. If the group fails to reach a resolution, the group as a whole should arrange a meeting with the instructor. The instructor's role is primarily to mediate the discussion within the group, rather than to intervene in the disagreement.

Problems are easier to resolve if handled early. When a problem arises, try to resolve it as soon as possible. Do not leave it until the end of the course.

At the end of the course, the following policies will be used to distribute marks among the group members:

  1. Normally, each member of the group will be given an equal mark. You should therefore strive to ensure that each group member makes an approximately equal contribution to the project.
  2. The group may propose a different distribution of the marks, provided all group members consent to the distribution. Such a proposal must be made to the instructor within three days after the due date of the last assignment. The marks will be distributed in such a way that the mean of the marks equals the original group mark and no individual project mark exceeds 100%.
  3. If agreement cannot be reached, a member of the group must contact the instructor within three days of the due date of the last assignment. The instructor will ask each group member to submit a written statement detailing the contributions of each group member, the nature of the conflict, and the steps that were taken by the group to resolve the conflict. Failure to submit the statement within three days of being asked to do so will result in a mark of zero for that group member. Based on the statements, the instructor will make a final decision about the mark distribution. Note that the instructor will generally not deviate from the equal distribution of marks unless convinced that the group took sufficient and timely steps to resolve the conflict internally.

Late Policy

The written report for each assignment must be submitted by the assignment deadline. Reports submitted after the deadline will not be marked and will receive a mark of zero. If you cannot finish an assignment by the deadline, submit what you have by the deadline, and explain any unfinished parts in your report.

For code submissions, the following late policy is in effect: (0.5 * best-on-time) + (0.5 * best-overall) (0.38 * best-on-time) + (0.62 * best-overall), where

Examples: Submitting an additional solution for an assignment can never reduce your mark.


Academic Integrity Policies

Academic Integrity

In order to maintain a culture of academic integrity, members of the University of Waterloo community are expected to promote honesty, trust, fairness, respect and responsibility. Check the Office of Academic Integrity's website for more information.

All members of the UW community are expected to hold to the highest standard of academic integrity in their studies, teaching, and research. This site explains why academic integrity is important and how students can avoid academic misconduct. It also identifies resources available on campus for students and faculty to help achieve academic integrity in — and out — of the classroom.


A student who believes that a decision affecting some aspect of his/her university life has been unfair or unreasonable may have grounds for initiating a grievance. Read Policy 70 — Student Petitions and Grievances, Section 4. When in doubt please be certain to contact the department's administrative assistant who will provide further assistance.


A student is expected to know what constitutes academic integrity, to avoid committing academic offenses, and to take responsibility for his/her actions. A student who is unsure whether an action constitutes an offense, or who needs help in learning how to avoid offenses (e.g., plagiarism, cheating) or about "rules" for group work/collaboration should seek guidance from the course professor, academic advisor, or the Undergraduate Associate Dean. For information on categories of offenses and types of penalties, students should refer to Policy 71 — Student Discipline. For typical penalties, check Guidelines for the Assessment of Penalties.

Avoiding Academic Offenses

Most students are unaware of the line between acceptable and unacceptable academic behaviour, especially when discussing assignments with classmates and using the work of other students. For information on commonly misunderstood academic offenses and how to avoid them, students should refer to the Faculty of Mathematics Cheating and Student Academic Discipline Policy.


A decision made or a penalty imposed under Policy 70, Student Petitions and Grievances (other than a petition) or Policy 71, Student Discipline may be appealed if there is a ground. A student who believes he/she has a ground for an appeal should refer to Policy 72 — Student Appeals.

Note for students with disabilities

AccessAbility Services, located in Needles Hall, Room 1401, collaborates with all academic departments to arrange appropriate accommodations for students with disabilities without compromising the academic integrity of the curriculum. If you require academic accommodations to lessen the impact of your disability, please register with AccessAbility Services at the beginning of each academic term.