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

學期
114-1
學分
0 學分
當期課號
515609
永久課號
CSCS10012
開課單位
資訊工程學系
授課教師
游逸平
校區
光復
類別
選修
上課時間表
週二
2
09:00–09:50
編譯器設計概論
EC122(光復)
3 節連堂
3
10:10–11:00
4
11:10–12:00

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

概述

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. Course Objectives: (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.

先修科目

You are assumed to be a C programmer.

備註

無備註

教學方式

Course website and TAs will be announced in the first week of the semester.

評分方式

1學期作業 The course involves a significant programming project - implementing a compiler for a simple programming language. The project will build the compiler as a series of phases and you must keep pace with the project in order to be successful in this course. The project draws heavily on much of what you have learned thus far and will stretch your programming skills. You are free to choose the language you will use for the programming project. You will be assigned to generate code for RISC-V processors. The penalty for late homework is 15% per day (weekends count as 1 day). Late homework will not be accepted after the solutions have been posted. There will be NO CREDIT given for plagiarism. 2.考試狀況 Midterm and Final Exam 3.評量方法 Midterm Exam 25% Final Exam 25% Course Projects 50%

課程大綱
  • Introduction

    - Course introduction - Overview of compilers, phases of a compiler

    講授:
    3
  • Lexical analysis, scanning

    - Regular expressions, lex/flex, start on FSA - How lex works, NFAs, DFAs

    講授:
    9
    實作:
    3
  • Syntax analysis, parsing

    - Context free grammars, ambiguity - Yacc/Bison introduction, top-down parsers - Top-down parsers, intro to bottom-up parsers - Bottom-up parsers - LR parsing

    講授:
    15
    實作:
    3
  • Context-Sensitive Analysis

    - Syntax-directed definitions, intro to semantic analysis - Type checking

    講授:
    6
    實作:
    3
  • Runtime environments

    - Symbol tables - Stack/heap managemen

    講授:
    6
  • Code generation

    - Generating code for RISC-V assembly code

    講授:
    6
    實作:
    3
週次計畫
週次主題
第 1 週

Introduction

2025-09-02(二)
第 2 週

Regular and Context-Free Languages, Lexical Analysis

2025-09-09(二)
第 3 週

Lexical Analysis, Lex - The Lexical-Analyzer Generator

2025-09-16(二)
第 4 週

Context-Free Grammar, Top-Down Parsing

2025-09-23(二)
第 5 週

Top-Down Parsing, Bottom-Up Parsing

2025-09-30(二)
第 6 週

Bottom-Up Parsing

2025-10-07(二)
第 7 週

Bottom-Up Parsing, Yacc - The Parser Generator

2025-10-14(二)
第 8 週

Midterm Exam

2025-10-21(二)
第 9 週

Syntax-Directed Translation

2025-10-28(二)
第 10 週

Syntax-Directed Translation, Intermediate-Code Generation

2025-11-04(二)
第 11 週

Intermediate-Code Generation

2025-11-11(二)
第 12 週

Intermediate-Code Generation, Run-Time Environment

2025-11-18(二)
第 13 週

Run-Time Environment, Code Generation

2025-11-25(二)
第 14 週

Code Generation, Code Optimization

2025-12-02(二)
第 15 週

Code Optimization

2025-12-09(二)
第 16 週

Final Exam

2025-12-16(二)
教科書

Required textbook: Compilers: Principles, Techniques, and Tools (2nd edition), by Aho, Lam, Sethi, and Ullman, Addison Wesley, 2007. Reference book: Lex & Yacc, by Doug Brown, John Levine, and Tony Mason, O'Reilly Media, 1995.

Office Hours
地點
EC532
時間
教師未提供此項資料
聯絡方式
分機56688 ypyou@cs.nycu.edu.tw