Boost logo

Boost Users :

From: Joel FALCOU (joel.falcou_at_[hidden])
Date: 2008-06-04 16:28:13


Eric Niebler a écrit :
> I'm not sure how the data parameter figures here. Wouldn't the semantic
> action be conditioned on the expression type? E.g., when an expression
> is a binary +, do the binary + action. For that, you'd just use a proto
> grammar decorated with transforms, and not involve the data parameter at
> all.

Yeah I kinda brainstormed a bit further. What I have now is the
following. I construct an AST with a simple grammar with no transform.
Then I use a transform that turn the AST into a tuple containing the
pointer to each matrix data int he AST. Then i use another transform to
compute if the AST is "SIMDizable" aka every terminal is a matrix of the
same type and this type has a SIMD equivalent. If this is true, then I
apply another transform that turn all SIMDizable node into their SIMD
version (basically repalcing proto::tag::plus for ex. into
my_lib::tag::simd::plus) and evaluates it with a visitor which
references the data tuples.

> Better IMO to wait until v4 is finished and committed to trunk.
*nods*

> You can certainly write a transform that turns terminal references into
> values, but that's not the default behavior.
The example is indeed valuable I can see my former error now. Thanks for
the head up.

-- 
Joel FALCOU
Research Engineer @ Institut d'Electronique Fondamentale
Université PARIS SUD XI
France

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