What's the difference between parse tree and AST?

后端 未结 5 1403
我在风中等你
我在风中等你 2020-11-30 18:38

Are they generated by different phases of a compiling process? Or are they just different names for the same thing?

5条回答
  •  Happy的楠姐
    2020-11-30 19:17

    From what I understand, the AST focuses more on the abstract relationships between the components of source code, while the parse tree focuses on the actual implementation of the grammar utilized by the language, including the nitpicky details. They are definitely not the same, since another term for "parse tree" is "concrete syntax tree".

    I found this page which attempts to resolve this exact question.

提交回复
热议问题