On 03/22/2011 02:11 PM, Ruslan Zasukhin wrote:
> On 3/20/11 1:11 PM, "Matt Fowles" <[email protected]> wrote:
>
> Hi Matt,
>
>> Ruslan,
>
>> Try:
>>
>> query_expression
>> : query_term (( "union" | "except" )^ "all"? query_term)*
>> -> ^(QUERY_EXPRESSION $query_expression)
>> ;
>
> Well, $ not helps. Still same
> error 165 uses rewrite syntax and also an ast operator
>
> As I understand,
> -> is re-write syntax
> ^ is AST operator ...
Sounds like ANTLR is being picky and not letting you mix both AST
construction and rewrite rules in the same production. You *could* try
the following:
query_expression
: qe -> ^(QUERY_EXPRESSION $qe)
;
qe : query_term (( 'union' | 'except' )^ 'all'? query_term)*
;
Now one rule has the AST construction, and the other the rewrite rule.
--
Kevin J. Cummings
[email protected]
[email protected]
[email protected]
Registered Linux User #1232 (http://counter.li.org)
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.