title: ANTLR - accessing token values in c/c++
body: <p>I am trying to parse integers and to access their value in antlr 3.2.</p>
  
  <p>I already found out how to do this in Java:</p>
  
  <pre><code>//token definition
  
  INT :  '0'..'9'+;
  
  //rule to access token value:
  
  start : val=INT           {Integer x = Integer.valueOf( $val.text ).intValue(); }
  
  ;
  </code></pre>
  
  <p>... but I couldn't find a solution for this in C/C++. Does someone know how to do this?</p>