[antlr-interest] funny error message
Micke Hovmöller
micke.hovmoller at gmail.com
Wed Feb 13 01:09:19 PST 2008
On Feb 13, 2008 3:39 AM, Darien Hager <darien.hager at etelos-inc.com> wrote:
>
> Well, with hindsight it looks like a pretty good error message.
>
> I guess it might hinge on the definition of "unreachable" or what component
> is doing the reaching. Two possible quick interpretations of the message:
>
> This token cannot be reached...
> 1) ...because it is an orphan not used by any parser rules.
> 2) ...because other lexer tokens will always match first.
>
> I think I might assume explanation #1, just from reading the error message,
> while it appears to be #2 that is happening.
I have stumbled upon this as well, and I also mistakenly assumed that
the error message referred to case 1, when in fact it did refer to
case #2.
I don't know if case #2 will be caught and reported, and if so, if it
gives the same error message. My suggestion would be to change the
error message to text #2 specifically. If #1 is caught, the message
should be different. (Maybe that is already the case?)
(Bad or incomplete error messages bothers me more than it should. I
can still get upset thinking about Oracle's classic "wrong number or
types of arguments". What lazy fool decided to save half an hour of
development time merging two separate errors into one?)
/Micke
More information about the antlr-interest
mailing list