編譯原理:Introduction

1.1 語言處理器

  1. 如何實現語言?
  • Interpreter 解釋器(用“is”的方法解釋程序,幾乎沒有預處理)
    source code + input —interpreter—> output
  • compilers 編譯器(特點是有預處理)
    source code —compiler—> machine code(target code)
    input —target code—> output
  • hybrid compilers(如java)
    source code —translator—> intermediate program(bytecode)
    intermediate program(bytecode) + input —virtual machine—> output
    language-processsing system

1.2 編譯器結構

the phases of compilers
詞法分析(lexical analysis):單詞拼寫是否正確?
語法分析(syntax analysis):句子語法結構是否正確
語義分析(semantic analysis)+ 中間代碼生成(intermediate code generate):分析句子語義,初步翻譯生成中間代碼
優化(optimizer):對翻譯進行修飾

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章