[antlr-interest] Understanding the "the following token definition is unreachable" warning
Terence Parr
parrt at cs.usfca.edu
Mon Jun 9 23:54:12 PDT 2008
Hi Lloyd, please use fragment not protected.
Ter
On Jun 10, 2008, at 7:15 AM, Lloyd Dupont wrote:
> In ANTLR v3.0 I just started to create a new grammar (I'm using
> ANTLR works 1.0)
> Here is the whole grammar file:
> ====
> grammar SIPGrammar;
>
> options
> {
> language=CSharp;
> output=AST;
> }
>
> message : LWS+;
>
>
> LWS : (WSP* CRLF) => (WSP* CRLF) WSP+
> | WSP+;
> protected WSP : ' ' | '\t';
> protected CRLF : '\r\n';
> ====
>
> When I compile it tell me the following warning message:
> ======
> [14:39:47] warning(208): C:\...\SIPGrammar.g:14:11: The following
> token definitions are unreachable: WSP
> ======
> Now, the position 14:11 is just before W in "protected WSP"
> What the heck does that means?
>
> When I try the interpreter everything seems to work out well...
>
More information about the antlr-interest
mailing list