[antlr-interest] Token Unreachable?

Randall R Schulz rschulz at sonic.net
Mon Nov 13 09:00:36 PST 2006


Hi,

I'm getting this diagnostic from ANTLR:

TSTP.g:1062:1: The following token definitions are unreachable: 
SingleQuoted


These rules refer to SingleQuoted:

name
	:	( AtomicWord )
	|	( SingleQuoted )
	|	( UnsignedInteger )
	;


atomicWord
	:	 AtomicWord
	;


AtomicWord
	:	( LowerWord )
	|	( SingleQuoted )
	;


The parser rules "name" and "atomicWord" are used extensively in the 
grammar. AtomicWord's only allowable first character is a lower-case 
letter. UnsignedInteger's first character must be a decimal digit. 
SingleQuoted starts with a single quote. Thus there is no ambiguity 
between these three lexical rules.

So I don't see why it's telling me SingleQuoted is unreachable.


Randall Schulz


More information about the antlr-interest mailing list