title: ANTLR4: get subtoken's type
body: <p>I'm building parser for my grammar using ANTLR4 and want to get type of token inside of a other token if that's possible.
  For example:</p>
  
  <pre><code>NUMBER_LITERAL
      : INT_LITERAL
      | FLOAT_LITERAL;
  </code></pre>
  
  <p>when I want to build AST for such rule I can get that it's <code>NUMBER_LITERAL</code> using <code>Token::getType</code> but if I then want to decide if it's <code>INT_LITERAL</code> or <code>FLOAT_LITERAL</code> I can't seem to find any way to do so.</p>
  
  <p>Is this possible or do I have to create parser rule for <code>NUMBER_LITERAL</code>?</p>