Syllabus and general information for MCS-388: Compiler Design (Spring 2006)

Overview

MCS-388 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 and syntactic analysis, naive code generation, data-flow analysis, register allocation and assignment, and optimization, including partial redundancy elimination.

Office hours

I will be available in my office (OHS 303) 12:30-1:20 Mondays, Tuesdays, and Fridays, 11:30-12:20 Wednesdays, as well as by appointment. Or try your luck: just stop by and see whether my door is open. You may send me electronic mail at max@gustavus.edu 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 http://www.gustavus.edu/+max/courses/S2006/MCS-388/. After this syllabus I will give hardcopy handouts only to those students who want them.

Prerequisites

MCS-388 draws heavily on MCS-265, MCS-287, and MCS-284. Some notions from MCS-375 and MCS-236 also crop up. You're expected to be able to program. Since the compiler-building tools and pre-existing code modules I supply will be centered around the Java programming language, the path of least resistance will probably be to learn that language as we go if you don't already know it. On the other hand, there are comparable compiler-building tools centered around other languages, so if you would rather use another language, that's fine too, you'll just have a little less of a support network. I'll gladly accept labs written in any programming language: C++, Scheme, Python, ML, Ada, you name it.

Text and readings

Our primary text will be the "dragon book," i.e., Compilers: Principles Techniques and Tools by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman, Addison Wesley, 1986. We will also use some additional material: documentation, which will be on-line or in the lab area, and supplementary readings, which I will hand out. (There's also an on-line Java Tutorial at http://java.sun.com/docs/books/tutorial/, and copies of a couple Java books in the MCS Lab monitors' room, any of which you are welcome to use as a supplement.)

Labs

Some days, shown in the syllabus, we will meet in the OHS 326 computer lab rather than in the usual classroom. Each lab has three lab days set aside for us to work together, but will also require you to spend additional time out of class.

Honor

You are expected to be familiar with the college academic honesty honor code policy, and to comply with that policy. If you have any questions about it, please ask. One specific requirement of that policy is that you write the following in full and sign it on every graded paper, i.e., on every homework and lab report:

On my honor, I pledge that I have not given, received, nor tolerated others' use of unauthorized aid in completing this work.

Late assignments

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

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.

Please see the separate homework policy, linked to the web version of this syllabus.

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.

Grading

I will provide you with a grade on each homework assignment and lab assignment, in addition to the mid-term and final grades, so that you may keep track of your performance. The homeworks will contribute half of your final grade, with the labs contributing the other half. 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 assignments, and thus can dramatically improve your grade. You are responsible for all course material, whether or not you are present when it was covered or distributed.

Please see the separate homework policy, linked to the web version of this syllabus.

Style guidelines

All assignments 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.

Accessibility

If you have a learning, psychological, or physical disability for which a reasonable accommodation can be made, I would be happy to refer you to the college's disability services coordinator and to cooperate in the accommodation process. It is generally best if this can be done as soon as possible.

Syllabus

In the reading column, section 0 means the material at the beginning of a chapter before the first section. When a reading is indicated as going to a particular page number, it means up to the heading on that page. The same section number on the next class day then indicates to finish the section.

This is my best guess as to the rate at which we will cover material. However, don't be shocked if I have to pass out one or more revised syllabi.
DateReadingTopicDue
2/61.0-2.2Introduction, syntax definition
2/72.3-2.4Syntax-directed translation
2/8Lab 1: Generating Code from ASTs
2/103.0-3.1, 3.3, 3.5Lexical analysis

2/13Lexical-analyzer generators
2/144.0-4.2Context-free grammarsHW 1
2/15Lab 1 (continued)
2/174.3Writing a grammar

2/204.4-p.188Top-down parsing
2/214.4More on predictive parsing
2/22Lab 1 (continued)HW 1, draft 2
2/244.5, 4.7-p.220Bottom-up parsingLab 1

2/274.7-p.230SLR parser generation
2/284.7-p.240Canonical LR and LALR parser generationHW 2
3/1No class (conference)
3/3No class (conference)

3/64.8-p.251, 4.9Using ambiguous grammars; parser generators
3/75.0-5.3Syntax-directed definitionsHW 3
3/8Lab 2: Scanning and Parsing
3/10Lab 2 (continued)

3/13Lab 2 (continued)HW 2, draft 2
3/148.0-8.1Intermediate code
3/158.2-8.3, p.481Declarations and simple assignmentsLab 2 and HW 3, draft 2
3/17Lab 3: Adding Variables

3/208.3Array access; type conversions
3/218.4Control flow
3/22Lab 3 (continued)
3/24Lab 3 (continued)

4/3Lab 3 (continued)
4/47.0-7.3Run-time environmentsLab 3
4/5Preview of lab 4
4/7Lab 4: Control Flow and Scoping

4/10Lab 4 (continued)
4/11Modern run-time environment issuesHW 4
4/12Lab 4 (continued)

4/189.0-9.3Code generation
4/19Preview of lab 5Lab 4
4/21Lab 5: ProceduresHW 4, draft 2

4/249.4Basic blocks and flow graphs
4/2510.0-10.2Optimization
4/26Lab 5 (continued)
4/2810.4Loops in flow graphsHW 5

5/1Lab 5 (continued)
5/210.5Data-flow analysis
5/310.6Iterative data-flow analysisLab 5
5/5Lab 6: Wildcard Lab

5/8notesPartial redundancy eliminationHW 6 and HW 5, draft 2
5/9Liveness analysis
5/10Lab 6 (continued)
5/12notesInterference graphs

5/15Lab 6 (continued)
5/16Register allocationHW 6, draft 2
5/17Synthesis and evaluationLab 6


Course web site: http://www.gustavus.edu/+max/courses/S2006/MCS-388/
Instructor: Max Hailperin <max@gustavus.edu>