title: Backslash escaped characters in JavaCC token
body: <p>I'm writing <a href="http://javacc.org/" rel="nofollow noreferrer">JavaCC</a> parser for a character stream like this</p>
  
  <p><code>Abc \(Def\) Gh (Ij; Kl); Mno (Pqr)</code></p>
  
  <p>and should get it <a href="http://www.engr.mun.ca/~theo/JavaCC-FAQ/javacc-faq-moz.htm#tth_sEc1.3" rel="nofollow noreferrer" title="tokenized">tokenized</a> like this</p>
  
  <ol>
  <li>Abc \(Def\) Gh</li>
  <li>LPAREN</li>
  <li>Ij</li>
  <li>SEMICOLON</li>
  <li>Kl</li>
  <li>RPAREN</li>
  <li>SEMICOLON</li>
  <li>Mno</li>
  <li>LPAREN</li>
  <li>Pqr</li>
  <li>RPAREN</li>
  </ol>
  
  <p>The current token definition is</p>
  
  <pre><code>TOKEN:
  {
    &lt; WORDCHAR : (~[";", "(", ")"])+ &gt;
     |  &lt;LPAREN: "("&gt;
     |  &lt;RPAREN: ")"&gt;
     |  &lt;SEMICOLON: ";"&gt;
  }
  </code></pre>
  
  <p>How should I change the WORDCHAR token to include backslash escaped parentheses but not parentheses without leading backslash?</p>