I use a ReportError override to handle "flood" messages generated by
some malformed files:
public override void ReportError( RecognitionException e )
{
errorCount++;
if ( canCancelOperation && errorCount >= maxErrors )
throw new OperationCanceledException();
base.ReportError( e );
}
Then I catch the OperationCanceledException in the function that
launches the parser and deal with it appropriately.
Sam
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of harshada gune
Sent: Friday, September 12, 2008 11:49 AM
To: [EMAIL PROTECTED]
Subject: [antlr-interest] how to exit when first parser error occurs
I got this answer for lexer error, but how to exit on parser error?
Thanks and regards,
Harshada.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address