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

Terence Parr parrt at cs.usfca.edu
Tue Dec 2 08:33:08 PST 2003


If you label a token reference and then attach an exception, I think  
you can tell it to do some interesting things like when to consume til  
end of rule (i.e., give up) or don't consume anything and keep going  
(they just forgot a token)...etc...

Ter

On Tuesday, December 2, 2003, at 07:31  AM, Ric Klaren wrote:

> 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/
>
>
>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com link sharing, pure-n-simple




 

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




More information about the antlr-interest mailing list