Title

第6講 編譯器概念

Syllabus

章節大綱

Mini project : Build a calculator
https://github.com/htchen/calculator_tree

 

L6_A
       編譯器概念
       (Concept of compiler)
       詞法分析
       (Lexical Analysis) 
       - lex.c、lex.h,使用函數 : getToken()、advance()、
         match() 和 getlexeme()
 
      - lex.c、lex.h,functions : getToken()、advance()、
        match() and getlexeme())

 

L6_B
       檢查語法
       (Check expression)
       - 剖析樹
       (- Parse tree)
       - 語法樹
       (- Syntax tree)
       -將語法轉成函數
       (- Statements into functions)


L6_C
       檢查語法
       (Check expression)
       - 將語法轉成函數
       (- Statements into functions)
       - 尾端遞迴
       (- Tail recursion)
       計算數值
       (Calculate value)
       - getval()、setval() 和 Symbol table
       (- getval()、setval() and Symbol table)

 

L6_D
       錯誤訊息
       (show error)
       計算數值
       (Calculate value)
       - getval()、setval() 和 Symbol table
       (- getval()、setval() and Symbol table)
       建立Syntax tree
       (build Syntax tree)


陳煥宗教授-程式設計二講義
            
 Teaching Materials