2 項進行中

115-1 選課時程

進行中

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

加入行事曆

選擇訂閱 Google Calendar,或下載通用的 ICS 檔案。

使用 Google Calendar 時,Google 會收到這份課表的公開連結。

編譯器設計概論

Intro. to Compiler Design

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

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

概述

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

    introduction to compiler organization

    講授:
    3
  • a simple compiler

    Show a simple compiler.

    講授:
    3
  • scanning and its implementation

    regular expressions

    講授:
    3
    實作:
    6
  • parsing

    grammars and parsing LL(1) grammars and parsers LR parsing

    講授:
    9
    實作:
    9
  • basic code generation

    semantic processing symbol table run-time storage organization processing declarations processing expressions and data struct references translating control structures Translating procedures and functions

    講授:
    33
    實作:
    40
  • Java and JVM

    Java code generation

    講授:
    3
週次計畫
週次主題
第 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