[antlr-interest] Would somebody help me clarify the difference between AST, Tree Grammars, and Parse Trees?
ANTLR Mailing List
jstpierre-antlr at mecheye.net
Sun Oct 14 15:57:12 PDT 2007
I need a good example/explanation between the difference between tree
grammars, ASTs and Parse Trees.
I see that grammars don't have to be tree grammars to output ASTs.
This is very confusing to me...
For a simple grammar to test:
// Begin Grammar
output = AST;
k = 10;
SEMI = ';';
program : statement *;
: expression SEMI;
INT : ( '0'..'9' ) +;
// End Grammar
When removing "output = AST", I see no difference in the output generated by
When putting "tree " in front of "grammar TestGrammar", it fails and
generates a NullPointerException.
Anybody have an explanation?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest