CS445/CS545 Compiler Construction
Spring 2003

Instructor: Christino Tamon
Teaching Assistant: Brendan Johnson
Lectures: MWF 11am Science Center 354
Labs: SUN lab Rowley 142 or COSI lab SC346 or ITL lab SC344
Office hours: Science Center 373 MW 9-11am, F 10-11am
Pre-requisites: CS344, CS345.
Syllabus: A study of compiler design. Overview of the compilation process. Formal definition of syntax, lexical scanning, parsing including LL and LR grammars, run-time structures, intermediate code generation, and storage allocation. Students are expected to develop a compiler for a substantial subset of a high-level language using compiler tools such as lex and yacc.

Course grading: Project 50%, Exams 40%, Miscellaneous 10%

Texts: [main][recommended]

Tentative Outline

  1. Language translation. Compilation. Overview.
  2. Lexical Analysis. Regular expressions.
  3. Syntax Analysis. Theory of Parsing: top-down LL(1); bottom-up SLR(1), LR(1) (and LALR(1)).
  4. Semantic Analysis. Parse trees. Syntax-directed translation. Type checking.
  5. Code generation. Runtime environments.

Objectives and outcomes

The objective of this course is to learn the fundamentals of compiler theory and its application in constructing a real working compiler.

The specific outcomes are as follows:

Requirements and Policies

Although attendance is not mandatory, students are responsible for all course materials covered in lectures and any exams given during class periods. Students that need to make up missing course work must follow the official Clarkson policies regarding these matters. All students must submit their own work; the exchange of ideas are encouraged but ultimately the submitted work must be the student's own. Please refer to the Clarkson University Regulations for more guidelines on academic integrity and related matters.

Project Breakdowns

Tentative schedule of deadline: Optional topics:


See Brendan Johnson's page.

C help guide and some files: main.c. list.c. list.h. Makefile.

Readings and notes (tentative outline)

(Under construction)

Our Dragon course project

The goal of the project is to build a compiler for a large chunk of the Pascal programming language that will output a SPARC assembly program. This project will give you a chance to apply skills you learned from other courses along with hopefully new ones: To synchronize the compiler project, make your compiler take a single input Pascal file (with suffix extension of ".p", say "main.p") and make it write the SPARC assembly output to file with the same name except for the suffix (which is changed to ".s", so "main.s"). We will then use GCC to produce the executable by "gcc main.s". So if your compiler executable is called yapc then the following sequence should be used to test all our final executables.
yapc main.p
gcc main.s


Full report (due before dead week) containing at least the following items:


During the last week of classes, schedule a meeting to present the online demonstration of the compiler. Be prepared for some extra testing and questions about your compiler project.