001 /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.13-12-g880e696 */ 002 package org.extendj.ast; 003 004 import java.util.HashSet; 005 import java.io.File; 006 import java.util.Set; 007 import java.util.Collections; 008 import java.util.Collection; 009 import java.util.ArrayList; 010 import beaver.*; 011 import java.util.*; 012 import java.io.ByteArrayOutputStream; 013 import java.io.PrintStream; 014 import java.lang.reflect.InvocationTargetException; 015 import java.lang.reflect.Method; 016 import org.jastadd.util.*; 017 import java.util.zip.*; 018 import java.io.*; 019 import org.jastadd.util.PrettyPrintable; 020 import org.jastadd.util.PrettyPrinter; 021 import java.io.FileNotFoundException; 022 import java.io.BufferedInputStream; 023 import java.io.DataInputStream; 024 /** 025 * @ast node 026 * @declaredat /home/jesper/git/extendj/java5/grammar/Generics.ast:34 027 * @production VariableArityParameterDeclarationSubstituted : {@link VariableArityParameterDeclaration} ::= <span class="component"><Original:VariableArityParameterDeclaration></span>; 028 029 */ 030 public class VariableArityParameterDeclarationSubstituted extends VariableArityParameterDeclaration implements Cloneable { 031 /** 032 * @declaredat ASTNode:1 033 */ 034 public VariableArityParameterDeclarationSubstituted() { 035 super(); 036 } 037 /** 038 * Initializes the child array to the correct size. 039 * Initializes List and Opt nta children. 040 * @apilevel internal 041 * @ast method 042 * @declaredat ASTNode:10 043 */ 044 public void init$Children() { 045 children = new ASTNode[2]; 046 } 047 /** 048 * @declaredat ASTNode:13 049 */ 050 public VariableArityParameterDeclarationSubstituted(Modifiers p0, Access p1, String p2, VariableArityParameterDeclaration p3) { 051 setChild(p0, 0); 052 setChild(p1, 1); 053 setID(p2); 054 setOriginal(p3); 055 } 056 /** 057 * @declaredat ASTNode:19 058 */ 059 public VariableArityParameterDeclarationSubstituted(Modifiers p0, Access p1, beaver.Symbol p2, VariableArityParameterDeclaration p3) { 060 setChild(p0, 0); 061 setChild(p1, 1); 062 setID(p2); 063 setOriginal(p3); 064 } 065 /** 066 * @apilevel low-level 067 * @declaredat ASTNode:28 068 */ 069 protected int numChildren() { 070 return 2; 071 } 072 /** 073 * @apilevel internal 074 * @declaredat ASTNode:34 075 */ 076 public boolean mayHaveRewrite() { 077 return false; 078 } 079 /** 080 * @apilevel internal 081 * @declaredat ASTNode:40 082 */ 083 public void flushAttrCache() { 084 super.flushAttrCache(); 085 } 086 /** 087 * @apilevel internal 088 * @declaredat ASTNode:46 089 */ 090 public void flushCollectionCache() { 091 super.flushCollectionCache(); 092 } 093 /** 094 * @apilevel internal 095 * @declaredat ASTNode:52 096 */ 097 public void flushRewriteCache() { 098 super.flushRewriteCache(); 099 } 100 /** 101 * @apilevel internal 102 * @declaredat ASTNode:58 103 */ 104 public VariableArityParameterDeclarationSubstituted clone() throws CloneNotSupportedException { 105 VariableArityParameterDeclarationSubstituted node = (VariableArityParameterDeclarationSubstituted) super.clone(); 106 return node; 107 } 108 /** 109 * @apilevel internal 110 * @declaredat ASTNode:65 111 */ 112 public VariableArityParameterDeclarationSubstituted copy() { 113 try { 114 VariableArityParameterDeclarationSubstituted node = (VariableArityParameterDeclarationSubstituted) clone(); 115 node.parent = null; 116 if (children != null) { 117 node.children = (ASTNode[]) children.clone(); 118 } 119 return node; 120 } catch (CloneNotSupportedException e) { 121 throw new Error("Error: clone not supported for " + getClass().getName()); 122 } 123 } 124 /** 125 * Create a deep copy of the AST subtree at this node. 126 * The copy is dangling, i.e. has no parent. 127 * @return dangling copy of the subtree at this node 128 * @apilevel low-level 129 * @deprecated Please use treeCopy or treeCopyNoTransform instead 130 * @declaredat ASTNode:84 131 */ 132 @Deprecated 133 public VariableArityParameterDeclarationSubstituted fullCopy() { 134 return treeCopyNoTransform(); 135 } 136 /** 137 * Create a deep copy of the AST subtree at this node. 138 * The copy is dangling, i.e. has no parent. 139 * @return dangling copy of the subtree at this node 140 * @apilevel low-level 141 * @declaredat ASTNode:94 142 */ 143 public VariableArityParameterDeclarationSubstituted treeCopyNoTransform() { 144 VariableArityParameterDeclarationSubstituted tree = (VariableArityParameterDeclarationSubstituted) copy(); 145 if (children != null) { 146 for (int i = 0; i < children.length; ++i) { 147 ASTNode child = (ASTNode) children[i]; 148 if (child != null) { 149 child = child.treeCopyNoTransform(); 150 tree.setChild(child, i); 151 } 152 } 153 } 154 return tree; 155 } 156 /** 157 * Create a deep copy of the AST subtree at this node. 158 * The subtree of this node is traversed to trigger rewrites before copy. 159 * The copy is dangling, i.e. has no parent. 160 * @return dangling copy of the subtree at this node 161 * @apilevel low-level 162 * @declaredat ASTNode:114 163 */ 164 public VariableArityParameterDeclarationSubstituted treeCopy() { 165 doFullTraversal(); 166 return treeCopyNoTransform(); 167 } 168 /** 169 * @apilevel internal 170 * @declaredat ASTNode:121 171 */ 172 protected boolean is$Equal(ASTNode node) { 173 return super.is$Equal(node) && (tokenString_ID == ((VariableArityParameterDeclarationSubstituted)node).tokenString_ID) && (tokenVariableArityParameterDeclaration_Original == ((VariableArityParameterDeclarationSubstituted)node).tokenVariableArityParameterDeclaration_Original); 174 } 175 /** 176 * Replaces the Modifiers child. 177 * @param node The new node to replace the Modifiers child. 178 * @apilevel high-level 179 */ 180 public void setModifiers(Modifiers node) { 181 setChild(node, 0); 182 } 183 /** 184 * Retrieves the Modifiers child. 185 * @return The current node used as the Modifiers child. 186 * @apilevel high-level 187 */ 188 @ASTNodeAnnotation.Child(name="Modifiers") 189 public Modifiers getModifiers() { 190 return (Modifiers) getChild(0); 191 } 192 /** 193 * Retrieves the Modifiers child. 194 * <p><em>This method does not invoke AST transformations.</em></p> 195 * @return The current node used as the Modifiers child. 196 * @apilevel low-level 197 */ 198 public Modifiers getModifiersNoTransform() { 199 return (Modifiers) getChildNoTransform(0); 200 } 201 /** 202 * Replaces the TypeAccess child. 203 * @param node The new node to replace the TypeAccess child. 204 * @apilevel high-level 205 */ 206 public void setTypeAccess(Access node) { 207 setChild(node, 1); 208 } 209 /** 210 * Retrieves the TypeAccess child. 211 * @return The current node used as the TypeAccess child. 212 * @apilevel high-level 213 */ 214 @ASTNodeAnnotation.Child(name="TypeAccess") 215 public Access getTypeAccess() { 216 return (Access) getChild(1); 217 } 218 /** 219 * Retrieves the TypeAccess child. 220 * <p><em>This method does not invoke AST transformations.</em></p> 221 * @return The current node used as the TypeAccess child. 222 * @apilevel low-level 223 */ 224 public Access getTypeAccessNoTransform() { 225 return (Access) getChildNoTransform(1); 226 } 227 /** 228 * Replaces the lexeme ID. 229 * @param value The new value for the lexeme ID. 230 * @apilevel high-level 231 */ 232 public void setID(String value) { 233 tokenString_ID = value; 234 } 235 /** 236 * JastAdd-internal setter for lexeme ID using the Beaver parser. 237 * @param symbol Symbol containing the new value for the lexeme ID 238 * @apilevel internal 239 */ 240 public void setID(beaver.Symbol symbol) { 241 if (symbol.value != null && !(symbol.value instanceof String)) 242 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 243 tokenString_ID = (String)symbol.value; 244 IDstart = symbol.getStart(); 245 IDend = symbol.getEnd(); 246 } 247 /** 248 * Retrieves the value for the lexeme ID. 249 * @return The value for the lexeme ID. 250 * @apilevel high-level 251 */ 252 @ASTNodeAnnotation.Token(name="ID") 253 public String getID() { 254 return tokenString_ID != null ? tokenString_ID : ""; 255 } 256 /** 257 * Replaces the lexeme Original. 258 * @param value The new value for the lexeme Original. 259 * @apilevel high-level 260 */ 261 public void setOriginal(VariableArityParameterDeclaration value) { 262 tokenVariableArityParameterDeclaration_Original = value; 263 } 264 /** 265 * @apilevel internal 266 */ 267 protected VariableArityParameterDeclaration tokenVariableArityParameterDeclaration_Original; 268 /** 269 * Retrieves the value for the lexeme Original. 270 * @return The value for the lexeme Original. 271 * @apilevel high-level 272 */ 273 @ASTNodeAnnotation.Token(name="Original") 274 public VariableArityParameterDeclaration getOriginal() { 275 return tokenVariableArityParameterDeclaration_Original; 276 } 277 /** 278 * @apilevel internal 279 */ 280 public ASTNode rewriteTo() { 281 return super.rewriteTo(); 282 } 283 }