To provide a thorough understanding of the basic structure of compilers for Algol-like languages. A major part of the course consists of the implementation of a compiler for a simplified Algol-like language. To acquaint students with software tools and techniques which are applicable both to compilers and the implementation of system utility routines, command interpreters, etc.
CS 444 is a course for CS major students, and is normally taken in a student's fourth year. It should appeal to anyone who is interested in the design and implementation of programming languages. Anyone who does a substantial amount of programming should find the material valuable.
Prerequisites: CS 350 or 354 or ECE 354; Computer Science students only.
Modern Compiler Implementation in Java, 2nd ed., by A. Appel, Cambridge University Press, 2002.
Crafting a Compiler Implementation by Fischer, LeBlanc, Cytron, Addison-Wesley
3 hours of lectures per week. Normally available in Winter.
An overview of language translation. Compiler-compilers and translator writing systems. The notions of lexical analysis, parsing, and one-pass vs. multi-pass compilation.
Discussion of a general-purpose procedural, algorithmic programming language (derivative of Ada) for which students taking the course write a compiler. Organizing group projects. Documentation. Programming style.
Introduction to automatic tools for lexical and syntactic analysis. Discussion of underlying theory.
Organization of a symbol table to reflect scoping rules provided by various language constructs. Discussion of time/space trade-offs.
Semantic analysis - checking that the program makes "sense". Declarations. Type checking. Overload resolution.
The runtime stack. Displays. Static and dynamic links. Parameter passing. Procedure call and return. Data templates. Strings. Heap storage management.
Intermediate code. Trees and quadruples. Arithmetic expressions. Boolean expressions. Code templates for various constructs. An introduction to code improvement and control-flow analysis. Table-driven code generation.
Overview of techniques for producing "better" code.

David R. Cheriton School of Computer Science
University of Waterloo
Waterloo, Ontario, Canada N2L 3G1
Tel: 519-888-4567 x33293
Fax: 519-885-1208
Contact | Feedback: cs-uops@cs.uwaterloo.ca | David R. Cheriton School of Computer Science | Faculty of Mathematics