<html>
<body>
The warning is correct.<br><br>
<font face="Courier New, Courier">ID_ETHERTYPE</font>
<font face="Courier New, Courier" color="#3F7F5F">
</font><font face="Courier New, Courier">:</font>
<font face="Courier New, Courier" color="#2A00FF">'EtherType'</font>
<font face="Courier New, Courier">;<br><br>
</font>can conflict with <br><br>
<font face="Courier New, Courier">T_MACADDR</font>
<font face="Courier New, Courier" color="#3F7F5F">
</font><font face="Courier New, Courier">:S_HEX ...<br><br>
</font>since <br><br>
<font face="Courier New, Courier" color="#DC0000"><b>fragment</b></font>
<font face="Courier New, Courier"> S_HEX
:(</font><font face="Courier New, Courier" color="#2A00FF">'0'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'9'</font>
<font face="Courier New, Courier"> |
</font><font face="Courier New, Courier" color="#2A00FF">'a'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'f'</font>
<font face="Courier New, Courier"> |
</font><font face="Courier New, Courier" color="#2A00FF">'A'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'F'</font>
<font face="Courier New, Courier">);<br><br>
</font>which could be just a single character 'E'<br><br>
Warnings go away if you change S_HEX to<br><br>
<font face="Courier New, Courier" color="#DC0000"><b>fragment</b></font>
<font face="Courier New, Courier"> S_HEX<br>
:(</font><font face="Courier New, Courier" color="#2A00FF">'0'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'9'</font>
<font face="Courier New, Courier"> |
</font><font face="Courier New, Courier" color="#2A00FF">'a'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'f'</font>
<font face="Courier New, Courier"> |
</font><font face="Courier New, Courier" color="#2A00FF">'A'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'F'</font>
<font face="Courier New, Courier">)
(</font><font face="Courier New, Courier" color="#2A00FF">'0'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'9'</font>
<font face="Courier New, Courier"> |
</font><font face="Courier New, Courier" color="#2A00FF">'a'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'f'</font>
<font face="Courier New, Courier"> |
</font><font face="Courier New, Courier" color="#2A00FF">'A'</font>
<font face="Courier New, Courier">..</font>
<font face="Courier New, Courier" color="#2A00FF">'F'</font>
<font face="Courier New, Courier">);<br><br>
</font>(you will need to change other rules accordingly)<br><br>
Using sample input, you can generate the token stream and verify the
actual path the lexer is taking.<br><br>
<br><br>
<br>
At 01:50 AM 5/20/2009, you wrote:<br>
<blockquote type=cite class=cite cite="">Dear ANTLR users,<br><br>
I am a happy (until now) new user of ANTLR. I learned ANTLR from<br>
scratch by reading the &quot;The Definitive ANTLR Reference&quot; book
and<br>
trying to code a configuration file parser with ANTLR 3.1.3.<br><br>
While coding the grammar, I had no problem for converting grammar
into<br>
Java until a certain moment, where I get lots of warnings similar to<br>
&quot;warning(209): TestKO.g:450:1: Multiple token rules can match
input<br>
such as &quot;'T'&quot; : ID_TFTPTIMESTAMP, ID_TFTPMODEMADDRESS,<br>
ID_TESTMODEENABLE, ID_TEKGRACETIME, SNMP_TIMETICKS, T_OID&quot;<br><br>
Typically, with TestOK.g grammar, conversion works. With TestKO.g<br>
grammar, conversion returns warnings (see error.txt file).<br><br>
I can't understand why these warnings are returned as - I think -<br>
there is no errors in my grammar (lots of warning lines are returned<br>
against lines that were unmodified between TestOK and TestKO !).<br><br>
May you have some feedbacks if this is finally a mistake in my
grammar<br>
(any advice is welcome, as I mentionned it is my first experience
with<br>
ANTLR) or is it known problems with ANTLR (I read some threads on<br>
ANTLR interest mailing list with the same warnings, but it seems
this<br>
is not the same situation).<br><br>
Thanks!<br>
Yann<br><br>
Content-Type: text/plain; charset=US-ASCII;
name=&quot;error.txt&quot;<br>
Content-Disposition: attachment; filename=&quot;error.txt&quot;<br>
X-Attachment-Id: f_fuxs4kr41<br><br>
Content-Type: application/octet-stream; name=&quot;TestOK.g&quot;<br>
Content-Disposition: attachment; filename=&quot;TestOK.g&quot;<br>
X-Attachment-Id: f_fuxs4kqq0<br><br>
Content-Type: application/octet-stream; name=&quot;TestKO.g&quot;<br>
Content-Disposition: attachment; filename=&quot;TestKO.g&quot;<br>
X-Attachment-Id: f_fuxs4krf2<br><br>
<br>
List:
<a href="http://www.antlr.org/mailman/listinfo/antlr-interest" eudora="autourl">
http://www.antlr.org/mailman/listinfo/antlr-interest</a><br>
Unsubscribe:
<a href="http://www.antlr.org/mailman/options/antlr-interest/your-email-address" eudora="autourl">
http://www.antlr.org/mailman/options/antlr-interest/your-email-address</a>
</blockquote></body>
</html>