Compilers
Computer Science 331
Spring, 2012
- Instructor: John L.
Donaldson
- Meeting time: MWF 1:30-2:20 pm, King 221
- Office: King 223C
- Office hours: MW 2:30-4:00 pm (or by appointment)
Course Information
- Prerequisite: 151 and 210 (or consent of instructor)
- Text: Aho, Lam, Sethi, and Ullman, Compilers:
Principles, Techniques, and Tools, second edition,
Addison-Wesley, 2007.
- Course Objectives:
- Study the basic language concepts which form the
theoretical foundations of compiler design
- Study the techniques, data structures, and algorithms used
in the construction of a modern, multi-phase compiler
- Implement a compiler for a subset of C
Grading Procedures
Your grade will be based on homework, a multi-phase programming
project, and two exams.
| Point breakdown (approximate): |
| Project/Homework |
200-250 |
| Midterm Exam (March 21) |
100 |
| Final Exam (May 16 - 9 am) |
150 |
| Total |
450-500 |
Policies
Please hand in assignments on time and working.
Paper-and-pencil homework assignments must be handed in by the due
date; late homeworks will not be accepted. For hands-on
programming assignments, late programs will be assessed a penalty
of up to 10% per day.
All late assignments must be submitted by the end of the reading
period.
Regular class attendance and participation is expected of everyone
in the class.
You may work on the programming projects individually or in
pairs. If you work with a partner, your pair should submit one
solution for each phase of the project.
The Honor Code
The Honor Code has a straightforward application to this
class. On all of the exams you are responsible for your own
work; you may neither give nor receive aid during the course of the
exam. If someone takes an exam at a different time than the
rest of the class there may be no communication concerning the exam
between that person and anyone else in the class, not even about
whether the exam was easy or difficult. The atmosphere is
somewhat more relaxed for the homework and programming assignments.
You may discuss the problems with anyone else in the class,
but you may not share your code with anyone (other than your partner
on the programming projects). You must design and write your
own solutions.
Topical outline and reading assignments
- What is a compiler? Why study compilers?
Languages and grammars. Phases of a compiler.
(chapters 1, 2)
- Lexical analysis. Finite state automata and regular
expressions. (chapter 3)
- Parsing. (chapter 4)
- Syntax-directed translation. (chapter 5)
- Semantic analysis and intermediate code generation.
(chapter 6)
- Run-time support for procedures. Storage
organization. Parameter passing and activation
records. Heap management and garbage collection (chapter
7)
- Code generation:. Basic blocks and flow graphs. (chapter
8)
- Machine-independent optimization. (chapter 9)