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 FloatingPointType : {@link NumericType}; 015 * @ast node 016 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:61 017 */ 018 public class FloatingPointType extends NumericType 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 FloatingPointType clone() throws CloneNotSupportedException { 034 FloatingPointType node = (FloatingPointType)super.clone(); 035 node.in$Circle(false); 036 node.is$Final(false); 037 return node; 038 } 039 /** 040 * @apilevel internal 041 */ 042 @SuppressWarnings({"unchecked", "cast"}) 043 public FloatingPointType copy() { 044 045 try { 046 FloatingPointType node = (FloatingPointType) clone(); 047 node.parent = null; 048 if(children != null) 049 node.children = (ASTNode[]) children.clone(); 050 051 return node; 052 } catch (CloneNotSupportedException e) { 053 throw new Error("Error: clone not supported for " + getClass().getName()); 054 } 055 056 }/** 057 * Create a deep copy of the AST subtree at this node. 058 * The copy is dangling, i.e. has no parent. 059 * @return dangling copy of the subtree at this node 060 * @apilevel low-level 061 */ 062 @SuppressWarnings({"unchecked", "cast"}) 063 public FloatingPointType fullCopy() { 064 065 FloatingPointType tree = (FloatingPointType) copy(); 066 if (children != null) { 067 for (int i = 0; i < children.length; ++i) { 068 069 ASTNode child = (ASTNode) children[i]; 070 if(child != null) { 071 child = child.fullCopy(); 072 tree.setChild(child, i); 073 } 074 } 075 } 076 return tree; 077 078 } /** 079 * @ast method 080 * 081 */ 082 public FloatingPointType() { 083 super(); 084 085 086 } 087 /** 088 * Initializes the child array to the correct size. 089 * Initializes List and Opt nta children. 090 * @apilevel internal 091 * @ast method 092 * @ast method 093 * 094 */ 095 public void init$Children() { 096 children = new ASTNode[3]; 097 setChild(new Opt(), 1); 098 setChild(new List(), 2); 099 } 100 /** 101 * @ast method 102 * 103 */ 104 public FloatingPointType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) { 105 setChild(p0, 0); 106 setID(p1); 107 setChild(p2, 1); 108 setChild(p3, 2); 109 } 110 /** 111 * @ast method 112 * 113 */ 114 public FloatingPointType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) { 115 setChild(p0, 0); 116 setID(p1); 117 setChild(p2, 1); 118 setChild(p3, 2); 119 } 120 /** 121 * @apilevel low-level 122 * @ast method 123 * 124 */ 125 protected int numChildren() { 126 return 3; 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 lexeme ID. 169 * @param value The new value for the lexeme ID. 170 * @apilevel high-level 171 * @ast method 172 * 173 */ 174 public void setID(String value) { 175 tokenString_ID = value; 176 } 177 /** 178 * JastAdd-internal setter for lexeme ID using the Beaver parser. 179 * @apilevel internal 180 * @ast method 181 * 182 */ 183 public void setID(beaver.Symbol symbol) { 184 if(symbol.value != null && !(symbol.value instanceof String)) 185 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 186 tokenString_ID = (String)symbol.value; 187 IDstart = symbol.getStart(); 188 IDend = symbol.getEnd(); 189 } 190 /** 191 * Retrieves the value for the lexeme ID. 192 * @return The value for the lexeme ID. 193 * @apilevel high-level 194 * @ast method 195 * 196 */ 197 public String getID() { 198 return tokenString_ID != null ? tokenString_ID : ""; 199 } 200 /** 201 * Replaces the optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! 202 * @param opt The new node to be used as the optional node for the SuperClassAccess child. 203 * @apilevel low-level 204 * @ast method 205 * 206 */ 207 public void setSuperClassAccessOpt(Opt<Access> opt) { 208 setChild(opt, 1); 209 } 210 /** 211 * Check whether the optional SuperClassAccess child exists. 212 * @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not. 213 * @apilevel high-level 214 * @ast method 215 * 216 */ 217 public boolean hasSuperClassAccess() { 218 return getSuperClassAccessOpt().getNumChild() != 0; 219 } 220 /** 221 * Retrieves the (optional) SuperClassAccess child. 222 * @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise. 223 * @apilevel low-level 224 * @ast method 225 * 226 */ 227 @SuppressWarnings({"unchecked", "cast"}) 228 public Access getSuperClassAccess() { 229 return (Access)getSuperClassAccessOpt().getChild(0); 230 } 231 /** 232 * Replaces the (optional) SuperClassAccess child. 233 * @param node The new node to be used as the SuperClassAccess child. 234 * @apilevel high-level 235 * @ast method 236 * 237 */ 238 public void setSuperClassAccess(Access node) { 239 getSuperClassAccessOpt().setChild(node, 0); 240 } 241 /** 242 * @apilevel low-level 243 * @ast method 244 * 245 */ 246 @SuppressWarnings({"unchecked", "cast"}) 247 public Opt<Access> getSuperClassAccessOpt() { 248 return (Opt<Access>)getChild(1); 249 } 250 /** 251 * Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! 252 * <p><em>This method does not invoke AST transformations.</em></p> 253 * @return The optional node for child SuperClassAccess. 254 * @apilevel low-level 255 * @ast method 256 * 257 */ 258 @SuppressWarnings({"unchecked", "cast"}) 259 public Opt<Access> getSuperClassAccessOptNoTransform() { 260 return (Opt<Access>)getChildNoTransform(1); 261 } 262 /** 263 * Replaces the BodyDecl list. 264 * @param list The new list node to be used as the BodyDecl list. 265 * @apilevel high-level 266 * @ast method 267 * 268 */ 269 public void setBodyDeclList(List<BodyDecl> list) { 270 setChild(list, 2); 271 } 272 /** 273 * Retrieves the number of children in the BodyDecl list. 274 * @return Number of children in the BodyDecl list. 275 * @apilevel high-level 276 * @ast method 277 * 278 */ 279 public int getNumBodyDecl() { 280 return getBodyDeclList().getNumChild(); 281 } 282 /** 283 * Retrieves the number of children in the BodyDecl list. 284 * Calling this method will not trigger rewrites.. 285 * @return Number of children in the BodyDecl list. 286 * @apilevel low-level 287 * @ast method 288 * 289 */ 290 public int getNumBodyDeclNoTransform() { 291 return getBodyDeclListNoTransform().getNumChildNoTransform(); 292 } 293 /** 294 * Retrieves the element at index {@code i} in the BodyDecl list.. 295 * @param i Index of the element to return. 296 * @return The element at position {@code i} in the BodyDecl list. 297 * @apilevel high-level 298 * @ast method 299 * 300 */ 301 @SuppressWarnings({"unchecked", "cast"}) 302 public BodyDecl getBodyDecl(int i) { 303 return (BodyDecl)getBodyDeclList().getChild(i); 304 } 305 /** 306 * Append an element to the BodyDecl list. 307 * @param node The element to append to the BodyDecl list. 308 * @apilevel high-level 309 * @ast method 310 * 311 */ 312 public void addBodyDecl(BodyDecl node) { 313 List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); 314 list.addChild(node); 315 } 316 /** 317 * @apilevel low-level 318 * @ast method 319 * 320 */ 321 public void addBodyDeclNoTransform(BodyDecl node) { 322 List<BodyDecl> list = getBodyDeclListNoTransform(); 323 list.addChild(node); 324 } 325 /** 326 * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. 327 * @param node The new node to replace the old list element. 328 * @param i The list index of the node to be replaced. 329 * @apilevel high-level 330 * @ast method 331 * 332 */ 333 public void setBodyDecl(BodyDecl node, int i) { 334 List<BodyDecl> list = getBodyDeclList(); 335 list.setChild(node, i); 336 } 337 /** 338 * Retrieves the BodyDecl list. 339 * @return The node representing the BodyDecl list. 340 * @apilevel high-level 341 * @ast method 342 * 343 */ 344 public List<BodyDecl> getBodyDecls() { 345 return getBodyDeclList(); 346 } 347 /** 348 * Retrieves the BodyDecl list. 349 * <p><em>This method does not invoke AST transformations.</em></p> 350 * @return The node representing the BodyDecl list. 351 * @apilevel low-level 352 * @ast method 353 * 354 */ 355 public List<BodyDecl> getBodyDeclsNoTransform() { 356 return getBodyDeclListNoTransform(); 357 } 358 /** 359 * Retrieves the BodyDecl list. 360 * @return The node representing the BodyDecl list. 361 * @apilevel high-level 362 * @ast method 363 * 364 */ 365 @SuppressWarnings({"unchecked", "cast"}) 366 public List<BodyDecl> getBodyDeclList() { 367 List<BodyDecl> list = (List<BodyDecl>)getChild(2); 368 list.getNumChild(); 369 return list; 370 } 371 /** 372 * Retrieves the BodyDecl list. 373 * <p><em>This method does not invoke AST transformations.</em></p> 374 * @return The node representing the BodyDecl list. 375 * @apilevel low-level 376 * @ast method 377 * 378 */ 379 @SuppressWarnings({"unchecked", "cast"}) 380 public List<BodyDecl> getBodyDeclListNoTransform() { 381 return (List<BodyDecl>)getChildNoTransform(2); 382 } 383 /** 384 * @apilevel internal 385 */ 386 public ASTNode rewriteTo() { 387 return super.rewriteTo(); 388 } 389 }