課程資訊
課程名稱
編譯程式設計
Compiler Design 
開課學期
114-1 
授課對象
電機資訊學院  資訊工程學系  
授課教師
洪鼎詠 
課號
CSIE3230 
課程識別碼
902 39200 
班次
 
學分
3.0 
全/半年
半年 
必/選修
選修 
上課時間
星期二6,7,8(13:20~16:20) 
上課地點
資111 
備註
限學士班三年級以上
總人數上限:30人 
 
課程簡介影片
 
核心能力關聯
核心能力與課程規劃關聯圖
課程大綱
為確保您我的權利,請尊重智慧財產權及不得非法影印
課程概述

Overview
Design of a simple compiler
Theory and practice of Scanning
Formal grammars and parsing
Top-down parsing
Bottom-up parsing
Syntax-directed compilation
Declaration processing and Symbol tables
Semantic analysis
Code generation
Program analysis and Optimization 

課程目標
This course is an introduction to compiler design and development. Its focus is on the process and techniques in constructing a compiler, including lexical analysis, parsing, symbol table manipulation, code generation and code optimization. The theory, techniques and algorithms associated with a compiler can be applied to a wide range of problems in software design and development. The goal of this course is to provide students with the essential theory and techniques in building a simple yet complete compiler which generates real ISA (Instruction Set Architecture) code such as the RISC-V.  
課程要求
Students are required to implement a real compiler  
預期每週課前或/與課後學習時數
 
Office Hours
 
指定閱讀
C. N. Fischer, R. K. Cytron, R. J. LeBlanc,
"Crafting a Compiler"
2010
ISBN 10: 0-13-606705-0
ISBN 13: 978-0-13-606705-4

A.V. Aho, M. Lam, R. Sethi, and J.D. Ullman
"Compilers: Principles, Techniques and Tools"
2nd edition, 2007
ISBN 0-321-48681-1 
參考書目
C. N. Fischer, R. K. Cytron, R. J. LeBlanc,
"Crafting a Compiler"
2010
ISBN 10: 0-13-606705-0
ISBN 13: 978-0-13-606705-4

A.V. Aho, M. Lam, R. Sethi, and J.D. Ullman
"Compilers: Principles, Techniques and Tools"
2nd edition, 2007
ISBN 0-321-48681-1 
評量方式
(僅供參考)
 
No.
項目
百分比
說明
1. 
Compiler Implementation 
45% 
 
2. 
Midterm Exam 
25% 
 
3. 
Final Exam 
25% 
 
4. 
Quizzes and Class Participation 
5% 
 
  1. 本校尚無訂定 A+ 比例上限。
  2. 本校採用等第制評定成績,學生成績評量辦法中的百分制分數區間與單科成績對照表僅供參考,授課教師可依等第定義調整分數區間。詳見學習評量專區 (連結)。
 
課程進度
週次
日期
單元主題
第1週
9/02  Introduction 
第2週
9/09  1) Introduction
2) Chapter 2 
第3週
9/16  Chapter 2: AC-DC Compiler Construction
Chapter 3: Scanner 
第4週
9/23  Chapter 3: Scanner
Chapter 4: CFG and Parser 
第5週
9/30  Chapter 5: Top Down Parsing 
第6週
10/07  Chapter 6: Bottom-Up (Shift-Reduce) Parsing 
第7週
10/14  Chapter 7: Syntax Directed Translation 
第8週
10/21  Midterm Exam 
第9週
10/28  Chapter 8: Declaration Processing and Symbol Table 
第10週
11/04  Chapter 8: Type expressions and type equivalence
Chapter 9: Semantic Analysis 
第11週
11/11  Code Generation for RISC-V  
第12週
11/18  Code Generation for Assignments and Expressions.
Simple Register Allocation
Register Convension 
第13週
11/25  Code Generation for Control Structures
Code Generation for Arrays and Procedure Calls 
第14週
12/02  1) Compiler Optimizations: Principles and Basic algorithms
2) Transformations and Analyses 
第15週
12/09  Register Allocation and Code Scheduling  
第16週
12/16  Final Exam