title: Token Aliases in Antlr
body: <p>I have rules that look something like this:</p>
  
  <pre><code>INTEGER           : [0-9]+;
  field3     : INTEGER COMMA INTEGER;
  </code></pre>
  
  <p>In the parsed tree I get an List called INTEGER with two elements.</p>
  
  <p>I would rather find a way for each of the elements to be named.</p>
  
  <p>But if I do this:</p>
  
  <pre><code>INTEGER  : [0-9]+;
  DOS      : INTEGER;
  UNO      : INTEGER;
  field3     : UNO COMMA DOS;
  </code></pre>
  
  <p>I still get the array of INTEGERs.</p>
  
  <p>Am I doing it right and I just need to dig deeper to figure out what is wrong?</p>
  
  <p>Is there some kind of syntax to alias INTEGER as UNO just for this command (that is actually what I would prefer)?</p>