BU CAS CS 525
Compiler Design and Implementation
Semester: Spring 2009

Course Information

  • Instructor: Hongwei Xi (email: hwxi AT cs DOT bu DOT edu)
  • Instructor's Office: MCS 172
  • Instructor's Office Hours: T: 4-6; W: 2-3; by appointments
  • Grader: TBA
  • Lecture Times: Tuesday & Thursday 2:00-3:30 PM
  • Classroom: PSY B51, 64-72-86 Cummington Street
  • Midterm Exam is a one-and-one-half hour in-class exam scheduled on Thursday, March 5, 2009
  • Final Exam is a two-hour exam officially scheduled on Thursday, May 7, 2009, from 9 to 11AM
  • Overview

    Compiler Design and Implementation is a course that introduces students to some basics in the design and implementation of compilers. In this course, we are to teach the theory behind various components of a compiler and the programming techniques involved to put the theory into practice. ATS is the chosen languauge for implementation. However, with the consent of the instructor, a student may choose another functional programming language he or she is familiar with. We plan to cover the first part, that is, the first twelve chapters of the following textbook by Andrew Appel:

    Textbook

  • Modern Compiler Implementation in ML by Andrew W. Appel. ISBN 0-521-58274-1. Cambridge University Press.
  • Reference Books

  • Introduction to the Theory of Computation, by Michael Sipser. ISBN 0-534-95651-3. PWS Publishing Company, 20 Park Plaza, Boston, MA 02116.
  • ATS/Anairiats: User's Programming Guide (pdf)
  • ML for the Working Programmer by Lawrence C. Paulson. ISBN 0-521-57050-6 (hardback) and 0-521-56543-X (paperback). Cambridge University Press.
  • Elements of ML Programming by Jeffery D. Ullman. ISBN 0-13-790387-1. Prentice-Hall.
  • Prerequisites

  • Familiarity with programming in general.
  • CS320 (Concepts of Programming Languages)
  • Programming Languages

  • Standard ML of New Jersey (meta language)
  • ATS (meta language)
  • Logistics

  • Syllabus (ps)(pdf)
  • Schedules
  • Guidelines for Homework Submission (ps) (pdf)
  • How to use gsubmit to submit homework?
  • Archived Messages(new!)
  • Slides

  • Introduction (ppt) (ps)
  • Parsing Combinators (ppt) (ps)
  • Notes

  • A Crash Course on SML (ps) (pdf)
  • A session on using Standard ML.
  • Code

  • calc-2009-01-15.dats
  • calc-2009-01-17.dats
  • calc-2009-01-29.dats
  • DFA_example1.dats
  • DFA_example4.dats
  • grammar.sats and grammar.dats
  • grammar_example_3_10.dats
  • grammar_example_3_12.dats
  • grammar_example_3_15.dats
  • A parsing combinator package: parcomb
  • An example of parsing with parsing combinators: lambda_example.dats
  • A Tiger compiler written in ATS: TIGERATS (tgz)
  • Mailing List

  • The class mailing-list is cascs525a1-l@bu.edu. Please find information on using the mailing-list here.
  • Class Calendar

  • Class begins on Thursday, January 15, 2009
  • No Class. Substitute Monday Schedule of Classes Tuesday, February 17, 2009
  • Midterm Exam is a one-hour in-class exam scheduled on Thursday, March 5, 2009
  • Spring Recess Saturday, March 7, through Sunday, March 15, 2009
  • No Class. Substitute Monday Schedule of Classes Thursday, April 23, 2009
  • Last Day of Instruction, Thursday, April 30, 2009
  • Study Period, May 1 - 4, 2009
  • Final Exam is a two-hour exam officially scheduled on Friday, May 8, 2009, from 9 to 11AM
  • Assignments

  • Assignment 1 (ps) (pdf) (Due on Tuesday, the 27th of January, 2009)
  • Assignment 2 (ps) (pdf) (Due on Tuesday, the 3rd of February, 2009)
  • Assignment 3 (ps) (pdf) (Due on Thursday, the 19th of February, 2009)
  • Assignment 4 (ps) (pdf) (Due on Thursday, the 5th of March, 2009)
  • Assignment 5 (ps) (pdf) (Due on Thursday, the 19th of March, 2009)
    symbol.sml  expressions.sml
  • Assignment 6 (ps) (pdf) (Due on Thursday, the 26th of March, 2009)
  • Assignment 7 (ps) (pdf) (Due on Thursday, the 2nd of April, 2009)
  • Assignment 8 (ps) (pdf) (Due on Thursday, the 9th of April, 2009)
  • Assignment 9 (ps) (pdf) (Due on Thursday, the 16th of April, 2009)
  • Assignment 10 (ps) (pdf) (Due on Thursday, the 23th of April, 2009)
  • Assignment 11 (ps) (pdf) (Due on Thursday, the 30th of April, 2009)
  • Solutions

    Examination