Duration
25h Th, 75h Proj.
Number of credits
Lecturer
Language(s) of instruction
English language
Organisation and examination
Teaching in the second semester
Schedule
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.
The techniques reviewed in the course are not only useful for full compiler constructions, but, among other many uses, they can be used to develop domain specific languages (as found in a huge amount in software),
This course contributes to the learning outcomes I.1, I.2, II.1, II.2, III.1, III.3, IV.3, VI.2, VI.3, VII.1, VII.2, VII.3, VII.4, VII.5 of the MSc in computer science and engineering.
Prerequisite knowledge and skills
Prerequisites: INFO2009 (Introduction to computer science), INFO0902 (data structures and algorithms), or similar courses.
Corequisite: INFO0016 (Introduction to the theory of computation) or similar course.
Planned learning activities and teaching methods
Lectures are given in English. Ex-cathedra lectures on the theory as well as on the more practical aspects (related to the project). 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, hybrid learning)
Face-to-face.
Course materials and recommended or required readings
The contents of the course, as well as the assignments and useful links, will be made available on the eCampus space for the course.
Exam(s) in session
Any session
- In-person
oral exam
Written work / report
Other : Practical evaluation on machine
Further information:
The evaluation is based on a homework assignment, i.e., the implementation of a compiler for a given small language. This homework is not subject to specific rules. While it is strongly advised to be fully involved and write from scratch a compiler within a small group of students, to learn as much as possible by yourself, we will not check in the delivered source for code reuse, previous projects, AI generated code, etc... We will provide an automated feedback on the compliance of the code w.r.t. the specification. The homework assignment itself is not evaluated.
For both sessions, the evaluation will be both practical and theoretical.
For the practical part, each student will be given a little exercise on the basis of her/his homework project (e.g., modify the compiler, add a feature, fix a problem...). No internet connection will be available. The student will have access to static documentation, that will be subject to approval two weeks before the exam. Example are: C reference, python reference, flex/bison manuals,... Students may suggest, no later than two weeks before the evaluation, some general material to add to the repository of available document; this material will be subject to approval. No AI tool, web search, community, repositories of software, etc... may be used for this practical evaluation. The grade will be Pass or Fail.
The theoretical evaluation will take the form of an oral exam, where questions will be asked on the theory and practice of compilers, according to the course.
If the practical grade is Pass, the final grade is the grade of the theoretical evaluation, otherwise it is the grade of the theoretical evaluation capped by 7/20.
Work placement(s)
Organisational remarks and main changes to the course
The contents of the lectures, as well as the assignments and useful links, will be made available on the eCampus space for the course.
Contacts
Teacher: Pascal Fontaine, 04 366 28 75, Pascal.Fontaine@uliege.be
Assistant: Roland Greffe, R.Greffe@uliege.be
Association of one or more MOOCs
Items online
e-Campus space
All materials and links are available on the e-Campus space of the course.
Course web page
Lecture slides and instructions for the project are available on this web page.