Compiler Construction

Core Course

People

Sebastian Hack, Fabian Ritter, Roland Leißa

General Information

The course treats compiler construction for imperative programming languages. This includes lexical, syntactical, and semantic analysis as well as static program analysis, optimization, and code generation. This course provides all necessary theoretical knowledge required to implement a compiler from scratch, which forms the practical part of the lecture.

Modus Operandi

There will be voluntary mini tests which will take place in the last 20 minutes within the tutorial. Additionally, there will be voluntary exercise sheets. To get a course certificate, students must pass the final exam and the project. Final grades will be based on the exam and the project.

Lecture

Tutorial

Exams

Support

Material

Slides

Date Topic
2017-10-17 Introduction (Code)
2017-10-20 Intro to Syntax Analysis, Lexing
2017-10-24 Grammars, Push-Down Automata
2017-10-27 LL Parsing
2017-11-03, 2017-11-07 LR Parsing
2017-11-14 Semantic Analysis
2017-11-17 Introduction to Program Analysis
2017-11-21 Constant Propagation, Soundness
2017-11-24 Superfluous Computations, Dead Code Elimination
2017-12-01 Interval Analysis, Widening
2017-12-05 Pentagons, Global Value Numbering
2017-12-08 SSA Introduction
2017-12-12 SSA Construction, Background reading: Cytron et al.

Exercises

  1. Exercise sheet 1 (including project tasks A and B, updated with fixed indentation in example)Solution 1
  2. Exercise sheet 2Solution 2
  3. Exercise sheet 3 (including project task C)Solution 3
  4. Exercise sheet 4Solution 4
  5. Exercise sheet 5 (including project task D)Solution 5
  6. Exercise sheet 6 (including project task E)Solution 6
  7. Exercise sheet 7

Project Material

Literature

The course is mainly built on these books:

The library has several copies of the English version of the book.

The following books are among the "standard" compiler textbooks:

The following textbooks are stanard references for loop transformations:

The following textbook provides a good introduction into the theory of polyhedra and linear programming: