[antlr-interest] [3.1.1][C-target] @init/@after pairing lost with backtracking/semantic predicates?
Sven Van Echelpoel
sven.van.echelpoel at empolis.com
Mon May 4 00:43:10 PDT 2009
>
> You can generally do what you need though like this:
>
> s : {start();} ( alt1 | alt2 | alt3) { end(); } ;
>
> I also recommend that you do not use backtracking for a production parser.
Well, I'm not using backtracking on the whole parser, but only the one
induced by syntactic predicates here and there (and in a single rule
with options { backtracking=true; }, because the semantic predicates
there would seriously hinder readability).
>
> > Would it be correct to say that during backtracking the 'stack' is not
> > properly unwound,
> Sort of ;-) It is complicated to get all of this to work exactly like
> try {} catch {} finally {}. I think I can probably do it, but it needs
> some effort in the templates. I'll 'rule' on this for the next release.
A bit too late for me I'm afraid, with release only weeks away :-) But
with the information I have now, I think I can work around it.
Thanks,
Sven
More information about the antlr-interest
mailing list