CS712/CS812
Compiler Design
Spring 2001
(Revised)


Instructor: P. Hatcher
Office: Kingsbury M202
Phone: 862-2678
E-mail: pjh@cs.unh.edu
Office Hours: MWF 9:30-10:00am, MWF 11:15am-12:00noon, and MWF 1:30-2:00pm or by appointment.

The prerequisite for this course is CS671.

This course has two major objectives:

Grading

The major portion (70%) of your course grade will be based upon a large group programming project. The class will cooperate to produce a single compiler: a C compiler written in C that generates code for the Compaq Alpha.

The project will consist of four phases:

  1. January 29 to March 4: global declarations, scanner, abstract syntax tree construction, Alpha register allocation, and semantic analysis tools.

  2. March 5 to April 1: local and struct/union declarations, function declarations and function calls, basic expressions, and basic control flow.

  3. April 2 to April 22: more operators (e.g. bitwise operators, shift operators), arrays and pointers, and more control flow (e.g. switch, goto).

  4. April 23 to May 13: structs and unions, bit fields, initializers, enum types, typedef declarations, constant expressions, incomplete arrays, old-style functions, and other "odds and ends".

Each student will receive an individual assignment and an individual grade for each phase. Students will have some input on choosing their assignments, but I ultimately will make the assignments in order to ensure overall project success. Students will also be expected to submit a self-assessment of their work for each phase. The grade for each phase will be worth 17.5%, but the effort required for phases may vary.

Project assignments are due on the last day of each phase. Assignments may be handed in late at a penalty of 5% per day up to one week late. An assignment is not considered late unless turned in after 8am on the day after the due date.

Since this is a collaborative assignment, some meetings outside of class will be required to coordinate with me or with other students. In addition, strict coding conventions will be in place and must be followed for full credit.

General project guidelines (including coding coventions) are given here.

There will be three homework assignments given during the semester.

  1. Homework 1 is a programming assignment to introduce compiler writing using lex and yacc.
  2. Homework 2 is a written assignment concerning LL parsing.
  3. Homework 3 is a written assignment concerning LR parsing.
The homework (in total) will be worth 9% of your course grade. Each assignment will be worth 3%.

The rest (21%) of your course grade will be based upon a final examination. This examination will be comprehensive and will be closed book. The final exam will be Fri May 16 10:30am-12:30pm.

In summary, your course grade will be determined in the following way:

Textbooks

There is no required textbook for this course.

On reserve in the Kingsbury library:

Note that one of the books is available on-line. You can also download PDF for the this book here.

I do not think you need to purchase any of the above books. Access to the copies on reserve in the library should be sufficient. However, if you want to order your own copies of any of the books on reserve, I suggest Quantum Books or Amazon.com Books.

O'Reilly and Associates publishes a good book on lex and yacc:

Documentation is available on-line for the Unix utilities we will be making heavy use of this semester. Look in ~cs712/public/docs on alberti.

Computer Accounts

The UNH CIS Alpha servers (alberti.unh.edu, hypatia.unh.edu and hopper.unh.edu) are the primary computing resources for this course. You should automatically be given accounts on these machines. During the semester you may use any other machines that you have access to, but for grading purposes your programs must execute on the CIS Alpha machines.
Last modified on February 18, 2001.

Comments and questions should be directed to pjh@cs.unh.edu