| Date | Topic | Reading | Handouts and Suggested Exercises | Due |
| Jan 23 (W) | Introduction to Compilers (slides) | Syllabus and HW1 | ||
| Jan 25 (F) | MiniSVG Intro | Ch 1 | ||
| Jan 28 (M) | Lexical Analysis Intro (slides) | Ch 2 through 2.6 | Exercise 2.6.2 and 2.6.3 | HW1: Review |
| Jan 30 (W) | MiniSVG Tokens (slides) | |||
| Feb 1 (F) | Context Free Grammars and Parse Trees (slides) | Exercises 2.2.3, 2.3.2 | ||
| Feb 4 (M) | Top-Down, Predictive Parsers (slides) | Exercise 2.4.1 | HW2: Exercise 2.6.3 | |
| Feb 6 (W) | Error recovery intro (slides) | Ch. 4 through 4.4 | ||
| Feb 8 (F) | MiniJava and MIPS (slides) | Appendix A: Assemblers, Linkers, and the SPIM Simulator (read A9 and A10, skim A1-A4) | Try out spim and xspim | PA1: MiniSVG |
| Feb 11 (M) | MiniJava Compiler overview (slides) | Ch 2 | Exercise 2.8.1 | HW3: Exercise 2.3.2 |
| Feb 13 (W) | Lexical Analysis: Regular Expressions (slides) | Ch 3 through 3.3 and JLex Manual | JLex tutorial | |
| Feb 15 (F) | MiniJava and MIPS example (sent to mailing list) | |||
| Feb 18 (M) | Lexical Analysis: NFAs and DFAs (slides) | Ch 3.4 through 3.8 | Exercise 3.3.4 | PA2: MiniJava and MIPS Warmup |
| Feb 20 (W) | CFGs for parsing: Make expression grammar LL (slides) | Ch 4-4.4 | 4.4.3 | HW4: Exercise 3.3.4 |
| Feb 22 (F) | CFGs for parsing: Intro bottom-up parsing | Ch. 4.5 and 4.6.3 | 4.2.1 | |
| Feb 25 (M) | Bottom-Up Parsing and AST creation(slides) | Ch 2.8, 5.3.1, and skim JavaCUP manual | JavaCUP and JLex example | PA3: MiniJava Lexer using JLex |
| Feb 27 (W) | Building the AST (slides) | HW5: 4.2.1 | ||
| Feb 29 (F) | LR parsing: LR(0) parse table (slides) | Ch 4.6 | 4.6.3 | |
| Mar 3 (M) | LR parsing: LR(1) parse table (slides) | Ch 4.7 | 4.7.1a and 4.7.2 (LR(1)) | |
| Mar 5 (W) | Ambiguous grammars and LR parsers (slides) | Ch 4.8-4.9 | 4.8.2 | HW6: 4.7.1a |
| Mar 7 (F) | LR(1) list grammars (no slides) | |||
| Mar 10 (M) | Midterm Review (slides) | HW7: Study for midterm, do lots of example problems | ||
| Mar 12 (W) | Midterm Exam (in class) | |||
| Mar 14 (F) | Instructor at conference -- No Class | |||
| Mar 17 (M) | Spring Recess -- No Class | |||
| Mar 19 (W) | Spring Recess -- No Class | |||
| Mar 21 (F) | Spring Recess -- No Class | |||
| Mar 24 (M) | Error Handling in LR Parsers and Parser Generators (slides) | Ch. 4.8.3 | HW8: Email a test case java file and the resulting AST dot file being generated by your PA4 implementation | |
| Mar 26 (W) | Intro to PA5 | PA5 writeup | PA4: AST using JavaCUP | Mar 28 (F) | Visitor Design Pattern (slides) | visitor design pattern wikipedia entry | Code up one of the wikipedia examples and step through it in the debugger |
| Mar 31 (M) | Building the Symbol Table (slides) | Ch 6 in Gagnon's Masters Thesis, Ch 2.7 | ||
| Apr 2 (W) | Symbol Table cont... | How could we enable the same name used in multiple nested scopes by changing the insert(STE) method of the SymTable and Scope? | HW9: Submit a visitor derived from DepthFirstAdapter that counts all instances of the various ast.node classes in an ast | |
| Apr 4 (F) | Semantic Analysis - Type checking in PA5 | |||
| Apr 7 (M) | Semantic Analysis - Type checking | Ch 6.3 | HW10: Create a MiniJava example and turn in the astlines.dot file generated by your compiler. | |
| Apr 9 (W) | Implementing functions: gcc stackframe (slides) | Appendix A: Assemblers, Linkers, and the SPIM Simulator (read A.5 and A.6) | ||
| Apr 11 (F) | Calculating offsets: MiniJava stackframe (slides) | Suggested exercise about x86 on slides | ||
| Apr 14 (M) | The Frame Class (see slides from Friday) | Handout | HW11: send a MiniJava testcase that triggers a specific type error message. In the email, indicate which message should be triggered. | |
| Apr 16 (W) | Stack frames for other language features (no slides) | Ch 7-7.3 | PA5: Semantic analysis and stack frame | |
| Apr 18 (F) | PA6 Intro (no slides) | PA6 writeup | ||
| Apr 21 (M) | Intermediate Representations (slides) | Ch 6 intro, 6.2 through 6.2.2 | Translate the examples in exercise 6.2.2 into 3-address code. | HW12: Email the initArray MIPS routine in the same file as a main routine that calls it. It should be possible to run it through spim. |
| Apr 23 (W) | L-values, R-values, and accessing variables (slides) | (pg. 98, Ch 2.8.4) | ||
| Apr 25 (F) | Translating integer expressions and array accesses (slides) | Ch 6.4 | 6.4.3 a and b | |
| Apr 28 (M) | Translating integer expressions and array accesses cont...(slides) | HW13: Translate (t102 = foo( t103, t104 * t104 )) and (x = t200 + y - x) to 3-address code and then to Assem(MIPS). Assume t### are compiler temporaries and put x and y in reasonable stack locations. | ||
| Apr 30 (W) | Translating Statements and Expression involving Classes (slides) | |||
| May 1 (F) | Translating Boolean Expressions and If Statements (slides) | Ch. 6.6 | Using short-circuiting, write 3-address code for the statement: if (x == 1 && y == 2 && z==3) w = 4; | |
| May 5 (M) | Control Flow, Basic Blocks, and Tracing (slides) | Ch 6.8 (switch statements), Ch 8.4 (basic blocks and control-flow) | HW14: Exercise 6.6.4 | |
| May 7 (W) | Instruction Selection and Register Allocation (slides) | Ch. 8 through 8.3 | 8.2.1, 8.2.2, 8.2.4 | PA6: MIPS code gen |
| May 9 (F) | Final Review (slides) | |||
| May 12 (M) | Final Exam (11:20am-1:20pm) | |||