CPSC 124/258: Compiler Construction

Dr. Chuck C. Liang
Associate Professor of Computer Science, Hofstra University .

Office Address:
201A Adams Hall
Hofstra University
Hempstead, NY 11550
Office Phone: (516 463) 5559

Email: cscccl@hofstra.edu (<- click to send me mail)

Official Office Hours: MW 5:30-6:30pm, F 2-3pm or by appointment.

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: CSC 123

Required Text: "Modern Compiler Implementation in Java, 2nd edition " by Andrew Appel.

Reference Material:

Class Web Page: http://www.cs.hofstra.edu/~cscccl/csc124

Tentative Schedule and List of Topics:

  1. Overview of the Structure of a Compiler;
    Regular Languages and Finite Automata
  2. Lexical analysis tools.
  3. Context Free Grammers;
    Derivation trees, Ambiguous grammers,
  4. Grammer transformations; Predictive parsing
  5. LL, LR, and LALR parsing
  6. Java Cup Grammer Specifications; error handling
  7. Interpreters; Building parse trees
  8. Symbol Tables and Environments; Type Checking
  9. CPU cycle overiew; intermediate code generation
  10. Intel x86/64 architecture and Assembly language programming
  11. x86/64 Code Generation
  12. Implementing Static Scoping; Runtime stack
  13. Code optimazation; register allocation
  14. 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. Depending on specific background, students 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.