Course Logo This page collects key material for the course. Slides are updated throughout the term, for example to correct errors. Please get the latest versions before revising. If you find a mistake, please let me know. Office hours are 12:00-13:00 after the Wednesday lecture. My office is Chichester 2, Room 312. As I supervise a lot of students, I strongly recommend to consult my online calendar to check my availablility, and then to email me for an appointment.

Important pages. Course's Canvas page and course's homepage. The course also has a Discord channel for chats about compilers. The channel invite can be found on Canvas.

Lecture slides. Slides for lectures. (Slides not yet delivered are from last year.) I will make small changes throughout the year, in order to correct typos.

1.pdf 1-handout.pdf Introduction, administrativa, course overview (Integer power example)
2.pdf 2-handout.pdf Lexing 1: regular expressions
3.pdf 3-handout.pdf Lexing 2: finite state automata
4.pdf 4-handout.pdf Syntax analysis 1: context free grammars
5.pdf 5-handout.pdf Syntax analysis 2: parsing (Optional.java)
6.pdf 6-handout.pdf Semantic analysis
7.pdf 7-handout.pdf Stack machines
8.pdf 8-handout.pdf Register machines
9.pdf 9-handout.pdf Accumulator machine
10.pdf 10-handout.pdf Introduction to realistic code generation
11.pdf 11-handout.pdf Introduction to the RISC-V processor
12.pdf 12-handout.pdf Code generation for the RISC-V processor
13.pdf 13-handout.pdf Compiling objects
14.pdf 14-handout.pdf Garbage collection
15.pdf 15-handout.pdf Extra material: caching (not exam relevant)
16.pdf 16-handout.pdf Extra material JIT compilers (not exam relevant)

Lecture videos. Will be uploaded here after lectures. Please let me know if you have trouble accessing them.

2 Oct 2019 Introduction
4 Oct 2019 Lexing (1)
9 Oct 2019 Lexing (2)
11 Oct 2019 Lexing (3)
16 Oct 2019 Lexing (4), Parsing (1)
18 Oct 2019 Parsing (2)
23 Oct 2019 Parsing (3)
25 Oct 2019 Parsing (4)
30 October 2019 Semantic analysis (1)
1 Nov 2019 Semantic analysis (2)
6 Nov 2019 Stack machines (1)
8 Nov 2019 Stack machines (2)
13 Nov 2019 Register machine. Accumulator machine (1)
15 Nov 2019 Accumulator machine (2). Intro to realistic compilation (1).
20 Nov 2019 Intro to realistic compilation (2).
22 Nov 2019 Intro to realistic compilation (1). RISC-V (1).
27 Nov 2019 RISC-V (2). Lecture video-only due to strike.
29 Nov 2019 Code generation for RISC-V (1). Lecture video-only due to strike.
4 Dec 2019 Code generation for RISC-V (). Lecture video-only due to strike.
6 Dec 2019 Code generation for OO languages.
11 Dec 2019 Garbarge collection (1).
13 Dec 2019 Garbarge collection (2).

Note that the the content of the videos that replaced lectures during the strike is also examinable content for this course.

Tutorial exercises. Sometimes, due to scheduling of tutorials and lectures, tutorial questions might be a bit ahdead of lecture material, especially at the start of term. Don't let this worry you, you can always do those exercises later.

Week 2 (Solutions).
Week 3 (Solutions).
Week 4 (Solutions).
Week 5 (Solutions).
In Week 6 we continue working on last week's tutorial exercises, and on the first assessd coursework.
Week 7 (Solutions).
Week 8 (Solutions).
Week 9 (Solutions).
Week 10 (Solutions).
In Week 11 we continue working on last week's tutorial exercises, and the 2nd assessed coursework.

Assessed coursework.

Past exams. Can be found here.

Online Material and Books: The course does not follow a set textbook. Instead, suitable lecture notes will be provided. Below is a small selection of supplementary reading material. Most go well beyond what we will cover in the course.