Instructor:
薛智文 Chih-Wen
Hsueh
Contact: cwhsueh@csie.ntu.edu.tw,
x322, DTH 322
Office Hours: TH 5 9, or by
appointment, DTH 322
TAs: 紀均易, 廖偉翔, taC@newslab.csie.ntu.edu.tw,
x408, DTH 408
Office Hours: M 6 T 8, or by
appointment, DTH 108
Course Plan (subject to
change):
- Introduction (ch#1, reading ch1.6 and ch#2 by yourself is
expected.)
- Lexical analysis (Scanner) (ch#3.1–3.4, 3.6, 3.7,
3.5, 3.8):
- regular expressions, finite state automata, LEX
- Syntax analysis (Parser) (ch#4.1–4.7):
- context-free grammar, top-down parsing, LL(1), bottom-up
parsing, SLR, LR(0), LR(1), LALR(1)
- Syntax-directed translation (ch#5.1–5.6, 4.8,
4.9):
- Syntax-directed translation, using ambiguous grammar, YACC
- Symbol tables (ch#2.7, 6.5):
- data structures for symbol tables, type checking
- Intermediate code generation
(ch#6.1–6.4,6.6–6.8):
- intermediate code, declarations, ex-pressions, advanced
data structure, control flow, procedure/function, other statements
- Run time storage organization
(ch#7.1–7.4):
- stack, access to nolocal data, heap
- Optimization (ch#8.4,8.5,8.6,9.1,9.2,8.7):
- basic blocks, flow graphs, machine-independent
optimizations
- How to write a compiler
- Advanced topics1:
- garbage collection (ch#7.5–7.8), parallelism
(ch#10, ch#11), ...
Homeworks: 作業遲交每一天扣 10%,
抄襲(被抄襲)均不計分.
Final Project: 抄襲(被抄襲)均不計分.
Final project:
Due: 11:59pm, June 26 (Tuesday) 2007
Reference :
http://www.iis.sinica.edu.tw/~tshsu/compiler2006/slides/slide0.pdf
NOTE: Some percentage of scores will be deducted each day for a
late submission.
Unless I agreed in person,
projects submitted later than 11:59pm, June 28 (Thursday) 2007
will not be graded!
Schedule (subject to change):
No. |
Date |
Topics |
Notes |
1 |
March 1 |
Introduction; |
|
2 |
March 8 |
Scanner (I);Scanner (II); LEX |
Announcing HWK#1 |
3 |
March 15 |
Homework discussion |
TA hosts |
4 |
March 22 |
Parser: Introduction; Top-down parsing (I) |
HWK#1 due, Announcing HWK#2 |
5 |
March 29 |
Top-down parsing (II); Bottom-up parsing (I) |
|
|
April 5 |
Holiday |
|
6 |
April 12 |
Bottom-up parsing (II) |
HWK#2 Due, Announcing HWK#3 |
7 |
April 19 |
Bottom-up parsing (III) |
|
8 |
April 26 |
Mid-term exam |
covering lectures 1–7, HWK#3 due |
9 |
May 3 |
Syntax-directed translation |
|
10 |
May 10 |
YACC and data structures |
Announcing HWK#4 |
11 |
May 17 |
Intermediate-code generation (I) |
|
12 |
May 24 |
Intermediate-code generation (II) |
|
13 |
May 31 |
Run-time environments (I) |
HWK#4 due, Announcing HWK#5 |
14 |
June 7 |
Run-time environments (II) |
|
15 |
June 14 |
Optimization |
|
16 |
June 21 |
Putting everything together |
HWK#5 due |
|
TBA |
Final project due |
|
Prerequisites:
Assembly language, high-level
programming language (C-like language), data structures, and automata.
Textbook:
"Compilers Principles, Techniques, and
Tools," by A.V. Aho, M. S. Lam, R. Sethi, and J.D. Ullman,
2007 (2
nd edition) Addison Wesley.
Evaluation:
-
homeworks (25%): one homework
per 2 to 3 lectures.
-
mid-term exam (35%);
-
final project (40%): check points, documents, presentation, and
testing;
-
class participation and performance.
Reference: