Sam Harwell wrote:
> It's a good idea to override ReportError, and this will almost surely
> provide you with the results you want. You can also put a breakpoint in
> NoViableAltException's constructor. 
> 

So you are proposing that I override ReportError and re-throw the
exception? I basically want this code to work as expected (taken from
http://www.antlr.org/wiki/display/ANTLR3/Five+minute+introduction+to+ANTLR+3):

try {
            parser.expr();
        } catch (RecognitionException e)  {
            Console.Error.WriteLine(e.StackTrace);
        }

Since the RecognitionException is swallowed within the parser itself and
the default implementation of ReportError doesn't rethrow it by itself,
this code doesn't work as expected, i.e. the catch block can never be
executed. Correct?

Cheers
Jan

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to