CS3142 - Compilers
Announcements
- March 25: model answers to previous exam questions are now available. NB: there might be
occasional errors and omissions and they are supposed to give a hint to answering the exam!
(available from CS machines only)
- 2004 exam model answers
- 2003 exam model answers
- 2002 exam model answers
- March 25: Provided that you get a first, the department
can support you to do a PhD and i'd be happy to be the
supervisor of a compiler-related topic.
Course Book
The module textbook is
"Compilers: Principles, Techniques, and Tools"
by Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman. Widely known as the
"Dragon book", it has been a standard reference for two generations.
Other recommended books:
- Engineering a compiler, by Cooper and Torczon. A good book,
follows quite closely the structure of this course.
- Modern Compiler Design, by Grune et al. This is a new book
and has good coverage.
- The essence of compilers, by Hunter. Somewhat compact.
Schedule
- Lectures (LF15): Wednesdays 11-12; Thursdays 9-10
Handouts
(NB: Accessible from Computer Science machines only)
- Lecture 01 (Introduction): [powerpoint],
[pdf]
[Aho, 1.1]
- Lecture 02 (General Structure of a Compiler): [powerpoint],
[pdf]
[Aho, pp. 1-24]
- Lecture 03 (Introduction to Lexical Analysis): [powerpoint],
[pdf]
[Aho, pp.25-29; 84-87; 92-105]
- Lecture 04 (Lexical Analysis II: from REs to DFAs): [powerpoint],
[pdf]
[Aho, pp.113-125]
- Lecture 05 (Lexical Analysis III): [powerpoint],
[pdf]
- Lecture 06 (Introduction to Parsing): [powerpoint],
[pdf]
- Lecture 07 (Top-Down Parsing): [powerpoint],
[pdf]
- Lecture 08 (Bottom-Up Parsing): [powerpoint],
[pdf]
- Lecture 09 (LR(1) Parsing): [powerpoint],
[pdf]
(Check this for the answer to the
example in slide 5)
- Lecture 10 (Context Sensitive Analysis: Attribute Grammars): [powerpoint],
[pdf]
- Lecture 11 (Intermediate Representations & Symbol Tables): [powerpoint],
[pdf]
- Lecture 12 (The Procedure Abstraction): [powerpoint],
[pdf]
- Lecture 13 (Code Generation - Instruction Selection): [powerpoint],
[pdf]
- Lecture 14 (Register Allocation): [powerpoint],
[pdf]
- Lecture 15 (Register Allocation via Graph Colouring): [powerpoint],
[pdf]
- Lecture 16 (Global Register Allocation via Graph Colouring): [powerpoint],
[pdf]
[not to be examined - for information only]
- Lecture 17 (Instruction Scheduling): [powerpoint],
[pdf]
- Lecture 18 (Code Optimisation): [powerpoint],
[pdf]
Resources on the web
Earlier versions of this webpage
(links may not work as a result of changes to the CS web site)
Exam Papers from past years
(accessible from UoM machines only - NB: exams prior to 2002 were set by the
lecturer who taught the Compilers course in previous years)
Staff