This course introduces the fundamental concepts on programming languages, and explain how programs are executed on computers and how a compiler works.
By the end of this course, students will be able to:
1. Explain how programs are executed on computers.
2. Explain, for each component of a compiler, what it is for, how it works, and what algorithms it uses.
3. Implement an interpreter and a compiler for simple programming languages.
interpreter, compiler, parsing, code generation, virtual machine, garbage collection
|✔ Specialist skills||Intercultural skills||Communication skills||Critical thinking skills||Practical and/or problem-solving skills|
Students learn theories and techniques through lectures and obtain programming skills through programming exercises.
|Course schedule||Required learning|
|Class 1||Overview: how is a program executed: interpreters and compilers||Understand how a program is executed|
|Class 2||Lexical analysis: token, regular expression, NFA, DFA||Understand the theory for lexical analysis|
|Class 3||Lexical analysis: programming||Understand how lexical analysis is implemented|
|Class 4||Parsing(1): context-free grammar, BNF, predictive parsing||Understand predictive parsing|
|Class 5||Parsing(2): basic LR parsing||Understand basic LR parsing|
|Class 6||Parsing(3): extensions of LR parsing||Understand extensions of LR parsing|
|Class 7||Parsing: programming||Implement a parser|
|Class 8||Test level of understanding on parsing with exercise problems and overview of the second part of the course||Test level of understanding on parsing|
|Class 9||Virtual machine||Understand the execution of a program by using virtual machines|
|Class 10||Garbage collection||Understand algorithms for garbage collection|
|Class 11||Virtual machine and garbage collection: programming||Touch an implementation of a virtual machine with garbage collection|
|Class 12||Code generation(1): overview, assembly language||Understand the basics of code generation|
|Class 13||Code generation(2): optimization||Understand the standard optimization techniques|
|Class 14||Code generation(3): live variable analysis, register allocation||Know some advanced topics on code generation|
|Class 15||Code generation: programming||Implement a code generator|
Course materials are provided during class.
The following is reference books related to this course.
Modern Compiler Implementation in Java， Andrew W. Appel．
Compilers: Principles, Techniques, and Tools, Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman
Assessment is based on the score of exercises and reports on programming.
Students require the knowledge of automata and context-free grammars.