|
Boost Users : |
Subject: Re: [Boost-users] [Proto] proto::reverse_fold_tree
From: Eric Niebler (eric_at_[hidden])
Date: 2009-02-02 14:38:35
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
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