title: attribute references not allowed in lexer actions
body: <p>I found a simple grammar to start learning ANTLR. I put it in the myGrammar.g file. here is the grammar:</p>
  
  <pre><code>grammar myGrammar;
  /* This will be the entry point of our parser. */
  eval
      :    additionExp
      ;
  
  /* Addition and subtraction have the lowest precedence. */
  additionExp
      :    multiplyExp 
           ( '+' multiplyExp 
           | '-' multiplyExp
           )* 
      ;
  
  /* Multiplication and division have a higher precedence. */
  multiplyExp
      :    atomExp
           ( '*' atomExp 
           | '/' atomExp
           )* 
      ;
  atomExp
      :    Number
      |    '(' additionExp ')'
      ;
  
  /* A number: can be an integer value, or a decimal value */
  Number
      :    ('0'..'9')+ ('.' ('0'..'9')+)?
      ;
  
  /* We're going to ignore all white space characters */
  WS  
      :   (' ' | '\t' | '\r'| '\n') {$channel=HIDDEN;}
      ;
  </code></pre>
  
  <p>when I use this command :</p>
  
  <blockquote>
    <p>java -jar /usr/local/...(antlr path)  /home/ali/Destop/...(myGrammar.g path)</p>
  </blockquote>
  
  <p>I have this error:</p>
  
  <blockquote>
    <p>myGrammar.g:39:36: attribute references not allowed in lexer actions: $channel</p>
  </blockquote>
  
  <p>what is the problem and what should I do?</p>