COMP 520 Compiler Design

Fall 2010

This website is still being updated, but the content is mostly correct.

Please refer to this web page weekly to review the course material and to check for updated links. All class members are encouraged to follow changes to the public_html directory using Subversion; all important announcements will be made in class or via email.

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:

  • A page describing the final was added.
  • The Tiny milestone has been extended until Sunday at midnight!

About this course

Official course description
Philosophy of the course
Availability

People

Lecturer (Jesse Doherty)
Teaching assistants (Soroush Radpour)

Printed Readings

Course text (readings)
Lecture notes

Deadlines and Important Dates

Deliverables, milestones, and exercises
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

How to use Subversion

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 and run WIG services

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 and Scanners

   September 2009
 S  M Tu  W Th  F  S
          1  2  3  4
          *     *

Slides, 4-on-1

Exercises

Reading C1: Louden, Chapter 1
Reading C2: Appel, Chapter 2
Reading O1: Flex

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.

Additionally, all students must read ALL of the material in
Chapters 1 and 2 of Version Control with Subversion.

Week 2: Scanners and parsers

   September 2009
 S  M Tu  W Th  F  S
 5  6  7  8  9 10 11
    H     *     *
Monday, September 7th is a holiday.

Slides, 4-on-1

Exercises

Reading C3: Louden, Chapter 3
Reading C4: Appel, Chapter 3.2-3.5

Week 3: Abstract syntax trees and SableCC

   September 2009
 S  M Tu  W Th  F  S
12 13 14 15 16 17 18
    *     *     * 

Slides, 4-on-1
SableCC Slides

Tiny expression language source code

Exercises

Reading O2: Bison
Reading O3: SableCC, Gagnon, Chapters 3-6

WIG milestone: form groups and begin planning

Week 4:

   September 2009
 S  M Tu  W Th  F  S
19 20 21 22 23 24 25
    *     *     * 

Slides, 4-on-1

Exercises

WIG milestone: Try out each toolset on a Tiny example

Week 5:

   September 2009
 S  M Tu  W Th  F  S
26 27 28 29 30      
    *     *
   
    October 2009
 S  M Tu  W Th  F  S
                1  2
                *

Slides, 4-on-1

Exercises

JOOS deliverable: benchmark programs
JOOS deliverable: comments and desugaring

Reading O4: HTML
Reading O5: CGI

Week 6: Symbol tables

    October 2009
 S  M Tu  W Th  F  S
 3  4  5  6  7  8  9
    *     *     *

Regular Lecture slides: Slides, 4-on-1

Special lecture slides: Slides, 4-on-1

Exercises

WIG milestone: CGI vs. WIG

Reading C5, Louden, Chapter 6.3

Week 7: Type checking

    October 2009
 S  M Tu  W Th  F  S
10 11 12 13 14 15 16
    H     *     *
Monday, October 12th is a holiday.

Slides, 4-on-1

Exercises

WIG milestone: scanner and parser

Reading C6, Louden, Chapter 6.4

Week 8: Virtual machines

    October 2009
 S  M Tu  W Th  F  S
17 18 19 20 21 22 23
    *     *     *

Slides, 4-on-1

Exercises

WIG milestone: symbol tables

Week 9: Code generation

    October 2009
 S  M Tu  W Th  F  S
24 25 26 27 28 29 30
   **     *     *
(midterm)

Slides, 4-on-1

Exercises

WIG milestone: type checking

midterm

Week 10: Optimization

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

Slides, 4-on-1

Exercises

JOOS deliverable: stack limits

Week 11: Garbage collection

   November 2009
 S  M Tu  W Th  F  S
 7  8  9 10 11 12 13
    *     *     *

Slides, 4-on-1

Exercises

Reading C7, Appel, Chapter 13

Week 12: Native code generation

   November 2009
 S  M Tu  W Th  F  S
14 15 16 17 18 19 20
    *    **     *
peephole

Slides, 4-on-1

JOOS deliverable: peephole patterns

Week 13: Static analysis

   November 2009
 S  M Tu  W Th  F  S
21 22 23 24 25 26 27
    *     *    **
             project

WIG deliverable: compiler
WIG deliverable: report

Slides, 4-on-1

Reading C8: Appel, Chapter 10

Week 14: Presenting your compilers

   November 2009
 S  M Tu  W Th  F  S
28 29 30            
    *

   December 2009
 S  M Tu  W Th  F  S
          1  2  3  4
          * **
           final  
Group meetings will be scheduled on Monday and Wednesday.

Maintained by Chris Pickett [HOME]