001 /* This file was generated with JastAdd2 (http://jastadd.org) version R20130213 */ 002 package AST; 003 004 import java.util.HashSet; 005 import java.io.File; 006 import java.util.*; 007 import beaver.*; 008 import java.util.ArrayList; 009 import java.util.zip.*; 010 import java.io.*; 011 import java.io.FileNotFoundException; 012 import java.util.Collection; 013 /** 014 * @production WildcardExtends : {@link AbstractWildcard} ::= <span class="component">{@link Access}</span>; 015 * @ast node 016 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.ast:22 017 */ 018 public class WildcardExtends extends AbstractWildcard implements Cloneable { 019 /** 020 * @apilevel low-level 021 */ 022 public void flushCache() { 023 } 024 /** 025 * @apilevel internal 026 */ 027 public void flushCollectionCache() { 028 } 029 /** 030 * @apilevel internal 031 */ 032 @SuppressWarnings({"unchecked", "cast"}) 033 public WildcardExtends clone() throws CloneNotSupportedException { 034 WildcardExtends node = (WildcardExtends)super.clone(); 035 node.type_computed = false; 036 node.type_value = null; 037 node.in$Circle(false); 038 node.is$Final(false); 039 return node; 040 } 041 /** 042 * @apilevel internal 043 */ 044 @SuppressWarnings({"unchecked", "cast"}) 045 public WildcardExtends copy() { 046 047 try { 048 WildcardExtends node = (WildcardExtends) clone(); 049 node.parent = null; 050 if(children != null) 051 node.children = (ASTNode[]) children.clone(); 052 053 return node; 054 } catch (CloneNotSupportedException e) { 055 throw new Error("Error: clone not supported for " + getClass().getName()); 056 } 057 058 }/** 059 * Create a deep copy of the AST subtree at this node. 060 * The copy is dangling, i.e. has no parent. 061 * @return dangling copy of the subtree at this node 062 * @apilevel low-level 063 */ 064 @SuppressWarnings({"unchecked", "cast"}) 065 public WildcardExtends fullCopy() { 066 067 WildcardExtends tree = (WildcardExtends) copy(); 068 if (children != null) { 069 for (int i = 0; i < children.length; ++i) { 070 071 ASTNode child = (ASTNode) children[i]; 072 if(child != null) { 073 child = child.fullCopy(); 074 tree.setChild(child, i); 075 } 076 } 077 } 078 return tree; 079 080 } /** 081 * @ast method 082 * @aspect GenericsPrettyPrint 083 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsPrettyPrint.jrag:164 084 */ 085 public void toString(StringBuffer s) { 086 s.append("? extends "); 087 getAccess().toString(s); 088 } 089 /** 090 * @ast method 091 * 092 */ 093 public WildcardExtends() { 094 super(); 095 096 097 } 098 /** 099 * Initializes the child array to the correct size. 100 * Initializes List and Opt nta children. 101 * @apilevel internal 102 * @ast method 103 * @ast method 104 * 105 */ 106 public void init$Children() { 107 children = new ASTNode[1]; 108 } 109 /** 110 * @ast method 111 * 112 */ 113 public WildcardExtends(Access p0) { 114 setChild(p0, 0); 115 } 116 /** 117 * @apilevel low-level 118 * @ast method 119 * 120 */ 121 protected int numChildren() { 122 return 1; 123 } 124 /** 125 * @apilevel internal 126 * @ast method 127 * 128 */ 129 public boolean mayHaveRewrite() { 130 return false; 131 } 132 /** 133 * Replaces the Access child. 134 * @param node The new node to replace the Access child. 135 * @apilevel high-level 136 * @ast method 137 * 138 */ 139 public void setAccess(Access node) { 140 setChild(node, 0); 141 } 142 /** 143 * Retrieves the Access child. 144 * @return The current node used as the Access child. 145 * @apilevel high-level 146 * @ast method 147 * 148 */ 149 public Access getAccess() { 150 return (Access)getChild(0); 151 } 152 /** 153 * Retrieves the Access child. 154 * <p><em>This method does not invoke AST transformations.</em></p> 155 * @return The current node used as the Access child. 156 * @apilevel low-level 157 * @ast method 158 * 159 */ 160 public Access getAccessNoTransform() { 161 return (Access)getChildNoTransform(0); 162 } 163 /** 164 * @apilevel internal 165 */ 166 protected boolean type_computed = false; 167 /** 168 * @apilevel internal 169 */ 170 protected TypeDecl type_value; 171 /** 172 * @attribute syn 173 * @aspect LookupParTypeDecl 174 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1370 175 */ 176 @SuppressWarnings({"unchecked", "cast"}) 177 public TypeDecl type() { 178 if(type_computed) { 179 return type_value; 180 } 181 ASTNode$State state = state(); 182 int num = state.boundariesCrossed; 183 boolean isFinal = this.is$Final(); 184 type_value = type_compute(); 185 if(isFinal && num == state().boundariesCrossed){ type_computed = true; } 186 return type_value; 187 } 188 /** 189 * @apilevel internal 190 */ 191 private TypeDecl type_compute() { return lookupWildcardExtends(getAccess().type()); } 192 /** 193 * @attribute inh 194 * @aspect LookupParTypeDecl 195 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1373 196 */ 197 @SuppressWarnings({"unchecked", "cast"}) 198 public TypeDecl lookupWildcardExtends(TypeDecl typeDecl) { 199 ASTNode$State state = state(); 200 TypeDecl lookupWildcardExtends_TypeDecl_value = getParent().Define_TypeDecl_lookupWildcardExtends(this, null, typeDecl); 201 return lookupWildcardExtends_TypeDecl_value; 202 } 203 /** 204 * @apilevel internal 205 */ 206 public ASTNode rewriteTo() { 207 return super.rewriteTo(); 208 } 209 }