Syllabus - CSE 40243/60243 - Compilers - Spring 2008

Prof. Douglas Thain
Email: dthain at cse dot nd dot edu
Office: 382 Fitzpatrick Hall
Office Hours: Tue 1:45-2:45PM, Wed 2-3PM

TA: Yingxin Jiang
Email: yjiang3 at nd dot edu
Office: 214 Cushing
Office Hours: 4-5PM Mondays, 11-12AM Tuesdays

This class will introduce students to the theory and practice of compilers. Students will construct a working compiler that transforms C into x86 assembly. This project will proceed in four steps, requiring the construction of a scanner, parser, type checker, and code generator. More theoretical topics will be explored in lectures and written assignments and evaluated in exams.

This will be an exciting and very challenging course for advanced undergraduates as well as graduate students. Compilers cover a broad array of topics in computer science, ranging from the abstract theory of automata to the very practical details of assembly languages. In addition, students will gain experience with tools and techniques for software engineering. Students completing this course will gain a broad range of skills valuable in both the job market and in graduate studies.

Prerequisites

  • Programming skills in C and at least one assembly language.
  • Data structures. (CSE 30331)
  • Computer architecture I. (CSE 30321)
  • Required Textbook

  • V. Aho, R. Sethi, & J. D. Ullman, Compilers-Principles, Techniques, and Tools, Addison-Wesley, second edition, 2007.
  • Recommended Reading

  • Fischer and LeBlanc, Crafting a Compiler in C, Benjamin/Cummings, 1991.
  • Kernighan and Ritchie, The C Programming Language, Prentice Hall, 1988.
  • Intel Corp, IA-32 Intel Architecture Software Developer's Manual, Volumes 1-3, 2004. Digital and hard copies can be obtained at no charge from http://www.intel.com/products/processor/manuals
  • Course Goals

    1. Discuss the role and limitations of the compiler in a computer system. (Midterm, Final)
    2. Create and analyze finite state automata for lexical analysis. (Project 1, Midterm, Homework 1)
    3. Create and analyze parsing algorithms for common catetgories of grammars. (Project 2, Midterm, Homework 2)
    4. Apply type theory to find bugs in compiled programs. (Project 3, Midterm and/or Final)
    5. Create and analyze trivial and pattern-matching code generators. (Project 4, Final)
    6. Understand and apply basic optimization techniques. (Final)
    7. Employ standard tools to create scanners, parsers, and code generators. (Projects 1, 2, and 4)
    8. Construct a complete working compiler for a small language. (Projects)

    Course Web Page:http://www.cse.nd.edu/~dthain/courses/cse40243/fall2008
    Assignments, announcements, and other critical information will be posted to the course web page. Students are responsible for checking the page periodically for new material.

    Course Mailing List: http://listserv.nd.edu/archives/cse40243-01-fa08.html
    Announcements and discussion of course projects will take place on the course mailing lists. All students are responsible for keeping a valid email address on file with the registrar and checking new messages regularly

    Attendance

    Students are expected to attend all class meetings and exams, and turn in all assignments before the due date and time. Exceptions will only be made for the grave circumstances outlined in the duLac student life handbook. Students who must be absent due to participation in a University activity must confer with the instructor at the earliest possible date.

    Grading

    All assignments are due at the beginning of class on the date due. Late assignments will receive no credit. This includes assignments submitted after class has begun.

    Paper assignments should be brought to class. Programming assignments will be turned in electronically by copying all required files to a "dropbox" directory. You are free to turn in assignments multiple times before the deadline expires. It would be a good habit to turn in an incomplete but working assignment on a daily basis. Thus, there is no excuse for failing to turn in an assignment: everyone should turn in something long before the deadline. Exceptions will be made only in grave circumstances.

    For each assignment, a numeric grade will be assigned. Throughout the semester, students will be advised of their numeric grades and the class average. At the end of the semester, number grades will be converted to letter grades.

    If a student believes that an error has been made in grading an item, it must be brought to the attention of the TA within seven days after the item has been returned. Factual and clerical errors will be cheerfully corrected. Matters of judgement are left to the TA's discretion. The student may appeal any decision to the instructor, but it is very unlikely for the instructor to over-rule the TA's decisions.

    Grades will be weighted as follows:
    Homeworks 20
    Projects 50
    Midterm 15
    Final 15

    Collaboration

    All exams, homeworks, and programming assignments are to be completed alone.

    You may exchange general advice and assist other classmates with debugging localized problems. However, each student must write their own code from scratch. Copying code from other sources is expressly prohibited. If you are not sure whether a certain activity would be considered "advice" or "copying", then you should assume that is not permitted.

    You must read and abide by the Academic Code of Honor.