[antlr-interest] 3.0 feature change request re: exceptions

Richard Clark rd_clark at sbcglobal.net
Thu Aug 5 22:42:15 PDT 2004


I've been working on automatic error recovery in my Eclipse editor (read: when the lexer 
chokes, package up the offending character in an error token) and noticed some problems 
with RecognitionException and its children.

In particular, MismatchedCharException and NoViableAltForCharException both deal with 
single-character lexer problems, but duplicate each other's code so I have to write if-
then-else chains using instanceof to tell them apart and extract the mismatched character.

It would be better to do this:
- RecognitionException
-- LexerRecognitionException
--- MismatchedCharException
--- NoViableAltForCharException

and put common getters into LexerRecognitionException, e.g. getFoundCharacter()

That would greatly simplify error processing and still be backward compatible.

 ...Richard




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list