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 ParameterDeclarationSubstituted : {@link ParameterDeclaration} ::= <span class="component"><Original:ParameterDeclaration></span>; 015 * @ast node 016 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.ast:33 017 */ 018 public class ParameterDeclarationSubstituted extends ParameterDeclaration 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 ParameterDeclarationSubstituted clone() throws CloneNotSupportedException { 034 ParameterDeclarationSubstituted node = (ParameterDeclarationSubstituted)super.clone(); 035 node.sourceVariableDecl_computed = false; 036 node.sourceVariableDecl_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 ParameterDeclarationSubstituted copy() { 046 047 try { 048 ParameterDeclarationSubstituted node = (ParameterDeclarationSubstituted) 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 ParameterDeclarationSubstituted fullCopy() { 066 067 ParameterDeclarationSubstituted tree = (ParameterDeclarationSubstituted) 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 * 083 */ 084 public ParameterDeclarationSubstituted() { 085 super(); 086 087 088 } 089 /** 090 * Initializes the child array to the correct size. 091 * Initializes List and Opt nta children. 092 * @apilevel internal 093 * @ast method 094 * @ast method 095 * 096 */ 097 public void init$Children() { 098 children = new ASTNode[2]; 099 } 100 /** 101 * @ast method 102 * 103 */ 104 public ParameterDeclarationSubstituted(Modifiers p0, Access p1, String p2, ParameterDeclaration p3) { 105 setChild(p0, 0); 106 setChild(p1, 1); 107 setID(p2); 108 setOriginal(p3); 109 } 110 /** 111 * @ast method 112 * 113 */ 114 public ParameterDeclarationSubstituted(Modifiers p0, Access p1, beaver.Symbol p2, ParameterDeclaration p3) { 115 setChild(p0, 0); 116 setChild(p1, 1); 117 setID(p2); 118 setOriginal(p3); 119 } 120 /** 121 * @apilevel low-level 122 * @ast method 123 * 124 */ 125 protected int numChildren() { 126 return 2; 127 } 128 /** 129 * @apilevel internal 130 * @ast method 131 * 132 */ 133 public boolean mayHaveRewrite() { 134 return false; 135 } 136 /** 137 * Replaces the Modifiers child. 138 * @param node The new node to replace the Modifiers child. 139 * @apilevel high-level 140 * @ast method 141 * 142 */ 143 public void setModifiers(Modifiers node) { 144 setChild(node, 0); 145 } 146 /** 147 * Retrieves the Modifiers child. 148 * @return The current node used as the Modifiers child. 149 * @apilevel high-level 150 * @ast method 151 * 152 */ 153 public Modifiers getModifiers() { 154 return (Modifiers)getChild(0); 155 } 156 /** 157 * Retrieves the Modifiers child. 158 * <p><em>This method does not invoke AST transformations.</em></p> 159 * @return The current node used as the Modifiers child. 160 * @apilevel low-level 161 * @ast method 162 * 163 */ 164 public Modifiers getModifiersNoTransform() { 165 return (Modifiers)getChildNoTransform(0); 166 } 167 /** 168 * Replaces the TypeAccess child. 169 * @param node The new node to replace the TypeAccess child. 170 * @apilevel high-level 171 * @ast method 172 * 173 */ 174 public void setTypeAccess(Access node) { 175 setChild(node, 1); 176 } 177 /** 178 * Retrieves the TypeAccess child. 179 * @return The current node used as the TypeAccess child. 180 * @apilevel high-level 181 * @ast method 182 * 183 */ 184 public Access getTypeAccess() { 185 return (Access)getChild(1); 186 } 187 /** 188 * Retrieves the TypeAccess child. 189 * <p><em>This method does not invoke AST transformations.</em></p> 190 * @return The current node used as the TypeAccess child. 191 * @apilevel low-level 192 * @ast method 193 * 194 */ 195 public Access getTypeAccessNoTransform() { 196 return (Access)getChildNoTransform(1); 197 } 198 /** 199 * Replaces the lexeme ID. 200 * @param value The new value for the lexeme ID. 201 * @apilevel high-level 202 * @ast method 203 * 204 */ 205 public void setID(String value) { 206 tokenString_ID = value; 207 } 208 /** 209 * JastAdd-internal setter for lexeme ID using the Beaver parser. 210 * @apilevel internal 211 * @ast method 212 * 213 */ 214 public void setID(beaver.Symbol symbol) { 215 if(symbol.value != null && !(symbol.value instanceof String)) 216 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 217 tokenString_ID = (String)symbol.value; 218 IDstart = symbol.getStart(); 219 IDend = symbol.getEnd(); 220 } 221 /** 222 * Retrieves the value for the lexeme ID. 223 * @return The value for the lexeme ID. 224 * @apilevel high-level 225 * @ast method 226 * 227 */ 228 public String getID() { 229 return tokenString_ID != null ? tokenString_ID : ""; 230 } 231 /** 232 * Replaces the lexeme Original. 233 * @param value The new value for the lexeme Original. 234 * @apilevel high-level 235 * @ast method 236 * 237 */ 238 public void setOriginal(ParameterDeclaration value) { 239 tokenParameterDeclaration_Original = value; 240 } 241 /** 242 * @apilevel internal 243 * @ast method 244 * 245 */ 246 247 /** 248 * @apilevel internal 249 */ 250 protected ParameterDeclaration tokenParameterDeclaration_Original; 251 /** 252 * Retrieves the value for the lexeme Original. 253 * @return The value for the lexeme Original. 254 * @apilevel high-level 255 * @ast method 256 * 257 */ 258 public ParameterDeclaration getOriginal() { 259 return tokenParameterDeclaration_Original; 260 } 261 /** 262 * @apilevel internal 263 */ 264 protected boolean sourceVariableDecl_computed = false; 265 /** 266 * @apilevel internal 267 */ 268 protected Variable sourceVariableDecl_value; 269 /** 270 * @attribute syn 271 * @aspect SourceDeclarations 272 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1524 273 */ 274 @SuppressWarnings({"unchecked", "cast"}) 275 public Variable sourceVariableDecl() { 276 if(sourceVariableDecl_computed) { 277 return sourceVariableDecl_value; 278 } 279 ASTNode$State state = state(); 280 int num = state.boundariesCrossed; 281 boolean isFinal = this.is$Final(); 282 sourceVariableDecl_value = sourceVariableDecl_compute(); 283 if(isFinal && num == state().boundariesCrossed){ sourceVariableDecl_computed = true; } 284 return sourceVariableDecl_value; 285 } 286 /** 287 * @apilevel internal 288 */ 289 private Variable sourceVariableDecl_compute() { return getOriginal().sourceVariableDecl(); } 290 /** 291 * @apilevel internal 292 */ 293 public ASTNode rewriteTo() { 294 return super.rewriteTo(); 295 } 296 }