
Thanks Eric, Eric Niebler <eric@boost-consulting.com> writes:
Yes, the assumption is that you will only be applying a transform to expressions that match the grammar. You can enforce this via:
// make sure it matches BOOST_MPL_ASSERT((matches<Expr, width_transform>)); // apply the transform width_transform::call(expr, state, visitor);
It would be nice if it failed loudly, instead of silently doing the wrong thing, though. I'll looking into changing this.
Would be very nice to have, if doable. Otherwise, should be spelled out very clearly in the documentation, in case it is not now. In my case there's one grammar passed to the domain, but then there're many others embedded in transforms and their structure is typically different. For instance, in the general grammar you typically have one pattern capturing all binary expressions, but then for specific transforms you may need to have more refined patterns and it is probably rather easy to forget to cover some parts of the space covered by the general grammar. Regards, Maurizio