ECS 142: Compilers

Subject
ECS 142
Title
Compilers
Status
Active
Units
4.0
Learning Activities
Lecture: 3 hours
Discussion: 1 hour
Description
Principles and techniques of lexical analysis, parsing, semantic analysis, code generation, and code optimization. Implementation of compilers. GE Prior to Fall 2011: SciEng. GE: SE.
Prerequisites
ECS 140A; ECS 120; ECS 122A recommended.
Enrollment Restrictions
Pass One open to Computer Science and Computer Science Engineering Majors only.

Summary of Course Content
The lecture topics include the following, not necessarily listed in chronological order:

I. Introduction

  • Interpreters and compilers
  • Phases of a compiler
  • Symbol tables

II. Lexical Analysis

  • Role of lexical analyzers
  • Regular expressions
  • DFAs and NFAs
  • Lexical-analyzer generators

III. Syntax Analysis

  • Context-free grammars
  • Top-down parsing
  • Bottom-up parsing, including LR(1), SLR(1), and LALR(1)
  • Error recovery

IV. Semantic Analysis

  • Syntax-directed definitions
  • Attributed grammar
  • Type checking

V. Run-time Environments

  • Storage organization
  • Activation records

VI. Code Generation

  • Intermediate code generation
  • Code-generation algorithms

VII. Code Optimization

  • Local optimizations
  • Global optimizations

Illustrative Reading
A. Aho, M. Lam, R. Sethi, and J. Ullman, Compilers: Principles, Techniques, and Tools (2nd Edition), Prentice Hall, 2006. ISBN 0-321-48681-1.

Potential Course Overlap
None

Course Category