[antlr-interest] AST/rewrite rule question

Ashish asengine at gmail.com
Fri Jan 18 16:44:41 PST 2008


That worked. Of course. Thanks !



On Jan 18, 2008 4:25 PM, Terence Parr <parrt at cs.usfca.edu> wrote:

>
> On Jan 18, 2008, at 3:51 PM, Ashish wrote:
>
> > 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);
>
> try
>
> selectQueries :  (sq+=selectQuery)* -> ^(SELECT_QUERIES $sq+);
>
> Ter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080118/a42dbc45/attachment.html 


More information about the antlr-interest mailing list