This is easy for a parser. Just add the following to your grammar.
@rulecatch{}
Aside from answering the single question "In the input recognized by this
grammar? (yes/no)", this is a rather useless thing to do. There are many,
many other ways to approach error handling that are more appropriate for any
other task.
Sam
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Wujek Srujek
Sent: Monday, September 12, 2011 4:18 AM
To: antlr-interest Interest
Subject: Re: [antlr-interest] ANTLRWorks 2 (for ANTLR v4)
I am new to ANTLR3 and haven't yet got a lot of experience with it. The one
thing that is bugging me, though, is how hard it was to make sure ANTLR
doesn't perform any recovery and fails on first error with checked
exceptions. And it involved a nasty trick with sneaky throwing... I would
love to see it made easier.
wujek
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.