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 BoundTypeAccess : {@link TypeAccess} ::= <span class="component"><TypeDecl:TypeDecl></span>; 015 * @ast node 016 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/BoundNames.ast:8 017 */ 018 public class BoundTypeAccess extends TypeAccess 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 BoundTypeAccess clone() throws CloneNotSupportedException { 034 BoundTypeAccess node = (BoundTypeAccess)super.clone(); 035 node.decls_computed = false; 036 node.decls_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 BoundTypeAccess copy() { 046 047 try { 048 BoundTypeAccess node = (BoundTypeAccess) 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 BoundTypeAccess fullCopy() { 066 067 BoundTypeAccess tree = (BoundTypeAccess) 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 GenericsTypeAnalysis 083 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:333 084 */ 085 public boolean isRaw() { 086 return getTypeDecl().isRawType(); 087 } 088 /** 089 * @ast method 090 * 091 */ 092 public BoundTypeAccess() { 093 super(); 094 095 096 } 097 /** 098 * Initializes the child array to the correct size. 099 * Initializes List and Opt nta children. 100 * @apilevel internal 101 * @ast method 102 * @ast method 103 * 104 */ 105 public void init$Children() { 106 } 107 /** 108 * @ast method 109 * 110 */ 111 public BoundTypeAccess(String p0, String p1, TypeDecl p2) { 112 setPackage(p0); 113 setID(p1); 114 setTypeDecl(p2); 115 } 116 /** 117 * @ast method 118 * 119 */ 120 public BoundTypeAccess(beaver.Symbol p0, beaver.Symbol p1, TypeDecl p2) { 121 setPackage(p0); 122 setID(p1); 123 setTypeDecl(p2); 124 } 125 /** 126 * @apilevel low-level 127 * @ast method 128 * 129 */ 130 protected int numChildren() { 131 return 0; 132 } 133 /** 134 * @apilevel internal 135 * @ast method 136 * 137 */ 138 public boolean mayHaveRewrite() { 139 return false; 140 } 141 /** 142 * Replaces the lexeme Package. 143 * @param value The new value for the lexeme Package. 144 * @apilevel high-level 145 * @ast method 146 * 147 */ 148 public void setPackage(String value) { 149 tokenString_Package = value; 150 } 151 /** 152 * JastAdd-internal setter for lexeme Package using the Beaver parser. 153 * @apilevel internal 154 * @ast method 155 * 156 */ 157 public void setPackage(beaver.Symbol symbol) { 158 if(symbol.value != null && !(symbol.value instanceof String)) 159 throw new UnsupportedOperationException("setPackage is only valid for String lexemes"); 160 tokenString_Package = (String)symbol.value; 161 Packagestart = symbol.getStart(); 162 Packageend = symbol.getEnd(); 163 } 164 /** 165 * Retrieves the value for the lexeme Package. 166 * @return The value for the lexeme Package. 167 * @apilevel high-level 168 * @ast method 169 * 170 */ 171 public String getPackage() { 172 return tokenString_Package != null ? tokenString_Package : ""; 173 } 174 /** 175 * Replaces the lexeme ID. 176 * @param value The new value for the lexeme ID. 177 * @apilevel high-level 178 * @ast method 179 * 180 */ 181 public void setID(String value) { 182 tokenString_ID = value; 183 } 184 /** 185 * JastAdd-internal setter for lexeme ID using the Beaver parser. 186 * @apilevel internal 187 * @ast method 188 * 189 */ 190 public void setID(beaver.Symbol symbol) { 191 if(symbol.value != null && !(symbol.value instanceof String)) 192 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 193 tokenString_ID = (String)symbol.value; 194 IDstart = symbol.getStart(); 195 IDend = symbol.getEnd(); 196 } 197 /** 198 * Retrieves the value for the lexeme ID. 199 * @return The value for the lexeme ID. 200 * @apilevel high-level 201 * @ast method 202 * 203 */ 204 public String getID() { 205 return tokenString_ID != null ? tokenString_ID : ""; 206 } 207 /** 208 * Replaces the lexeme TypeDecl. 209 * @param value The new value for the lexeme TypeDecl. 210 * @apilevel high-level 211 * @ast method 212 * 213 */ 214 public void setTypeDecl(TypeDecl value) { 215 tokenTypeDecl_TypeDecl = value; 216 } 217 /** 218 * @apilevel internal 219 * @ast method 220 * 221 */ 222 223 /** 224 * @apilevel internal 225 */ 226 protected TypeDecl tokenTypeDecl_TypeDecl; 227 /** 228 * Retrieves the value for the lexeme TypeDecl. 229 * @return The value for the lexeme TypeDecl. 230 * @apilevel high-level 231 * @ast method 232 * 233 */ 234 public TypeDecl getTypeDecl() { 235 return tokenTypeDecl_TypeDecl; 236 } 237 /** 238 * @apilevel internal 239 */ 240 protected boolean decls_computed = false; 241 /** 242 * @apilevel internal 243 */ 244 protected SimpleSet decls_value; 245 /** 246 * @attribute syn 247 * @aspect BoundNames 248 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/BoundNames.jrag:93 249 */ 250 @SuppressWarnings({"unchecked", "cast"}) 251 public SimpleSet decls() { 252 if(decls_computed) { 253 return decls_value; 254 } 255 ASTNode$State state = state(); 256 int num = state.boundariesCrossed; 257 boolean isFinal = this.is$Final(); 258 decls_value = decls_compute(); 259 if(isFinal && num == state().boundariesCrossed){ decls_computed = true; } 260 return decls_value; 261 } 262 /** 263 * @apilevel internal 264 */ 265 private SimpleSet decls_compute() { return SimpleSet.emptySet.add(getTypeDecl()); } 266 /** 267 * @attribute syn 268 * @aspect PrettyPrint 269 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800 270 */ 271 public String dumpString() { 272 ASTNode$State state = state(); 273 try { return getClass().getName() + " [" + getTypeDecl().fullName() + "]"; } 274 finally { 275 } 276 } 277 /** 278 * @apilevel internal 279 */ 280 public ASTNode rewriteTo() { 281 return super.rewriteTo(); 282 } 283 }