Compiler Construction
Lectures will be delivered live following the timetable. Lecture recordings will be made available following the last lecture. Students who are unable to attend a particular lecture are invited to email the lecturer to request access to the recording.
Lecture slides
Last year's slides are still available, and largely current; there won't be substantial changes to the course material this year.
- Lecture 1 (2026-01-23): introduction
- Lecture 2 (2026-01-26) (without transitions): lexing
- Lecture 3 (2026-01-28) (without transitions): context-free grammars
- Lecture 4 (2026-01-30) (without transitions): LL parsing
- Lecture 5 (2026-02-01) (without transitions): Foundations of LR parsing
- Lecture 6 (2026-02-03): (without transitions): SLR(1) and LR(1)
- Lecture 7 (2026-02-05): (without transitions): translation
Additional material
- Lecture 1 (introduction)
- Compiler explorer: examine the output of compilers for C, Java, OCaml, Python, Rust, ...
- Lecture 2 (lexing)
- Lecture 4 (LL parsing)
- LL(1) parser visualization
- JFLAP can also generate LL(1) parse tables
- Slang implementation
- Online slang explorer
- Defunctionalization: everybody does it, nobody talks about it (SIGPLAN blog)
- Suggestions for Slang improvements (from Prof Timothy Griffin)
- Rocq proof that
fib_cps m k = k (fib m)
Past exam questions
- Lecture 2 (lexing): P4Q1 2025, P4Q1 2024 (part), P4Q3 2018 (part)
- Lecture 3 (context-free grammars): P4Q4 2021 (part), P4Q1 2023 (part), P4Q4 2018 (part), P4Q4 2020 (part), P4Q1 2024 (part)
- Lecture 4 (LL parsing): P4Q4 2020 (part), P4Q1 2022, P4Q1 2024 (part)
- Lecture 5 (Foundations of LR parsing): P3Q4 2015 (part), P4Q4 2021 (part)
- Lecture 6 (SLR(1) and LR(1)): P3Q3 2015 (part), P4Q1 2023 (part), P4Q4 2020 (part), P4Q4 2021 (part)
- Lecture 7 (translation): P3Q3 2016 (part), P4Q3 2020 (part), P4Q3 2021 (part)