Academic year
Subject Area
Computer Science
Language of Instruction
Mode of Delivery
ECTS Credits
1st Cycle Studies

Recommended Prerequisites

Basic knowledge of Algorithms, Data Structures and Finite Automata (course units: Algorithms and Data Structures and Theory of Computation).

Teaching Methods

Theoretical lectures (T) are mainly of an expository nature, but are also used to answer questions of general interest to the class. Practical (TP) sessions serve to consolidate the concepts presented in the lectures through pencil-and-paper exercises and programming exercises (using e.g. lex and yacc). They are also used to introduce the various project goals. Laboratory (PL) sessions provide additional support regarding the exercises proposed in the TP sessions, as well as support concerning the project.

Learning Outcomes

To provide the student with an in-depth contact with methodologies and techniques for compiling programs written in high-level languages, aiming to generate machine code. In particular, the student should come to: understand the goals and architecture of a compiler; understand the principles of lexical, syntactic and semantic analysis, and be able to construct these phases of a compiler, both from scratch and using appropriate tools; understand the principles of final code generation. This body of knowledge has application in a wide range of questions beyond compiler construction. In addition to these subject-related skills, students are expected to develop other skills, including analysis and synthesis, critical reasoning, practical application of the acquired knowledge, and an attention to quality. Autonomous learning, the ability to work in a team, oral and written communication, and problem solving skills are also to be fostered.

Work Placement(s)



1. Goals and architecture of a compiler

2. Lexical analysis

3. Syntax analysis (top-down and bottom-up parsing)

4. Abstract syntax

5. Semantic analysis

6. Activation records

7. Intermediate representation

8. Code generation.

Head Lecturer(s)

Raul André Brajczewski Barbosa

Assessment Methods

Project: 40.0%
Exam: 60.0%


Bibliografia essencial | Required textbook:


- Compilers: Principles, Techniques, and Tools, 2nd edition, A. V. Aho, M. S. Lam, R. Sethi, J. D. Ullman, Addison-Wesley, 2006.


Bibliografia suplementar | Supplemental bibliography:


- Modern Compiler Implementation in C, A. W. Appel, Cambridge University Press, 1998.

- Modern Compiler Design, 2nd edition, D. Grune, H. E. Bal, C. J. H. Jacobs, K. G. Langendoen, Springer, 2012.

- Processadores de Linguagens: da concepção à implementação, R. G. Crespo, IST Press, 2001.

- Modern Compiler Implementation in Java, A. W. Appel, Cambridge University Press, 2002.