CS 433 - Spring 2008
Compiler Design
Announcements
Final Exam:
Self-scheduled (pick up at my office!), Monday 5/12 - Tuesday 5/20.
The exam is open book / notes, and you may want to bring your notes,
handouts (including Omg grammar), homeworks, and solutions.
You may not use a computer or access material online during the exam.
Homework
- Homework 0: suggest language syntax.
Submissions.
- Homework 1, due Monday 2/18.
Solutions.
- Homework 2, due Monday 2/25.
Solutions.
- Homework 3, due Monday 3/3.
Solutions.
- Homework 4, due Monday 3/10.
Solutions.
- Homework 5, due Monday 3/17 and Friday 3/21.
Solutions.
- Homework 6, due Friday 4/4 and Friday 4/11.
Solutions.
America's funniest error messages.
- Homework 7, due Tuesday 4/22.
Solutions.
- Homework 8, due Tuesday 4/29.
Solutions.
- Homework 9, due Monday 5/5 and Friday 5/9.
Lectures & Readings
- M 2/11 - Course info, function and structure of a compiler (Ch 1)
- W 2/13 - Symbol table organization, language discussion (Ch 2.7, 1st ed. Ch 7.6)
- F 2/15 - Regular expressions (Ch 3.3)
- M 2/18 - Scanning with Lex/Flex (Ch 3.5,
Flex man page,
examples)
- W 2/20 - Formal grammars, CFGs (Ch 4.1-2)
- M 2/25 - Derivations and parse trees (Ch 4.2-3)
- W 2/27 - Parsing with Yacc (Ch 4.9,
Yacc paper,
examples)
- F 2/29 - Syntax tree, HW 3, debugging
- M 3/3 - Declaration resolution, nested scopes (Ch 2.7)
- W 3/5 - Intro to parsing, top-down parsing, LL(1) and S grammars,
parse.omg (Ch 4.4)
- F 3/7 - Bottom-up parsing, LR(k) grammars, handles, rewriting grammars (Ch 4.5, 4.3)
- M 3/10 - Rewriting grammars, declaration resolution for functions and parameters (Ch 4.3)
- W 3/12 - LR(0) parsing, LR(0) items, viable prefix (Ch 4.5, 4.6.1-2, 4.6.5)
- F 3/14 - LR(0) machine, DFAs, goto, closure (Ch 4.6.2,
notes on LR(0) parsing)
- M 3/17 - LR(0) parsing summary, resolution of named types and structures
- W 3/19 - Run-time storage management, displacements (Ch 7.1-3)
- F 3/21 - Type checking (Ch 6.5)
- M 3/31 - HW 6, Intro to code generation (Ch 8.1)
- W 4/2 - Pentium assembly review, code generation for variables and arrays
- F 4/4 - Low-level code generation, managing of temporaries
- M 4/7 - Dynamic memory allocation (Ch 7.4)
- W 4/9 - Garbage collection (Ch 7.5-6)
- F 4/11 - No class (programming contest)
- M 4/14 - HW 7, code generation: data types and implementation
- W 4/16 - Code generation for control structures (Ch 6.6)
- F 4/18 - Control structures: avoiding extra jumps, if, statement lists
- M 4/21 - No class
- W 4/23 - HW 8, control structures: while, return
- F 4/25 - Introduction to LR(1) parsing, First and Follow, SLR(1) parsing (Ch 4.4.2, 4.6.3-4)
- M 4/28 - LR(1) parsing (Ch 4.7)
- W 4/30 - LALR parsing, code generation for function calls (Ch 4.7;
notes on LR(1) parsing)
- F 5/2 - Code generation for functions, HW 9, intro to optimization
- M 5/5 - Optimization, common subexpression elimination (CSE) (Ch 8.4-11, 9.1)
- W 5/7 - Global CSE, data flow analysis (Ch 9.2)
- F 5/9 - Global CSE, course summary, exam info (notes on optimization)
Resources on C and Assembly: