Compiler Design
Spring 2018


General Information

Class time: 2EF5B (Tue. 13:20-15:10 and Fri. 9:00-9:50)
Class location: EC114


  Name     Email     Office hours     Location  
Prof. Yi-Ping You     By appointment EC708


  Name     Email     Phone     Location  
陳博聖 pschen [at] 54745 EC618
蘇意喬 ycsu [at] 54745 EC618
洪語聰 ychong [at] 54745 EC618

You may also mail to Compiler-grad-s18 [AT] All TAs will receive the mail.


This course is intended to explore the principal ideas and techniques of compiler construction. Topics include lexical analysis, syntax analysis including LL and LR parsers, type checking, run-time environments, symbol tables, code generation, and compiler-construction tools.

This course aims to give you a solid foundation in the theory of compiler construction as well as the experience of building a compiler. Much of what you have learned about algorithms and data structures will come to bear as you study and implement the various components of a compiler. In a sense, compiler construction is a showcase for many other disciplines of computer science.


  1. To learn structure of compilers.
  2. To learn basic techniques used in compiler construction such as lexical analysis, top-down and bottom-up parsing, context-sensitive analysis, and intermediate code generation.
  3. To learn basic data structures used in compiler construction such as abstract syntax trees, symbol tables, three-address code, and stack machines.
  4. To learn software tools used in compiler construction such as lexical analyzer generators (Lex), and parser generators (Yacc).
  5. To construct a compiler for a small language using the above techniques and tools.


Programming Languages, Data Structures, and Assembly Language and System Programming

Week-by-week Schedule

Week Lecture Note Assignment
1 Course Introduction & Overview pdf pdf
2 Lexical Analysis I pdf pdf
3 Lexical Analysis II pdf
4 Lex - The Lexical-Analyzer Generator pdf pdf
5 Syntax Analysis: Context-Free Grammar pdf
6 Syntax Analysis: Top-Down and Buttom-Up Parsing pdf
7 Syntax Analysis: Top-Down and Buttom-Up Parsing
8 Syntax Analysis: More LR Parsing / Yacc - The Parser Generator pdf pdf pdf
9 Midterm Exam
10 Syntax-Directed Translation pdf
11 Syntax-Directed Translation / Intermediate-Code Generation pdf pdf
12 Intermediate-Code Generation
13 Run-Time Environment pdf pdf
14 Run-Time Environment
15 Code Generation pdf
16 Control-Flow Analysis and Optimizations pdf pdf pdf
17 Data-Flow Analysis and Optimizations pdf
18 Final Exam


Reference Books

Useful Links & Documents


Grades will be assigned based on These weights are subject to minor variation.

Late Assignment Policy & Honesty Policy