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 PrimitiveTypeAccess : {@link TypeAccess} ::= <span class="component"><Package:String></span> <span class="component"><ID:String></span> <span class="component"><Name:String></span>; 015 * @ast node 016 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:24 017 */ 018 public class PrimitiveTypeAccess 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 PrimitiveTypeAccess clone() throws CloneNotSupportedException { 034 PrimitiveTypeAccess node = (PrimitiveTypeAccess)super.clone(); 035 node.decls_computed = false; 036 node.decls_value = null; 037 node.getPackage_computed = false; 038 node.getPackage_value = null; 039 node.getID_computed = false; 040 node.getID_value = null; 041 node.in$Circle(false); 042 node.is$Final(false); 043 return node; 044 } 045 /** 046 * @apilevel internal 047 */ 048 @SuppressWarnings({"unchecked", "cast"}) 049 public PrimitiveTypeAccess copy() { 050 051 try { 052 PrimitiveTypeAccess node = (PrimitiveTypeAccess) clone(); 053 node.parent = null; 054 if(children != null) 055 node.children = (ASTNode[]) children.clone(); 056 057 return node; 058 } catch (CloneNotSupportedException e) { 059 throw new Error("Error: clone not supported for " + getClass().getName()); 060 } 061 062 }/** 063 * Create a deep copy of the AST subtree at this node. 064 * The copy is dangling, i.e. has no parent. 065 * @return dangling copy of the subtree at this node 066 * @apilevel low-level 067 */ 068 @SuppressWarnings({"unchecked", "cast"}) 069 public PrimitiveTypeAccess fullCopy() { 070 071 PrimitiveTypeAccess tree = (PrimitiveTypeAccess) copy(); 072 if (children != null) { 073 for (int i = 0; i < children.length; ++i) { 074 075 ASTNode child = (ASTNode) children[i]; 076 if(child != null) { 077 child = child.fullCopy(); 078 tree.setChild(child, i); 079 } 080 } 081 } 082 return tree; 083 084 } /** 085 * @ast method 086 * 087 */ 088 public PrimitiveTypeAccess() { 089 super(); 090 091 092 } 093 /** 094 * Initializes the child array to the correct size. 095 * Initializes List and Opt nta children. 096 * @apilevel internal 097 * @ast method 098 * @ast method 099 * 100 */ 101 public void init$Children() { 102 } 103 /** 104 * @ast method 105 * 106 */ 107 public PrimitiveTypeAccess(String p0) { 108 setName(p0); 109 } 110 /** 111 * @ast method 112 * 113 */ 114 public PrimitiveTypeAccess(beaver.Symbol p0) { 115 setName(p0); 116 } 117 /** 118 * @apilevel low-level 119 * @ast method 120 * 121 */ 122 protected int numChildren() { 123 return 0; 124 } 125 /** 126 * @apilevel internal 127 * @ast method 128 * 129 */ 130 public boolean mayHaveRewrite() { 131 return false; 132 } 133 /** 134 * Replaces the lexeme Name. 135 * @param value The new value for the lexeme Name. 136 * @apilevel high-level 137 * @ast method 138 * 139 */ 140 public void setName(String value) { 141 tokenString_Name = value; 142 } 143 /** 144 * @apilevel internal 145 * @ast method 146 * 147 */ 148 149 /** 150 * @apilevel internal 151 */ 152 protected String tokenString_Name; 153 /** 154 * @ast method 155 * 156 */ 157 158 public int Namestart; 159 /** 160 * @ast method 161 * 162 */ 163 164 public int Nameend; 165 /** 166 * JastAdd-internal setter for lexeme Name using the Beaver parser. 167 * @apilevel internal 168 * @ast method 169 * 170 */ 171 public void setName(beaver.Symbol symbol) { 172 if(symbol.value != null && !(symbol.value instanceof String)) 173 throw new UnsupportedOperationException("setName is only valid for String lexemes"); 174 tokenString_Name = (String)symbol.value; 175 Namestart = symbol.getStart(); 176 Nameend = symbol.getEnd(); 177 } 178 /** 179 * Retrieves the value for the lexeme Name. 180 * @return The value for the lexeme Name. 181 * @apilevel high-level 182 * @ast method 183 * 184 */ 185 public String getName() { 186 return tokenString_Name != null ? tokenString_Name : ""; 187 } 188 /** 189 * Replaces the lexeme Package. 190 * @param value The new value for the lexeme Package. 191 * @apilevel high-level 192 * @ast method 193 * 194 */ 195 public void setPackage(String value) { 196 tokenString_Package = value; 197 } 198 /** 199 * @apilevel internal 200 * @ast method 201 * 202 */ 203 204 /** 205 * @apilevel internal 206 */ 207 protected String tokenString_Package; 208 /** 209 * Replaces the lexeme ID. 210 * @param value The new value for the lexeme ID. 211 * @apilevel high-level 212 * @ast method 213 * 214 */ 215 public void setID(String value) { 216 tokenString_ID = value; 217 } 218 /** 219 * @apilevel internal 220 * @ast method 221 * 222 */ 223 224 /** 225 * @apilevel internal 226 */ 227 protected String tokenString_ID; 228 /** 229 * @apilevel internal 230 */ 231 protected boolean decls_computed = false; 232 /** 233 * @apilevel internal 234 */ 235 protected SimpleSet decls_value; 236 /** 237 * @attribute syn 238 * @aspect TypeScopePropagation 239 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupType.jrag:234 240 */ 241 @SuppressWarnings({"unchecked", "cast"}) 242 public SimpleSet decls() { 243 if(decls_computed) { 244 return decls_value; 245 } 246 ASTNode$State state = state(); 247 int num = state.boundariesCrossed; 248 boolean isFinal = this.is$Final(); 249 decls_value = decls_compute(); 250 if(isFinal && num == state().boundariesCrossed){ decls_computed = true; } 251 return decls_value; 252 } 253 /** 254 * @apilevel internal 255 */ 256 private SimpleSet decls_compute() { return lookupType(PRIMITIVE_PACKAGE_NAME, name()); } 257 /** 258 * @apilevel internal 259 */ 260 protected boolean getPackage_computed = false; 261 /** 262 * @apilevel internal 263 */ 264 protected String getPackage_value; 265 /** 266 * @attribute syn nta 267 * @aspect TypeScopePropagation 268 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupType.jrag:235 269 */ 270 @SuppressWarnings({"unchecked", "cast"}) 271 public String getPackage() { 272 if(getPackage_computed) { 273 return getPackage_value; 274 } 275 ASTNode$State state = state(); 276 int num = state.boundariesCrossed; 277 boolean isFinal = this.is$Final(); 278 getPackage_value = getPackage_compute(); 279 setPackage(getPackage_value); 280 if(isFinal && num == state().boundariesCrossed){ getPackage_computed = true; } 281 return getPackage_value; 282 } 283 /** 284 * @apilevel internal 285 */ 286 private String getPackage_compute() { return PRIMITIVE_PACKAGE_NAME; } 287 /** 288 * @apilevel internal 289 */ 290 protected boolean getID_computed = false; 291 /** 292 * @apilevel internal 293 */ 294 protected String getID_value; 295 /** 296 * @attribute syn nta 297 * @aspect TypeScopePropagation 298 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupType.jrag:236 299 */ 300 @SuppressWarnings({"unchecked", "cast"}) 301 public String getID() { 302 if(getID_computed) { 303 return getID_value; 304 } 305 ASTNode$State state = state(); 306 int num = state.boundariesCrossed; 307 boolean isFinal = this.is$Final(); 308 getID_value = getID_compute(); 309 setID(getID_value); 310 if(isFinal && num == state().boundariesCrossed){ getID_computed = true; } 311 return getID_value; 312 } 313 /** 314 * @apilevel internal 315 */ 316 private String getID_compute() { return getName(); } 317 /** 318 * @attribute syn 319 * @aspect PrettyPrint 320 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800 321 */ 322 public String dumpString() { 323 ASTNode$State state = state(); 324 try { return getClass().getName() + " [" + getName() + "]"; } 325 finally { 326 } 327 } 328 /** 329 * @apilevel internal 330 */ 331 public ASTNode rewriteTo() { 332 return super.rewriteTo(); 333 } 334 }