[antlr-interest] AST and Parse Tree

Alexandre Porcelli porcelli at uol.com.br
Wed Oct 24 05:42:43 PDT 2007


It is the default behavior, if you want a real tree... you will need
to use, at least, the "^" operator.

On 10/24/07, Simone Tripodi <simone.tripodi at gmail.com> wrote:
> 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