[antlr-interest] Problems with semantic predicates

Haralambi Haralambiev hharalambiev at gmail.com
Fri Apr 18 03:39:31 PDT 2008


Sorry, but I should have been more clear.

The
example above is just a representation of the problem. In reality, in
the grammar I am working on, the r and r2 are not consequent rules. r2
will eventually be called by some rule that is in the chain initiated
by r.
However, reworking the rules will be tricky, to say the least.

I assume that instead of a rewriting rule, I could use Java code for bulding
the tree, taking into account the already set scope variable, but I was
looking for a solution that will not require such manual work.

That's why I was looking for a way to always execute some action, even in
backtracking mode.

Hari

On 4/18/08, Gavin Lambert <antlr at mirality.co.nz> wrote:
>
> At 22:07 18/04/2008, Haralambi Haralambiev wrote:
>
> > The problem is that the grammar that I am working on is far more complex
> > and the backtracking option is actually needed. Thus, I need to find a
> > solution that will not require disabling that option.
> >
>
> The change I mentioned right at the end of the post (involving getting rid
> of the parameter) should do that.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080418/bb4328ce/attachment.html 


More information about the antlr-interest mailing list