Compiler Construction Course
Concepts and Practical Application to .NET
A.Wöß, H. Mössenböck
University of Linz, Austria
Latest updates:
Nov. 10, 2004
Jan. 31, 2005: add project specification
Feb. 11, 2005: Bugfixes in slides (05, 06, 07)
Mar. 01, 2005: Bugfixes in slides (03, 06);
This course goes through all phases of a compiler. It shows the theoretical
concepts underlying each phase as well as how to implement it efficiently.
The students will write a small compiler for a C#-like programming language
(Z#). It will translate a source program into the code of a virtual machine (CLR).
The implementation language will be C#.
All material is published under the
Microsoft Curriculum Licence.
© University of Linz, Institute for System Software, 2004
Course Description
Download
Authors
Contact
Learning Objectives
The course will teach students the following skills:
-
acquire the practical skills to write a simple compiler for an imperative
programming language.
-
understand the concepts of scanning, parsing, name management
in nested scopes, and code generation.
-
learn to transfer the skills also to general software engineering tasks
(e.g. parsing of structured data files or argument lists)
Contents
For the lecture we provide a total of 338 slides in both English and German.
For the accompanying programming project we provide a detailed specification
including a description of the Z# programming language and a description of
the subset of the Common Intermediate Language (CIL) relevent for the project.
Additionally, we offer code fragments for the compiler classes that should help
students get started with the project, and a set of NUnit test cases as well as
sample Z# programs to test the compiler.
-
Overview (39 slides)
compilers and interpreters, structure of a compiler, single-pass vs.
multi-pass compilers
-
Scanning (21 slides)
finite automata, scanner implementation
-
Parsing (52 slides)
recursive descent parsing, push down automata, terminal start symbols
and successors, LL(1) condition, implementation of a parser
-
Semantic Analysis (31 slides)
syntax-directed translation, attribute grammars
-
Symbol Table Handling (37 slides)
symbols, types, scopes
-
Code Generation (80 slides)
Extension Material:
-
LALR parsing (49 slides)
LALR(1) table generation, optimizations, semantics, error handling
-
Compiler Generators (29 slides)
lex/yacc, Coco/R
|
Dipl.-Ing. Albrecht Wöß
Holds a master degree from the University of Linz. Special interests include
compiler construction and object-oriented programming. He lead the
"Compiler Generation Tools for C#" project funded by the 1st Rotor RFP.
|
|
Prof. Dr. Hanspeter Mössenböck
PhD in Computer Science (University of Linz, 1987). From 1988 to 1994
assistant professor at ETH Zurich with Prof. Niklaus Wirth.
Since 1994 full professor of Computer Science at the University of
Linz, Austria. Head of the Institute for System Software.
Besides teaching courses on compiler construction, (object-oriented) programming,
algorithms & data structures, and .NET, he also regularly lectures
at the Oxford Brookes University, UK, and appeared as a speaker of
various .NET events.
|
Prof. Dr. Hanspeter Mössenböck
Johannes Kepler University Linz
Institute for System Software
Altenbergerstraße 69, 4040 Linz, Austria
Web: www.ssw.uni-linz.ac.at/General/Staff/HM/
Phone: +43-732-2468-7130
|