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