The AST does not contain all the information from the source, such as parentheses, etc. This information may be present in the concrete syntax tree. A parser may produce either an AST or a concrete syntax tree, based on ruled defined (?)?
ANTLR's AST processing is pretty powerful. We can write tree grammar, which will generate a tree parser which can contain custom actions, or String template output statements.
In some implementations the parsing stage may not produce an AST at all. We may build custom actions, which could be performed in the parsing stage.
No comments:
Post a Comment