Instructor
- Emil Sekerinski
- Office hours: Fridays 1:00 - 2:00 and by appointment, ITB 215
Prerequisites
For COMPSCI 3TB3: COMPSCI 2C03, COMPSCI 2GA3, COMPSCI 2AC3 or 2FA3, COMPSCI 3MI3For SFWRENG 4TB3: SFWRENG 2C03, SFWRENG 2FA3, SFWRENG 2GA3, and registration in Level IV or above of a Software Engineering
Calendar Description
Lexical analysis, syntax analysis, type checking; syntax-directed translation, attribute grammars; compiler structure; implications of computer architecture; mapping of programming language concepts; code generation and optimization.Midterm and Exam Dates
- Midterm Test: Tuesday, 24 Feb 2026, 2:30 - 3:20 (class time), CNH 104. Details to be announced on Avenue.
- Final Exam: Date and time as announced on Mosaic. Details to be announced on Avenue.
Format and Attendance
- The lectures introduce the course material through the course notes. Further study of the course notes is required, but reading in advance is not.
- The labs present ungraded lab questions, discuss their solution, introduce the graded assignment questions, and present the solutions to the assignment questions of the previous week. The solutions to lab questions and assignments are only presented in the lab sessions; they are not posted.
- Attendance at the labs is required but not checked. Regular attendance to the lectures and labs is essential for the successful completion of the assignments, the midterm tests, and the final exam. Lectures and labs are neither streamed nor recorded.
Material and Fees
- The course notes are freely available on the JupyterHub server; see Avenue for access. They can either be used remotely or can be downloaded. While you only need a web browser to access the course notes, is recommended that you install Jupyter and extensions on your computer for offline reading of the course notes. All software used in this course is freely available.
- You are asked to bring your laptop computer to the labs, midterm test, and final exam. Since the course notes are electronic and interactive, you can use your computer in the lectures and labs, but for the purpose of this course only. You must use your computer such that it is not distractive to those around you.
Learning Objectives
Compilers convert programs in "high-level" languages to executable code. This course introduces the concepts of compilation and illustrates those by a compiler for a small Pascal-like language for a virtual machine and a RISC processor. However, this course is not just about writing compilers! Students will be able to:- identify the phases of compilation, linking, loading, and execution,
- apply parsing, analysis, and generation techniques for translation and other syntax-directed processing (e.g. for query languages, mark-up languages, and protocols),
- design the grammar of formal languages,
- relate the topics of other courses, in particular, architecture, programming languages, computation theory, and operating systems,
- explain the way current programming languages are defined through the impact of parsing techniques and processor architectures, and be prepared for new languages,
- improve their programming style by being aware of the memory layout of data types (e.g. arrays, objects), compilation of control structures (e.g. short circuit evaluation, recursion), and optimization techniques,
- determine the suitability of programming languages for specific applications based on the compilation techniques (e.g. byte code, just-in-time, garbage collection), and
- judge the suitability of compiler construction tools (e.g. scanner and parser generators) for applications.
Topics
- Language and Syntax
- Regular Languages
- Analysis of Context-free Languages
- Syntax-Directed Translation
- The Construction of a Parser
- A Stack Architecture as Target
- A RISC Architecture as Target
- Loading and Linking
- Separate Compilation
- Further Data Types
- Concurrency and Parallelism
- Garbage Collection
- Generalized Parsing
Generative AI: Use Prohibited
Students are not permitted to use generative AI in this course. In alignment with McMaster Academic Integrity Policy, it “shall be an offence knowingly to … submit academic work for assessment that was purchased or acquired from another source”. This includes work created by generative AI tools. Also state in the policy is the following, “Contract Cheating is the act of “outsourcing of student work to third parties” … with or without payment.” Using Generative AI tools is a form of contract cheating. Charges of academic dishonesty will be brought forward to the Office of Academic Integrity.Evaluation
- Assignments 28%, midterm test 22%, final exam 50%.
- There are 11 weekly assignments; each is introduced in the lab session for which you are registered. Each assignment is worth 3%; the marks are summed up and capped at 28%. That is, if you don't do perfectly on some assignments, you can stil get the full 28% of the assignments. If you MSAF an assignment, you get a 3-day extension. Collaboration on assignments is not allowed unless expliclity stated. Late submissions are not accepted.
- Tests: You must take the final exam. If you miss the midterm test due to a valid reason (e.g. MSAF), the weight will be shifted to the final exam. The tests include programming questions with Jupyter. You need to bring a laptop computer that runs a web browser to the tests.
- The assignments, the midterm test, and the final exam are to be submitted on the JupyterHub server.
Academic Integrity
You are expected to exhibit honesty and use ethical behaviour in all aspects of the learning process. Academic credentials you earn are rooted in principles of honesty and academic integrity. It is your responsibility to understand what constitutes academic dishonesty.
Academic dishonesty is to knowingly act or fail to act in a way that results or could result in unearned academic credit or advantage. This behaviour can result in serious consequences, e.g. the grade of zero on an assignment, loss of credit with a notation on the transcript (notation reads: “Grade of F assigned for academic dishonesty”), and/or suspension or expulsion from the university. For information on the various types of academic dishonesty please refer to the Academic Integrity Policy
The following illustrates only three forms of academic dishonesty:
- Plagiarism, e.g. the submission of work that is not one’s own or for which other credit has been obtained.
- Improper collaboration in group work.
- Copying or using unauthorized aids in tests and examinations.