title: Parsing strings in Xtext
body: <p>I'm currently attempting to write an Eclipse-based editor for an in-house language we use in the Company. The language is a collection of statements of the form:</p>
  
  <pre><code>{action}: {arguments}
  </code></pre>
  
  <p>...on its own line. The format of {arguments} depends on the type of {action} being performed. An example of a script fragment could look like:</p>
  
  <pre><code>banner: Some string with numbers and punctuation (23) in it!
  # some comment
  timeout: 42
  </code></pre>
  
  <p>My problem is parsing such a fragment. I've got comments and the timeout statement working, but I can't seem to create a rule to cover the banner statement. All of my attempts have resulted in Antlr "token definition unreachable" warnings, or the editor not being able to match input. I've tried the following rules for the banner statement:</p>
  
  <pre><code>Banner:
    'banner:' name=ANY_OTHER*;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Banner:
    'banner:' name=FF_STRING;
  terminal FF_STRING : ('a'..'z'|'A'..'Z'|'0'..'9'|'.'|':'|' ')+;
  </code></pre>
  
  <p>...which gives me the antlr warnings. A hack I've come up with is to simple create a terminal which is identical to an SL_COMMENT, with 'banner:' instead of '#' at the beginning. The disadvantage is that I do not get syntax colouring, nor does 'banner' show up in the auto-completion list.</p>
  
  <p>Any advice is welcome.</p>