|
Boost : |
Subject: Re: [boost] [proto] [ was Re: [spirit2] Trivial parser crashes ]
From: Eric Niebler (eric_at_[hidden])
Date: 2008-11-18 10:54:26
Joel de Guzman wrote:
> On expressions:
>
> r %= some-expression;
>
> The rule's operator%= kicks in. However, on expressions:
>
> r %= r2; // r and r2 has the same type
>
> Then proto %= kicks in leaving it as a no-op. Nothing happens.
> Hence, the rhs is never "auto-assigned" to the lhs.
>
> I'm not sure how to deal with this. Do you have a hint?
> I place the original test code here. Tracing the code, the
> first %= works as expected while the second and third becomes
> no-ops calling proto operator %=.
You can disable proto's operator%= by specifying a domain with a grammar
to proto::extends as described in the docs. You could also try defining
a rule::operator%=(rule) member and see if that one gets picked up.
-- Eric Niebler BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk