Compilersclass="thumb"

Compilers

Alex Aiken

Course Description

In this course, you will learn principles and practices for design and implementation of compilers and interpreters. Topics covered include: lexical analysis; parsing theory; symbol tables; type systems; scope; semantic analysis; intermediate representations; runtime environments; code generation; and basic program analysis and optimization. Students will construct a compiler for a simple object-oriented language during the course's programming projects.

To understand the concepts in this course, you should be familiar with regular expressions, context-free grammars, graphs, sets, and formal languages. Well-developed programming skills and debugging ability will also be important for the programming assignments. An understanding of simple code generation and function calling conventions, as well as some exposure to different language paradigms would also be helpful. If you are unsure about some of these topics, be prepared to brush up on your own to fill in the gaps as you encounter them.

While a textbook is not required to complete the course, Compilers: Principles, Techniques, and Tools (2nd Edition) by Aho, Sethi, Lam, and Ullman (a.k.a. the "purple dragon" book) can be a useful reference. This is a new edition of the classic compiler text and is a very thorough and solid treatment of the material. Some students may find it helpful as a reference or supplemental source.

This course is a work in progress. Not all of the videos, assignments, and materials for this course have been uploaded (or even filmed/written, for that matter). Please be patient as we work to finish the course.


I. INTRODUCTION



II. THE COOL PROGRAMMING LANGUAGE



III. LEXICAL ANALYSIS



IV. FINITE AUTOMATA



V. PARSING



VI. TOP-DOWN PARSING



VII. BOTTOM-UP PARSING I



VIII. BOTTOM-UP PARSING II



IX. SEMANTIC ANALYSIS AND TYPE CHECKING



X. COOL TYPE CHECKING



XI. RUNTIME ORGANIZATION



XII. CODE GENERATION



XIII. OPERATIONAL SEMANTICS



XIV. LOCAL OPTIMIZATION



XV. GLOBAL OPTIMIZATION



XVI. REGISTER ALLOCATION



XVII. GARBAGE COLLECTION



XVIII. JAVA