## 编译与静态分析 ### 编译 source code ->scanner(词法分析,正则表达式 ===>tokens) ->parser(语法分析器,context-free grammer ====>AST) ->Type checker(语义检查,type checker====>decoratred AST) ->Translator(IR 三地址码,static Analysis ) ->code generator ->machine code 在通过各类检查后,判断非平凡属性问题,在Translator环节做静态分析。 ### AST VS IR  三地址码IR : 1、包含控制流信息 2、语言无关 3、简洁且统一 更适合静态分析。 
## 编译与静态分析 ### 编译 source code ->scanner(词法分析,正则表达式 ===>tokens) ->parser(语法分析器,context-free grammer ====>AST) ->Type checker(语义检查,type checker====>decoratred AST) ->Translator(IR 三地址码,static Analysis ) ->code generator ->machine code 在通过各类检查后,判断非平凡属性问题,在Translator环节做静态分析。 ### AST VS IR  三地址码IR : 1、包含控制流信息 2、语言无关 3、简洁且统一 更适合静态分析。  soot的jimple IR (typed 3-addressed IR ) 
Difference
Hamlet: Do you see yonder cloud that's almost in shape of a camel?
Polonius: By the mass, and 'tis like a camel, indeed.
Hamlet: Methinks it is like a weasel. Polonius: It is backed like a weasel. Hamlet: Or like a whale? Polonius: Very like a whale. -- Shakespeare
Hamlet: Do you see the cloud over there that's almost the shape of a camel?
Polonius: By golly, it is like a camel, indeed.
Hamlet: I think it looks like a weasel.
Polonius: It is shaped like a weasel.
Hamlet: Or like a whale? Polonius: It's totally like a whale. -- Shakespeare