INF 225, Fall 2005


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.23.08.05 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.24.08.05 34Chapter: 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.30.08.05 35Chapter: 2 - Scanning
Topics: - Subset construction - from NFA to DVA (section 2.4.2)
- minimizing the number of states in a DFA
69-74
4.31.08.05 35Chapter: 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





06.09.05 36no lecture - 1. obligatory exercise
07.09.05 36no lecture - 1. obligatory exercise





5.13.09.05 37Chapter: 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.14.09.05 37Chapter: 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.05 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.21.09.05 38Chapter: 4 - Top-Down Parsing
Topics: LL(1) Parsing
- basic method (section 4.2.1)
- parsing table (section 4.2.1)
152-157





9.27.09.05 39Chapter: 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.28.09.05 39Chapter: 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.04.10.05 40Chapter: 5 - Bottom-Up Parsing
Topics: - LR(0) parsing algorithm (section 5.2.3)
- SLR(1) parsing (section 5.3)
206-217
12.05.10.05 40Chapter: 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





11.10.05 41no lecture - 2. obligatory exercise
12.10.05 41no lecture - 2. obligatory exercise





18.10.05 43no lecture - 2. obligatory exercise
19.10.05 42no lecture - 2. obligatory exercise





13.25.10.04 43Chapter: 6 - Semantic Analysis
Topics: - attributes and attribute grammars (section 6.1)
- algorithms for attribute computations
257-295
14.26.10.04 44Chapter: 6 - Semantic Analysis
Topics: - data types and type constructors (section 6.4.1)
313-320





15.01.11.04 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.02.11.04 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





17.08.11.04 45Chapter: 7 - Runtime Environments
Topics: - fully dynamic runtime environments (section 7.4)
- parameter passing mechanisms (section 7.5)
373-388
18.09.11.04 45Chapter: 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.04 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
20.16.11.04 46Course overview