25h Th, 75h Proj.
Number of credits
|Master of science in computer science and engineering (120 ECTS)||5 crédits|
|Master in computer science (120 ECTS)||5 crédits|
|Master in computer science (60 ECTS)||5 crédits|
|Master in mathematics (120 ECTS)||6 crédits|
Language(s) of instruction
Organisation and examination
Teaching in the second semester
Units courses prerequisite and corequisite
Prerequisite or corequisite units are presented within each program
Learning unit contents
This course addresses the practical and theoretical aspects of compiler construction. The course will include the following topics:
- Definition and general structure of a compiler
- Lexical analysis: regular expressions, analysis based on deterministic and non deterministic finite automata, implementation
- Syntax analysis: context-free grammar, top-down and bottom-up parsing, implementation
- Semantic analysis: concept, syntax-directed translation, scope and type checking, symbol table
- Intermediate code generation: intermediate representations, SSA form, code optimization, introduction to LLVM
- Final code generation: instruction selection, register allocation, memory management, code optimization
- Practicals : design and implementation of a complete compiler
Learning outcomes of the learning unit
At the end of the course, the student will have a good theoretical and practical knowledge of the general structure of a compiler and will be able to implement from scratch a compiler for a simple language.
Prerequisite knowledge and skills
Prerequisites: INFO2009 (Introduction to computer science), INFO0902 (data structures and algorithms), INFO0016 (Introduction to the theory of computation) or similar courses.
Planned learning activities and teaching methods
Ex-cathedra lectures on the theory as well as on the more practical aspects (related to the project). During the semester, about 8-9 lectures in total. Project: The students (by groups of two) design and implement a complete compiler for a mini-language.
Mode of delivery (face-to-face ; distance-learning)
Recommended or required readings
Lecture slides and instructions for the project are available on the course website:http://www.montefiore.ulg.ac.be/~geurts/compil.html
Assessment methods and criteria
First session: the students will be evaluated on the basis of:
- The practical assignment: the implementation of a compiler for a mini-language. The project will be divided into four deadlines. At each deadline, the source code provided by the students will be tested automatically by the submission plateform on some standardized tests. The evaluation of the assignment will be based on the performance at the different submission steps, the intermediate reports (3), the final report and the final source code. NB: Typically, grades for the assignment are assigned to the whole group. However, in some particular cases (e.g., when there are evidences that a member of a group has not participated enough in the project), the grade may be assigned more individually, reflecting the personal involvement of each member of a group.
- Individual oral exam: This exam will focus on the compiler developed during the assignment and on the lecture material. The objective of the oral exam is to ensure that the student has correctly assimilated the concepts discussed during the lectures and that he participated to the practical assignment.
- Same as in the first session. Students will have the opportunity to improve their compiler with respect to the first session.
Course web page
Lecture slides and instructions for the project are available on this web page.