[antlr-interest] Any ready smart recovering from parsing errors?

Ric Klaren klaren at cs.utwente.nl
Tue Dec 2 07:31:42 PST 2003


On Mon, Dec 01, 2003 at 05:27:37PM -0000, Anton wrote:
> It was said, that it is possible to port the code of that Cocktail
> compiler into Antlr? Has anyone tried to do it actually? At least
> anything?
>
> As an alternative, I've seen also some notes about FOLLOW and FIRST
> bit sets, which generally allow "as much as Cocktail does, but with
> even greater flexibility". First of all, can not find these sets :(

These should be available via $FIRST or $FIRST(rulename) and $FOLLOW or
$FOLLOW(rulename). They give the names of the bitsets internally used for
the match/consume/consumeUntil/etc methods. Should be documented in 2.7.2
release notes and runtime.html.

> And the second, it is really great to know that "it is possible", but
> it would be even better to see it working! Any real examples
> (especially for java.g)? Or good detailed descriptions of how to do
> it?

I don't know of any examples. If you grab a copy of the public cocktail
toolbox and check for the docs on the LL(1) parser (ell.ps) it contains a
description of how ell does error recovery and how the sets are calculated.
It might take some hacking to completely implement it since the 'repair'
mode from ell is not present in antlr. Atm I have no clue wether it could be
emulated or not. If you have trouble finding the doc from ell drop me a
line I still have a copy lying about.

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893722  ----
-----+++++*****************************************************+++++++++-------
  "I think we better split up."
  "Good idea. We can do more damage that way."
  --- Ghostbusters


 

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




More information about the antlr-interest mailing list