Lehrstuhl Informatik II   
Sprachen und Beschreibungsstrukturen      
   Home Lehre Sommersemester 18 Vorlesungen Compiler Construction I login

Compiler Construction I

Dozent:Dr. Michael Petter
Ort/Zeit:MI HS 2 Thursdays 14:15-15:45
Beschreibung:    Introduction to Compilerconstruction - how to translate an imperative language.


  • Two Tutorial sessions:
    Mo, 8:30-10:00 MI 02.07.014
    Thu 8:30-10:00 MI 02.07.014 !!!! There is no free seminar room at 10:00 - believe it or not

Slides (state of Aug. 14th 2017):



A Compiler is an essential part of the system software stack. Its job consists in translating programs from a high-level programming language like C or Java into a sequence of machine instructions of an actual processor. Compilers are comparatively complex programs. Their construction involves ideas and approaches from many different areas of computer science. The first two phases, i.e. lexical and syntactical analysis of the input program, are a major application for formal methods. Later on, e.g. during code generation, we treat methods for register allocation via approximative graph colouring.

The lecture is divided into the following topics:

  1. Outline of compiler construction
  2. Lexikal analysis:
    From regular expressions to NFAs
    Scannerdesign with NFAs
  3. Syntactical analysis
    Contextfree languages & pushdown automata
    Item-Pushdownautomata & Recursive Descent Parsing
    Shift-Reduce Parsing & LR(1) Parser
  4. Semantical analysis
  5. Codegeneration
    Code generation schemes
  6. Optimizations

Finally we may find time for less standard techniques for compilers, as e.g. the type inference of programs.

Exam FAQ:

  1. Attention: There will be only one exam at the end of the semester, and no repetition exam in the winter!
  2. You are allowed to bring all printed or handwritten material, you like
  3. In case you did not pass, you have the opportunity to take "Programming Languages" or "Program Optimization" next semester or alternatively repeat the exam next summer.
  4. We will provide two printouts of the lecture slides in case there is some information you forgot to add to your A4 sheet. We will also provide some copies of the RCMa specification document.


Wilhelm, Seidl, Hack: Compiler Design: Syntactic and Semantic Analysis

for TUM students, the German edition is downloadable for free through the TUM/LRZ-Proxy, the English edition is available in the form of several hardcopies in the library.

R-CMa specification

The instructions and the code generation schemes are summarized in the R-CMa specification.


  • Exercise Sheet 01
  • Exercise Sheet 01 Solution
  • Exercise Sheet 02
  • Exercise Sheet 02 Solution
  • Exercise Sheet 03
  • Exercise Sheet 03 Solution
  • Exercise Sheet 04
  • Exercise Sheet 04 Solution
  • Exercise Sheet 05
  • Exercise Sheet 05 Solution
  • Exercise Sheet 06
  • Exercise Sheet 06 Solution
  • Exercise Sheet 07
  • Exercise Sheet 07 Solution
  • Exercise Sheet 08
  • Exercise Sheet 08 Solution
  • Exercise Sheet 09
  • Exercise Sheet 09 Solution
  • Exercise Sheet 10
  • Exercise Sheet 10 Solution

TUM - Lehrstuhl Informatik II (Sprachen und Beschreibungsstrukturen) Thanks: Tango and TinyMCE     Generationszeit: 8 ms