title: Custom terminals in XText
body: <p>I've started to learn XText recently and tried to do a simple thing - have a custom terminals definition instead of importing <code>org.eclipse.xtext.common.Terminals</code>. </p>
  
  <p>First I've created BlahLang.xtest via wizard in x.mvmn.blah.xtext package.</p>
  
  <p>Then I've checked tutorials and done two things:
  a) Created custom terminals file in same package where my xtext file was.
  Namely Test.xtext in x.mvmn.blah.xtext.</p>
  
  <p>The contents of the file were same as in Terminals.xtext, but with corrected package declaration:</p>
  
  <pre><code>grammar x.mvmn.blah.xtext.Test hidden(WS, ML_COMMENT, SL_COMMENT)
  
  import "http://www.eclipse.org/emf/2002/Ecore" as ecore
  
  terminal ID:
      '^'? ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | '0'..'9')*;
  
  terminal INT returns ecore::EInt:
      ('0'..'9')+;
  
  terminal STRING:
      '"' ('\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\' | '"'))* '"' |
      "'" ('\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\' | "'"))* "'";
  
  terminal ML_COMMENT:
      '/*'-&gt;'*/';
  
  terminal SL_COMMENT:
      '//' !('\n' | '\r')* ('\r'? '\n')?;
  
  terminal WS:
      (' ' | '\t' | '\r' | '\n')+;
  
  terminal ANY_OTHER:
      .;
  </code></pre>
  
  <p>b) In my BlahLang.xtext file I've imported that file via 'with' declaration instead of <code>org.eclipse.xtext.common.Terminals</code> that was placed there by wizard:</p>
  
  <pre><code>grammar x.mvmn.blah.xtext.BlahLang with x.mvmn.blah.xtext.Test
  
  generate blahLang "http://www.mvmn.x/blah/xtext/BlahLang"
  
  Model:
      greetings+=Greeting*;
  
  Greeting:
      'Hello' name=ID '!';
  </code></pre>
  
  <p>According to all documentation and tips I found online everything should've been fine. But nothing works - the files generated by XText are referencing non-existing classes:</p>
  
  <pre><code>x.mvmn.blah.xtext.services.TestGrammarAccess
  x.mvmn.blah.xtext.TestStandaloneSetup
  x.mvmn.blah.xtext.validation.TestValidator
  </code></pre>
  
  <p>I've tried different workarounds (played around with adding "generate" to Test.xtext etc) but nothing worked. I'm practically stuck and have no slightest idea what is wrong and how can I fix things.</p>
  
  <p>Please help.</p>