/** * Walk the subtree rooted under node *top (only the children, not *top itself) * post-order, calling the function void visit(SafraTree& tree, SafraTreeNode *node) * in the SafraTreeVisitor on each node. */ public void walkChildrenPostOrder(SafraTreeVisitor visitor, SafraTreeNode top) { SafraTreeWalker walker = new SafraTreeWalker(visitor); // = don't visit top walker.walkSubTreePostOrder(this, top, false); }
/** Constructor. * @param visitor the visitor functor */ public SafraTreeWalker(SafraTreeVisitor visitor) { _visitor = visitor; }
/** Constructor. * @param visitor the visitor functor */ public SafraTreeWalker(SafraTreeVisitor visitor) { _visitor = visitor; }
/** * Walk the subtree rooted under node *top post-order, * calling the function void visit(SafraTree& tree, SafraTreeNode *node) * in the SafraTreeVisitor on each node. */ public void walkSubTreePostOrder(SafraTreeVisitor visitor, SafraTreeNode top) { SafraTreeWalker walker = new SafraTreeWalker(visitor); walker.walkSubTreePostOrder(this, top); }
/** * Walk the tree post-order, calling the function * void visit(SafraTree& tree, SafraTreeNode *node) * in the SafraTreeVisitor on each node. */ public void walkTreePostOrder(SafraTreeVisitor visitor) { SafraTreeWalker walker = new SafraTreeWalker(visitor); walker.walkTreePostOrder(this); }
/** * Walk the tree post-order, calling the function * void visit(SafraTree& tree, SafraTreeNode *node) * in the SafraTreeVisitor on each node. */ public void walkTreePostOrder(SafraTreeVisitor visitor) { SafraTreeWalker walker = new SafraTreeWalker(visitor); walker.walkTreePostOrder(this); }
/** * Walk the subtree rooted under node *top post-order, * calling the function void visit(SafraTree& tree, SafraTreeNode *node) * in the SafraTreeVisitor on each node. */ public void walkSubTreePostOrder(SafraTreeVisitor visitor, SafraTreeNode top) { SafraTreeWalker walker = new SafraTreeWalker(visitor); walker.walkSubTreePostOrder(this, top); }
/** * Walk the subtree rooted under node *top (only the children, not *top itself) * post-order, calling the function void visit(SafraTree& tree, SafraTreeNode *node) * in the SafraTreeVisitor on each node. */ public void walkChildrenPostOrder(SafraTreeVisitor visitor, SafraTreeNode top) { SafraTreeWalker walker = new SafraTreeWalker(visitor); // = don't visit top walker.walkSubTreePostOrder(this, top, false); }