Syllabus - CSE 40243 - Compilers - Spring 2006

Prof. Douglas Thain
Email: dthain at cse dot nd dot edu
Phone: 631-6845
Office: 356-D Fitzpatrick Hall
Office Hours: Mon 3-4PM; Thu 11-12 AM or by appointment.

TA: Paul Madrid
Email: pmadrid at cse dot nd dot edu
Office: 222 Cushing
Office Hours: Tuesday 1-2pm & Wednesday 10-11am or by appointment.

Location:
DeBartolo Hall Room 125
9:30-10:45 AM
Tuesdays and Thursdays

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 technical 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

  • C. N. Fisher & R. Leblanc, Jr., Crafting a Compiler in C, Benjamin/Cummings, 1991.
  • References

  • V. Aho, R. Sethi, & J. D. Ullman, Compilers-Principles, Techniques, and Tools, Addison-Wesley, 1986,
  • Louden, Compiler Construction, Principles and Practice, Brooks/Cole, 1997.
  • 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 LL, LR, SLR, and LALR 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/spring2006
    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-sp06.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

    Grading

    All assignments are due at the beginning of class on the date due. Late assignments will receive no credit. (Assignments turned in after class has begun are considered late.) 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.

    Any question or dispute about a graded item should be brought to the attention of the teaching assistant within one week of receiving the item. Of course, any factual or clerical error in grading will be corrected cheerfully. Matters of judgement are left entirely to the TA's discretion. If unsatisfied, students may appeal to the instructor within one week. However, take note that it is highly unlikely that the instructor will overturn the TA's decision. Questions and appeals will not be heard after one week has passed.

    Each graded item will be assigned a numeric score. Students will periodically be informed of their grades, cumulative scores, and class averages. Numeric grades will be assigned to letter grades at the end of the semester. The relative weight of each assignment is as follows:

    Homework One 5
    Homework Two 5
    Scanner 10
    Parser 10
    Semantic Checker10
    Code Generator 10
    Midterm 20
    Final 30

    Collaboration

    All assignments are to be done individually. You must be the sole author of all code and other written material that you submit for grading. You may not read, re-use, or submit code created by others. However, you may discuss general ideas, algorithms, and problems with your classmates. Any activity that falls into the gray area between "authorship" and "discussion" should be assumed off-limits unless explicitly approved by the instructor.

    The midterm and final exams are to be taken alone.

    You must read, understand, and abide by the CSE Department Honor Policy and the University Academic Code of Honor, both available on the web. At key points during the semester, the matter of appropriate collaboration will be discussed in class.

    Any violation of these rules will be considered a very serious matter and will result in a referral to the University honor committee and the appropriate rector and academic advisor. Penalties may include failure of the class and suspension or expulsion from the University.

    Miscellaneous

    Please turn off cell phones during class.