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 RawMethodDecl : {@link ParMethodDecl}; 015 * @ast node 016 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericMethods.ast:8 017 */ 018 public class RawMethodDecl extends ParMethodDecl 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 RawMethodDecl clone() throws CloneNotSupportedException { 034 RawMethodDecl node = (RawMethodDecl)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 RawMethodDecl copy() { 044 045 try { 046 RawMethodDecl node = (RawMethodDecl) 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 RawMethodDecl fullCopy() { 064 065 RawMethodDecl tree = (RawMethodDecl) 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 * @aspect LookupParTypeDecl 081 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:863 082 */ 083 public boolean isRawType() { 084 return true; 085 } 086 /** 087 * @ast method 088 * 089 */ 090 public RawMethodDecl() { 091 super(); 092 093 094 } 095 /** 096 * Initializes the child array to the correct size. 097 * Initializes List and Opt nta children. 098 * @apilevel internal 099 * @ast method 100 * @ast method 101 * 102 */ 103 public void init$Children() { 104 children = new ASTNode[6]; 105 setChild(new List(), 2); 106 setChild(new List(), 3); 107 setChild(new Opt(), 4); 108 setChild(new List(), 5); 109 } 110 /** 111 * @ast method 112 * 113 */ 114 public RawMethodDecl(Modifiers p0, Access p1, String p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5, List<Access> p6, GenericMethodDecl p7) { 115 setChild(p0, 0); 116 setChild(p1, 1); 117 setID(p2); 118 setChild(p3, 2); 119 setChild(p4, 3); 120 setChild(p5, 4); 121 setChild(p6, 5); 122 setGenericMethodDecl(p7); 123 } 124 /** 125 * @ast method 126 * 127 */ 128 public RawMethodDecl(Modifiers p0, Access p1, beaver.Symbol p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5, List<Access> p6, GenericMethodDecl p7) { 129 setChild(p0, 0); 130 setChild(p1, 1); 131 setID(p2); 132 setChild(p3, 2); 133 setChild(p4, 3); 134 setChild(p5, 4); 135 setChild(p6, 5); 136 setGenericMethodDecl(p7); 137 } 138 /** 139 * @apilevel low-level 140 * @ast method 141 * 142 */ 143 protected int numChildren() { 144 return 6; 145 } 146 /** 147 * @apilevel internal 148 * @ast method 149 * 150 */ 151 public boolean mayHaveRewrite() { 152 return false; 153 } 154 /** 155 * Replaces the Modifiers child. 156 * @param node The new node to replace the Modifiers child. 157 * @apilevel high-level 158 * @ast method 159 * 160 */ 161 public void setModifiers(Modifiers node) { 162 setChild(node, 0); 163 } 164 /** 165 * Retrieves the Modifiers child. 166 * @return The current node used as the Modifiers child. 167 * @apilevel high-level 168 * @ast method 169 * 170 */ 171 public Modifiers getModifiers() { 172 return (Modifiers)getChild(0); 173 } 174 /** 175 * Retrieves the Modifiers child. 176 * <p><em>This method does not invoke AST transformations.</em></p> 177 * @return The current node used as the Modifiers child. 178 * @apilevel low-level 179 * @ast method 180 * 181 */ 182 public Modifiers getModifiersNoTransform() { 183 return (Modifiers)getChildNoTransform(0); 184 } 185 /** 186 * Replaces the TypeAccess child. 187 * @param node The new node to replace the TypeAccess child. 188 * @apilevel high-level 189 * @ast method 190 * 191 */ 192 public void setTypeAccess(Access node) { 193 setChild(node, 1); 194 } 195 /** 196 * Retrieves the TypeAccess child. 197 * @return The current node used as the TypeAccess child. 198 * @apilevel high-level 199 * @ast method 200 * 201 */ 202 public Access getTypeAccess() { 203 return (Access)getChild(1); 204 } 205 /** 206 * Retrieves the TypeAccess child. 207 * <p><em>This method does not invoke AST transformations.</em></p> 208 * @return The current node used as the TypeAccess child. 209 * @apilevel low-level 210 * @ast method 211 * 212 */ 213 public Access getTypeAccessNoTransform() { 214 return (Access)getChildNoTransform(1); 215 } 216 /** 217 * Replaces the lexeme ID. 218 * @param value The new value for the lexeme ID. 219 * @apilevel high-level 220 * @ast method 221 * 222 */ 223 public void setID(String value) { 224 tokenString_ID = value; 225 } 226 /** 227 * JastAdd-internal setter for lexeme ID using the Beaver parser. 228 * @apilevel internal 229 * @ast method 230 * 231 */ 232 public void setID(beaver.Symbol symbol) { 233 if(symbol.value != null && !(symbol.value instanceof String)) 234 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 235 tokenString_ID = (String)symbol.value; 236 IDstart = symbol.getStart(); 237 IDend = symbol.getEnd(); 238 } 239 /** 240 * Retrieves the value for the lexeme ID. 241 * @return The value for the lexeme ID. 242 * @apilevel high-level 243 * @ast method 244 * 245 */ 246 public String getID() { 247 return tokenString_ID != null ? tokenString_ID : ""; 248 } 249 /** 250 * Replaces the Parameter list. 251 * @param list The new list node to be used as the Parameter list. 252 * @apilevel high-level 253 * @ast method 254 * 255 */ 256 public void setParameterList(List<ParameterDeclaration> list) { 257 setChild(list, 2); 258 } 259 /** 260 * Retrieves the number of children in the Parameter list. 261 * @return Number of children in the Parameter list. 262 * @apilevel high-level 263 * @ast method 264 * 265 */ 266 public int getNumParameter() { 267 return getParameterList().getNumChild(); 268 } 269 /** 270 * Retrieves the number of children in the Parameter list. 271 * Calling this method will not trigger rewrites.. 272 * @return Number of children in the Parameter list. 273 * @apilevel low-level 274 * @ast method 275 * 276 */ 277 public int getNumParameterNoTransform() { 278 return getParameterListNoTransform().getNumChildNoTransform(); 279 } 280 /** 281 * Retrieves the element at index {@code i} in the Parameter list.. 282 * @param i Index of the element to return. 283 * @return The element at position {@code i} in the Parameter list. 284 * @apilevel high-level 285 * @ast method 286 * 287 */ 288 @SuppressWarnings({"unchecked", "cast"}) 289 public ParameterDeclaration getParameter(int i) { 290 return (ParameterDeclaration)getParameterList().getChild(i); 291 } 292 /** 293 * Append an element to the Parameter list. 294 * @param node The element to append to the Parameter list. 295 * @apilevel high-level 296 * @ast method 297 * 298 */ 299 public void addParameter(ParameterDeclaration node) { 300 List<ParameterDeclaration> list = (parent == null || state == null) ? getParameterListNoTransform() : getParameterList(); 301 list.addChild(node); 302 } 303 /** 304 * @apilevel low-level 305 * @ast method 306 * 307 */ 308 public void addParameterNoTransform(ParameterDeclaration node) { 309 List<ParameterDeclaration> list = getParameterListNoTransform(); 310 list.addChild(node); 311 } 312 /** 313 * Replaces the Parameter list element at index {@code i} with the new node {@code node}. 314 * @param node The new node to replace the old list element. 315 * @param i The list index of the node to be replaced. 316 * @apilevel high-level 317 * @ast method 318 * 319 */ 320 public void setParameter(ParameterDeclaration node, int i) { 321 List<ParameterDeclaration> list = getParameterList(); 322 list.setChild(node, i); 323 } 324 /** 325 * Retrieves the Parameter list. 326 * @return The node representing the Parameter list. 327 * @apilevel high-level 328 * @ast method 329 * 330 */ 331 public List<ParameterDeclaration> getParameters() { 332 return getParameterList(); 333 } 334 /** 335 * Retrieves the Parameter list. 336 * <p><em>This method does not invoke AST transformations.</em></p> 337 * @return The node representing the Parameter list. 338 * @apilevel low-level 339 * @ast method 340 * 341 */ 342 public List<ParameterDeclaration> getParametersNoTransform() { 343 return getParameterListNoTransform(); 344 } 345 /** 346 * Retrieves the Parameter list. 347 * @return The node representing the Parameter list. 348 * @apilevel high-level 349 * @ast method 350 * 351 */ 352 @SuppressWarnings({"unchecked", "cast"}) 353 public List<ParameterDeclaration> getParameterList() { 354 List<ParameterDeclaration> list = (List<ParameterDeclaration>)getChild(2); 355 list.getNumChild(); 356 return list; 357 } 358 /** 359 * Retrieves the Parameter list. 360 * <p><em>This method does not invoke AST transformations.</em></p> 361 * @return The node representing the Parameter list. 362 * @apilevel low-level 363 * @ast method 364 * 365 */ 366 @SuppressWarnings({"unchecked", "cast"}) 367 public List<ParameterDeclaration> getParameterListNoTransform() { 368 return (List<ParameterDeclaration>)getChildNoTransform(2); 369 } 370 /** 371 * Replaces the Exception list. 372 * @param list The new list node to be used as the Exception list. 373 * @apilevel high-level 374 * @ast method 375 * 376 */ 377 public void setExceptionList(List<Access> list) { 378 setChild(list, 3); 379 } 380 /** 381 * Retrieves the number of children in the Exception list. 382 * @return Number of children in the Exception list. 383 * @apilevel high-level 384 * @ast method 385 * 386 */ 387 public int getNumException() { 388 return getExceptionList().getNumChild(); 389 } 390 /** 391 * Retrieves the number of children in the Exception list. 392 * Calling this method will not trigger rewrites.. 393 * @return Number of children in the Exception list. 394 * @apilevel low-level 395 * @ast method 396 * 397 */ 398 public int getNumExceptionNoTransform() { 399 return getExceptionListNoTransform().getNumChildNoTransform(); 400 } 401 /** 402 * Retrieves the element at index {@code i} in the Exception list.. 403 * @param i Index of the element to return. 404 * @return The element at position {@code i} in the Exception list. 405 * @apilevel high-level 406 * @ast method 407 * 408 */ 409 @SuppressWarnings({"unchecked", "cast"}) 410 public Access getException(int i) { 411 return (Access)getExceptionList().getChild(i); 412 } 413 /** 414 * Append an element to the Exception list. 415 * @param node The element to append to the Exception list. 416 * @apilevel high-level 417 * @ast method 418 * 419 */ 420 public void addException(Access node) { 421 List<Access> list = (parent == null || state == null) ? getExceptionListNoTransform() : getExceptionList(); 422 list.addChild(node); 423 } 424 /** 425 * @apilevel low-level 426 * @ast method 427 * 428 */ 429 public void addExceptionNoTransform(Access node) { 430 List<Access> list = getExceptionListNoTransform(); 431 list.addChild(node); 432 } 433 /** 434 * Replaces the Exception list element at index {@code i} with the new node {@code node}. 435 * @param node The new node to replace the old list element. 436 * @param i The list index of the node to be replaced. 437 * @apilevel high-level 438 * @ast method 439 * 440 */ 441 public void setException(Access node, int i) { 442 List<Access> list = getExceptionList(); 443 list.setChild(node, i); 444 } 445 /** 446 * Retrieves the Exception list. 447 * @return The node representing the Exception list. 448 * @apilevel high-level 449 * @ast method 450 * 451 */ 452 public List<Access> getExceptions() { 453 return getExceptionList(); 454 } 455 /** 456 * Retrieves the Exception list. 457 * <p><em>This method does not invoke AST transformations.</em></p> 458 * @return The node representing the Exception list. 459 * @apilevel low-level 460 * @ast method 461 * 462 */ 463 public List<Access> getExceptionsNoTransform() { 464 return getExceptionListNoTransform(); 465 } 466 /** 467 * Retrieves the Exception list. 468 * @return The node representing the Exception list. 469 * @apilevel high-level 470 * @ast method 471 * 472 */ 473 @SuppressWarnings({"unchecked", "cast"}) 474 public List<Access> getExceptionList() { 475 List<Access> list = (List<Access>)getChild(3); 476 list.getNumChild(); 477 return list; 478 } 479 /** 480 * Retrieves the Exception list. 481 * <p><em>This method does not invoke AST transformations.</em></p> 482 * @return The node representing the Exception list. 483 * @apilevel low-level 484 * @ast method 485 * 486 */ 487 @SuppressWarnings({"unchecked", "cast"}) 488 public List<Access> getExceptionListNoTransform() { 489 return (List<Access>)getChildNoTransform(3); 490 } 491 /** 492 * Replaces the optional node for the Block child. This is the {@code Opt} node containing the child Block, not the actual child! 493 * @param opt The new node to be used as the optional node for the Block child. 494 * @apilevel low-level 495 * @ast method 496 * 497 */ 498 public void setBlockOpt(Opt<Block> opt) { 499 setChild(opt, 4); 500 } 501 /** 502 * Check whether the optional Block child exists. 503 * @return {@code true} if the optional Block child exists, {@code false} if it does not. 504 * @apilevel high-level 505 * @ast method 506 * 507 */ 508 public boolean hasBlock() { 509 return getBlockOpt().getNumChild() != 0; 510 } 511 /** 512 * Retrieves the (optional) Block child. 513 * @return The Block child, if it exists. Returns {@code null} otherwise. 514 * @apilevel low-level 515 * @ast method 516 * 517 */ 518 @SuppressWarnings({"unchecked", "cast"}) 519 public Block getBlock() { 520 return (Block)getBlockOpt().getChild(0); 521 } 522 /** 523 * Replaces the (optional) Block child. 524 * @param node The new node to be used as the Block child. 525 * @apilevel high-level 526 * @ast method 527 * 528 */ 529 public void setBlock(Block node) { 530 getBlockOpt().setChild(node, 0); 531 } 532 /** 533 * @apilevel low-level 534 * @ast method 535 * 536 */ 537 @SuppressWarnings({"unchecked", "cast"}) 538 public Opt<Block> getBlockOpt() { 539 return (Opt<Block>)getChild(4); 540 } 541 /** 542 * Retrieves the optional node for child Block. This is the {@code Opt} node containing the child Block, not the actual child! 543 * <p><em>This method does not invoke AST transformations.</em></p> 544 * @return The optional node for child Block. 545 * @apilevel low-level 546 * @ast method 547 * 548 */ 549 @SuppressWarnings({"unchecked", "cast"}) 550 public Opt<Block> getBlockOptNoTransform() { 551 return (Opt<Block>)getChildNoTransform(4); 552 } 553 /** 554 * Replaces the TypeArgument list. 555 * @param list The new list node to be used as the TypeArgument list. 556 * @apilevel high-level 557 * @ast method 558 * 559 */ 560 public void setTypeArgumentList(List<Access> list) { 561 setChild(list, 5); 562 } 563 /** 564 * Retrieves the number of children in the TypeArgument list. 565 * @return Number of children in the TypeArgument list. 566 * @apilevel high-level 567 * @ast method 568 * 569 */ 570 public int getNumTypeArgument() { 571 return getTypeArgumentList().getNumChild(); 572 } 573 /** 574 * Retrieves the number of children in the TypeArgument list. 575 * Calling this method will not trigger rewrites.. 576 * @return Number of children in the TypeArgument list. 577 * @apilevel low-level 578 * @ast method 579 * 580 */ 581 public int getNumTypeArgumentNoTransform() { 582 return getTypeArgumentListNoTransform().getNumChildNoTransform(); 583 } 584 /** 585 * Retrieves the element at index {@code i} in the TypeArgument list.. 586 * @param i Index of the element to return. 587 * @return The element at position {@code i} in the TypeArgument list. 588 * @apilevel high-level 589 * @ast method 590 * 591 */ 592 @SuppressWarnings({"unchecked", "cast"}) 593 public Access getTypeArgument(int i) { 594 return (Access)getTypeArgumentList().getChild(i); 595 } 596 /** 597 * Append an element to the TypeArgument list. 598 * @param node The element to append to the TypeArgument list. 599 * @apilevel high-level 600 * @ast method 601 * 602 */ 603 public void addTypeArgument(Access node) { 604 List<Access> list = (parent == null || state == null) ? getTypeArgumentListNoTransform() : getTypeArgumentList(); 605 list.addChild(node); 606 } 607 /** 608 * @apilevel low-level 609 * @ast method 610 * 611 */ 612 public void addTypeArgumentNoTransform(Access node) { 613 List<Access> list = getTypeArgumentListNoTransform(); 614 list.addChild(node); 615 } 616 /** 617 * Replaces the TypeArgument list element at index {@code i} with the new node {@code node}. 618 * @param node The new node to replace the old list element. 619 * @param i The list index of the node to be replaced. 620 * @apilevel high-level 621 * @ast method 622 * 623 */ 624 public void setTypeArgument(Access node, int i) { 625 List<Access> list = getTypeArgumentList(); 626 list.setChild(node, i); 627 } 628 /** 629 * Retrieves the TypeArgument list. 630 * @return The node representing the TypeArgument list. 631 * @apilevel high-level 632 * @ast method 633 * 634 */ 635 public List<Access> getTypeArguments() { 636 return getTypeArgumentList(); 637 } 638 /** 639 * Retrieves the TypeArgument list. 640 * <p><em>This method does not invoke AST transformations.</em></p> 641 * @return The node representing the TypeArgument list. 642 * @apilevel low-level 643 * @ast method 644 * 645 */ 646 public List<Access> getTypeArgumentsNoTransform() { 647 return getTypeArgumentListNoTransform(); 648 } 649 /** 650 * Retrieves the TypeArgument list. 651 * @return The node representing the TypeArgument list. 652 * @apilevel high-level 653 * @ast method 654 * 655 */ 656 @SuppressWarnings({"unchecked", "cast"}) 657 public List<Access> getTypeArgumentList() { 658 List<Access> list = (List<Access>)getChild(5); 659 list.getNumChild(); 660 return list; 661 } 662 /** 663 * Retrieves the TypeArgument list. 664 * <p><em>This method does not invoke AST transformations.</em></p> 665 * @return The node representing the TypeArgument list. 666 * @apilevel low-level 667 * @ast method 668 * 669 */ 670 @SuppressWarnings({"unchecked", "cast"}) 671 public List<Access> getTypeArgumentListNoTransform() { 672 return (List<Access>)getChildNoTransform(5); 673 } 674 /** 675 * Replaces the lexeme GenericMethodDecl. 676 * @param value The new value for the lexeme GenericMethodDecl. 677 * @apilevel high-level 678 * @ast method 679 * 680 */ 681 public void setGenericMethodDecl(GenericMethodDecl value) { 682 tokenGenericMethodDecl_GenericMethodDecl = value; 683 } 684 /** 685 * Retrieves the value for the lexeme GenericMethodDecl. 686 * @return The value for the lexeme GenericMethodDecl. 687 * @apilevel high-level 688 * @ast method 689 * 690 */ 691 public GenericMethodDecl getGenericMethodDecl() { 692 return tokenGenericMethodDecl_GenericMethodDecl; 693 } 694 /** 695 * @apilevel internal 696 */ 697 public ASTNode rewriteTo() { 698 return super.rewriteTo(); 699 } 700 }