Loading ...
Sorry, an error occurred while loading the content.

3946Re: [antlr-interest] RFC: defaulterrorhandler [WAS: Re: how do i skip unmatched characters?]

Expand Messages
  • Stdiobe
    Jul 4, 2001

      > Could you subclass the generated lexer and override nextToken() to
      > implement your exception catching?

      I have thought about that idea, but due to the large number of lexers that
      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).

    • Show all 19 messages in this topic