Winter 2007-2008 Compiler Construction 0368-3133


Quick Facts

News

Schedule

Recitations

Project

Resources

Quick Facts

Instructor: Shmuel (Mooly) Sagiv
Teaching Assistant: Roman Manevich
Programming assignments grader: Amit Weinstein
Course forum

Course number Time Location
0368-3133-02 Wednesday, 10:00-11:00 Schreiber 7
0368-3133-03 Wednesday 14:00-15:00 Schreiber 7
0368-3133-04 Wednesday, 15:00-16:00 Schreiber 7
TA office hours Wednesday, 16:00-17:00
Please coordinate before arriving.
Schreiber open space (basement), tel. 5358

News

  • 2/6/2008 Grades for PA3 are now available.
    Please check that your grade and team information are correct.
  • 3/4/2008 Grades for PA2 are now available.
    Please check that your grade and team information are correct.
  • 1/4/2008 I will give a make-up class on April 15, following Mooly's make-up class (13:00) in Ornstein 111, followed by another hour which I will use to prepare for the exam.
  • 16/3/2008 Next week's recitation (March 26) is canceled due to travel abroad.
  • 9/3/2008 Grades for PA1 are now available. No points were reduced for not recognizing '1a' and similar strings as an error. Those who do recognize it got 2 extra points.
    Please check that your grade and team information are correct (especially for those who changed teams).
  • 7/3/2008 For those who missed T7 on Friday, I will repeat T7 on Wednesday 12/3 between 9:10-10:00 at Schreiber 007.
  • 6/3/2008 There will be an extra recitation tomorrow between 9:10-10:00 at Ornstein 111.
  • 6/2/2008 Please check that the project teams information is correct.
  • 30/1/2008 The recitations next week (6/2/2008) are canceled. New time/day/place will be announced.
  • 21/1/2008 Recitations commence on 23/1/2008, same hours, same rooms.
  • 30/10/2007 Tomorrow's recitation (31/10/2007) will not be given. Please follow the information on this web-site and the course mailing list.
  • 6/11/2007 There are no recitations until further notice.

Schedule

Assignment Published Due Weeks
Split into teams 24/10/07 31/10/07 1
PA1 Lexical analysis [code skeleton]
[Line count example]
[Quicksort.ic] [Quicksort.tokens.txt]
[Sieve.ic] [Sieve.tokens.txt]
[Quicksort_bad.ic] [Quicksort_bad.tokens.txt]
The directory structure for the submission is shown here.
30/1/08 13/2/08 2
PA2 Syntax analysis and AST construction [code skeleton]
The directory structure of the submission is shown here.
libic.sig. [FAQ]
20/2/08 12/3/08 3
TA1 Theoretical assignment 1 [solution]. 27/2/2008 --- ---
PA3 Semantic analysis [FAQ]
[example1.ic / -dump-symtab output]
[example2.ic / -dump-symtab output]
12/3/2008 9/4/2008 4
PA4 Intermediate representation [FAQ]
LIR and microLIR documentation version 1.2
microLIR simulator version 1.4
15/4/2008 15/5/2008 4
Bonus assignment: PA5 Code generation [FAQ]
Supporting materials
15/4/2008 ? ?
Final Exam
First term (Moed Aleph) revised exam form with solutions 30/04/2008 (9:00 AM)
Second term (Moed Bet) exam form with solutions 3/10/2008 (9:00 AM)
Exams from previous years
Another relevant link.

Recitations

Date Topic Material
T1 24/10/07 Project overview and IC language [slides] [printer friendly version]
T1' 23/01/08 Refreshing T1 [slides] [printer friendly version]
T2 30/01/08 Lexical analysis (scanning) [slides] [printer friendly version]
T3 13/02/08 Syntax analysis (parsing) [slides] [printer friendly version]
T4 20/02/08 Parsing with CUP + AST construction [slides] [printer friendly version]
LR(0) parsing algorithms [slides] [printer friendly version]
CVS introduction [slides] [printer friendly version]
T5 27/02/08 AST construction and traversal [slides] [printer friendly version]
[SLP example]
T6 05/03/08 Scopes and symbol tables [slides] [printer friendly version]
T7 07/03/08 Type-checking [slides] [printer friendly version]
T8 12/03/08 Semantic analysis recap + IR part 1 [slides] [printer friendly version]
T9 19/03/08 IR part 2 + runtime organization [slides] [printer friendly version]
T10 15/04/08 IR part 3 [slides] [printer friendly version]
T11 15/04/08 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.
  • Material from the 2006 course is available here.
  • Slides and materials from the Cornell course are available from here.
  • Slides and materials the 2005 course is 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 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