title: JFlex parametrized token
body: <p>I want to parse expressions of the following structure:</p>
  
  <pre><code>compositeKey ::= key (separator key)*
  </code></pre>
  
  <p>Here is the flex code fragment:</p>
  
  <pre><code>KEY_CHARACTER=[^:\s]
  KEY_SEPARATOR=[:]
  
  %state WAITING_KEY
  
  ...
  &lt;WAITING_KEY&gt; {KEY_CHARACTER}+        { yybegin(WAITING_KEY); return MyTypes.KEY; }
  &lt;WAITING_KEY&gt; {KEY_SEPARATOR}         { yybegin(WAITING_KEY); return MyTypes.KEY_SEPARATOR; }
  </code></pre>
  
  <p>Code generated by given flex fragment works fine, but what if I want to get key separator at "runtime"?
  It actually may be any character, specified by user. 
  How to do it with jflex? </p>