[antlr-interest] Way to "cut" parsing?

Jim Idle jimi at temporal-wave.com
Mon Oct 15 21:04:19 PDT 2012


If you are using the backtrack = true option, then that is how it works. It
cannot identify the error closer than the rule it starts backtracking on and
that's that. You should only use the backtrack=true option if there is no
other way to parse your input, otherwise you should do the work to factor
your rules and so on. Turn off the back tracking and memoizing options and
look to fix the ambiguities in your grammar. What language are you trying to
parse?

Jim


-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Juancarlo Añez
Sent: Tuesday, October 16, 2012 10:33 AM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Way to "cut" parsing?

Hello Jim,

Please see the FAQ:
>
> http://www.antlr.org/wiki/display/ANTLR3/Custom+Syntax+Error+Recovery
>

I didn't find an answer there,


> Also be aware of: http://antlr.markmail.org which will allow you to
> search the archives of the list and will usually give you an answer
> quicker than the list itself will :) Almost everything that could be
> asked about ANTLR
> 3.4 has been asked and answered by now ;)
>

Or there.

This may be more like it:

http://www.antlr.org/wiki/display/ANTLR3/Error+reporting+and+recovery

but that just turns off recovery, it doesn't provide a "cut" as in Prolog
and other grammars.

It's not just a matter of reporting errors as close as possible to the
offending phrase. The parser can be much more efficient if it knows it's
committed to a given rule once a certain phrase is seen.

Thanks!

--
Juancarlo *Añez*

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


More information about the antlr-interest mailing list