3946Re: [antlr-interest] RFC: defaulterrorhandler [WAS: Re: how do i skip unmatched characters?]
- Jul 4, 2001Matt,
> Could you subclass the generated lexer and override nextToken() toI have thought about that idea, but due to the large number of lexers that
> implement your exception catching?
I (will) have, I considered this to be not very practical.
(I'm developing parsers for several programming languages, each
with multiple dialects, preprocessors, etc., so that will result in a large
number of lexers. I don't want to solve this problem in each (derived)
lexer, although that's still an option.)
I would prefer a solution where ANTLR generates the desired behaviour,
i.e. catch RecognitionExceptions in the nextToken method.
(I know, I could change the Antlr generator, but before I do that, I want
to be sure that I'm not re-inventing the wheel).
- << Previous post in topic Next post in topic >>