Boost logo

Boost Users :

Subject: [Boost-users] [Proto] Splitting AST
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2009-03-02 12:55:04


Let's say I want to take an expression involving operators +,-,*,/ and a
function split.

What I want to do is writing a transform taking such an expression and
returning a fusion::vector or list (I guess) of expressions containing
all sub-expressions of the original AST only separated on each insatcne
of a split call.

E.g :

Xpr = a+b+split( c*d + split(e-f));
is turned into

Xprs = [ a+b+placeholder<1>, c*d+placeholder<2>, e-f];

I guess I should use the State/Data parameters of the transform but i
can't get the thing right. Any hints on how to tackle this without
losing hairs ?

-- 
___________________________________________
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