Compiler Construction
- German: Compilerbau | Turnus: sommer in the module handbook, but offered in winter term 2026/27 | Language: de (slides in English) | Status: active, exam period
2026-winter - Lecturer: Janis Voigtländer, University of Duisburg-Essen
- Written exam: 11 March 2027
Overview
Module handbook goal (translated from the slide quote): the course has the dual aim of teaching the theoretical and algorithmic foundations needed to understand and design compilers and interpreters, and of confronting students with the practical problems of compiler construction. Successful participation in the exercises requires developing a complete compiler in which the algorithms from the lecture are implemented.
Topics from the module handbook: introduction to compiler construction · syntax and semantics of programming languages · architecture of compilers and interpreters · lexical analysis · syntactical analysis · intermediate representations · code generation · optimisation.
What the course actually focuses on (slide 14): the phases before register allocation, barely optimising; the triad formalisms, (efficient) algorithms, tools; explicitly no focus on good error messages.
Format: 3 V + 1 U, two weekly slots (Tue 10:15–11:45 LK 051, Wed 08:30–10:00 LC 140), used flexibly. Attendance at both slots is expected.
Implementation style: Haskell, largely with DSLs from which Haskell code is generated; “live programming”, no sample solutions — guided hands-on, follow-along application.
Exam prerequisite (Prüfungsvorleistung)
Four milestones, of which at least the first three must be reached:
| # | Milestone | Target |
|---|---|---|
| 1 | lexical analysis for C₀ | ~4 weeks |
| 2 | syntactical analysis for C₀ | ~8 weeks |
| 3 | semantical analysis for C₀ | ~10–11 weeks |
| 4 | generating intermediate code for C₀ | end of term |
Slide 18, verbatim: “Copying other implementations (including from LLMs) will result in disqualification. In case of doubt regarding independent work, I will ‘interview’ you.”
The example language: C₀
A sublanguage of C. Slide 16’s sample program computes :
#include <stdio.h>
int main () {
int i, n, s;
scanf("%d", &n);
i = 1; s = 0;
while (i <= n) {
s = s + i * i;
i = i + 1;
}
printf("%d", s);
return 0;
}The target language: AM₀
A heavily simplified “assembly language” with READ, LIT, STORE, LOAD, ADD, MUL, LE, JMC, JMP, WRITE and memory addresses — the machine the last block compiles to (slide 17 shows the 21 instructions for the program above).
Concepts
Concept map: _index.md (MOC: reading order, mastery, gaps, rendering conventions).
| Block | Page | Mastery |
|---|---|---|
| Lexical analysis — theory: regex, NFA, DFA, powerset, minimization | lexical-analysis-formalism | learning |
| Lexical analysis — practice: longest match, generators, flex/Alex, C₀ lexer | practical-lexers | learning |
Not yet ingested (announced in the table of contents, absent from the 55-page deck): syntactical analysis (CFGs, LL(1), grammar transformations, ASTs, SLR), semantical analysis (attribute grammars, circularity test, tools, C₀ semantics), interpreters, code generation (AM₀, translation functions).
Materials
| Source | Pages | Status | Notes |
|---|---|---|---|
raw/compilerbau/compilerbau-slides-55.pdf (version 28.10.2026) | 55 | OK | LaTeX Beamer, text-based; figures (all automata) are drawn as graphics and are not in the text layer — reconstructed by hand into Mermaid/Graphviz on the concept pages. Deck grows weekly. |
| Moodle | — | external | slides, exercise examples, tooling hints, announcements, submission of exercise solutions |
| Literature (most aligned) | — | — | Torben Ægidius Mogensen, Introduction to Compiler Design, Springer 2017 |
Conversion: pdf2md raw/compilerbau/ → sibling compilerbau-slides-55.md (18.5 KB). Re-run after each weekly update; compare against the previous .md and record the new version date here.
Exam notes
- 11 March 2027, written exam. No past exams ingested yet.
- Highest-probability constructive task: regex → NFA (Thompson) → DFA (powerset) → minimal DFA. Drilled in lexical-analysis-formalism §7.
- Notation in the exam is the lecture’s: , for DFA transitions, for the NFA transition relation (literature/Mogensen uses ).
- Slide-35 and slide-51 exercises are the canonical drill set; solutions for 35 are in the wiki, 51’s are left as practice.
- Weak areas: — (no quiz results yet)