CS 494 Compiler Design (3-0-3)

Design and implementation of compilers, principles of languages translation. Each student implements a complete compiler for a small but substantial language. The stages of a compiler. Boot-strapping a compiler. Lexical analysis, regular expressions, finite state machines. Syntactic analysis, context free grammars, parsers. Semantic analysis, type checking, symbol tables. Syntax-directed translation. Data flow analysis, peephole optimization. Code generation.

Prerequisite: : CS 385.

 

This is the generic web site for CS494.  Each semester the course is offered, the TA will set up a more detailed web site, including an exam schedule, precise details of the four parts of the compiler construction project, etc.

 

Course goals:

-Understanding what each component of a compiler does, how each component can be implemented, and how they are integrated

-designing and implementing a significant piece of software

 

Project work:  Students will implement a compiler for a small but non-trivial programming language, the language’s lexical rules and syntax to be specified at the beginning of the course.  The compiler will translate from the given source language into SPIM assembly code.  Students will work solo (in teams of one), in teams of two, or in teams of three.  The larger the team, the more it is expected to implement.  Exact details will vary by semester.  As an example:

-teams of one have implemented a complete lexical analyzer, a parser for a pared down language, a symbol table constructor and simple semantic analysis analyzer, and a code generator for source code without procedure calls

-teams of two have implemented a complete lexical analyzer, a parser for the entire language, a symbol table constructor, simple semantic analysis analyzer and type analyzer, and a code generator for source code with procedure calls

-teams of three have implemented a complete lexical analyzer, a parser for the entire language, a symbol table constructor, simple semantic analysis analyzer and type analyzer, and a code generator for source code with procedure calls and dataflow-based register allocation.

 

Whether a student works in a team of one, two, or three, s/he is responsible, on exams, for all topics covered in class, including principles needed by 3-person teams to implement the complete compiler.

 

Textbooks

-Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman: Compilers - Principles, Techniques and Tools. Addison-Wesley 1988, ISBN 0-201-10088-6

 

-Britton, Robert L, MIPS Assembly Language Programming, Pearson/Prentice Hall, 0-13-142044-5

 

Grading:  Grading varies somewhat from semester to semester. It is based upon four in-class exams and the compiler construction project.  If class attendance drops, pop quizzes, that count for the semester grade, will be given.  In past semesters, the grade breakdown has been:  45% for the four exams, 45% for the compiler implementation project, and 10% for pop quizzes.  For students working in teams of two or three, project part of the grade will be based on both the quality of the software – same for all team members -- and on the individual student’s contribution, as judged from written de-briefing reports and personal interviews.