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

Bart Kiers bkiers at gmail.com
Thu Mar 3 14:22:00 PST 2011


Hi,

2011/3/3 Juan Manuel Cámara <juanmcam at gmail.com>

> ...
> 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? ...
>

_You_ need to tell how the tree looks like.

See: http://www.antlr.org/wiki/display/ANTLR3/Tree+construction
<http://www.antlr.org/wiki/display/ANTLR3/Tree+construction>And/or:
http://stackoverflow.com/questions/4931346/how-to-output-the-ast-built-using-antlr

<http://stackoverflow.com/questions/4931346/how-to-output-the-ast-built-using-antlr>
Regards,

Bart.


More information about the antlr-interest mailing list