Compiler Construction Course, Summer 2005

Department of Computer Sciences, University of Salzburg

Prof. Christoph Kirsch

Time, Location: Tue 10-12, Techno-Z T03 and Wed 9-10, Techno-Z T02. First two lectures on Thursday, March 17, 9-10, Techno-Z T04 and Friday (!), March 18, 10-12, Techno-Z T01 (to catch up with lost time).

Brief Overview:

This course provides an introduction to compiler construction: scanning, parsing, symbol-table handling, code generation, and code optimization. The course closely follows the textbook on compiler construction by N. Wirth and, in addition, provides some more details on bottom-up parsing and compiler generators. The goal of the course is to have students understand and appreciate principled engineering of compilers through a focus on fundamental rather than advanced compilation techniques in class in combination with creative freedom in class projects. Teams of 2-3 students will be asked to design their own source language (with formal grammar), and implement their own compiler and target machine in a programming language of their choice. However, each compiler must be able to compile itself in a live demo at the end of the semester. Therefore, source languages are constrained to subsets of programming languages for which executable compilers are available (unless students choose to compile their compiler at least once by hand). Moreover, source languages must be typed (basic types, arrays, and records; no pointers) and feature at least a concept for parameterized local hiding such as procedures with arguments and a concept for global hiding such as modules supporting separate compilation.

Goal of the course:

Learn, through compiler construction, how software-related concepts of programming languages such as data types and procedures work and translate into hardware-related concepts such as machine registers and code.

Student Projects:

  • Teams of 2-3 students will design their own source language (with formal grammar), and implement their own compiler and target machine in a programming language of their choice. Each compiler will be demonstrated to compile itself at the end of the semester. Each team creates a wiki page that describes the project. See the requirements in the above overview.

Required Textbooks:

  • Niklaus Wirth: Compiler Construction, Addison-Wesley, 1996.
  • Aho, Sethi, Ullman: Compilers: Principles, Techniques and Tools.
Recommended Textbooks:
  • Keith Cooper, Linda Torczon: Engineering A Compiler. Morgan Kaufmann, 2004.
  • Andrew Appel, Jens Palsberg: Modern Compiler Implementation in Java. Cambridge University Press, 2nd edition, 2003.
Web sources:

Grading: in-person project presentation (necessary for Vorlesungsschein), project source code and compiler executable (necessary for Proseminarschein).

Prerequisites: programming experience, basic knowledge of programming language concepts.

Administrative contact: Petra . Kirchweger @ cs . uni-salzburg . at