Announcements
9/30/17 Two old midterms (from 2014 and 2015) are available for study purposes here. I have also included a solution key for the 2014 exam (but not for the 2015 exam). We did not cover DFA reduction this semester, so don't worry about those questions -- that topic will not be on the exam. LR(1) parsers will also not be on the exam (though LR(0) parsers will be!)
8/21/17 The course questionnaire is available here. You can sign up for the course's Piazza page here.
8/18/17 Webpage live!
Course Description
This course focuses on the tools and techniques needed to build an optimizing compiler. Topics include:
- Scanning and parsing: determining the syntactic structure of a program
- Semantic routines: determining the semantics of a program and building an intermediate representation
- Code generation: emitting assembly code that is equivalent to the program
- Program optimizations: improving the performance of a program
- Program analysis: determining interesting information about a program's behavior
Course Details
The course syllabus covers most of the details of the course, including a tentative schedule, exam dates, etc. We will be using Piazza for online discussion of the lectures and assignments. If you have a question about a concept covered in lecture or about a detail of an assignment, check Piazza first!
Lecture Notes
- Lecture 1: What is a compiler. Also available 6-to-a-page.
- Lecture 2: Scanners. Also available 6-to-a-page.
- Lecture 3: Parsers. Also available 6-to-a-page.
- Lecture 4: Expressions. Also available 6-to-a-page.
- Lecture 5: Control structures. Also available 6-to-a-page.
- Lecture 6: Functions. Also available 6-to-a-page.
- Lecture 7: Code generation and local optimizations. Also available 6-to-a-page.
- Lecture 8: Instruction scheduling. Also available 6-to-a-page.
- Lecture 9: Control flow graphs. Also available 6-to-a-page.
- Lecture 10: Dataflow analysis: constant propagation. Also available 6-to-a-page.
- Lecture 11: Dataflow analysis: bitvector dataflow. Also available 6-to-a-page.
- Lecture 12: Loop optimizations. Also available 6-to-a-page.
- Lecture 13: Dependence analysis. Also available 6-to-a-page.
Problem sets
- Problem Set 1: Regular expressions and finite automata.
- Problem Set 2: Context-free Grammars and LL(1) parsers.
- Problem Set 3: LR(0) parsers.
- Problem Set 4: Functions and CSE.
- Problem Set 5: Register allocation and instruction scheduling.
- Problem Set 6: Dataflow analysis.
- Problem Set 7: Loop optimizations.
Project
- Step 0: Test submission. Due 8/25
- Step 1: Scanner. Due 9/6
- Step 2: Parser. Due 9/15
- Step 3: Symbol table. Due 9/29
- Step 4: Expressions. Due 10/18
- Step 5: Control Structures. Due 11/1
- Step 6: Functions. Due 11/17
- Step 7: Register Allocation. Due 12/4