Summer 2025 - CMPT 379 D100

Principles of Compiler Design (3)

Class Number: 3822

Delivery Method: In Person

Overview

  • Course Times + Location:

    May 12 – Aug 8, 2025: Mon, 12:30–2:20 p.m.
    Burnaby

    May 12 – Aug 8, 2025: Wed, 12:30–1:20 p.m.
    Burnaby

  • Prerequisites:

    (MACM 201 or CMPT 210), (CMPT 295 or ENSC 215) and CMPT 225, all with a minimum grade of C-.

Description

CALENDAR DESCRIPTION:

This course covers the key components of a compiler for a high level programming language. Topics include lexical analysis, parsing, type checking, code generation and optimization. Students will work in teams to design and implement an actual compiler making use of tools such as lex and yacc.

COURSE DETAILS:

As Steve Yegge said, "If you don't know how compilers work, then you don't know how computers work." (http://steve-yegge.blogspot.ca/2007/06/rich-programmer-food.html) This is a course for those who are interested in the design and implementation of programming languages. Compilers let us to use a high-level programming language by translating programs into low-level machine code. Understanding how compilers work is essential if you want to be a good programmer. In this course, you will build a working compiler using lex, yacc and LLVM (it's ok if you don't know what those terms mean).

Topics

  • Overview of a compiler
  • Lexical Analysis: regular expressions
  • Simple Parsing: context-free grammars, top-down and bottom-up parsing
  • LL(1) parsing: efficient top-down parsing
  • Shift-reduce parsers: introduction to bottom-up parsing
  • SLR/LR parsing: fast and efficient bottom-up parsing
  • Type checking: checking semantics of programs
  • Semantics and code generation: from a high-level language to assembly language
  • Optimization: an introduction to various types of code optimization

Grading

  • The grade distribution will be handed out at the start of classes. Students must attain an overall passing grade on the weighted average of exams in the course in order to obtain a clear pass (C- or better).

Materials

MATERIALS + SUPPLIES:

Reference Books

  • Compilers: Principles, Techniques and Tools (2nd Edition), A. V. Aho, M. S. Lam, R. Sethi, and J. D. Ullman, Addison-Wesley, 2006, 9780321486813, The purple dragon book

REQUIRED READING NOTES:

Your personalized Course Material list, including digital and physical textbooks, are available through the SFU Bookstore website by simply entering your Computing ID at: shop.sfu.ca/course-materials/my-personalized-course-materials.

Registrar Notes:

ACADEMIC INTEGRITY: YOUR WORK, YOUR SUCCESS

At SFU, you are expected to act honestly and responsibly in all your academic work. Cheating, plagiarism, or any other form of academic dishonesty harms your own learning, undermines the efforts of your classmates who pursue their studies honestly, and goes against the core values of the university.

To learn more about the academic disciplinary process and relevant academic supports, visit: 


RELIGIOUS ACCOMMODATION

Students with a faith background who may need accommodations during the term are encouraged to assess their needs as soon as possible and review the Multifaith religious accommodations website. The page outlines ways they begin working toward an accommodation and ensure solutions can be reached in a timely fashion.