CS712/CS812
Compiler Design
Spring 1997


Instructor: P. Hatcher
Office: Kingsbury M204
Phone: 862-2678
E-mail: pjh@cs.unh.edu
Office Hours: MWF 8:30-9:00am, MWF 10:10-11:00am or by appointment.

Teaching Assistant: Mark MacBeth
E-mail: mwm@cs.unh.edu
Office Hours: Tu 3:30-5pm; Th 3:30-6:30pm in Linux cluster, 3rd floor Kingsbury.

The prerequisite for this course is CS671.

This course has two major objectives:

Grading

The major portion (50%) of your course grade will be based upon a large programming project: writing a compiler for a sizable subset of Java (target architecture is the Java Virtual Machine). No prior knowledge of Java is required.

The project will consist of the following parts:

  1. Tune-up: a 2's complement calculator - due Feb 9.

  2. Java: declarations - due Mar 2.

  3. Java: expressions - due Mar 30.

  4. Java: control flow - due April 20.

  5. Java: method calls and new - due May 11.

Each part will be graded with equal weight (but they are not necessarily of equal difficulty).

You will construct your Java compiler using building blocks given to you and written in C++. For this reason it is likely to be best to write your code in C++.

Programming project parts may be handed in late at a penalty of 5% per day up to one week late. A program is not considered late unless turned in after 8am on the day after the due date.

Each programming assignment will have 3 distinct levels, the 75% level, the 85% level and the 100% level. You receive 75% of the points if you complete the 75% level. You receive 85% of the points if you complete both the 75% and the 85% level. You receive 100% of the points if you complete all three levels.

WARNING: All students are expected to do their own work on the programming assignments (and homework and exams for that matter). No collaboration is allowed. A general rule to follow is that you may discuss the programs with other students at the concept level but never at the coding level. If you are at all unclear about this general rule, don't discuss the programs with other students at all.

WARNING: To get full credit on a programming assignment, your code must be adequately documented and structured. If we can't easily read and understand your code, you will lose points!

One or two oral quizzes will be given to each student during the semester. These quizzes will be given individually, outside of normal class time, and will be 15-30 minutes in duration. These quizzes will cover your prior submissions of programming assignments. You will be asked to explain and defend your code: design decisions, algorithm choices, implementation details, documentation, etc. Your grade will be based upon on how well you can explain your own programs. These quizzes will be worth 10% of your course grade. Your grade for this 10% cannot exceed the average of your programming assignments.

There will be two or three homework assignments given during the semester.

  1. Homework 1 concerns LL parsing.
  2. Homework 2 concerns LR parsing.
The homework (in total) will be worth 10% of your course grade.

The rest (30%) 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:

You may want to keep an eye on the Developer's Corner at the Sun Java web site for documents on the Java programming language and the Java virtual machine. For example, The Java Language Specification by Gosling, Joy and Steele is available on-line here. The Java Virtual Machine Specification by Lindholm and Yellin is available in Postscript (~301K) and PDF (~200K) here.

If you want to order your own copies of any of the books on reserve, I suggest Quantum Books or Amazon.com Books.

If you are thinking of purchasing your own Java books, O'Reilly and Associates publishes inexpensive books on Java:

I do not think these books are as thorough as the Java books on reserve, but if money is tight they might prove to be adequate.

O'Reilly and Associates also publish a 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.

Computer Accounts

{christa,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 christa and hopper.
Last modified on April 21, 1997.

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