编译原理: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):对翻译进行修饰

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