001 /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.3 */ 002 package AST; 003 004 import java.util.Collection; 005 import java.util.ArrayList; 006 import java.util.HashSet; 007 /** 008 * @ast node 009 * @production Opt : {@link ASTNode}; 010 011 */ 012 public class Opt<T extends ASTNode> extends ASTNode<T> implements Cloneable { 013 /** 014 * @apilevel internal 015 */ 016 public Opt<T> clone() throws CloneNotSupportedException { 017 Opt node = (Opt) super.clone(); 018 node.in$Circle(false); 019 node.is$Final(false); 020 return node; 021 } 022 /** 023 * @apilevel internal 024 */ 025 public Opt<T> copy() { 026 try { 027 Opt node = (Opt) clone(); 028 node.parent = null; 029 if(children != null) { 030 node.children = (ASTNode[]) children.clone(); 031 } 032 return node; 033 } catch (CloneNotSupportedException e) { 034 throw new Error("Error: clone not supported for " + getClass().getName()); 035 } 036 } 037 /** 038 * Create a deep copy of the AST subtree at this node. 039 * The copy is dangling, i.e. has no parent. 040 * @return dangling copy of the subtree at this node 041 * @apilevel low-level 042 */ 043 public Opt<T> fullCopy() { 044 Opt tree = (Opt) copy(); 045 if (children != null) { 046 for (int i = 0; i < children.length; ++i) { 047 ASTNode child = (ASTNode) children[i]; 048 if(child != null) { 049 child = child.fullCopy(); 050 tree.setChild(child, i); 051 } 052 } 053 } 054 return tree; 055 } 056 /** 057 */ 058 public Opt() { 059 super(); 060 } 061 /** 062 * Initializes the child array to the correct size. 063 * Initializes List and Opt nta children. 064 * @apilevel internal 065 * @ast method 066 */ 067 public void init$Children() { 068 } 069 /** 070 */ 071 public Opt(T opt) { 072 setChild(opt, 0); 073 } 074 /** 075 * @apilevel internal 076 */ 077 public boolean mayHaveRewrite() { 078 return false; 079 } 080 /** 081 * @apilevel low-level 082 */ 083 public void flushCache() { 084 super.flushCache(); 085 } 086 /** 087 * @apilevel internal 088 */ 089 public void flushCollectionCache() { 090 super.flushCollectionCache(); 091 } 092 /** 093 * @apilevel internal 094 */ 095 public ASTNode rewriteTo() { return super.rewriteTo(); 096 }}