2 Feb
2009
2 Feb
'09
7:38 p.m.
Joel Falcou wrote:
Dave Jenkins a écrit :
You can see that both are broken if you try the expression "(a*b+c)*(do*e+f)". That displays [f e d] for reverse_fold_tree and [a b] for fold_tree.
Then, is there anyway to implement a real Depth First or Breadth First traversal of the whole AST in Proto ?
Certainly, but not with any of Proto's "built-in" transforms. Generic tree traversal is a HUGE domain, and not something I can just whip out. ;-) Dan Marsden has been working on that problem for some time with his Boost.Traversal library. The Haskell folks have done lots of work in this area, too. Just Google "Scrap Your Boilerplate" and see how deep the rabbit hole goes. -- Eric Niebler BoostPro Computing http://www.boostpro.com