[antlr-interest] Any known good ways to recover from simple parse errors
Ric Klaren
klaren at cs.utwente.nl
Tue May 14 02:22:54 PDT 2002
Hi,
On Mon, May 13, 2002 at 06:54:24PM +0300, Sander Mägi wrote:
> I am looking for advice on creating a parser that could recover from common
> parsing errors.
>
> What I want to achieve is to modify java parser so that when it hits a
> missing semicolon or unmatching brace error it would mark a construct it
> was working on as invalid and try to detect where the next logical
> construct starts.
>
> Does anyone know if there is public research or samples available on this
> topic or can just offer good advice on how would be best to start with it.
You can try and find the papers on the cocktail toolbox from gmd. They use
a automatic error recovery mechanism that most of the time get's things
right by skipping forward some tokens or by inserting some tokens until a
valid input stream comes into mind. This mechanism should be portable to
antlr. Maybe there's enough info already in the antlr generated parsers to
build this. With custom error handlers. If you can't find the docs mail me
I still have some postscripts lying about....
Cheers,
Ric
--
-----+++++*****************************************************+++++++++-------
---- Ric Klaren ----- klaren at cs.utwente.nl ----- +31 53 4893722 ----
-----+++++*****************************************************+++++++++-------
"I don't have anything against Java - it's the best damn implementation
of UCSD Pascal ever released..." --- Larry Smith
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list