CPSC 371: Compiler Theory and Construction, Spring 1999

Class Time: Tu 6:45-9:15pm
Location: MCEC 246

Dr. Chuck C. Liang
Office: MCEC 343
Office Phone: (860 297) 5395
Designated Office Hours: Monday-Thursday 4-5pm or by appointment
Email: chuck.liang@mail.trincoll.edu


Course Description:

A study of the use of language theory and automata theory in the design and construction of compilers. Topics to be discussed include lexical analysis, parsing, symbol tables, syntax trees, storage allocation, error recovery, translation systems, code generation and optimization. Students will practice programming (in Java) by writing a working compiler of limited scale for a subset of ALGOL, Pascal, or some other language.
Prerequisite: CPSC 215L and at least one of CPSC 230, 219 or 316.

Required Text: "Modern Compiler Implementation in Java " by Andrew Appel.

Reference Material:

Class Web Page: http://www2.trincoll.edu/~cliang/c371/


Tentative Schedule and List of Topics:

  1. Overview of the Structure of a Compiler;
    Regular Languages and Finite Automata
  2. JLex; Context Free Grammers;
    Derivation trees, Ambiguous grammers,
  3. Grammer transformations; Predictive parsing
  4. LL, LR, and LALR parsing
  5. Java Cup Grammer Specifications; error handling
  6. Interpreters; Building parse trees
  7. Symbol Tables and Environments; Type Checking
  8. CPU cycle overiew; intermediate code generation
  9. SPARC architecture and Assembly language programming
  10. SPARC Code Generation
  11. Implementing Static Scoping; Runtime stack
  12. Code optimazation; register allocation
  13. Implementing Object Orientation and other Advanced Features


Exams, Assignments and Grading:

There will be approximately one programming assignment per week. Some written assignments will also be given. There will be a midterm exam and possibly a final. The grade distribution will be roughly 60% programming assignments and 40% written homeworks and exams.

All material handed in must be in hard copy, and be well organized and legible. Unreadable material will not be graded. Consultation of outside sources (books, web material) for completion of assignments must be pre-approved. Late assignments will not be accepted.

Attendance: Attendance is required due to the schedule and nature of the course.

A Note on Collaboration:

Students are expected to write their own programs. No code sharing is allowed. Code sharing include, but is not limited to, looking at someone else's code, copying and pasting text, writing code together, telling a friend what to type over the phone, and debugging a friend's program. Students are allowed to converse and share ideas, as long as no actual exchange of code is involved. For example, "I used an array to represent the symbol table; the size of the array is determined by a parameter to the constructor" is borderline acceptable. Anything more specific would be considered code sharing.

Final Note:

Because of the advanced nature of the course, students may be expected to learn certain topics and techniques on their own. Those who have not taken CPSC 230 and/or CPSC 219 may need extra effort to keep up. This course does not teach basic programming and OS skills. A high level of intellectual dedication is required.

The contents of the this syllabus may be modified according to the progress of the course.