Updated: 22 August 2002
| CSC 390
Compiler Construction |
4 cr. |
The fundamental problems in the design and implementation of programming
language processors are studied. Language syntax and semantics, parsing,
implementation techniques such as recursive descent and backtracking, code
generation, optimization, and error diagnostics are covered. Concepts are
illustrated through extensive programming assignments. Three lecture hours
and three hours of scheduled laboratory per week, plus extensive laboratory
work outside of class.
Prerequisite: CSC 260.
Goals:
This course is intended to give students an in-depth
introduction to peogramming language processors, as an important subdiscipline
of computer science, and as an example of problem solution that has achieved
orders of magnitude improvement through the rigorous and methodical study of
the problem. Specific goals are:
- CG1: to provide an understanding of the environment and basic features of a compiler;
- CG2: to explain the use of grammars in specifying a language;
- CG3: to explain the phases of compilation and how they are implemented;
- CG4: to demonstrate how object-oriented techniques are applied to the
development of a compiler.
Objectives:
Upon successful completion of the course, a student will have:
- CO1: learned to analyze and describe the compiler environment;
- CO2: learned to specify, analyze and transform grammars describing programming languages;
- CO3: learned the concepts of the various compiler phases, and analyzed and
modified implementations of some of these phases;
- CO4: programmed a simple compiler or fragment, and extended a larger complete compiler.
Topics:
- Introduction:
- compilers, interpreters, assemblers
- single-pass vs. multiple-pass compilers
- Overview: lexical analysis, parsing, code generation
- Representing computer languages:
- EBNF, grammars, parse trees, syntax diagrams (or syntax trees)
- Example: a simple compiler (e.g., a recursive-descent expression compiler)
- Scanning and tokenizing
- Grammars (especially context-free grammars)
- Parsing (top-down vs. bottom-up)
- LL Parsers
- Symbol tables
- Semantic processing
- Storage management
- Handling types and variables
- Processing expressions
- Translating control structures
- Translating procedures and functions
- Translating records
- Translating arrays
- Optimization strategies
Assignments:
A number of written assignments will involve practice
with EBNF, parse trees, syntax diagrams, etc. Programming assignments will
involve the design and implementation of portions of a compiler for a subset
of a specific programming language such as Java or C. Consult the instructor
for the language(s) to be studied and used in a given semester.
Examinations:
Normally two examinations are given in class at the
one-third and two-thirds points of the course. There is also a comprehensive
written final examination.
Bibliography:
- Fischer, Charles; LeBlanc, Richard.. Crafting a Compiler with C.
Addison-Wesley, 1991.
- Holmes, James. Building Your Own Compiler with C++.
Prentice Hall, 1995.
- Holub, Allen L. Compiler Design in C.
Prentice Hall, 1990.
- Watt, David; Brown, Deryck. Programming Language Processors in Java.
Prentice Hall, 2000.
Salem State Home •
Computer Science Home •
Faculty •
Computer Studies Major •
Flow Sheet
Computer Studies Minor •
Courses •
Course Sequence Diagram •
Computer Laboratories
|