INF 225, Fall 2009


Literature

Kenneth C. Louden "Compiler Construction: Principles and Practice", PWS Publishing, 1997. http://www.mathcs.sjsu.edu/faculty/louden/cmptext/


Lectures and group meetings

There will be 19 lectures of two hours and weekly group meetings of two hours.


Exercises

There are 10 weekly volontary exercises and 3 compulsory exercises forming a large project with a complete compiler for C- as the final goal. There will be at least 60 hours needed for the compulsory exercises.


Plan of Lectures






Nr.DateWeekTopicsPages





1.18.08.09 34Chapter: 1 - Introduction and Chapter: 2 - Scanning
Topics: - Overview of translation
- scanning process (section 2.1)
- use of regular expressions to define tokens (section 2.2)
- Regular expression - introduction and examples
1-18, 21-37
2.19.08.09 34Chapter: 2 - Scanning
Topics: - Regular expressions - definition and extensions
- Deterministic Finite Automata - an alternative definition of token (section 2.3.1)
37-53





3.03.09.09 35Chapter: 2 - Scanning
Topics: - Nondeterministic Finite Automata (section 2.3.2)
- Thompson's construction - from regular expressions to NFA (section 2.4.1)
53-69
4.06.09.09 35Chapter: 2 - Scanning
Topics: - Subset construction - from NFA to DVA (section 2.4.2)
- minimizing the number of states in a DFA
The Lex tool for automatically generating a scanner
- regular expressions in Lex (section 2.6.1)
- format of Lex files (section 2.6.2)
- examples of Lex programs (section 2.6.3)
69-91





01.09.09 36no lecture - 1. obligatory exercise
02.09.09 36no lecture - 1. obligatory exercise





08.09.09 37no lecture - 1. obligatory exercise
09.09.09 37no lecture - 1. obligatory exercise





5.15.09.09 38Chapter: 3 - Context-Free Grammars and Parsing
Topics: - parsing process (section 3.1)
- context-free grammars (section 3.2)
- parse trees and abstract syntax trees (section 3.3)
95-114
6.16.09.09 38Chapter: 3 - Context-Free Grammars and Parsing
Topics: ambigous grammars: precedence and associativity (sections 3.4.1+2)
- dangling else problem (sections 3.4.3)
- EBNF and Syntax Diagrams (section 3.5)
- Chomsky hierarchy (section 3.6.3)
114-133





7.22.09.09 39Chapter: 4 - Top-Down Parsing
Topics: - recursive descent parsing (section 4.1)
- left recursion removal and left factoring (section 4.2.3)
143-152, 157-166
8.23.09.09 39Chapter: 4 - Top-Down Parsing
Topics: LL(1) Parsing
- basic method (section 4.2.1)
- parsing table (section 4.2.1)
152-157





9.29.09.0940Chapter: 4 - Top-Down Parsing
Topics: LL(1) Parsing
- first and follow sets (section 4.3)
- error recovery in recursive-decent parsing (section 4.5)
166-196
10.30.09.0940Chapter: 5 - Bottom-Up Parsing
Topics: LR(0) parsing
- overview of bottom-up parsing (section 5.1)
- finite automata of LR(0) items (section 5.2.1+2)
197-206





11.06.10.09 41Chapter: 5 - Bottom-Up Parsing
Topics: - LR(0) parsing algorithm (section 5.2.3)
- SLR(1) parsing (section 5.3)
206-217
07.10.09 41no lecture - 2. obligatory exercise





13.10.09 42no lecture - 2. obligatory exercise
14.10.09 42no lecture - 2. obligatory exercise





12. 20.10.09 43Chapter: 6 - Semantic Analysis
Topics: - structure of symbol table (section 6.3.1)
- declarations (section 6.3.2)
- scope rules and block structures (section 6.3.3)
- interaction of declarations (section 6.3.4)
295-313
13.21.10.09 43Chapter: 6 - Semantic Analysis
Topics: - attributes and attribute grammars (section 6.1)
- algorithms for attribute computations
257-295





14.27.10.09 44Chapter: 6 - Semantic Analysis
Topics: - data types and type constructors (section 6.4.1)
- type names, type declarations, recursive types (section 6.4.2)
313-322
15.28.10.09 44Chapter: 7 - Runtime Environments
Topics: - memory organization (section 7.1)
- fully static runtime environments (section 7.2)
- stack-based runtime environment (section 7.3)
345-373





16.03.11.09 45Chapter: 7 - Runtime Environments
Topics: - fully dynamic runtime environments (section 7.4)
- parameter passing mechanisms (section 7.5)
373-388
17.04.11.09 45no lecture - opening of BLDL





18.10.11.09 46Chapter: 8 - Code Generation
Topics: - intermediate code
- three-address code, P-code (section 8.1)
- code as a synthesized attribute (section 8.2.1)
397-410
19.11.11.09 46Chapter: 8 - Code Generation
Topics: - basic code generation techniques (section 8.2)
- code generation of datastructure (section 8.3)
- code generation of control statements (section 8.4)
- code generation of function calls (section 8.5)
410-443





17.11.09 47no lecture - 3. obligatory exercise
18.11.09 47no lecture - 3. obligatory exercise





24.11.09 48no lecture - preparation exam
20.25.11.09 48Course Overview





02.12.09 49no lecture - preparation exam
03.12.09 49no lecture - preparation exam





7+8.12.09 50 Exam