[antlr-interest] AST and Parse Tree

Simone Tripodi simone.tripodi at gmail.com
Wed Oct 24 05:39:18 PDT 2007


Hi Alex,
thank you very much, I tried it but I obtained a flat tree where all
tokens are leaf of a 'nil' root.
Do you have thought about it?
Thanks in advance,
Simone

2007/10/24, Alexandre Porcelli <alexandre.porcelli at gmail.com>:
> When you declare the option AST, you have that.
>
> options{
>         output=AST;
> }
>
> Ps: using AST rewriting you can remove same unnecessary element from
> AST (ex: commas, parenthesis, etc...) and enclose logical statements
> in a real tree.
>
> Regards,
> Alexandre Porcelli
>
> On 10/24/07, Simone Tripodi <simone.tripodi at gmail.com> wrote:
> > Hallo everybody,
> > does it is possible to have an AST that reflects the parse tree,
> > without rewriting any AST rule?
> > Thanks in advance,
> > Simo
> >
>


More information about the antlr-interest mailing list