CS 335: Principles of Compiler Design

Course Contents:

Compiler structure: analysis-synthesis model of compilation, various phases of a compiler, tool based approach to compiler construction.

Lexical analysis: interface with input, parser and symbol table, token, lexeme and patterns. Difficulties in lexical analysis. Error reporting. Implementation. Regular definition, Transition diagrams, LEX.

Syntax analysis: CFGs, ambiguity, associativity, precedence, top down parsing, recursive descent parsing, transformation on the grammars, predictive parsing, bottom up parsing, operator precedence grammars, LR parsers (SLR, LALR, LR), YACC.

Syntax directed definitions: inherited and synthesized attributes, dependency graph, evaluation order, bottom up and top down evaluation of attributes, L- and S-attributed definitions.

Type checking: type system, type expressions, structural and name equivalence of types, type conversion, overloaded functions and operators, polymorphic functions.

Run time system: storage organization, activation tree, activation record, parameter passing, symbol table, dynamic storage allocation.

Intermediate code generation: intermediate representations, translation of declarations, assignments, control flow, boolean expressions and procedure calls. Implementation issues.

Code generation and instruction selection: issues, basic blocks and flow graphs, register allocation, code generation, dag representation of programs, code generation from dags, peep hole optimization, code generator generators, specifications of machine.

Books and References:

A. V. Aho, R. Sethi, and J. D. Ullman.Compilers: Principles, Techniques and Tools, Addison-Wesley, 1988.

C. Fischer and R. LeBlanc.Crafting a Compiler, Benjamin Cummings, 1991.

C. Fischer and R. LeBlanc.Crafting a Compiler in C, Benjamin Cummings.

A. C. Holub.Compiler Design in C, Prentice-Hall Inc., 1993.

Appel.Modern Compiler Implementation in C: Basic Design, Cambridge Press.

Appel.Modern Compiler Implementation in Java: Basic Design, Cambridge Press.

Fraser and Hanson.A Retargetable C Compiler: Design and Implementation, Addison-Wesley.

Dhamdhere.Compiler Construction, McMillan India.

Holmes.Object Oriented Compiler Construction, Prentice Hall.

Holmes.Building your own Compiler with C++, Prentice Hall.

Wirth.Compiler Construction, Addison-Wesley.

Wilhelm and Maurer.Compiler Design, Addison-Wesley.

Any other book on Compilers: check central library

Reference to Programming Languages: search central library.

You may look at comp.compilers newsgroup from time to time:[ http://www.iecc.com/compiler ][2].

Back to list of courses