title: Is "Implicit token definition in parser rule" something to worry about?
body: <p>I'm creating my first grammar with ANTLR and ANTLRWorks 2. I have mostly finished the grammar itself (it recognizes the code written in the described language and builds correct parse trees), but I haven't started anything beyond that.</p>
  
  <p>What worries me is that every first occurrence of a token in a parser rule is underlined with a yellow squiggle saying "Implicit token definition in parser rule".</p>
  
  <p>For example, in this rule, the <code>'var'</code> has that squiggle:</p>
  
  <pre><code>variableDeclaration: 'var' IDENTIFIER ('=' expression)?;
  </code></pre>
  
  <p>How it looks exactly:</p>
  
  <p><img src="https://i.stack.imgur.com/orrJY.png" alt="enter image description here"></p>
  
  <p>The odd thing is that ANTLR itself doesn't seem to mind these rules (when doing test rig test, I can't see any of these warning in the parser generator output, just something about incorrect Java version being installed on my machine), so it's just ANTLRWorks complaining.</p>
  
  <p><strong>Is it something to worry about or should I ignore these warnings? Should I declare all the tokens explicitly in lexer rules?</strong> Most exaples in the official bible <a href="http://pragprog.com/book/tpantlr/the-definitive-antlr-reference" rel="noreferrer">The Defintive ANTLR Reference</a> seem to be done exactly the way I write the code.</p>