校際選修

115-1 選課時程

進行中

  • 初選第一階段 6/15/2026
  • 初選第二階段 6/22/2026
  • 校際選修 8/24/2026
  • 初選第三階段 8/31/2026
  • 開學後加退選 9/7/2026
  • 逾期加退選 9/21/2026
選課資源

編譯器設計概論

Intro. to Compiler Design

學期
106-1
學分
3 學分
當期課號
1210
永久課號
DCP4529
開課單位
資訊學院共同課程
授課教師
楊武、荊宇泰
校區
光復
類別
必修
上課時間表
週三
週五
3
10:10–11:00
編譯器設計概論
ED117
2 節連堂
4
11:10–12:00
7
15:30–16:20
編譯器設計概論
ED117

* 根據陽明交大上課時間表所列

概述

This course is an introduction to development tools for embedded systems. Our focus will be on the compiler construction, from the most basic to some introduction to optimization, object code format, and some topics related to embedded systems. In the introduction to the design and implementation of compilers for an imperative language, we will study various components in a compiler, including scanners, parsers, symbol tables, semantic analyzers, and code generators, and the overall organization of a compiler. In the scanners, we will study regular expressions and the transformation of a regular expression into a deterministic finite state machine. In the parsers, we will study LL and LR parsing methods and the construction of various parsing tables. There are many tools that can generate scanners and parsers from formal specifications. We will also study these tools and use them to generate the scanner and parser for our project. We will study and implement the code generation components of a compiler. The symbol tables are a data structure shared by most components in the compiler. We will study how to process variables, types, expressions, records, arrays, pointers, and simple control structures. Procedures and packages will also be studied. Finally, we will study techniques for code generation and local optimization. If time permits, we will study global optimization techniques in compilers. This course will include an integrated programming project. We will give you a detailed specification of a simplified language that is very similar to Ada. It will be our target language. We will also supply the documents of a scanner generator and of a parser generator. A target language and its simulator will also be provided. You will implement a scanner, a parser, and other components used to generate code for a hypothetical machine. To help you make progress, we will set three check points during the semester and a final demonstration at the end of the semester. You will need to finish a scanner, a parser, and a primitive code generator at the checkpoints, respectively. At the end of the semester, you will need to show (off) a complete compiler that generate code for the hypothetical machine. We will provide a simulator for the machine to run your object code. In the project, you will need to implement a minimum set of features, which will be announced later in the class. If you implement extra features, you will earn extra points.

先修科目

programming, data structure

教學方式

http://www.cs.nctu.edu.tw/~wuuyang/Lecture/lecture.compiler.html

評分方式

期中考(30%) 期末考(30%) 程式作業 (40%)

課程大綱
  • introduction
  • a simple compiler
  • scanning and its implementation
  • parsing
  • basic code generation
  • Java and JVM
週次計畫
週次主題
第 1 週chapter 1 introduction
第 2 週chapter 3 scanning and its implementation
第 3 週chapter 2 a simple compiler
第 4 週chapter 4 grammars and parsing
第 5 週chapter 5 Top-Down Parsing
第 6 週chapter 6 Bottom-Up Parsing
第 7 週chapter 6 Bottom-Up Parsing
第 8 週chapter 7 Syntax-Directed Translation
第 9 週Midterm exam chapter 7 Syntax-Directed Translation
第 10 週Double dispatch Chapter 8 Symbol Tables and Declaration Processing
第 11 週chapter 9 Semantic Analysis
第 12 週chapter 9 Semantic Analysis
第 13 週chapter 10 Intermediate Representations
第 14 週Code Generation for expressions
第 15 週Code generation for functions and procedures
第 16 週code generation for exceptions
第 17 週code generation for exceptions
第 18 週final examination
教科書

C.N. Fischer, R.K. Cytron, and R.J. LeBlanc, Jr., Crafting a Compiler, Addison-Wesley, 2010.

Office Hours
地點
EC332B
時間
星期二 1:20-3:10 PM.
聯絡方式
office phone: 56614, email: wuuyang@cs.nctu.edu.tw