Compiler Construction

About this course

Programs that run on a computer are written in a computer language, and the languages used for writing computer programs have significantly evolved over time. By abstracting from the details of the underlying computer architecture, higher-level languages aim at making the process of developing a program simpler and more understandable than when using a lower-level language. Modern languages offer us a variety of different concepts for expressing (executable) programs. Domain-specific (modeling) languages are even created specifically to solve problems in a particular domain of interest. However, programs written in a higher-level language must be translated into a lower-level, executable representation, which requires various forms of compilers doing this job for us.

This course will provide students with an introduction to modern compiler construction. The first two-thirds of the course will cover classical topics ranging from scanning and parsing over semantic analysis and interpretation to code generation and optimization. In the exercises, we will develop a fully functional interpreter for our own programming language. The remaining third of the course is dedicated to study the transition form classical compiler techniques into principles of model-driven software development. In the exercises, we will develop a fully functional, domain-specific modeling environment.

Organisation

Prerequisites

Learning outcomes

Why should I take this course?

The magic of computer languages:

Little languages are everywhere:

Domain-specific Languages and Model-driven Development

Schedule (Spring Semester 2025)

DateTopic
Part I: Classical Compiler Construction
18-02Introduction
25-02Lexical Analysis: Handwritten Scanners
04-03Q&A: Lexical Analysis: Scanner Generators
11-03Syntax Analysis: Grammars and Syntax Trees
18-03Syntax Analysis: Top-Down Parsing
25-03Syntax Analysis: Parser Generators
01-04Excursus: LR Parsing
08-04Semantic Analysis and Interpretation (I)
15-04Semantic Analysis and Interpretation (II)
22-04(No class)
29-04PEGs, Packrats and Parser Combinators
06-05Code Generation and Optimization
Part II: Modeling Language Engineering
13-05Defining/Implementing Modeling Languages
20-05Modeling Technologies
27-05Q&A

Exam

Repetition exam