Ejemplo n.º 1
0
 /**
  * @apilevel internal
  * @declaredat ASTNode:45
  */
 public Param copy() {
   try {
     Param node = (Param) clone();
     node.parent = null;
     if (children != null) {
       node.children = (ASTNode[]) children.clone();
     }
     return node;
   } catch (CloneNotSupportedException e) {
     throw new Error("Error: clone not supported for " + getClass().getName());
   }
 }
Ejemplo n.º 2
0
 /**
  * Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
  *
  * @return dangling copy of the subtree at this node
  * @apilevel low-level
  * @declaredat ASTNode:74
  */
 public Param treeCopyNoTransform() {
   Param tree = (Param) copy();
   if (children != null) {
     for (int i = 0; i < children.length; ++i) {
       ASTNode child = (ASTNode) children[i];
       if (child != null) {
         child = child.treeCopyNoTransform();
         tree.setChild(child, i);
       }
     }
   }
   return tree;
 }