[antlr-interest] Strange warnings
David Piepgrass
qwertie256 at gmail.com
Sun Jul 1 12:05:44 PDT 2007
I get some warnings related to this rule and I can't see why.
fragment PUNC_CHAR:
('\\' WS_CHAR)=>'\\'
| {input.LA(2) != '*' && input.LA(2) != '/'}? '/'
| (':'|'.'|'~'|'!'|'@'|'$'|'%'|'^'|'&'
|'*'|'-'|'+'|'='|'|'|','|'<'|'>'|'?');
PUNC: PUNC_CHAR+;
This rule says PUNC_CHAR can only match a backslash if it is followed
by a space. So there should be no way PUNC can match input such as
\\\! or \\\/.
Also, what is <EPSILON>?
[12:51:06] warning(209): Boo.g:153:1: Multiple token rules can match
input such as "'\\''\\''\\'{'!', '$'..'&', '*'..'.', ':', '<'..'@',
'^', '|', '~'}": ID, PUNC
As a result, tokens(s) PUNC were disabled for that input
[12:57:14] warning(209): D:\Dev\Loyc\BooLexer\Boo.g:153:1: Multiple
token rules can match input such as "'\\''\\''\\''/'": ID, PUNC
As a result, tokens(s) PUNC were disabled for that input
[12:57:14] warning(209): D:\Dev\Loyc\BooLexer\Boo.g:153:1: Multiple
token rules can match input such as "<EPSILON>": RE_STRING, PUNC
As a result, tokens(s) PUNC were disabled for that input
[12:57:14] warning(209): D:\Dev\Loyc\BooLexer\Boo.g:153:1: Multiple
token rules can match input such as "'\\''\\''\\''\\'": ID, PUNC
As a result, tokens(s) PUNC were disabled for that input
[12:57:14] warning(209): D:\Dev\Loyc\BooLexer\Boo.g:153:1: Multiple
token rules can match input such as "<EPSILON>": RE_STRING, PUNC
As a result, tokens(s) PUNC were disabled for that input
--
- David
http://qism.blogspot.com
More information about the antlr-interest
mailing list