[antlr-interest] Real examples of error recovery
Paul J. Lucas
dude at darkfigure.org
Mon Aug 23 20:34:24 PDT 2004
The examples of doing error handling in the documetation are a
bit... lacking. All the examples do is report errors. I want
to report errors and *recover* from errors.
In my particular case, things are more complicated because the
language (XQuery) is keyword-free. Hence, the lexer itself
maintains what state is in. When a syntax error occurs (for
example, an extra or missing token), the lexer may not be in the
state it needs to be in.
How, from the exception-handler in the parser, I (think) need
to be able to:
1. Determine what tokens the parser would like to see.
and:
2. Force the lexer to abrubtly reset its state to one
that will return the token(s) the parser wants.
Suggestions?
- Paul
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