CS 433 Compiler Design Spring 2008

Course Information

Course homepage:
http://www.cs.middlebury.edu/~schar/courses/cs433-s08/

Time and place:
MWF 11:15-12:05 in MBH 632

Professor:
Daniel Scharstein
633 McCardell Bicentennial Hall
443-2438
schar middlebury.edu

Office Hours:
Mon, Tue, Wed, Fri 1:30-2:30,
and by appointment

Lab system administrator:
Dave Guertin
506 McCardell Bicentennial Hall, 443-3143

Textbook (required):
Compilers: Principles, Techniques, and Tools, 2nd edition
A. Aho, M. Lam, R. Sethi, J. Ullman
Addison Wesley, 2007



Course Description

The design and construction of a compiler involves both theoretical issues of algorithm design and practical issues of software engineering. In this course we will look at both of these aspects of compiler construction. The course will involve a large software project intended to expose you to the engineering aspects of managing a large project and to familiarize you with the basic problems that must be addressed in any compiler. In class, we will explore the techniques that have been developed for lexical analysis, parsing, semantic analysis, code generation, and optimization.

Topics

The following is a tentative schedule of the topics to be covered in the course. References are given for readings in the text by Aho et al. The course web page will be updated with a more detailed schedule of topics and readings.

Week Dates Topics
12/11-15 Introduction, structure of a compiler, symbol tables, formal specification of syntax, regular expressions (Ch 1, 2, 3.3)
22/18-20 Lexical analysis, Lex, formal grammars, CFGs (Ch 3, 4.2)
32/25-29 Derivations, parse trees, syntax trees, Yacc (Ch 4.1-2, 4.9)
43/3-7 Declaration processing, top-down and bottom-up parsing (Ch 6.3, 7.1-2, 4.4-5)
53/10-14 More declaration processing, LR(0) parsing (Ch 7.3, 4.6)
63/17-21 Type checking, run-time storage management (Ch 6.5, 7.1-3)
3/24-28 Spring break
73/31-4/4 Code generation for expressions (Ch 6.4, 8.1, 8.3)
84/7-11 Dynamic memory allocation, garbage collection, assignments, arrays (Ch 7.4-5, 6.4)
94/14-18 Code generation for control structures, register spilling (Ch 6.6, 8.6)
104/21-25 More code generation, LR(1) parsing (6.6, 4.7)
114/28-5/2 Code generation for procedures, LALR parsing (Ch 6.9, 7.2, 4.7)
125/5-9 Optimization (Ch 9.1-2)

Assignments and Grading

There will be weekly homework assignments consisting of programming problems and/or written problems. Programming will be done in C. All programming problems will contribute to the main course project, the construction of a compiler for a simple programming language. The written problems are designed to expose you to aspects of compiler construction not touched on in the main project. It is essential that you hand in all assignments on time. No late submissions will be accepted, but each student is allotted three 24-hour extensions to use for any homework assignment during the term.

Your final grade will be based on assignments (40%), class attendance and participation (10%), a midterm exam (20%), and a final exam (30%). The midterm exam is scheduled for Wednesday, March 19, 7:30-9:30pm. The final exam will be self-scheduled. Both exams will be open book, open notes.


Collaboration Policy and Honor Code

The computer science faculty believes that collaboration fosters a healthy and enjoyable educational environment. For this reason, you are encouraged to talk with other students about the course and to form study groups.

Unless otherwise instructed, feel free to discuss problem sets with other students and exchange ideas about how to solve them. However, there is a thin line between collaboration and plagiarizing the work of others. Therefore, it is required that you must compose your own solution to each assignment. It is unacceptable (1) to solve a problem together and turn in two copies of the same solution or (2) to copy solutions written by your classmates. This implies that you should never have in your possession a copy of all or part of another student's work. It is your own responsibility to protect your work from unauthorized access. If an assignment (or part of one) is designated a group project, then the above rules apply to a group. That is, you are allowed to collaborate on the assignment with your partner(s), but work with others is restricted as discussed above. All exams, of course, must be entirely your own work and you may not collaborate with anyone.

When working on homework problems, it is perfectly reasonable to consult public literature (books, articles, etc.) for hints, techniques, and even solutions. However, you must reference any sources that contribute to your solution. It is also OK to borrow code from the textbook, from materials discussed in class, and from other sources as long as you give proper credit. Assignments and solutions from previous terms are not considered to be part of the "public" literature, and consulting problem set solutions from previous terms constitutes a violation of the Honor Code.

If you are uncertain how the Honor Code applies to a particular assignment, please ask me. The Department of Computer Science takes the Honor Code seriously. Violations are easy to identify and will be dealt with promptly.