Department of 
Computer Science

Search our Site

Line

ON THIS PAGE:

Course Objectives

Prerequisites

Approach

Typical Text

Course Outline

  COMP 240: Compilers
(3 hours)

Syllabus approved 6 May 1988

Course Objectives
To provide mastery of the tools and techniques of compiler construction.

Prerequisites
COMP 140, 144, 181.

Approach
Study chiefly of textbook but also of some literature, with emphasis on both principles and practice. Students will write parts of compilers. Use of compiler-writing tools will be at the instructor's discretion.

Typical Text
Aho, Sethi, and Ullman, Compilers: Principles, Techniques, and Tools (the new "dragon" book).

Course Outline
Numbers in parentheses indicate approximate number of weeks

    • Lexical Analysis (1.0)
      • Finite state machines
      • Regular expressions
      • Tools, e.g. lex

    • Syntactic Analysis (3.0)
      • Grammars: many types, including both top-down and bottom-up e.g. precedence, recursive descent, LALR(1)
      • Parse-tree representations
      • Parsing efficiency
      • Tools, e.g. yacc

    • Semantic Analysis (3.5)
      • Attribute grammars
      • Type checking
      • Symbol-table management
      • Challenges: e.g. dynamic variables, case statements, records
      • Tools, e.g., GAG, IDL

    • Code Generation (2.0)
      • Storage management: stack, heap, pointers
      • Effect of machine-language architecture
      • Peephole optimization
      • Tools, e.g. Graham-Glanville method

    • Optimization (2.5)
      • Local machine-independent
      • Global machine-independent
      • Machine-dependent

    • Errors and Recovery (1.0)
      • Lexical-phase
      • Syntactic-phase
      • Semantic-phase

Horizontal Line
Department of Computer Science
Campus Box 3175, Sitterson Hall
College of Arts & Sciences
The University of North Carolina at Chapel Hill
Chapel Hill, NC 27599-3175 USA
Phone: (919) 962-1700
Fax: (919) 962-1799

Content Manager: Associate Chairman for Academic Affairs
Server Manager: webmaster@cs.unc.edu
Last Content Review: 7 November 1995