COMP 520 Compiler Design
Fall 2005
  (PLEASE NOTE, THIS PAGE HAS BEEN UPDATED TO REFLECT the FALL 2005 VERSION OF THE COURSE. Please refer to the web page weekly to review the course material and to check for updates.)

http://www.cs.mcgill.ca/~nnaeem/520/

Academic Integrity at McGill University

McGill University values academic integrity. Therefore all students must understand the meaning and consequences of cheating, plagiarism and other academic offences under the Code of Student Conduct and Disciplinary Procedures (see http://www.mcgill.ca/integrity/ for more information). A helpful article on how to avoid plagiarism can be found at: http://www.mcgill.ca/integrity/studentguide/.

In terms of this course, part of your responsibility is to ensure that you put the name of the author on all code that is submitted. By putting your name on the code you are indicating that it is completely your own work. If you use some third-party code you must have permission to use it and you must clearly indicate the source of the code.

Announcements:

  • Sept 27, 2005. This is to let you know that the JOOS deliverables for the COMP 520 course ALL have to be done using the C implementation of JOOS (A- Compiler). I was of the view that Laurie used to give students the option of using either Java or C to do these deliverables but it turns out that this is not true. As pointed out by a couple of students a lot of the stuff asked for in the deliverable is either trivial to do in the Java implementation or already done there. So please make sure you are using the flex/bison C implementation of the A- JOOS compiler to work on your deliverable for this friday.
  • Sept 25, 2005.There are some problems for running joos using SableCC3 from Lauries profile (Thanks Ximeng for pointing these out). Kacper has been looking for an alternate place to keep all these tools for easy access.
  • Sept 25, 2005.Instructions on using different tools can be found here. Further information on how to set up JOOS is available in the JOOS section on this webpage.
  • Sept 21, 2005.Kacper has been kind enough to write a crash course on setting up subversion. "You can find the guide, along with (nicer looking) pdf and ps versions at: Kacpers Guide. All COMP-520 students should have access to the repository area on cvs.cs.mcgill.ca. If you don't, send a request to help@cs.mcgill.ca, and be sure to mention your course and group number."(Kacper)
  • Sept 21, 2005.Check the link Groups to find the group number that has been assigned to you. Refer your group id in all correspondence regarding projects with the Instructor or the TAs. Also your submissions of milestones and deliverables should include your group number in the subject line of the email.
  • Sept 13, 2005. TA names have been added to the Teaching Assistants Page. More information will be added here as it becomes available.
  • Sept 13, 2005. When sending emails to the TAs or me please make sure the subject starts with COMP-520. This is to ensure that no emails are lost and that we can reply in a timely manner.
  • Sept, 6, 2005. You can find demo.l here demo.l. First run the lexer on it by issuing the command flex demo.. This makes the file lex.yy.c. Then issue the command gcc lex.yy.c -o demo -lfl. This will create a scanner executable with the name demo. You can run this using the command ./demo. Now test out your scanner. To exit press ctrl-c.
  • First class is Friday, Sept 1, ENGTR 2100, 11:35-12:25. Be sure to come on time.

About this course

Official course description
Philosophy of the course
Availability

People

Lecturer (Nomair A. Naeem)
Teaching assistants

Printed Readings

Course Text (Readings)
Lecture Notes

Deadlines and Important Dates

Deliverables and milestones
Week by Week Schedule
Midterm

Project

The project description
The A- source code (flex/bison/C)
The A- source code (SableCC/Java)
The A+ project
The A+ binary
JOOS examples
JOOS library source
JOOS extern classes

How to run Java and JOOS programs at McGill
How to run Soot at McGill

Project

The project description
Original WIG grammar
Yacc-style grammar, most conflicts solved
Sablecc-style grammar (version 2)
How to run SableCC
WIG examples
How to compile WIG programs

The <bigwig> project
The Mawl project

Peephole contest

Rules and prizes
Results and Winners

Online documentation

The flex scanner generator
The bison parser generator
The SableCC compiler generator
The Java language specification
The Java virtual machine
The Java API documentation

HTML User Guides
CGI Programming
The HTML 4.0 specification
The CGI specification

Under The Hood articles:


Week by week

Week 1: Introduction

   September 2005
 S  M Tu  W Th  F  S
            1   2  3  
                *

Slides, 4-on-1

Exercises

Reading 1: Louden, Chapter 1

Students who do not have a background in regular languages and finite state automata should review this material on their own. A good online resource may be found here . This review should be done ASAP.

Week 2: Scanners and parsers

   September 2005
 S  M Tu  W Th  F  S
 4  5  6  7  8  9  10 
    H     *     *
Note that Monday, September 5, is a holiday, no lectures. Note that there are 4 readings for this week. Use your holiday wisely.

Slides, 4-on-1

Exercises

Reading 2: Appel, Chapter 2
Reading 3: Flex

Reading 4: Louden, Chapter 3
Reading 5: Appel, Chapter 3.2-3.5

Week 3: Abstract syntax trees and SableCC

   September 2005
 S  M  Tu W  Th F  S
11 12  13 14 15 16 17
    *     *     * 

Slides, 4-on-1
SableCC Slides

Code for tiny expressions

Exercises

Reading 6: Bison
Reading 7: SableCC, Gagnon, Chapters 3-6

WIG milestone: form groups and begin planning

Week 4:

   September 2005
 S  M Tu  W Th  F  S
    *     *     * 
18 19 20 21 22 23 24 

Slides, 4-on-1

Exercises

WIG milestone: Use your group's chosen toolset on a Tiny example

Week 5:

    September 2005
 S  M Tu  W Th  F  S
25 26 27 28 29 30 
    *    *      *

    October 2005
 S  M Tu  W Th  F  S
                   1  

Slides, 4-on-1

Exercises

JOOS deliverable: benchmark programs
JOOS deliverable: comments and desugaring

Reading 8: HTML
Reading 9: CGI

Week 6: Symbol tables

    October 2005
 S  M Tu  W Th  F  S
 2  3  4  5  6  7  8 
    *     *     *

Slides, 4-on-1

Exercises

WIG milestone: CGI vs. WIG

Reading 10, Louden, Chapter 6.3

Week 7: Type checking

    October 2005
 S  M  Tu  W Th  F  S
 9 10  11 12 13 14 15 
    H     *     *
Note that Monday, October 10, is a holiday, no lectures.

Slides, 4-on-1

Exercises

WIG milestone: scanner and parser

Reading 11, Louden, Chapter 6.4

Week 8: Virtual machines

    October 2005
 S  M  Tu  W Th  F  S
16 17  18 19 20 21  22 
    *      *    **
             (midterm)

Slides, 4-on-1

Exercises

WIG milestone: symbol tables

midterm

This year it is a closed book midterm

Week 9: Code generation

   October 2005
 S  M Tu  W Th  F  S
23 24 25 26 27 28 29 
    *     *    *

Slides, 4-on-1

Exercises

WIG milestone: type checking

Week 10: Optimization

   October 2005
 S  M Tu  W Th  F  S
30 31
    *    

   November 2005
 S  M Tu  W Th  F  S
       1  2  3  4  5  
          *     *    

Slides, 4-on-1

Exercises

JOOS deliverable: stack limits

Week 11: Garbage collection

   November 2005
 S  M Tu  W Th  F  S
 6  7  8  9  10 11 12 
    *     *     *

Slides, 4-on-1

Exercises

Reading 12, Appel, Chapter 13

Week 12: Native code generation

   November 2004
 S  M Tu  W Th  F  S
13 14 15 16 17 18 19 
   **     *     *
  (PEEP)

Slides, 4-on-1

JOOS deliverable: peephole patterns

Note the deadline on MONDAY!

Week 13: Static analysis

   November 2004
 S  M Tu  W Th  F  S
20 21 22 23 24 25 26 
   *      *    * 

Slides, 4-on-1

Reading 13: Appel, Chapter 10

Week 14: Presenting your compilers

   November 2004
 S M   Tu  W Th  F  S
27 28  29 30
   ***    ***

   December 2004
 S  M Tu  W Th  F  S
             1  2  3  
               ***
Wig compiler and report due on Monday by noon
(Group meetings will be scheduled on Wednesday and Friday)
(No lectures)

Meetings of Groups

WIG deliverable: compiler
WIG deliverable: report

Maintained by Nomair A. Naeem Last modified Thu Sep 1 14:01:37 EDT 2005. [HOME]