title: Best way to validate semantics with xtext
body: <p>i'm new at Xtext validation system, and can't figure out how to validade my expressions.</p>
  
  <p>I have something like:</p>
  
  <pre><code>   VAR
        &lt;VARIABLE&gt;:&lt;TYPE&gt;:= &lt;VALUE&gt;;
     END_VAR
  </code></pre>
  
  <p>What i need to do is ensure that &lt;'TYPE'> is the same type as &lt;'VALUE'>.
  My grammar rules are setup like this snippet:</p>
  
  <pre><code>VarRule:
     'VAR' 
       variableDef+=VariableDefRule+ ';'
     'END_VAR'
  ;
  VariableDefRule:
    type=TypeName (':=' constant=Constant)?
  ;
  TypeName:
    INT | STRING | FLOAT
  ;
  
  INT: name='INT';
  STRING: name='STRING';
  FLOAT: name='FLOAT';
  
  Constant:
    Integer | String | ...
  ;
  terminal Integer returns ecore::EInt:
   (0..9)+
  ;
  </code></pre>
  
  <p>How can i associate the &lt;'VALUE'> element to a TypeName element? </p>