[antlr-interest] Understanding the "the following token definition is unreachable" warning

Lloyd Dupont ld at galador.net
Mon Jun 9 22:15:57 PDT 2008


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...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080610/6aace05d/attachment.html 


More information about the antlr-interest mailing list