Introduction to Compiler Design
Fall 2017

Announcement

General Information

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

Instructor

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

TAs

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

You may also mail to Compiler-f17 [AT] sslab.cs.nctu.edu.tw. All TAs will receive the mail.

Overview

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.

Goals

  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.

Prerequisites

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

Textbook

Reference Books

Useful Links & Documents

Grading

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

Late Assignment Policy & Honesty Policy