Syllabus and general information for MCS-388: Compiler Design (Spring 2008)
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 also serve as the basis for
compiler-writing projects. Topics include lexical and syntactic
analysis, code generation, data-flow analysis, and optimization.
Office hours
I will be available in my office (OHS 303) 9:00-11:20 Mondays
and Fridays 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/S2008/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 use that language. 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, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman, 2nd ed.,
2007. When appropriate, I will also distribute supplemental
reading.
Labs
Some days, shown in the syllabus, we will meet in the OHS 326 computer
lab rather than in the usual classroom. Each lab assignment will
generally 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.
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.
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.
In the reading column, section 0 means the material at the beginning
of a chapter before the first section. Similarly, subsection 0 means the material at the beginning
of a section before the first subsection.
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.
Date | Reading | Topic | Due
|
---|
2/11 | 1.0-2.2 | Introduction, syntax definition |
|
2/12 | 2.3-2.4 | Syntax-directed translation |
|
2/14 | | Lab 1: Generating Code from ASTs |
|
2/15 | 3.0-3.1, 3.3, 3.5 | Lexical analysis |
|
|
2/18 | | Lexical-analyzer generators |
|
2/19 | 4.0-4.2 | Context-free grammars | HW 1
|
2/21 | | Lab 1 (continued) |
|
2/22 | 4.3 | Writing a grammar |
|
|
2/25 | 4.4.0-4.4.3 | Top-down parsing |
|
2/26 | 4.4.4-4.4.5 | More on predictive parsing |
|
2/28 | | Lab 1 (continued) | HW 1 rewrite
|
2/29 | 4.5 | Bottom-up parsing | HW 2
|
|
3/3 | 4.6 | SLR parser generation |
|
3/4 | 4.7.0-4.7.4 | Canonical LR and LALR parser generation | Lab 1
|
3/6 | 4.8-4.9 | Using ambiguous grammars; parser generators |
|
3/7 | 5.0-5.4.3 | Syntax-directed definitions |
|
|
3/10 | | Lab 2: Scanning and Parsing | HW 2 rewrite, HW 3
|
3/11 | | Lab 2 (continued) |
|
3/13 | | No class |
|
3/14 | | No class |
|
|
3/17 | | Lab 2 (continued) |
|
3/18 | 6.0-6.2 | Intermediate code |
|
3/20 | 6.3 | Types and declarations | HW 3 rewrite, Lab 2
|
|
3/31 | | No class |
|
4/1 | | Lab 3: Adding Variables |
|
4/3 | 6.4, 6.5.2 | Array access; type conversions |
|
4/4 | | Lab 3 (continued) |
|
|
4/7 | 6.6 | Control flow | HW 4
|
4/8 | | Lab 3 (continued) |
|
4/10 | | Preview of lab 4 | Lab 3
|
4/11 | | Lab 4: Control Flow and Scoping |
|
|
4/14 | | Lab 4 (continued) |
|
4/15 | | Lab 4 (continued) | HW 4 rewrite
|
4/17 | 8.0-8.3 | Code generation |
|
4/18 | 8.4 | Basic blocks and flow graphs |
|
|
4/21 | | Preview of lab 5 | Lab 4
|
4/22 | | Lab 5: Procedures |
|
4/24 | 9.0-9.1 | Optimization |
|
4/25 | | Lab 5 (continued) |
|
|
4/28 | 9.2 | Data-flow analysis | HW 5
|
4/29 | | Lab 5 (continued) |
|
5/1 | | Data-flow analysis, continued |
|
5/2 | | Lab 5 (continued) |
|
|
5/5 | 9.5 | Partial redundancy elimination | Lab 5
|
5/6 | | Lab 6: Wildcard Lab | HW 5 rewrite
|
5/8 | 9.3, notes | Foundations of data-flow analysis |
|
5/9 | | Lab 6 (continued) | HW 6
|
|
5/12 | | More on data-flow analysis |
|
5/13 | | Lab 6 (continued) |
|
5/15 | Hack, 1-2 | Interference graphs |
|
5/16 | | Lab 6 (continued) | HW 6 rewrite
|
|
5/19 | Hack, 4.1-4.4 | Register allocation |
|
5/20 | | Synthesis and evaluation | Lab 6
|
Course web site: http://www.gustavus.edu/+max/courses/S2008/MCS-388/
Instructor: Max Hailperin <max@gustavus.edu>