title: Antlr parsing numbers problem
body: <p>I have a problem parsing integer &amp; hex numbers. I want to parse C++ enums with the following rules:</p>
  
  <pre><code>grammar enum;
  
  rule_enum
  :   'enum' ID '{' enum_values+ '}'';';
  
  enum_values
  :   enum_value (COMMA enum_value)+;
  
  enum_value
  :   ID ('=' number)?;
  
  number  :   hex_number | integer_number;
  
  hex_number
  :   '0' 'x' HEX_DIGIT+;
  
  integer_number
  :   DIGIT+;
  
  fragment
  HEX_DIGIT : ('0'..'9'|'a'..'f'|'A'..'F') ;
  
  fragment
  DIGIT   :   ('0'..'9');
  
  COMMA   :   ',';
  
  
  ID  :   ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*;
  </code></pre>
  
  <p>The problem I have is the following - when parsing code like:</p>
  
  <pre><code>enum Enum
  {
      Option1 = 0,
      Option2 = 1
  };
  </code></pre>
  
  <p>it does not recognize the 0 as integer_number but tries to parse it as hex_number. How can I resolve this?</p>
  
  <p>Thank you.
  Tobias</p>