Compilers
Keywords |
Classification |
Keyword |
OFICIAL |
Informatics Engineering and Computing |
Instance: 2023/2024 - 2S 
Cycles of Study/Courses
Acronym |
No. of Students |
Study Plan |
Curricular Years |
Credits UCN |
Credits ECTS |
Contact hours |
Total Time |
L.EIC |
319 |
Syllabus |
3 |
- |
6 |
52 |
162 |
Teaching language
Suitable for English-speaking students
Objectives
Provide concepts that allow to:
- understand the languages’ compilation phases, in particular for imperative and object-oriented (OO) languages;
- specify the syntax and semantics of a programming language;
- understand and use the data structures and the main algorithms used to implement compilers;
- engineering a compiler as a large-scale software project
Learning outcomes and competences
The skills and learning outcomes will allow students to:
- develop and implement in software language processing systems of artificial languages and information textually specified under certain lexical and grammar rules;
- design and implement in software the various compiler stages, namely:
- regular expressions and finite automata;
- syntactic and semantic analyzers;
- semantic analyzers;
- execution environments and virtual machines;
- intermediate code generation and symbol tables;
- data-flow and control-flow analysis and code optimization;
- code generators having processors or virtual machines as a target;
Working method
Presencial
Pre-requirements (prior knowledge) and co-requirements (common knowledge)
- Imperative programming languages, object-oriented programming languages.
- Data structures and algorithms.
- Theory of Computation.
- Computer Architecture.
Program
- Introduction. Compilation phases and typical structure of a compiler.
- Lexical analysis. Regular expressions and finite automaton. - Syntax analysis. Grammars. Syntax analysis’ algorithms. Error handling.
- Semantic analysis. Type checking.
- Execution environments. Memory organization and schemes for parameter passing.
- High and Low-level intermediate representations. Intermediate code generation techniques.
- Scheduling and Register allocation.
- Program analysis (control and data-flow); basic blocks.
- Code transformations (optimizations).
Mandatory literature
Cooper, Keith D.;
Engineering a compiler. ISBN: 1-55860-699-8
Complementary Bibliography
A. Aho, M. Lam, R. Sethi, J. Ullman;
Compilers: Principles, Techniques, and Tools, 2nd Edition, Addison Wesley, 2007. ISBN: 0321486811
Appel, Andrew Wilson;
Modern Compiler Implementation in Java, Cambridge University Press, 2002. ISBN: ISBN 0-521-82060-X
Teaching methods and learning activities
- Lectures: presentations, complemented by examples, demonstrations, and hints for the lab/programming project work.
- Labs: exercises and discussions and problem solving related to the practical work or programming project.
Software
JASMIN, http://jasmin.sourceforge.net/.
JavaCC, https://javacc.dev.java.net/
ANTLR, https://www.antlr.org
keywords
Technological sciences > Technology > Computer technology > Software technology
Evaluation Type
Distributed evaluation without final exam
Assessment Components
Designation |
Weight (%) |
Teste |
50,00 |
Trabalho laboratorial |
50,00 |
Total: |
100,00 |
Amount of time allocated to each course unit
Designation |
Time (hours) |
Elaboração de projeto |
50,00 |
Estudo autónomo |
56,00 |
Frequência das aulas |
56,00 |
Total: |
162,00 |
Eligibility for exams
For the purposes of being eligible for grading, the only requirement is that students have a grade of at least 8.0 i the group programming projects. Failure to meet this requirement results in a Fail grade in the class with RFF as you cannot make-up the grade of a programming project.
There is no attendance requirement for the TP classes except for the demo of the programming project which all the elements of each group must attend, in person.
No grades from the previous years for any of the grading elements are accepted towards this year’s final grade credit.
Calculation formula of final grade
In case the students does not meet the minimum grade of 8.0 in one of the grading components, he/she will be automatically enrolled in the “make-up” (“recurso”) term in which he/she will have to make-up for that component.
Passing grade: FG >= 9.5 and each T1 and T2 grade (T1 and T2) >= 8.0.
Final Grade components and calculation (all scores from 0 to 20)
- T1: first test grade (and corresponding MkUp1)
- T2: second test grade (and corresponding MkUp2)
- PRJ: compiler project grade
- Continuous Assessment grade (CA) = 0.5*T1 + 0.5*T2
- Final Grade (FG) =
- If abs(CA-PRJ) > 4.0 then FG = minimum(CA,PRJ) + 2.0 Otherwise, FG = 0.5 * CA + 0.5 * PRJ
Components that contribute to the project classification (PRJ):
- Checkpoints (1: 10% and 2: 15%): 25%
- Final work: 60%
- Presentation/discussion of the work: 15%
No grading component from a previous years can be used.
The tests (T1 and T2) and the make-up tests (MkUp1 and MkUp2) will include the use of auxiliary personal notes limited to 1 A4 size sheet with double-sided notes.
Internship work/project
Understanding and extension of the lexical analysis,
syntactic analysis, semantic analysis and code
generation phases of a compiler for a simple
imperative programming language.
This is an group programming project, with groups consisting of no monre than 3 students and no less than 2.
Special assessment (TE, DA, ...)
The assessment rules apply to all students, regardless of their status.
Classification improvement
The project grade cannot be made up in the current academic year and is valid for
all the terms in the current academic year. The continuous assessment grade (tests) can be made up, taking into account the best of the two classifications in the tests that the student chooses to (re)take.