Introduction to Compiler Design
Fall 2017


General Information

Class time: 3CD5G (Wed. 10:10-12:00 and Fri. 15:30-16:20)
Class location: EDB27


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


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

You may also mail to Compiler-f17 [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
3 Lexical Analysis II pdf
4 Lex - The Lexical-Analyzer Generator 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
9 Midterm Exam
10 Syntax-Directed Translation pdf
11 Syntax-Directed Translation
12 Intermediate-Code Generation pdf
13 Intermediate-Code Generation
14 Run-Time Environment pdf
15 Run-Time Environment
16 Code Generation pdf
17 Control-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