3 Dec
2008
3 Dec
'08
6:47 p.m.
Joel Falcou wrote:
Eric Niebler a écrit :
You use proto::functional::flatten to turn the binary + expression tree into a flat Fusion sequence, and then you use proto::functional::unpack_expr to turn the Fusion sequence into an expression node with any tag you want. See below:
I was roaming around flatten so guess I only missed the as_vector trick. I guess this means that this "n-ary" plus expression node can be then latter be matched by another grammar defined like (simple version ofc) :
struct some_grammar : nary_expr
> {};
Yep. I forgot to mention that you need to be aware of BOOST_PROTO_MAX_ARITY when unpacking sequences into expression nodes. -- Eric Niebler BoostPro Computing http://www.boostpro.com