Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IMP » Diagnose parser
Diagnose parser [message #21629] Mon, 23 June 2008 07:25 Go to next message
Eclipse User
Originally posted by: hasanp87.hotmail.com

Pls provide me with more information regarding diagnose parser class.I
need to detect and error but allow further parsing.
Thanks
Re: Diagnose parser [message #22286 is a reply to message #21629] Thu, 03 July 2008 08:33 Go to previous message
Eclipse User
Originally posted by: regenmacher.online.de

"Hasan" <hasanp87@hotmail.com> schrieb im Newsbeitrag
news:4323c0e47cad65c010d42754329827eb$1@www.eclipse.org...
> 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
mode"

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.

michael
Re: Diagnose parser [message #572000 is a reply to message #21629] Thu, 03 July 2008 08:33 Go to previous message
Michael Strothjohann is currently offline Michael Strothjohann
Messages: 52
Registered: July 2009
Member
"Hasan" <hasanp87@hotmail.com> schrieb im Newsbeitrag
news:4323c0e47cad65c010d42754329827eb$1@www.eclipse.org...
> 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
mode"

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.

michael
Previous Topic:Semantic check
Next Topic:lpg update site down
Goto Forum:
  


Current Time: Sun Sep 21 22:17:34 GMT 2014

Powered by FUDForum. Page generated in 0.06476 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software