This project has moved and is read-only. For the latest updates, please go here.
1
Vote

Irony Question

description

Irony includes two phases. In the first phase it create a parser tree. After that its optional to create a AST tree. What are the differences between the parse tree and the AST tree? What is the reason to implement that?

comments

designer0023 wrote Dec 20, 2016 at 4:52 PM

Irony includes two phases. In the first phase it create a parser tree. After that its optional to create a AST tree. What are the differences between the parse tree and the AST tree? What is the reason to implement that?

rivantsov wrote Dec 20, 2016 at 6:06 PM

see here
http://stackoverflow.com/questions/5026517/whats-the-difference-between-parse-tree-and-ast

parsing tree is the same as concrete syntax tree (CST)
as an example, if we build compiler for .NET languages, VB and c# would have different CSTs, but the same AST; so when building compilers for both, it makes sense to build two parsers (VB-CST-AST) and (c#->CST-AST), and then common module (AST-> optimization -> IL or machine codes)