Jim Idle wrote:
Greg Smolyn wrote:
Hi,
I've been using ANTLR quite successfully in a number of places in a
fairly large product-- mainly for parsing CSS and _javascript_.
However, I've recently tried to make my grammars more resilient to
errors and recover a bit more gracefully, and I've encountered a lot
of difficulty in finding information both in the ANTLR book (which
pretty much only describes how to _print_ errors) and in the mailing
list archives. Mainly, I'd like to be able to catch a parsing
exception, skip it, but _continue_ to parse the rest of the rule.
Unfortunately, the way the exceptions are structured, there is no way
to catch an exception in a rule and carry on-- you're already outside
the main loop of that rule.
Here's a scenario I've encountered-- I'll use CSS as an example.
Say you're given a CSS ruleset with a bad property:
a {
margin: 100px;
*margin: 200px;
background: foo.gif;
}
What I'd like to do is have it throw the exception and skip the
property, but continue along with the next one. I am stymied by how
to do this, however.
Download the JavaFX source code
I should have said compiler source code here.
https://openjfx-compiler.dev.java.net/
Jim
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
|
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address