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

Students should have basic programming skills with proficiency in at least one programming language, a solid understanding of algorithms and data structures, and foundational knowledge in discrete mathematics.

Learning outcomes

By the end of the course, students will be able to:

Why should I take this course?

The magic of computer languages:

Little languages are everywhere:

Domain-specific Languages and Model-driven Development

Schedule

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

Exam

Repetition exam