CS712/CS812
Compiler Design
Spring 1998


Instructor: P. Hatcher
Office: Kingsbury M208
Phone: 862-3778
E-mail: pjh@cs.unh.edu
Office Hours: MWF 10:00-11:00am, MWF 12:10-12:30pm or by appointment.

Teaching Assistant: Mark MacBeth
E-mail: mwm@cs.unh.edu
Office Hours: TuTh 1-3pm in Kingsbury 317.

The prerequisite for this course is CS671.

This course has two major objectives:

Grading

The major portion (55%) 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 8.

  2. Java: declarations - due Mar 1.

  3. Java: expressions - due Apr 5.

  4. Java: control flow - due April 19.

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

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 11% of your course grade. Your grade for this 11% cannot exceed the average of your programming assignments.

There will be two 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 6% of your course grade.

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

If you want to order your own copies of any of the books on reserve, I suggest Quantum Books or Amazon.com Books. Note that the above two Java reference books are available on-line.

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 on alberti.

Computer Accounts

alberti.unh.edu is the primary computing resource for this course. You should automatically be given accounts on this machine. During the semester you may use any other machines that you have access to, but for grading purposes your programs must execute on alberti.
Last modified on April 20, 1998.

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