Person in charge : Matthieu MANCENY
Pre-requisite: II.2204
Organization
: 7 * 3 hour courses + 7 * 3 hour lab sessions
Assessment: Exam and Project
ECTS : 5 credits

Overview

Programming languages are the foundations of Computer Science. Through programming languages, scientists and other types of programmers can use the computer resources to solve problems, entertain, aid humans in their jobs, etc. The language’s abstraction level and expressiveness may vary depending on the targeted domain, thus explaining the large amount of languages being developed and used everywhere in the world. Compilers are the pieces of software that transform the programs written with such programming languages into code that can be executed by a machine. Building a language and the associated compiler is a complex task that will be largely explained and experimented within this course.

Learning Objectives

Skills

This course will build up skills from designing languages and implementing interpreters and compilers. Students will go through an analysis of the best language and corresponding syntax to address a given class of problems. Lexical, syntax, and semantic analysis will be explained through theory and examples. Students will also be able to use the basis tools for building languages such as common lexical analyzers and parser generators. Compilers structure and design around an AST will be largely explained and used in the project.

Knowledge

Concepts

  • Lexical analysis
  • Syntactic analysis and grammar of a language
  • Semantic analysis
  • Abstract Syntax Trees (AST)
  • Type inference
  • Compilation algorithms
  • Compilers structures (AST visitors)
  • AST transformation and code generation

Know-how

  • Defining a BNF grammar
  • Using parser generators in Java (JFlex, CUP, or similar)
  • Simple language and compiler implementation

Teaching method

Foundations of languages and compilation will be explained in lectures and using small case studies in lab sessions. The students will also have to implement a simple language as an individual project.

Bibliography

  • CUP : http://www2.cs.tum.edu/projects/cup/
  • JFlex : http://jflex.de/
  • Classgen : http://classgen.sourceforge.net/