2012-01-09: You can use this old sample exam
to see what kind of questions to expect. However there is no guarantee that the old exam
covers all the material that will be included in this year's exam. It also may contain material that was not covered this year in class.
2011-12-09: Task description for assignment 7 published.
2011-12-09: Assignment 7 will be presented during the last half of the lecture on Monday, Dec 12.
2011-11-28: Compiler fragment for Assignment 6 (CD1_A6) published. Please check your svn repositories.
2011-11-26: Assignment 6 will be presented in class on Monday, Nov 28, at 10:15 am.
2011-11-18: Next office hours for Assignment 5: Monday, November 21, 10:15-12:00 in RZ H3. Note that there are no office hours on Friday, November 25!
2011-11-17: Code review sessions will take place during recitations on Nov 18.
2011-11-14: Grades for Assignment1 (CD1_A1) published. Please check the 'GRADE' file in your svn repositories.
2011-11-09: Compiler fragment for Assignment 5 (CD1_A5) published. Please check your svn repositories.
2011-11-09: Task description for Assignment 5 available. The assignment and some hints will be presented on Thursday, Nov 10, at 10:15 am.
2011-10-17: Task description for Assignment 3 available. The review will take place on Friday, Nov 18, from 1:15 - 4:00 pm. Check your email for the review location.
2011-10-18: Compiler fragment for Asssignment 2 (CD1_A2) published. Please check your SVN repositories.
2011-10-17: Task description for Assignment 2 available (fragment will follow soon). Assignment 2 will be explained in class on Thursday (Oct 20).
2011-10-14: The next recitation session will be on Thursday (20th October) during the first half of the lecture. Monday will be a lecture as usual.
2011-10-11: Lecture slides of September, 29: full version available.
2011-10-10: Typo in task description for Assignment 1 corrected.
2011-10-10: Next office hours: Friday, October 14, 13:15-16:00 in RZ H2.
2011-09-29: Compiler fragment for Asssignment 1 (CD1_A1) published. Please check your SVN repositories
2011-09-28: Task description for Assignment 1 available (fragment will follow soon). Assignment 1 will be explained during class on 10/3.
2011-09-22: First meeting of class (there is no lecture on 9/19).
2011-09-18: Team registration on-line.
Please register your team until Wednesday, September 28.
2011-09-18: Web site on-line.
Course overview
This course uses compilers as example to expose modern software development techniques and
introduces the students to the fundamentals of compiler construction. Students will
implement a simple yet complete compiler for an object-oriented programming language for a
realistic target machine. Students will learn the use of appropriate tools (parser
generators); the implementation language is Java. Throughout the course, students learn to
apply their knowledge of theory (automata, grammars, stack machines, program
transformation) and well-known programming techniques (module definitions, design
patterns, frameworks, software reuse) in a software project.
The course covers: Compiler organization. Lexical analysis. Top-down parsing via recursive
descent, table-driven parsers, bottom-up parsing. Symboltables, semantic checking. Code
generation for a simple RISC machine: conditionals, loops, procedure calls, simple
register allocation techniques.
Course schedule
Lectures are given
- Mondays 10:15 - 11:55
- Thursdays 10:15 - 11:55.
in IFW A32.1 .
The rooms for the recitation sessions will be announced later. Some of the lecture hours will be devoted to other activities (tutorials, reviews, etc) or will be devoted to group meetings. Please watch this page for updates and announcements.
Tentative schedule of lectures
This is a plan. No plan survives contact with reality.
Assistants
| Stephanie Balzer, RZ H 7 |
| Michael Pradel, RZ H 3 |
| Faheem Ullah, RZ H 2 |
Questions
To answer questions and discuss problems that you may encounter we offer office hours as well as a mailing list. These are:
- Office hours: on Fridays, 13:15 -- 16:00 in RZ H 2 or RZ H 3
- Mailing list: cd1 at lists.inf.ethz.ch
Please stick to the office hours and send technical questions only to the mailing list (and not directly to any of the assistants). Otherwise, make an appointment with one of the assistants.
Assignments are an important part of the course. You will not learn this
material from listening to a lecture alone -- you have to do the
assignments.
Note: Do not hesitate to write on the mailing list or make an appointment with your TA if you have trouble with the assignments!
Some of the assignments ask you to extend a compiler skeleton implemented in Java. Any code fragments are distributed via subversion. Your solutions to the assignments must be submitted via subversion as well.
Once you have registered a team, a directory will be made for you.
The URL for your team is:
https://svn.inf.ethz.ch/svn/trg/cd_students/2011hs/teams/<YourTeam>. You should log
in with your nethz log in and password. If there are any problems
please contact a TA immediately.
| Week |
Assignment |
Out |
Due |
Description |
Solution |
| 0 |
Choice of code generator target architecture |
2011-09-22 |
2011-09-29 |
Assignment 0 |
|
| 1 |
Simple code generator |
2011-10-03 |
2011-10-17 |
Assignment 1 |
|
| 4 |
Generating scanner and parser |
2011-10-20 |
2011-11-07 |
Assignment 2 |
|
| 7 |
SLR Parsing Table |
2011-11-07 |
2011-11-18 |
Assignment 3 |
|
| 7 |
Code Review |
2011-11-07 |
2011-11-28 |
Assignment 4 |
|
| 7 |
Symboltable and semantic check |
2011-11-10 |
2011-11-28 |
Assignment 5 |
|
| 10 |
Code generation |
2011-11-28 |
2011-12-12 |
Assignment 6 |
|
| 12 |
Global optimization |
2011-12-12 |
2011-12-23 |
Assignment 7 |
|
Grading
66% of your grade is determined by homework (various assignments related to
the topic of this course). 33% of the grade is determined by a
written 1 hr exam.
If you need to be away from Zurich during the exam period and cannot
take the written exam, please contact the instructor by Nov
15. Depending on the number of exchange/visiting students, we may offer
an alternative written exam in mid December.
List of computer rooms with Linux installed
- Computer rooms of D-INFK: CAB H 56, CAB H 57
- Computer rooms of ETH: HG D13, HG E26.1
Resources
- Language desciption of Javali [pdf]
- JLex: A Lexical Analyzer Generator for Java
- CUP Parser Generator for Java
- Intel, IA-32 Manuals
- Further information related to Java (in German).
- Books:
- Alfred V. Aho, Monica Lam, Ravi Sethi, Jeffrey D. Ullman,
Compilers: Principles, Techniques, and Tools (2nd Edition), Addison-Wesley 2007
(Deutsche Ausgabe: Addison-Wesley Deutschland 1988).
- Steven Muchnick,
Advanced Compiler Design and Implementation, Morgan Kaufmann Publishers, 1997.
- Erich Gamma, Rechard Helm, Ralph Johnson, John Vlissides, Design Patterns - Elements of Reusable Object-Oriented Software , Addison-Wesley 1994.
- Steve McConnell,
Code Complete: A Practical Handbook of Software Construction
, Microsoft Press, 2004.