Boost logo

Boost :

From: Maurizio Vitale (mav_at_[hidden])
Date: 2007-04-27 03:55:16


I think I haven't really understood how proto handles transforms and pattern matching.
I'm probably confused on how exactly result_of, arg and mpl placeholders play together
and I kind of get what I want in some cases.
For instance, given the pattern:

 proto::terminal< number<bounds<run_time,_>,_,_,_,_,_> >

how can I refer in the rhs of a transform to:

    a) the entire pattern being matched (e.g. terminal<> or number<>)
    b) the bound<> subobject
    c) the expression corresponding to the placeholder inside the bound object
    d) the expression corresponding to one of the other 5 placeholders in the number<> subtree

I'm particular unclear on how placeholders are bound to mpl placeholders: left to right,
depth/breath first traversal of the parse tree, some other way.

The only examples I've found uses mpl::_ and has a single proto::_ universal matcher in the
lhs so is not like I have any evidence of an intention to bind other mpl placeholders.
Maybe I have to dissect the matched expression myself, but I need at least to get an handle
to the entire expression.

This is blocking me at the moment, so if anybody has suggestions, they would be very much
appreciated.

Best regards,

     Maurizio


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk