ECE 495S - Introduction to Compilers and Translation Engineering

Lecture Hours: 3 Lab Hours: 3 Credits: 4

This is an experiential learning course.

Counts as:

Experimental Course Offered: Fall 2006

Catalog Description:
The design and construction of compilers and other translators. Topics include compilation goals, organization of a translator, grammars and languages, symbol tables, lexical analysis, syntax analysis (parsing), error handling, intermediate and final code generation, assemblers, interpreters, and an introduction to optimization. Emphasis is on engineering, from scratch, a compiler or interpreter for a small programming language -- typically a C or Pascal subset. Projects involve the stepwise implementation (and documentation) of such a system. Replaces ECE 468.

Supplementary Information:
Replaces ECE 468.

Engineering Design Content

The course project, which requires the students to construct a fully functional compiler, requires them to synthesize knowledge of programming, algorithms, and data structures learned in earlier courses. The objectives and high-level design of the project are provided, but the students are required to design interfaces between different components of the compiler. Students are required to come up with test cases for their projects and to ensure that they will work on "hidden" test cases.

Required Text(s):
  1. Course notes.
  2. Crafting a Compiler with C, Fischer and LeBlanc, Prentice-Hall, 1991, ISBN No. 0-8053-2166-7.

Recommended Text(s): None.

Learning Outcomes:

A student who successfully fulfills the course requirements will have demonstrated:
  1. an understanding of the terminology, representation, and use of formal languages and grammars. [a]
  2. an understanding of the terminology and techniques of lexical analysis, parsing, semantic processing, code generation, and optimization. [a,e]
  3. an ability to design and implement a compiler, translator, or interpreter for a small language. [a,b,c,e,k]

Lecture Outline:

Week(s) Topic
1 Structure of a compiler
2 Scanning, Scanner Generators
2 Grammar, Parsing, Parser Generators
1 Semantic Processing
1 Symbol Tables and Declarations
2 Processing Expressions and Control Structures
2 Procedures and Functions
2 Code Optimizations
1 Program Analysis
1 Tests

Lab Outline:

Weeks Laboratory Component
1-15 The laboratory course component will ensure that students become familiar and gain experience with design and engineering issues in a compiler implementation project. <p> There will be approximately seven laboratory projects. All projects will be implemented using the C< C++, or Java programming language. The students or student groups will design and implement a full compiler for a mini language. Each project builds on the previous projects, implementing compiler passes for scanning, parsing, semantic routines, register allocation, scheduling, and simple optimizations. At the end of the semester, the students will demonstrate a full compiler that translates a program written in the mini language into executable code.

Engineering Design Content:

Synthesis
Construction
Testing
Evaluation