|
Boost Users : |
Subject: Re: [Boost-users] [Proto]: How to use complex grammars in a domain/extension
From: Eric Niebler (eric_at_[hidden])
Date: 2010-09-21 09:39:48
On 9/21/2010 4:11 AM, Roland Bock wrote:
>
> On 09/21/2010 09:49 AM, Joel Falcou wrote:
>> The following code works here:
>>
>> //
>> -----------------------------------------------------------------------
>> [...]
> Yes, I know, but that is not the grammar I need. I want to combine my
> terminal similar to std::string, so that:
>
> std::string a, b;
>
> a; // ok
> a + b; // ok
> a == b; // ok
> a == b + b; // ok
> a && a == b; // ERROR
>
>>
>> Seems proto::or_ wiht *1* condition acts weird.
>> Eric, am I right or am I hallucinating and missing the obvious ?
>
> You can remove the proto::or_ like
>
> struct equation:
> proto::equal_to<addition, addition>
> {};
>
> It does not change the result. So it does not look like a problem in
> proto::or_, but maybe a bug in how proto determines the operators of
> extensions?
struct equation:
proto::or_<
proto::equal_to<addition, addition>,
proto::terminal<proto::_>
>
{};
?
-- Eric Niebler BoostPro Computing http://www.boostpro.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net