Winter 2006-2007 Compiler Construction 0368-3133


Quick Facts

News

Schedule

Recitations

Project

Resources

Quick Facts

Instructor: Shmuel (Mooly) Sagiv [Instruction page]
Teaching Assistant: Roman Manevich
Programming assignments grader: Eli Haham
Course forum

Course number Time Location
0368-3133-02 Wednesday, 10:00-11:00 Shenkar (Physics) 222
0368-3133-03 Tuesday 12:00-13:00
Wednesday, 11:00-12:00
Shenkar (Physics) 204
Shenkar (Physics) 222
0368-3133-04 Wednesday, 15:00-16:00 Schreiber 008
TA office hours Wednesday, 16:00-17:00
Please coordinate before arriving.
Schreiber open space (basement), tel. 5358

News

  • 11/9/2007: Note that the date for 'Moed bet' exam is 14/10/07 (9:00 AM).
  • 25/7/2007: The final grades of all students have been passed to the secretary and should be available to you soon. For the two teams that have issues with PA4/PA5, your grades will be updated after taking into account any updates for the assignment grades.
    The formula for computing the grades is the following:
    FINAL = 0.45*EXAM + 0.05*TA1 + 0.05*PA1 + 0.11*PA2 + 0.12*PA3 + 0.12*PA4 + 0.1*PA5.
  • 24/6/2007: PA5 grades are now available for 18 out of the 26 teams. Hopefully, the grader has the rest of the grades soon. Please let me know if you find any mistakes.
  • 8/5/2007: PA4 grades are now available. Please let me know if you find any mistakes.
  • 6/3/2007: The PA5 deadline has been extended to April 4.
  • 22/2/2007: PA3 grades are now available. Please let me know if you find any mistakes.
  • 18/2/2007: Mooly will give a special class on this Monday at Melamed auditorium on 16:00 (instead of 14:00).
  • 2/1/2007: TA1 grades are now available. The assignments are in a large brown envelope in my mailbox (268). See the link to the solution below.
  • 12/1/2007 PA2 grades are now available. Please let me know if you see an error (e.g., due to changes in teams).
  • 2/1/2007: There is a full day strike this Wednesday (3/1/2007). However, there is still a class tomorrow, 2/1/2007. Please see the forum for information about alternative hours.
  • 31/12/2006 Early publication of PA4. This is still subject to changes (until Tuesday).
  • 26/12/2006 PA1 grades are now available.
  • 24/12/2006: The deadline for PA3 has been extended by one week to 3/1/2007.
  • 22/12/2006: Additional information regarding scope rules is now available in the language specification.
  • 17/12/2006: No recitations this week (December 19-20). See you next week.
  • 4/12/2006: The deadline for PA2 has been extended by one week to 13/12/06.
  • 24/11/2006: There is a mistake in questions 3/4 of the theoretical assignment. Please see the revised assignment.
  • 22/11/2006: There is a mistake in the second question of the theoretical assignment. Please see the revised assignment.
  • 21/11/2006: This Tuesday 12:00-13:000 there is a strike and thus no studies. Therefore, just this week, we will reschedule recitation class CS0368-3133-03 to Wednesday 11:00-12:00. The class will take place at the Shenkar physics building, room 222.
  • 12/11/2006: We arranged to allow project teams who wish it to have CVS repositories. More information was sent by the mailing lists and posted in the forum.
  • 11/11/2006: We suggest that the CLASSPATH environment variable includes all three .jar files needed for JFlex and JavaCup: java-cup-v11a.jar/java-cup-v11a-runtime.jar/JFlex.jar (and the current directory: .)
  • 10/11/2006: Please note the exact directory structure for programming assignment 1.
  • 4/11/2006: Please note the change in day and hour of recitation class 0368-3133-03.
  • 4/11/2006: PA1 contains a mistake. The token type for the 'string' keyword is STRING and the token type for quoted strings is QUOTE. The PDF file and sample outputs have been updated.
  • 25/10/2006: Current project teams. Please check that your details were entered correctly.

Schedule

Assignment Published Due Weeks
Split into teams 25/10/06 1/11/06 1
PA1 Lexical analysis [code skeleton]
[Quicksort.ic] [Quicksort.tokens.txt]
[Sieve.ic] [Sieve.tokens.txt]
[Quicksort_bad.ic] [Quicksort_bad.tokens.txt]
The directory structure of the submission is shown here.
1/11/06 15/11/06 2
PA2 Syntax analysis and AST construction [code skeleton]
The directory structure of the submission is shown here.
libic.sig.
15/11/06 6/12/06
13/12/06
4
TA1 Theoretical assignment 1. (Fixed version.) [solution]. 15/11/06 6/12/06 3
PA3 Semantic analysis [FAQ]
[Example of symbol table printout] NOTE: this is a suggestion.
The example was created manually and may contain bugs.
5/12/06 27/12/06
3/1/2007
4
PA4 Intermediate representation [FAQ]
LIR and microLIR documentation version 1.3
microLIR simulator version 1.4
2/1/2007 24/1/2007
31/1/2007
4
PA5 Code generation [FAQ]
Supporting materials
23/1/2007 ≥14/3/2007
4/4/2007
≥7
Final Exam
First term (Moed Aleph) 21/02/07 (9:00 AM)
Second term (Moed Bet) 23/09/07 14/10/07 (9:00 AM)
Exams from previous years
Another relevant link.

Recitations

Date Topic Material
T1 25/10/06 Project overview and IC language [slides] [printer friendly version]
T2 1/11/06 Lexical analysis (scanning) [slides] [printer friendly version]
T3 7/11/06 Syntax analysis (parsing) [slides] [printer friendly version]
T4 14/11/06 Parsing with CUP + AST construction [slides] [printer friendly version]
LR(0) parsing algorithms [slides] [printer friendly version]
CVS introduction [slides] [printer friendly version]
T5 22/11/06 AST construction and traversal [slides] [printer friendly version]
[SLP example]
T6 28/11/06 Scopes and symbol tables [slides] [printer friendly version]
T7 6/12/06 Type-checking [slides] [printer friendly version]
T8 12/12/06 Semantic analysis recap + IR part 1 [slides] [printer friendly version]
T9 26/12/06 IR part 2 + runtime organization [slides] [printer friendly version]
T10 2/1/07 IR part 3 + activation records [slides] [printer friendly version]
T11 9/1/07 Activation records + introduction to x86 assembly [slides] [printer friendly version]
T12 15/1/07 Code generation + assembling and linking [slides] [printer friendly version]
Optimizing register allocation [slides] [printer friendly version]
T13 23/1/07 Recap [slides] [printer friendly version]

  • If your POWER POINT does not show certain mathematical characters, use these fonts. Make sure to extract to the appropriate directory, or install via the the Control Panel.
  • Slides and extra materials from 2002-2003 course are available here.
    Note: Turkish Coffee is similar but not entirely identical to IC.
  • Slides and materials from the Cornell course are available from here.
  • Slides and materials from last year's course (different project) are available from here.

Project

As part of course you are required to implement a compiler for an object-oriented language which is a simplified version of Java. The project materials are adapted with permission from course materials used by Prof. Radu Rugina at Cornell university.

Project Information

  • The project consists of implementing a working compiler for the IC langauge and x86 assembly.
  • The compiler is to be implemented in Java.
  • Implementation task split into assignments.
  • The project is to be implemented in teams of 2 or 3 students.
  • Your are required to split into teams during the first week of the semester.
  • Your are required to submit all assignments within the same team.
  • All team members will receive the same grade for the assignments.
  • Each team member is required to fully understanding all the code, including parts he/she did not directly work on.
  • Different teams must not share code, but may share ideas
  • Choose one member of the team to be responsible for the "team account": all assignments by a team should be submitted on his/her nova account.
  • Important: send an email to me with the subject "Compilation - new project team", list of members (first name, last name, id, username on nova), and the team-account username (the username of the representative team member).
Here are some useful advices for the project.

Submission Guidelines

  • Assignments should be checked in a directory IC_COMPILER/PA1,...,IC_COMPILER/PA5, according to the assignment number, directly under the team account directory.
  • The assignments will be copied automatically from the team account, on midnight of the submission due day. Directory and file names will be specified for each assignment.
  • The permissions of the entire path from your home directory down to the assignment files themselves should be 705. Make sure we can copy your files, but other students cannot.
  • Your code must compile without warnings.
  • Assignments will be checked both manually and automatically.
  • An automatic checker will run the program on inputs provided with each assignment and additional inputs. The output will be compared to the output of a reference compiler using "diff".
  • Your best bet is to thoroughly test your program on the provided inputs, and make up others of your own until you feel confident in your results. We will not spend a lot of time examining your source and/or giving design feedback. It is not that we don't consider style or design is important, but by now all of you have taken other courses and we hope you have internalized and practice good coding practices as a matter of habit. Thoughtful design and coding will improve your chances of having a correctly working program, too.
  • Please submit assignments on time. If a team member serves in the army during the semester, talk to me before you leave if you need an extension, and present an official confirmation when you are back.

Resources

IC Language

JFlex and JavaCup

Tools

Getting Started with Java