[antlr-interest] funny error message
Jim Idle
jimi at temporal-wave.com
Thu Feb 14 08:51:05 PST 2008
From: Daniels, Troy \(US SSA\) [mailto:troy.daniels at baesystems.com]
Sent: Thursday, February 14, 2008 7:28 AM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] funny error message
_____
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Jim Idle
Sent: Wednesday, February 13, 2008 12:45 PM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] funny error message
From: Darien Hager [mailto:darien.hager at etelos-inc.com]
Sent: Tuesday, February 12, 2008 6:40 PM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] funny error message
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.
The lexer and parser are not connected. The lexer just has to
tokenize and does not care if the consumer (which may not be a
parser) knows about the token.
However, I can see "...because it is an orphan not used by any lexer
rules. " While this lexer grammar is valid, it's likely not what the
user intended.
A: B;
fragment B: 'B';
fragment C: 'C';
C isn't unreachable in sense #2, but it won't ever be used
Except for:
A: B
( ‘C’ { $type = C; }
|
);
I understand what people are asking for, but it gets into the realm
where ‘fixing’ something for once person would be braking it for others.
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080214/6547c189/attachment-0001.html
More information about the antlr-interest
mailing list