[antlr-interest] Understanding priorities in lexing (newbie)

mail.acc at freenet.de mail.acc at freenet.de
Thu Jul 12 04:31:46 PDT 2007


Hi,
thanks for your quick reply and the detailed information about ANTLR.

> hi. See filter=true mode for lexers.  see fuzzy example in examples- 
> v3 :)
> Ter

> El 12/7/2007, a las 7:59, mail.acc at freenet.de escribió:
> As Ter has already stated, you need a filtering lexer for this.

I didn't want to use filter=true because I need the arbitary input in-between 
the matching token to process. And as far as I understand, in filter=true mode 
unmatched tokens are going to be discarded (and I need them in the 
TokenStream).



> prediction. This may seem counter-intuitive at first but you just  
> have to accept that as a basic premise ANTLR is all about speed and  
> that means no backtracking in the event of an error (unless you  
> explicitly turn it on); 

Does backtracking works in the lexer also?



> To fully understand how all this works you should take a simple  
> grammar like the one you post and look very, very carefully at the  
> generated code. 

Thanks again. I will try to do that.

Beste wishes from Germany
Andreas










More information about the antlr-interest mailing list