I'm receiving a warning when antlr v3.1 compiles on this rule
sentence
:
(CAPITAL_LETTERS_AND_NUMBERS | INT | ANY_WORD )
(
INT
| CAPITAL_LETTERS_AND_NUMBERS
| ANY_WORD
)*;
The warning is:
5:2: Decision can match input such as "CAPITAL_LETTERS_AND_NUMBERS" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
Semantic predicates were present but were hidden by actions.
Decision can match input such as "INT" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
Semantic predicates were present but were hidden by actions.
The reason I'm confused is the grammar which is quite complex passes until I put another subrule in another place in the file that uses sentence as well. It accepts the above rule until this happens which seems strange. I'm looking for hints as to how best to go about debugging and understanding how this could happen?
Thanks, Richard