編譯器設計概論
Intro. to Compiler Design
| 節 | 週二 | 週四 |
|---|---|---|
3 10:10–11:00 | 編譯器設計概論 EC114 2 節連堂 | |
4 11:10–12:00 | ||
7 15:30–16:20 | 編譯器設計概論 EC114 |
* 根據陽明交大上課時間表所列
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.
- 地點
- EC332B
- 時間
- 星期二 1:20-3:10 PM.
- 聯絡方式
- office phone: 56614, email: wuuyang@cs.nctu.edu.tw