title: Parsing different range integers in Xtext?
body: <p>I'm new in xText, I installed a couple of days ago and this may look like a simple question but I haven't find a solution yet and I've being looking over Google a lot.</p>
  
  <p>Basically I want to define an Assembly custom language.</p>
  
  <p>Here's what I'm defining:</p>
  
  <pre><code>grammar org.comp.language.ASAWriter with org.eclipse.xtext.common.Terminals
  
  generate aSAWriter "http://www.comp.org/language/ASAWriter"
  
  ASAWriter :
  (ModeloASA += Instructions)* 
  ;
  
  
  Instructions:
      readInteger|readSmallInteger|readMediumInteger
      ;
  
  readMediumInteger:
      'RMI' Register '-' MEDIUMINT ';'
  ;
  
  readInteger:
      'RI' Register '-' INT ';'
  ;
  
  readSmallInteger:
      'RSI' Register '-' SMALLINT ';'
  ;
  
  
  Register:
  'REG0'|'REG1'|'REG2'|'REG3'|'REG4'  
  ;
  
  
  terminal SMALLINT:
      '1'|'2'|'3'
  ;
  
  terminal MEDIUMINT:
      '1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'|'10'
  ;
  </code></pre>
  
  <p>My problem is that when I enter the following:</p>
  
  <pre><code>RI REG0-2;
  </code></pre>
  
  <p>This should be a valid instruction,  (Operation Register-Integer), but I'm getting the following error:
  mismatched input '2' expecting RULE_INT</p>
  
  <p>Basically the problem is that the number '2' is consumed but SMALLINT instead of INT.</p>
  
  <p>Any ideas on how to fix this? or if my approach is correct?</p>