[antlr-interest] Re: Problem with x: (A)(B)? ;

lgcraymer lgc at mail1.jpl.nasa.gov
Wed Feb 25 10:52:21 PST 2004


If (B)* works, then so should ( B | ).  That may solve your immediate problem.

--Loring


--- In antlr-interest at yahoogroups.com, "dotlessbraille" <easjolly at i...> wrote:
> I really appreciate your trying to help but request you to please 
> look at the generated Java. I understand that ANTLR will put in a 
> test for an EOF if I don't put one in.  However, this test is at the 
> highest level of alternatives.
> 
> The problem I am encountering is that ANTLR interprets the (B)? as 
> requiring either a B or an EOF directly after the A.  In other 
> words, it won't handle the case where there are two A's.  It works 
> fine if I use x:A(B)* which isn't what I want, however. 
> 
> startRule :
>       (x:A(B)? 
>       |b:B  
>       |eof:EOF 
>       );



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list