CS 712/812: Compiler Design

(Coordinator: Phil Hatcher)

Catalog Description

Formal languages and formal techniques for syntax analysis and parsing; organization of the compiler and its data structures; code generation. LL and LR parsing; automatic generation of scanners and parsers from high-level descriptions. Implementation of features from imperative and object-oriented languages. Students required to design and implement a compiler for a simple language.

Attributes

  • This course is designated as implementation-intensive.
  • This course can be taken as CS712H by honors students.

Course Topics and Student Outcomes

Algorithms (2):

  • LL parsing
  • LR parsing

Programming (3):

  • using the visitor pattern to implement tree traversals
  • using tools to generate code from a high-level description
  • working with and extending an existing framework (set of classes)
  • building a significant piece of software over the full semester

Applications (6):

  • reading a programming language specification document (Go)
  • using a parser generator (ANTLR)
  • using a code generator generator (LLVM)
  • abstract syntax trees

Evaluation

A midterm exam (16%), two homeworks (4%), programming project (60%) and a final exam (20%).

Topics

  • Compiler design overview
  • Type representation and declaration processing
  • Symbol table implementation
  • Building and processing abstract syntax trees
  • Processing expressions
  • Processing control structures
  • Implementing object-oriented languages
  • Reading the Go language specification
  • LL parsing
  • LR parsing
  • Using ANTLR
  • Using LLVM

Textbook

  • Keith Cooper and Linda Torczon. Engineering a Compiler, 2nd edition, Morgan Kaufmann, 2011. ISBN: 978-0120884780.