title: Xtext - Rule and validation issues
body: <p>I'm creating a DSL with Xtext which will be used for generating images. However because I'm completely unknown to Xtext, I'm stumbling upon some problems and I hope you can give me some guidance.</p>
  
  <p>Eventually I want the user to use the following coding structure:</p>
  
  <pre><code>bgcolor: ffffff
  bgsize: 500x500
  box1:
      bgcolor: 000000
      size: 300x300
      position: 100x100
  box2:
      bgcolor: eeeeee
      size: 300x300
      position: 100x100
  </code></pre>
  
  <p>What I came up with in Xtext is the following (I did not change anything to the MWE2):</p>
  
  <pre><code>Image : (ImageElement+=ImageElementType)*;
  ImageElementType:  BgColor | BgSize | Box;
  
  
  // SET BASIC TERMINAL RULES
  terminal SIZE : INT 'x' INT;
  
  terminal COLOR : COLOR_BASIC | COLOR_HEX;
  terminal COLOR_BASIC : 'green' | 'red' | 'blue' | 'yellow' | 'black' | 'white' | 'orange' | 'purple' | 'pink';
  terminal DIGIT : ('0'..'9'|'a'..'f'|'A'..'F');
  terminal COLOR_HEX : DIGIT DIGIT DIGIT DIGIT DIGIT DIGIT;
  
  BgColor: name='bgcolor:' value=COLOR;
  BgSize: name='bgsize:' value=SIZE;  
  
  Box: name='box:';
  </code></pre>
  
  <p>There are a couple of issues I need to solve but I would like to know what the best approach is to these issues.</p>
  
  <ul>
  <li>How can I set boundaries to the INT's used in terminal rule SIZE.</li>
  <li>How can I set that bgcolor: or bgsize: may only be used once?</li>
  <li>How can I set that box1, box2, etc is constructed from the same rule Box:?</li>
  <li>How can I set that the properties specified under box1: belong to that box?</li>
  <li>How can I make indents mandatory?</li>
  </ul>
  
  <p>I'm not seeking for a direct solution (would be great though ;-) ) but just some tips how to tackle these issues. Are all of these solved by editing the MWE2 workflow? I have some hard time with the documentation of Xtext. </p>
  
  <p>Thanks in advance for your time and comments!</p>
  
  <p>Kind regards</p>