[antlr-interest] AST/rewrite rule question

Ashish asengine at gmail.com
Fri Jan 18 16:03:13 PST 2008


On Jan 18, 2008 3:56 PM, Johannes Luber <jaluber at gmx.de> wrote:

> Ashish schrieb:
> > Hi,
> > If the start rule is specified without any rewrite rules all the queries
> > from the
> > input are parsed and nodes are created for the select queries as
> expected.
> > However if the start rule is modified to use the rewrite rule to create
> > the AST ie
> >
> > from
> >   selectQueries :  (selectQuery)*;
> > to
> >   selectQueries :  (sq+=selectQuery)* -> ^(SELECT_QUERIES $sq);
> >
> > then, only the first query in the file seems to be parsed. The rest seem
> > to be ignored.
> > Test file contents/program/grammar snippet  below.
> >
> > Thanks
> > Ashish
>
> Did you try
>
> selectQueries :  (sq+=selectQuery)* EOF -> ^(SELECT_QUERIES $sq);
>
> ?
>
Yes, I tried that. No luck. :)

-Ashish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080118/013408bd/attachment.html 


More information about the antlr-interest mailing list