[antlr-interest] How To: Tree Rewrite when there is an OR operator

Alexandre Porcelli porcelli at uol.com.br
Sun Oct 22 12:25:42 PDT 2006


Hi all,

I´d like to know from you how to rewrite a tree when we have this situation:


groupByClause
        :       'GROUP' 'BY' ('INPUT' 'SEQUENCE'| expression (','? expression)*)
        ;

I tried this one:

groupByClause
        :       'GROUP' 'BY' ('INPUT' 'SEQUENCE'| expression (','? expression)*)
        -> 'GROUP' 'BY' ('INPUT' 'SEQUENCE'| expression+)
        ;

But I got the following message:

syntax error: antlr: SQLDLI.g:172:37: expecting RPAREN, found '|'

How to solve this?

Thanks in advance,
Alexandre Porcelli


More information about the antlr-interest mailing list