[antlr-interest] Why is this nondeterminism

mzukowski at yci.com mzukowski at yci.com
Tue Jun 18 09:27:09 PDT 2002


Something is probably calling eventStatement somehow?  Also what is the type
rule?

Consider this input:

EVENT IDENT LPAREN IDENT RPAREN

it's having a tough time knowing if LPAREN IDENT RPAREN should match the
optional part of eventStatement or something that follows from something
calling eventStatement.  By default it will match in eventStatement.  If
that is the desired behavior then you can turn the warning off with an
option.  This is similar to the if/else problem which there must be a FAQ
for...

Monty

> -----Original Message-----
> From: Trey Spiva [mailto:Trey.Spiva at embarcadero.com]
> Sent: Tuesday, June 18, 2002 9:16 AM
> To: 'antlr-interest at yahoogroups.com'
> Subject: [antlr-interest] Why is this nondeterminism
> 
> 
> I am receiving the errors:
> 
> warning: nondeterminism upon
> k==1:LPAREN
> k==2:IDENT
> k==3:IDENT,RPAREN,"as"
> between alts 1 and 2 of block
> 
> for the following rules.  Can any one give me an idea of
> why the rules are nodeterministic.
> 
> eventStatement
>    : "event" IDENT ( LPAREN eventArgListDef RPAREN )?
>    ;
> 
> protected 
> eventArgListDef
>   : argumentModifiers IDENT ( "as"  type )?
>   ;
> 
> argumentModifiers
>   :  ( argumentModifier )*
>     {#argumentModifiers = #(#[MODIFIERS,"MODIFIERS"], 
> #argumentModifiers);}
>   ;
> 
> protected 
> argumentModifier
>    : "optional"
>    | "byval" 
>    | "byref"      
>    ;
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list