Boost logo

Proto :

Subject: Re: [proto] Adding stuff in proto operator
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2010-12-29 03:23:53

OK, small road bump.

I tried a simple "grammar as geenrator" thingy but using the idea that i
didnt wanted to replicate all possible generator out there.
So i made a template grammar taking a Generator and doing thing around:

struct print_tag : proto::callable
   typedef void result_type;
   template<class X> void operator()(X const&) const
     std::cout << typeid(typename proto::tag_of<X>::type).name() << "\n";

template<class Generator>
struct debug_generator
       : proto::when < proto::_
                     , proto::and_ < print_tag(proto::_)
                                           , Generator(proto::_)
> {};

I then took the Calc2 example and changed the calculator_domain to be :

struct calculator_domain
proto::domain<debug_generator<proto::generator<calculator_expression> > >

Boost version is 1.45
The full modified code is :
Alas, I got a lump of errors as specified here :

Am I missing something or is the and_ not working like I thougt it was
as a transform.

Proto list run by eric at