305372 Compiler Construction

Academic Year 2008, Semester 2

Overview

Typically compilers translate programs in source language (usually programming language) to equivalent programs in another language (usually machine language).  Although, we hardly develop the entire compiler nowsaday.  The concept of language translating embedded in other applications; for instance, input validation, string matching, etc.

Objective

In this course, students should be able to
  1. create an emulator for a hypothetical computer
  2. apply the concept of language translation into other context
  3. apply discipline software engineering practices in developing software
  4. use their personal data to improve their personal processes.

Approach

Students will gain the most by getting their hands dirty.  Hence,
  1. Students are required to read the handout before attending each class.
  2. Every two weeks, students are required to submit a report based on their personal study.
  3. Students must collect their personal data and use these data to improve their performance.
  4. Each week, there will be two sets of quizzes: one to check the understanding the material of the previous week and the other to check student's readiness for the upcoming materials.
  5. Each week, there will be two sets of assignments: one to reinforce the concept learned this week and the other to help prepare for the upcoming topics.

Reference

There is no official textbook for this class; however, the following books are helpful
  1. (PLAI) Shriram Krishnamurthi, Programming Languages: Application and Interpretation, April 26, 2007 version.  The author generously makes the electronic version of the book available for free here.
  2. (CCG) P.D. Terry, Compilers and Compiler Generators: An Introduction with C++, International Thomson, 1997, ISBN 1-85032-298-8.  This book is out-of-print but the author generously made the electronic version of the book available for free here.
  3. (Dragon) Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman, Compilers: Principles, Techniques, and Tools, Addison Wesley, 1986, ISBN 0-201-10088-6.  This book is also known as the Dragon book.
  4. (OOCC) Jim Holmes, Object-Oriented Compiler Construction, Prentice Hall, 1995, ISBN 0-13-192071-5.  This is a book using object-oriented approach to construct a compiler.
  5. (RCC) Christopher Fraser and David Hanson, A Retargetable C Compiler: Design and Implementation, AT&T, 1995, ISBN 0-8053-1670-1.  This is a book using literate programming to create a production-quality retargetable C compiler.
 

Course Outline

The following schedule is tentative only; it may change depending on the circumstances.
Week Topics
1 Introduction to Compiler
2 Automata, Regular Expression, Regular Grammar
3 Context-Free Languages
4 Top-down parsing
5 Bottom-up parsing
6 Attribute Grammar
7 Generating intermediate code I
8 Midterm
9 Generating intermediate code II
10 Optimization
11 Rudimentary Interpreter
12 Laziness
13 Recursion
14 Memory Management
15 What's next
16 Conclusion
17 Final Exam
Note that the above schedule is tentative by nature; it may change at the instructor's discretion.

Evaluation

The course evaluation will be divided equally between examinations and assignments.  The distribution of each half is shown below.
ItemsWeight
Assignments40%
Discussion10%
Quiz10%
Midterm Exam20%
Final Exam20%
Please make sure that you have carefully read and understand the academic policy.

Note that the above description is only tentative; it may change at the instructor's discretion.