title: is there a way to handle all antlr exception types in a rule catch[...] block
body: <p>I'm using ANTLR3 with the C runtime.</p>
  
  <p>I'd like to do some custom error handling.  What I'm really after is that if there is an antlr matching exception of any kind in a sub rule I'd like to tell ANTLR to skip trying to handle it and let it percolate up to a more global rule. </p>
  
  <p>At that rule I'll log it and then try to resume.</p>
  
  <p>I've set the rule catch method like so, so that all rules won't try to recover.</p>
  
  <pre><code>@rulecatch 
  {
      if (HASEXCEPTION())
      {
      PREPORTERROR();
      }
  }
  </code></pre>
  
  <p>This allows me to insert catch handlers on the rules that i want.</p>
  
  <p>At my rule of interest i can then use the catch syntax like so:</p>
  
  <pre><code>catch [ANTLR3_RECOGNITION_EXCEPTION]
  {
      PREPORTERROR();
      RECOGNIZER-&gt;consumeUntil(RECOGNIZER,RCURLY);
      CONSUME();
      PSRSTATE-&gt;error = ANTLR3_FALSE;
      PSRSTATE-&gt;failed = ANTLR3_FALSE;
       }
  </code></pre>
  
  <p>The problem is that this syntax seems to only allow me to catch one type of exception.  I'd like to be able to catch all exception types.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>I thought I could overload all the recovery functions but then some code generates exceptions like so:</p>
  
  <pre><code>                    CONSTRUCTEX();
                      EXCEPTION-&gt;type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                      EXCEPTION-&gt;message      = (void *)"";
                      EXCEPTION-&gt;decisionNum  = 23;
                      EXCEPTION-&gt;state        = 0;
  
  
                      goto rulewhenEx;
  </code></pre>
  
  <p>which means I'll need to catch all possible exceptions.</p>
  
  <p>Any thoughts??</p>