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- create an emulator for a hypothetical computer
- apply the concept of language translation into other context
- apply discipline software engineering practices in developing software
- use their personal data to improve their personal processes.
Approach
Students will gain the most by getting their hands dirty. Hence,- Students are required to read the handout before attending each class.
- Every two weeks, students are required to submit a report based on their personal study.
- Students must collect their personal data and use these data to improve their performance.
- 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.
- 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- (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.
- (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.
- (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.
- (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.
- (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 |
Evaluation
The course evaluation will be divided equally between examinations and assignments. The distribution of each half is shown below.Items | Weight |
Assignments | 40% |
Discussion | 10% |
Quiz | 10% |
Midterm Exam | 20% |
Final Exam | 20% |
Note that the above description is only tentative; it may change at the instructor's discretion.