[antlr-interest] Unreachable alternatives problem...

Aravinda Dassanayake aravinda777 at gmail.com
Thu Dec 20 06:42:50 PST 2007


Hi everybody,

I'm working on  a C# grammar to create a complexity calculation tool,
and I'm getting the following warning when a grammar check is done.

[12:05:42] Checking Grammar...
[12:05:44] warning(201): C_Sharp_warning_rem.g:45:28: The following
alternatives are unreachable: 1,2

[12:05:44] warning(208): C_Sharp_warning_rem.g:2047:1: The following
token definitions are unreachable:
DELIMITED_COMMENT,SINGLE_LINE_COMMENT,IDENTIFIER_OR_KEYWORD,DECIMAL_DIGITS,­INTEGER_TYPE_SUFFIX,HEX_DIGIT,REAL_TYPE_SUFFIX,SINGLE_CHARACTER,SIMPLE_ESCA­PE_SEQUENCE,HEXADECIMAL_ESCAPE_SEQUENCE,UNICODE_ESCAPE_SEQUENCE,REGULAR_STR­ING_LITERAL,SINGLE_REGULAR_STRING_LITERAL_CHARACTER,VERBATIM_STRING_LITERAL­,SINGLE_VERBATIM_STRING_LITERAL_CHARACTER,QUOTE_ESCAPE_SEQUENCE,NULL_LITERA­L


Could you please enlighten me on what exactly is meant by saying that
alternatives are unreachable as above, and how to get over them?

FYI, in my case I have glbal backtracking = true for the moment to
avoid a load of other warnings.

A quick response is highly appreciated.

Regards,
Aravinda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20071220/e96052dd/attachment-0001.html 


More information about the antlr-interest mailing list