[antlr-interest] Re: Real examples of error recovery
Paul J. Lucas
dude at darkfigure.org
Tue Aug 24 10:43:34 PDT 2004
--- In antlr-interest at yahoogroups.com, Ric Klaren <klaren at c...> wrote:
> I assume you're using multiple lexers and a tokenstream selector to
> implement those?
I have two lexers: (1) for "main" XQuery content and (2) for embedded XML content. Yes, I
am using a tokenstream selector.
> Tack something like this after the rule:
>
> rule: .... ;
> exception catch [antlr::RecognitionException &ex] { }
Well, I do still want to report the error.
> You can use the $FOLLOW/$FIRST sets inside the exception
> handler or $FOLLOW(rule) $FIRST(rule) to do calculations outside of a rule.
I've never seen any mention of those. Any documentation or examples?
> There's probably a load of papers available on the net on recovery
> strategies.
I tried a search for 'ANTLR "error recovery"' and didn't find anything interesting.
> consumeUntil(); Check out the CharScanner docs/class definition.
Thanks for the tip.
- 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