[antlr-interest] How to get the complete syntax tree

Juan Manuel Cámara juanmcam at gmail.com
Thu Mar 3 14:10:12 PST 2011


Hi,
I`m new for ANTLR, and have this trouble:
I implemented a simple mathematical expression parser, similar to the
example in the page,
I need to work with the generated AST, so I added the option output=AST to
the grammar.
The Parser works fine, but its return is a flat tree, all tokens are childs
of the root.

Is this the normal use?
Can someone guess what I'm doing wrong, or tell me the way to get the
complete tree?
If the question is so basic, and large to respond, any reference will be
welcome too...

Thanks!

Juan Manuel


More information about the antlr-interest mailing list