Parsing cache error messages eh?

> -----Original Message-----
> From: [email protected] [mailto:antlr-interest-
> [email protected]] On Behalf Of Joachim Schrod
> Sent: Thursday, November 11, 2010 7:01 PM
> To: [email protected]
> Subject: Re: [antlr-interest] NoViableAlException
> 
> Fabian Haupt wrote:
> >
> > I'm getting a NoViableAltException: line 1:55 no viable alternative
> at
> > input '.[CheckIntegrity'
> >
> > with the input of
> > 'The lower level block specifies a right link block of 0.
> > [CheckIntegrity+343^%SYS.DATABASE:%SYS]'
> > starting with the 'test' rule.
> >
> >
> > this is the grammar:
> > ----------------------------
> > grammar integrit;
> >
> > options {
> >    language= Java;
> > }
> >
> >
> > test:'The lower level block specifies a right link block of '+INT+'.'
> > WS debugnote NEWLINE;
> >
> > firstNodePtrWrong: INT+'. We were expecting it to point to ';
> >
> >
> > debugnote:'['+ID+'+'+INT+'^%SYS.DATABASE:%SYS'+']';
> >
> > ID  :   ('a'..'z'|'A'..'Z')+ ;
> > INT :   '0'..'9'+ ;
> > NEWLINE:('\r'? '\n');
> > WS  :   (' '|'\t')+ {skip();} ;
> 
> Without running it --
> You demand a WS in the test rule that will never appear there as you
> skip that token. Don't you mean NEWLINE there?

This is correct, you are asking for WS that will be skipped, but also, hard
coding the specific message is so long will get you in to trouble I think.
You are probably better off with awk for something like this I think.


Jim


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
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.

Reply via email to