INF 225, Fall 2007


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 20 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.27.08.07 35Chapter: 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.30.08.07 35Chapter: 2 - Scanning
Topics: - Regular expressions - definition and extensions
- Deterministic Finite Automata - an alternative definition of token (section 2.3.1)
- Nondeterministic Finite Automata (section 2.3.2)
- Thompson's construction - from regular expressions to NFA (section 2.4.1)
37-69





3.03.09.07 36Chapter: 2 - Scanning
Topics: - Subset construction - from NFA to DVA (section 2.4.2)
- minimizing the number of states in a DFA
69-74
4.06.09.07 36Chapter: 2 - Scanning
Topics: 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)
(75-80) 81-91





10.09.07 37no lecture - 1. obligatory exercise
13.09.07 37no lecture - 1. obligatory exercise





5.17.09.07 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.20.09.07 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.20.09.07 38Chapter: 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.24.09.07 39Chapter: 4 - Top-Down Parsing
Topics: LL(1) Parsing
- basic method (section 4.2.1)
- parsing table (section 4.2.1)
152-157
27.09.07 37no lecture





9.01.10.0740Chapter: 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.04.10.0740Chapter: 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.08.10.07 41Chapter: 5 - Bottom-Up Parsing
Topics: - LR(0) parsing algorithm (section 5.2.3)
- SLR(1) parsing (section 5.3)
206-217
11.10.07 41no lecture - 2. obligatory exercise





15.10.07 42no lecture - 2. obligatory exercise
18.10.07 42no lecture - 2. obligatory exercise





12. 22.10.07 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.25.10.07 43Chapter: 6 - Semantic Analysis
Topics: - attributes and attribute grammars (section 6.1)
- algorithms for attribute computations
257-295





14.29.10.07 44Chapter: 6 - Semantic Analysis
Topics: - data types and type constructors (section 6.4.1)
313-320
15.01.11.07 44Chapter: 6 - Semantic Analysis
Topics: - type names, type declarations, recursive types (section 6.4.2)
- type equivalence (section 6.4.3)
- type inference and type checking (section 6.4.4)
320-334





16.05.11.07 45Chapter: 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
17.08.11.07 45Chapter: 7 - Runtime Environments
Topics: - fully dynamic runtime environments (section 7.4)
- parameter passing mechanisms (section 7.5)
373-388





18.12.11.07 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.15.11.07 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)
Course overview
410-443





19.11.07 47no lecture - 3. obligatory exercise
22.11.07 47no lecture - 3. obligatory exercise





26.11.07 48no lecture - 3. obligatory exercise
29.11.07 48no lecture - 3. obligatory exercise





03.12.07 49 Course overview
06.12.07 49no lecture - preparation exam





10.12.07 50 exam