logo       

Re: Fusion-ifying proto parse trees: msg#00017

parsers.spirit.devel

Subject: Re: Fusion-ifying proto parse trees

Eric Niebler wrote:
dan marsden wrote:
Joel de Guzman wrote:
Given a node, you can know the Nth type from the traversal, right?
Given a node, you can get the Nth element by walking the tree, right?

IOTW, this is possible:
get_element_type<Node, N>::type

and so is this:
get_element<N>(node)

Yes, No?

If yes, then you can keep a reference to the root node
plus an N index, to represent your iterator.

Attached is a crude implementation of a get_element like facility for trees of unary_op and binary_op nodes
that I knocked together to get some familiarity with proto (v cool btw).

Thanks!

Yeah, thanks too, Dan!

Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise