[antlr-interest] Grammar Problem

Bogdan Mitu bogdan_mt at yahoo.com
Thu Apr 18 00:16:58 PDT 2002


--- Lloyd Dupont <lloyd at galador.net> wrote:
> I think that changing the top of your lexer to this will soleve your
> problem:
> 
> class TeenyLexer extends Lexer;
> options {
>     k = 3;
> }

k=2 should be enough. The problem is that with default lookahed (1) the
lexer can not choose between '<' and "</".

You will also get a warning in the rule WS, but the lexer will work, because
'\r' '\n' comes before '\r' and '\n' alternatives.

Take a look in the example grammars from ANTLR distribution, you may find
them helpful.

Bogdan


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


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

 

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



More information about the antlr-interest mailing list