|Re: Diagnose parser [message #22286 is a reply to message #21629]
||Thu, 03 July 2008 08:33
Originally posted by: regenmacher.online.de|
"Hasan" <email@example.com> schrieb im Newsbeitrag
> Pls provide me with more information regarding diagnose parser class.I
> need to detect and error but allow further parsing.
Please, be more specific.
DiagnoseParser is called when the parser catches a BadParseException.
If you are interested in error recovery, take a look at
protected RepairCandidate errorRecovery(int token)
in DiagnoseParser.java. ( DiagnoseParser.java is in lpg.runtime )
Error recovery is done in two phases: A primaryPhase and (when primaryPhase
failed)a secondaryPhase. If this secondaryPhase fails we fall into "panic
To learn more about primaryPhase and secondaryPhase: see DiagnoseParser.java
In "Getting Started with LPG" and "Using the LALR Parse Generator" you can
found some short notes about error recovery.
If you are interested in scope orientated error recovery and CS-related
discussion you may also be interested in Philippe Charles (1991) "A
Practical method for Constructing Efficient LALR(k) Parsers with Automatic
Error Recovery" In Appendix E an Example is given.
( http://jikes.sourceforge.net/documents/ )
As I recall P Charles is the one JikesPG-guy.
Powered by FUDForum
. Page generated in 0.02197 seconds