[antlr-interest] exception thrown in syntatic predicate can't be caught!

martinkbraid mbraid at sqlworks.com
Sun Apr 13 19:06:45 PDT 2003


Because I need to be able to handle garbage characters passed to my 
parser/lexer, I'm doing my own error processing in a top level rule 
by catching ANTLRExceptions. 

By chance, during syntactic predicate processing, the lexer 
encounters a garbage character and throws a TokenStreamException. But 
because inputState.guessing > 0 (because it was in a syntactic 
predicate), my exception handler does NOT get control and the 
exception passes out of the parser. What do I do? It would be 
impossible to avoid syntatic predicates?

Thanks, Martin Braid


 

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




More information about the antlr-interest mailing list