# Compiler Construction

![St George](figures/stgeorge.png)

This repo contains the lecture material for the MSc level course “Compiler Construction”.

The course provides students with an introduction to modern compiler construction. The first two-thirds of the course covers fundamental topics, and is 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

## Slides

The lecture notes are based partly (with permission) on similar courses offered by Profs. [Jens Palsberg](http://web.cs.ucla.edu/~palsberg/) ([CS132](http://web.cs.ucla.edu/~palsberg/course/cs132/S08/index.html)) and [Tony Hosking](http://hosking.github.io) ([CS502](https://www.cs.purdue.edu/homes/hosking/502/)).

The slides have been prepared with Apple Keynote. Interspersed with the slideware are hidden slides containing notes for students. PDF versions of the slides can be found [here](http://scg.unibe.ch/download/lectures/cc/).

The figures for the slides have mostly been prepared using [OmniGraffle](https://www.omnigroup.com/omnigraffle/).

## Repo

This repo lives on [github](https://github.com/onierstrasz/course-compiler-construction).
Further resources can be found on the [course web site](http://scg.unibe.ch/teaching/cc).

![CCSA4](https://licensebuttons.net/l/by-sa/3.0/88x31.png)
This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/).

---
