ICS 142 Winter 2004
Schedule


All assigned readings are from the Cooper text. It is a good idea to skim the assigned reading before the lecture for the main ideas, attend lecture, and then to go through the assigned reading again to fill in the details that you missed, both in your initial skim of the reading and in the lecture.

Some lectures will have little or no reading corresponding to them. In some cases, this is because a block of reading corresponds to more than one lecture. In other cases, the material covered in that lecture is not discussed in the textbook.

Date Lecture Topics Readings Project Due
Week 0
F 1/9
  • Introduction to the course
  • Why study compilers?
  • A brief overview of a compiler
  • Ch. 1
Week 1
W 1/14
  • Scanning vs. parsing
  • Hand-coded scanners
  • Deterministic finite-state automata (DFA's)
  • Regular expressions
  • Ch. 2.1 - 2.3
F 1/16
  • Non-deterministic finite-state automata (NFA's)
  • Constructing DFA's from regular expressions
  • Ch. 2.4
Week 2
W 1/21
  • Automatic scanner generation
  • Parsing
  • A brief review: grammars, parse trees, derivations, and ambiguity
  • Ch. 2.5 - 2.7
  • Ch. 3.1 - 3.2
F 1/23
  • Grammar review, continued
  • Top-down vs. bottom-up parsing, conceptually
  • Top-down parsing with backtracking
  • Eliminating left recursion from a grammar
  • Ch. 3.3
Week 3
M 1/26 Assignment #1 due 11:59pm
W 1/28
  • Top-down parsing without backtracking
  • FIRST and FOLLOW sets
  • Left factoring a grammar
  • Recursive descent parsing
F 1/30
  • Table-based LL(1) parsers
  • Bottom-up parsing, conceptual
  • The intuition behind shift-reduce parsing
  • Ch. 3.4.1 - 3.4.2
Week 4
W 2/4
  • LR(1) parsers
  • Constructing LR(1) parsing tables
  • Ch. 3.4.3
  • Ch. 3.5
F 2/6
  • Constructing LR(1) parsing tables, continued
  • Using CUP to specify an LR(1) parser
Assignment #2 due 11:59pm
Week 5
W 2/11
  • Semantic checking
  • Abstract syntax trees
  • Type checking (briefly)
  • Symbol tables (briefly)
  • Ch. 4.1 - 4.2
  • Ch. 4.4 - 4.6
  • Ch. 5.1 - 5.3
  • Ch. 5.7
F 2/13
  • MIDTERM (regular lecture time and location)
Week 6
W 2/18
  • More about abstract syntax trees and semantic checking
F 2/20
  • A fork in the road: interpreters vs. compilers
  • Interpreters for dynamic vs. static languages
  • A Monkie2004 interpreter
Week 7
M 2/23 Assignment #3 due 11:59pm
W 2/25
  • More about the Monkie2004 interpreter
  • Linear IR's
  • Stack-machine code
  • Ch. 5.4
F 2/27
  • Three-address code
  • ILOC
  • Appendix A
Week 8
W 3/3
  • Run-time organization
  • Subprogram linkage
  • Activation records
  • Subprogram call and return
  • Ch. 5.6
  • Ch. 6.1 - 6.2
  • Ch. 6.3.1 - 6.3.2
Th 3/4 Assignment #4 due 11:59pm
F 3/5
  • Parameter passing
  • Accessing nonlocal variables in block-structured languages
  • Ch. 6.4 - 6.6
Week 9
W 3/10
  • (More information about Assignment #5)
  • Intermediate code generation
  • The effect of the memory hierarchy
  • Keeping values in registers
  • Ch. 7.1 - 7.3
Th 3/11 Assignment #5 due 11:59pm
F 3/12
  • Implementing boolean values and boolean expressions
  • Implementing control-flow constructs
  • Basic blocks and control-flow graphs
  • Ch. 7.4
  • Ch. 7.8
Week 10
W 3/17
  • Local optimization
  • Extended basic blocks and superlocal optimization
  • The difficulties of global optimization (briefly)
  • Cloning of blocks and inlining of procedures
  • Ch. 8.1 - 8.2
  • Ch. 8.7
F 3/19
  • The instruction scheduling problem
  • List scheduling
  • Ch. 12.1 - 12.3
Assignment #6 due 11:59pm
Finals Week
W 3/24 FINAL EXAM: 4:00-6:00pm, ELH 100