title: Ignore MSGTokenError in JAVACC
body: <p>I use JAVACC to parse some string defined by a bnf grammar with initial non-terminal G.
  I would like to catch errors thrown by TokenMgrError. 
  In particular, I want to handle the following two cases:</p>
  
  <ol>
  <li>If some prefix of the input satisfies G, but not all of the symbols are read from the input, consider this case as normal and return AST for found prefix by a call to G().</li>
  <li>If the input has no prefix satisfying G, return null from G(). </li>
  </ol>
  
  <p>Currently I'm getting TokenMgrError 's in each of this case instead.
  I started to modify the generated files (i.e, to change Error to Exception and add appropriate try/catch/throws statements), but I found it to be tedious. In addition, automatic generation of the modified files produced by JAVACC does  not work. Is there a smarter way to accomplish this?</p>