Hi Paul, don't use ! and ->.  Just remove ! here and life is good.
Ter
On Feb 11, 2009, at 2:22 PM, Paul McKee wrote:

>
>
> Hello:
>
> I'm a Newbie to ANTLR and I hope someone can offer me some advice.  
> I'm trying to create a T-SQL Parser with output as an AST. I have:
> options {
>  backtrack=true;
>  output=AST;
> }
> Lines 410 and 411 of the grammar file are:
>
> fromClause  :
>  FROM! tableSource
>  ( COMMA! tableSource )* -> ^(FROM tableSource)+
>  ;
>
> And this generates the error mesages:
>
> [21:43:33] error(165): Z:\tsql\Tsql_a1.g:410:2: rule fromClause alt  
> 1 uses rewrite syntax and also an AST operator
> [21:43:33] error(165): Z:\tsql\Tsql_a1.g:411:4: rule fromClause alt  
> 1 uses rewrite syntax and also an AST operator
>
> However, when I split this into two rules as follows:
>
> fromClause
>  : fromClause1 -> ^(FROM fromClause1);
> fromClause1  :
>  FROM! tableSource
>  ( COMMA! tableSource )*  ;
>
> Then it all works fine.
> I am using the latest version of ANTLRworks.
> Any help or ideas would be much appreciated.
>
> Best Regards
>
> Paul McKee
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus  
> signature database 3846 (20090211) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address


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
-~----------~----~----~----~------~----~------~--~---

Reply via email to