[antlr-interest] lexer state ?

Lloyd Dupont lloyd at galador.net
Wed Apr 17 21:22:51 PDT 2002


> is there in ANTLR some kind of Lexer state ?
> I mean, I want, in case of parsing error, to skip all text up to the endof
line and resume
> my parsing next line.
> how to do that ?

I solve it using the following rule ?
is it a good idea (I mean will it stay stable with further evolution ?)

//------------------------------------------------
skipLine
{
  while(LA(1) != NEWLINE)
    consume();
}:
  NEWLINE
  ;
//------------------------------------------------



 

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



More information about the antlr-interest mailing list