[antlr-interest] RecognitionException in antlr3 (FIXED)
Dominique.Duflos at alcatel-lucent.fr
Dominique.Duflos at alcatel-lucent.fr
Tue Sep 25 07:23:46 PDT 2007
Matthew Bowman wrote:
Dominique.Duflos at alcatel-lucent.fr wrote:
> > Add this to the grammar:
> >
> > @rulecatch {
> > }
> > @members {
> > protected void mismatch(IntStream input, int ttype, BitSet follow)
> > throws RecognitionException
> > {
> > throw new MismatchedTokenException(ttype, input);
> > }
> > }
> >
>
What exactly does the @rulecatch { } block do? --Matthew
Well I don't know, I'm a complete beginner. I just found that the
@rulecatch { } block made the parser throw an exception for some of my
input error test cases, but not all of them. Then the overloading of
mismatch() did it for the rest.
--Dominique
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070925/be9acd1d/attachment.html
More information about the antlr-interest
mailing list