CC: Compiler Construction

Course: 21025 Compiler Construction (Spring 2017)
Lecturer:Prof. Oscar Nierstrasz, Mohammad Ghafari, Dr.
Assistants:Yuriy Tymchuk, Manuel Leuenberger
Audience:Master students in computer science
Lecture:Fridays, 10h15 - 12h00
Exercises:Fridays, 12h00 - 12h45
Place:Engehaldenstrasse 8, 001
Start:Feb 24, 2017
Repetition:Spring 2019

St George


This course will provide students with an introduction to modern compiler construction. The first two-thirds of the course will cover fundamental topics, and will be based on the text book Modern Compiler Implementation in Java (Second edition), Cambridge University Press, New York, NY, USA, 2002, by Andrew W. Appel, with Jens Palsberg). The remaining third of the course covers advanced topics of current interest.

Learning Outcomes

On successful completion of this course, you will be able to:

  • Distinguish formal and practical properties of different approaches to parsing
  • Understand and implement various techniques to parse source code
  • Implement a basic compiler
  • Use visitors to process an abstract syntax tree (AST)
  • Transform an AST to intermediate representation (IR)
  • Perform peephole optimization on the IR
  • Generate target code (eg Java bytecode) from IR


The final grade will be based 10% on exercises, 30% on a team project and 60% on the final exam.


Week Date Lecture
1 24-Feb-17 Introduction
2 03-Mar-17 Lexical Analysis
3 10-Mar-17 Parsing
4 17-Mar-17 Parsing in Practice
5 24-Mar-17 Semantic Analysis
6 31-Mar-17 Intermediate Representation
7 07-Apr-17 Optimization & JIT Compilation
- 14-Apr-17 Good Friday
- 21-Apr-17 Spring break
8 28-Apr-17 Code Generation
9 05-May-17 Bytecode and Virtual Machines
10 12-May-17 PEGs, Packrats and Parser Combinators
11 19-May-17 Program Transformation
12 26-May-17 Project Presentations
13 02-Jun-17 Final Exam

NB: The lecture notes are based partly on similar courses offered by Profs. Jens Palsberg (CS132) and Tony Hosking (CS502).

Last changed by oscar on 19 January 2017