Syllabus and general information for MC97: Compiler Design (Spring 1999)


MC97 attempts to draw together the theory and practice of compiler construction. Much of the material will have a strong theoretical foundation. However, with the exception of the last couple topics (due to time constraints), this material will serve as the basis for compiler-writing projects. Topics include lexical, syntactic, and semantic analysis, code generation, data-flow analysis, register allocation and assignment, and optimization.

Office hours

I will be available in my office (OHS 303) Mondays 10:30-11:20, Tuesdays 11:30-12:20, Wednesdays 2:30-3:20, and Thursdays 1:30-2:20 (except Wednesday, March 24th, Thursday, March 25th, and Thursday, April 22nd) and by appointment. You may send me electronic mail at or call me at extension 7466. I'll try to put any updates to my office hours on my web page, so check there if in doubt.

World Wide Web

All course materials will be available through my World Wide Web page. The URL for this course is After this syllabus I will give hardcopy handouts only to those students who want them.


Our text will be Modern Compiler Implementation in Java by Andrew Appel (Cambridge University Press, 1998).


On Thursdays, we will meet in the OHS 326 computer lab rather than in the usual classroom. Each lab has one, two, or three Thursdays set aside for us to work together, but will also require you to spend additional time out of class.


There will be midterm and final exams, as shown on the syllabus below. (Note that the final exam will be as scheduled by the registrar. The date and time shown in the syllabus are the tentative projection from the registrar's office, but are subject to change by that office.)


Students are encouraged to discuss the course, including issues raised by the assignments. However, the solutions to assignments should be individual original work unless otherwise specified. If an assignment makes you realize you don't understand the material, ask a fellow student a question designed to improve your understanding, not one designed to get the assignment done. To do otherwise is to cheat yourself out of understanding, as well as to be intolerably dishonorable.

Any substantive contribution to your solution by another person or taken from a publication should be properly acknowledged in writing. Failure to do so is plagiarism and will necessitate disciplinary action.

The same standards regarding plagiarism apply to team projects as to the work of individuals, except that the author is now the entire team rather than an individual. Anything taken from a source outside the team should be be properly cited.

One additional issue that arises from the team authorship of project reports is that all team members must stand behind all reports bearing their names. All team members have quality assurance responsibility for the entire project. If there is irreconcilable disagreement within the team it is necessary to indicate as much in the reports; this can be in the form of a ``minority opinion'' or ``dissenting opinion'' section where appropriate.

Late assignments

All lab assignments are due at the beginning of class on the day indicated. Late assignments will be penalized by one ``grade notch'' (such as A to A- or A- to B+) for each weekday (that the college is in session) late or fraction thereof. However, no late assignments will be accepted after graded assignments are handed back.

If you are too sick to complete an assignment on time, you will not be penalized. Simply write ``late due to illness'' at the top of the assignment, sign your name and hand it in. Other circumstances will be evaluated on a case-by-case basis.

Grade changes

Please point out any arithmetic or clerical error I make in grading, and I will gladly fix it. You may also request reconsideration if I have been especially unjust.


I will provide you with a letter grade on each assignment and test, in addition to the mid-term and final grades, so that you may keep track of your performance. As a guideline, the components will contribute in the following proportion to the final grade: The 58% from labs is subdivided as follows:

However, I reserve the right to subjectively adjust your final grade. Please see me if you have any question how you stand. Class participation is not graded; however, it allows you to find and repair the gaps in your understanding before doing the homework or exam, and thus can dramatically improve your grade.

Style guidelines

All homework and lab reports should be readily readable, and should not presuppose that I already know what you are trying to say. Use full English sentences where appropriate (namely almost everywhere) and clear diagrams, programs, etc. Remember that your goal is to communicate clearly, and that the appearance of these technical items plays a role in this communication process. Be sure your assignments are always stapled together and that your name is always on them.


Please contact me immediately if you have a learning or physical disability requiring accommodation.


The below is my best guess as to the rate at which we will cover material. However, don't be shocked if I have to issue one or more revised syllabi. Where a single number appears in the reading column, it means to read the full chapter. Where a reading is shown as beginning with section 0 of a chapter, it means to start at the very beginning of that chapter, before the first section heading. Note also that I won't be present for the March 25th and April 22nd lab periods.
2/101-2.4Lexical analysis
2/11Lab 1: Warm-up interpreter
2/122.5A lexical analyzer generator

2/153.0-3.2Predictive parsing
2/173.3LR parsingLab 1
2/18Lab 2: Lexical analysis
2/19More on LR parsing

2/223.4A parser generator
2/243.5Error recoveryLab 2
2/25Lab 3: Parsing and AST generation
2/264Abstract syntax

3/15.0-5.2Symbol tables
3/35.3-5.4Type checkingHW 1
3/4Lab 3, continued
3/5More on semantic analysis

3/86.0-6.1Stack frames
3/106.2Storage allocationLab 3
3/11Lab 4: Semantic analysis
3/12More on activation records

3/157.0-7.2Intermediate representation
3/177.3Processing declarationsHW 2
3/18Lab 4, continued
3/19More on intermediate code generation

3/22Review/catch-up/special topicLab 4
3/24Midterm exam
3/25Lab 5: Escape analysis
3/26No class

4/78Basic blocks and traces
4/8Lab 5, continued
4/9More on basic blocks and traces

4/129.0-9.1Instruction selection
4/149.3Implementing instruction selectionLab 5
4/15Lab 6: Redo worst of labs 1-4
4/169.2CISC instruction selection

4/1910.0-10.1Liveness analysis
4/2110.2Implementing liveness analysis
4/22Lab 6, continued
4/23No class

4/2611.0-11.2Register allocation
4/28Continued (Mayday: class 12:10-12:40)Lab 6
4/29Lab 7: Liveness analysis or register allocation
4/3011.3Precolored nodes

5/311.4Coloring implementation
5/511.5Register allocation for treesHW 3
5/6Lab 7, continued
5/712Lab wrap-up issues

5/1017.0-17.2Dataflow analysis
5/1217.3-17.4More on dataflow analysis
5/13Lab 7, continuedHW 4
5/1417.5-18.2Loop optimization

5/1718.3-18.5More on loop optimization
5/19Evaluation/review/catch-up/special topicLab 7

5/22Final: 10:30-12:30 in OHS 318 w/ Ron Rietz's class

Course web site:
Instructor: Max Hailperin <>