harpoon.IR.Tree
Interface Tree.CloneCallback

Enclosing class:
Tree

public static interface Tree.CloneCallback

Callback interface to tree cloning code to allow you to update type and other annotations as the tree is cloned.


Method Summary
 Tree callback(Tree oldTree, Tree newTree, TempMap tm)
          This method will be called once for every cloned/renamed subtree.
 

Method Detail

callback

Tree callback(Tree oldTree,
              Tree newTree,
              TempMap tm)
This method will be called once for every cloned/renamed subtree. The original tree will be passed in as oldTree and the new, cloned/renamed tree will be passed in as newTree. The return value of this function will be linked in to the cloned parent, so substitutions on the cloned-tree-in-progress can be made by returning something other than newTree. In normal use, however, newTree should always be returned.

The supplied TempMap specifies the Temp mapping in effect for the cloning operation. This allows you to update tree information which is tied to Temps.