The study of the compilation process for a programming language has to face several analysis, design and implementation issues whose solutions are often paradigmatic of problems that occur frequently during the development of complex software systems.
The course aims at providing an overall introduction to typical subjects in the discipline, with further exploring of a few aspects of significant interest.
Students must be familiar with the subjects considered in the following courses: Fondamenti di Programmazione, Algoritmi e Strutture Dati, Fondamenti dell'Informatica, as well as at least one course from Metodologie di Programmazione and Linguaggi Dichiarativi. It is recommended that students should have attended the course on Linguaggi di Programmazione.
Course contents summary
Introduction to the course.
Abstract machines, interpreters and compilers.
Division of the compiler into front end, middle end and back end.
Run-time and compilation-time support structures.
The front end.
Lexical analysis: automata, regular expressions and scanners.
Syntax analysis: context-free grammars and parsers.
Context-sensitive analysis: checks for the static semantics.
Support structures for compilation.
Symbol tables and memory allocation schemes.
Procedure abstraction: activation frames and calling conventions.
Generation of intermediate code: translation types and schemes.
The back end.
Selection and scheduling of machine instructions.
The middle end.
Introduction to code optimisation.
Data-flow and control-flow analysis.
Some examples of optimisation.
Engineering a Compiler,
Keith D. Cooper and Linda Torczon,
Morgan Kaufmann, 2003.
Compilers: Principles, Techniques and Tools (2nd edition),
Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman and Monica S. Lam,
Pearson Education, 2006.
The exam is based on the completion of an individual project, during the course of which students must tackle one of the subjects introduced and discussed during the lessons, building there knowledge of related problems and issues and applying a solution for the specific application context concerned.