[antlr-interest] @rulecatch overriding @after [C target]
Gavin Lambert
antlr at mirality.co.nz
Sat Aug 18 14:36:00 PDT 2007
At 11:30 18/08/2007, Matt Barringer wrote:
>It seems that @rulecatch causes @after to be ignored when using
the
>C target in ANTLR 3.0.1. For example, with a grammar that does
not
>have an @rulecatch block like:
[...]
>the generated code will be simply be:
>
> if (HASEXCEPTION())
> {
> /* Catch exceptions here */
> }
>
>
>Is that intentional? I haven't tried any of the other output
>targets to see what their behaviour is.
Does the C target support something like @finally? (I'm rusty on
all these special actions, so maybe that's what @after is for, but
at least on the face of it I can see an argument for @after being
"after successfully matching" while @finally would be "when
leaving the rule, successfully or not"... not that I know whether
that's actually the case or not :))
More information about the antlr-interest
mailing list