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

Lubos Vnuk lubos.vnuk at rts.at
Wed Feb 25 03:16:19 PST 2004


Your grammar is obviously for a language where A *must* be followed 
by B or EOF. What else can follow A?

HTH,
Lubos.

--- In antlr-interest at yahoogroups.com, "dotlessbraille" 
<easjolly at i...> wrote:
> Thanks but that's not the problem.
> Try the following.  The generated Java makes sense if
> you change the parser rule to x:(A)(B)*;
> 
> class XParser extends Parser;
> options {
>  buildAST = false;
> }
> startRule :
>       (x       {System.out.println ("x");} 
>       |b:B     {System.out.println ("b");}
>       |eof:EOF {System.out.println ("eof");});
> x:(A)(B)?;
> class XLexer extends Lexer;
> A:'a';
> B:'b';



 
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