Sorry to repost my question, but I'm very eager to get a response on how to
make the parser bail out (abort) on MissingTokenException.
Any advice?
----- Forwarded Message ----
From: Geoff hendrey <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: Sunday, October 26, 2008 5:02:53 PM
Subject: how to bail on MissingTokenException
Hi,
I recently upgraded to ANTLR 3.1.1.
I want to know how to handle MissingTokenException, so that the paring throws a
RecognitionException when there is a missing token.
My grammar file aready has this:
@members{
protected void mismatch(IntStream input, int ttype, BitSet follow)throws
RecognitionException{
throw new MismatchedTokenException(ttype, input);
}
public Object recoverFromMismatchedSet(IntStream input, RecognitionException e,
BitSet follow)throws RecognitionException{
throw e;
}
}
@rulecatch{
catch(RecognitionException e){
throw e;
}
Can you tell me what to add so that MissingTokenException will throw a
RecognitionException and abort the parsing?
(also, this is a bit of a tangent, but why do you document the ANTLR runtime
API's Java Classes using Doxygen? I find it much harder to read and navigate
than JavaDoc. Are JavaDocs available?)
-geoff
--~--~---------~--~----~------------~-------~--~----~
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