[antlr-interest] simple URL extractor
Jim Idle
jimi at temporal-wave.com
Wed Apr 25 09:28:06 PDT 2007
You should note that backtracking, even with memorize turned on should
be a last resort or used to get things working until you come back and
hone things down a bit. It probably isn't so bad for a single rule,
depending what it is, but full backtracking causes the recognizer to do
a lot more work of course.
Jim
-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Johannes Luber
Sent: Tuesday, April 24, 2007 10:11 AM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] simple URL extractor
bace.spam at gmx.net wrote:
>
> No, unfortunately I cannot discard the remaining text. I know the
grammar looks fine - but does not work. I get the same inappropriate
behavior if I set backtrack=true; at the beginning. Do you know how I
can set the backtrack-option for only one rule in antlr v3:
Do you have rules which apply to the remaining text?
> rule
> (options {backtrack=true;})
> : alter1 | ... | alterN
> ;
Remove the () and the rule should be fine. I recommend though to add
memoize=true; to speed speed up the parser.
Best regards,
Johannes Luber
More information about the antlr-interest
mailing list