Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Detecting series of operator in grammar
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2008-12-03 13:44:16


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<plus,vararg<_> > {};

?

-- 
___________________________________________
Joel Falcou - Assistant Professor
PARALL Team - LRI - Universite Paris Sud XI
Tel : (+33)1 69 15 66 35

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