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 ASTNode; 015 * @ast node 016 * 017 */ 018 public class ASTNode<T extends ASTNode> extends beaver.Symbol implements Cloneable, Iterable<T> { 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 ASTNode<T> clone() throws CloneNotSupportedException { 034 ASTNode node = (ASTNode)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 ASTNode<T> copy() { 044 045 try { 046 ASTNode node = (ASTNode) 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 ASTNode<T> fullCopy() { 064 065 ASTNode tree = (ASTNode) 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 AccessControl 081 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/AccessControl.jrag:125 082 */ 083 public void accessControl() { 084 } 085 /** 086 * @ast method 087 * @aspect AnonymousClasses 088 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/AnonymousClasses.jrag:202 089 */ 090 protected void collectExceptions(Collection c, ASTNode target) { 091 for(int i = 0; i < getNumChild(); i++) 092 getChild(i).collectExceptions(c, target); 093 } 094 /** 095 * @ast method 096 * @aspect BranchTarget 097 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/BranchTarget.jrag:44 098 */ 099 public void collectBranches(Collection c) { 100 for(int i = 0; i < getNumChild(); i++) 101 getChild(i).collectBranches(c); 102 } 103 /** 104 * @ast method 105 * @aspect BranchTarget 106 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/BranchTarget.jrag:150 107 */ 108 public Stmt branchTarget(Stmt branchStmt) { 109 if(getParent() != null) 110 return getParent().branchTarget(branchStmt); 111 else 112 return null; 113 } 114 /** 115 * @ast method 116 * @aspect BranchTarget 117 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/BranchTarget.jrag:190 118 */ 119 public void collectFinally(Stmt branchStmt, ArrayList list) { 120 if(getParent() != null) 121 getParent().collectFinally(branchStmt, list); 122 } 123 /** 124 * @ast method 125 * @aspect DeclareBeforeUse 126 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/DeclareBeforeUse.jrag:13 127 */ 128 public int varChildIndex(Block b) { 129 ASTNode node = this; 130 while(node.getParent().getParent() != b) { 131 node = node.getParent(); 132 } 133 return b.getStmtListNoTransform().getIndexOfChild(node); 134 } 135 /** 136 * @ast method 137 * @aspect DeclareBeforeUse 138 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/DeclareBeforeUse.jrag:31 139 */ 140 public int varChildIndex(TypeDecl t) { 141 ASTNode node = this; 142 while(node != null && node.getParent() != null && node.getParent().getParent() != t) { 143 node = node.getParent(); 144 } 145 if(node == null) 146 return -1; 147 return t.getBodyDeclListNoTransform().getIndexOfChild(node); 148 } 149 /** 150 * @ast method 151 * @aspect DefiniteAssignment 152 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:12 153 */ 154 public void definiteAssignment() { 155 } 156 /** 157 * @ast method 158 * @aspect DA 159 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:450 160 */ 161 protected boolean checkDUeverywhere(Variable v) { 162 for(int i = 0; i < getNumChild(); i++) 163 if(!getChild(i).checkDUeverywhere(v)) 164 return false; 165 return true; 166 } 167 /** 168 * @ast method 169 * @aspect DA 170 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:560 171 */ 172 protected boolean isDescendantTo(ASTNode node) { 173 if(this == node) 174 return true; 175 if(getParent() == null) 176 return false; 177 return getParent().isDescendantTo(node); 178 } 179 /** 180 * @ast method 181 * @aspect ErrorCheck 182 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:12 183 */ 184 protected String sourceFile() { 185 ASTNode node = this; 186 while(node != null && !(node instanceof CompilationUnit)) 187 node = node.getParent(); 188 if(node == null) 189 return "Unknown file"; 190 CompilationUnit u = (CompilationUnit)node; 191 return u.relativeName(); 192 } 193 /** 194 * @ast method 195 * @aspect ErrorCheck 196 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:34 197 */ 198 public ASTNode setLocation(ASTNode node) { 199 setStart(node.getStart()); 200 setEnd(node.getEnd()); 201 return this; 202 } 203 /** 204 * @ast method 205 * @aspect ErrorCheck 206 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:40 207 */ 208 public ASTNode setStart(int i) { 209 start = i; 210 return this; 211 } 212 /** 213 * @ast method 214 * @aspect ErrorCheck 215 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:44 216 */ 217 public int start() { 218 return start; 219 } 220 /** 221 * @ast method 222 * @aspect ErrorCheck 223 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:47 224 */ 225 public ASTNode setEnd(int i) { 226 end = i; 227 return this; 228 } 229 /** 230 * @ast method 231 * @aspect ErrorCheck 232 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:51 233 */ 234 public int end() { 235 return end; 236 } 237 /** 238 * @ast method 239 * @aspect ErrorCheck 240 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:55 241 */ 242 public String location() { 243 return "" + lineNumber(); 244 } 245 /** 246 * @ast method 247 * @aspect ErrorCheck 248 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:58 249 */ 250 public String errorPrefix() { 251 return sourceFile() + ":" + location() + ":\n" + " *** Semantic Error: "; 252 } 253 /** 254 * @ast method 255 * @aspect ErrorCheck 256 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:61 257 */ 258 public String warningPrefix() { 259 return sourceFile() + ":" + location() + ":\n" + " *** WARNING: "; 260 } 261 /** 262 * @ast method 263 * @aspect ErrorCheck 264 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:171 265 */ 266 public void error(String s) { 267 ASTNode node = this; 268 while(node != null && !(node instanceof CompilationUnit)) 269 node = node.getParent(); 270 CompilationUnit cu = (CompilationUnit)node; 271 if(getNumChild() == 0 && getStart() != 0 && getEnd() != 0) { 272 int line = getLine(getStart()); 273 int column = getColumn(getStart()); 274 int endLine = getLine(getEnd()); 275 int endColumn = getColumn(getEnd()); 276 cu.errors.add(new Problem(sourceFile(), s, line, column, endLine, endColumn, Problem.Severity.ERROR, Problem.Kind.SEMANTIC)); 277 } 278 else 279 cu.errors.add(new Problem(sourceFile(), s, lineNumber(), Problem.Severity.ERROR, Problem.Kind.SEMANTIC)); 280 } 281 /** 282 * @ast method 283 * @aspect ErrorCheck 284 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:187 285 */ 286 public void warning(String s) { 287 ASTNode node = this; 288 while(node != null && !(node instanceof CompilationUnit)) 289 node = node.getParent(); 290 CompilationUnit cu = (CompilationUnit)node; 291 cu.warnings.add(new Problem(sourceFile(), "WARNING: " + s, lineNumber(), Problem.Severity.WARNING)); 292 } 293 /** 294 * @ast method 295 * @aspect ExceptionHandling 296 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:54 297 */ 298 public void exceptionHandling() { 299 } 300 /** 301 * @ast method 302 * @aspect ExceptionHandling 303 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ExceptionHandling.jrag:224 304 */ 305 protected boolean reachedException(TypeDecl type) { 306 for(int i = 0; i < getNumChild(); i++) 307 if(getChild(i).reachedException(type)) 308 return true; 309 return false; 310 } 311 /** 312 * @ast method 313 * @aspect LookupMethod 314 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupMethod.jrag:54 315 */ 316 public static Collection removeInstanceMethods(Collection c) { 317 c = new LinkedList(c); 318 for(Iterator iter = c.iterator(); iter.hasNext(); ) { 319 MethodDecl m = (MethodDecl)iter.next(); 320 if(!m.isStatic()) 321 iter.remove(); 322 } 323 return c; 324 } 325 /** 326 * @ast method 327 * @aspect MemberMethods 328 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupMethod.jrag:359 329 */ 330 protected static void putSimpleSetElement(HashMap map, Object key, Object value) { 331 SimpleSet set = (SimpleSet)map.get(key); 332 if(set == null) set = SimpleSet.emptySet; 333 map.put(key, set.add(value)); 334 } 335 /** 336 * @ast method 337 * @aspect VariableScope 338 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupVariable.jrag:182 339 */ 340 public SimpleSet removeInstanceVariables(SimpleSet oldSet) { 341 SimpleSet newSet = SimpleSet.emptySet; 342 for(Iterator iter = oldSet.iterator(); iter.hasNext(); ) { 343 Variable v = (Variable)iter.next(); 344 if(!v.isInstanceVariable()) 345 newSet = newSet.add(v); 346 } 347 return newSet; 348 } 349 /** 350 * @ast method 351 * @aspect Modifiers 352 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Modifiers.jrag:11 353 */ 354 void checkModifiers() { 355 } 356 /** 357 * @ast method 358 * @aspect NameCheck 359 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/NameCheck.jrag:11 360 */ 361 public void nameCheck() { 362 } 363 /** 364 * @ast method 365 * @aspect NameCheck 366 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/NameCheck.jrag:14 367 */ 368 public TypeDecl extractSingleType(SimpleSet c) { 369 if(c.size() != 1) 370 return null; 371 return (TypeDecl)c.iterator().next(); 372 } 373 /** 374 * @ast method 375 * @aspect AddOptionsToProgram 376 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/Options.jadd:14 377 */ 378 public Options options() { 379 return state().options; 380 } 381 /** 382 * @ast method 383 * @aspect PrettyPrint 384 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:13 385 */ 386 public String toString() { 387 StringBuffer s = new StringBuffer(); 388 toString(s); 389 return s.toString().trim(); 390 } 391 /** 392 * @ast method 393 * @aspect PrettyPrint 394 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:19 395 */ 396 public void toString(StringBuffer s) { 397 throw new Error("Operation toString(StringBuffer s) not implemented for " + getClass().getName()); 398 } 399 /** 400 * @ast method 401 * @aspect PrettyPrint 402 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:770 403 */ 404 public String dumpTree() { 405 StringBuffer s = new StringBuffer(); 406 dumpTree(s, 0); 407 return s.toString(); 408 } 409 /** 410 * @ast method 411 * @aspect PrettyPrint 412 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:776 413 */ 414 public void dumpTree(StringBuffer s, int j) { 415 for(int i = 0; i < j; i++) { 416 s.append(" "); 417 } 418 s.append(dumpString() + "\n"); 419 for(int i = 0; i < getNumChild(); i++) 420 getChild(i).dumpTree(s, j + 1); 421 } 422 /** 423 * @ast method 424 * @aspect PrettyPrint 425 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:785 426 */ 427 public String dumpTreeNoRewrite() { 428 StringBuffer s = new StringBuffer(); 429 dumpTreeNoRewrite(s, 0); 430 return s.toString(); 431 } 432 /** 433 * @ast method 434 * @aspect PrettyPrint 435 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:790 436 */ 437 protected void dumpTreeNoRewrite(StringBuffer s, int indent) { 438 for(int i = 0; i < indent; i++) 439 s.append(" "); 440 s.append(dumpString()); 441 s.append("\n"); 442 for(int i = 0; i < getNumChildNoTransform(); i++) { 443 getChildNoTransform(i).dumpTreeNoRewrite(s, indent+1); 444 } 445 } 446 /** 447 * @ast method 448 * @aspect PrimitiveTypes 449 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrimitiveTypes.jrag:11 450 */ 451 452 protected static final String PRIMITIVE_PACKAGE_NAME = "@primitive"; 453 /** 454 * @ast method 455 * @aspect TypeCheck 456 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeCheck.jrag:12 457 */ 458 public void typeCheck() { 459 } 460 /** 461 * @ast method 462 * @aspect UnreachableStatements 463 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/UnreachableStatements.jrag:12 464 */ 465 void checkUnreachableStmt() { 466 } 467 /** 468 * @ast method 469 * @aspect VariableDeclarationTransformation 470 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/VariableDeclaration.jrag:134 471 */ 472 public void clearLocations() { 473 setStart(0); 474 setEnd(0); 475 for(int i = 0; i < getNumChildNoTransform(); i++) 476 getChildNoTransform(i).clearLocations(); 477 } 478 /** 479 * @ast method 480 * @aspect CodeGeneration 481 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:11 482 */ 483 public void setSourceLineNumber(int i) { 484 setStart(ASTNode.makePosition(i, 1)); 485 } 486 /** 487 * @ast method 488 * @aspect CodeGeneration 489 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:30 490 */ 491 protected int findFirstSourceLineNumber() { 492 if(getStart() != 0) 493 return getLine(getStart()); 494 for(int i = 0; i < getNumChild(); i++) { 495 int num = getChild(i).findFirstSourceLineNumber(); 496 if(num != -1) 497 return num; 498 } 499 return -1; 500 } 501 /** 502 * @ast method 503 * @aspect CodeGeneration 504 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:586 505 */ 506 public void error() { 507 Throwable t = new Throwable(); 508 StackTraceElement[] ste = new Throwable().getStackTrace(); 509 String s = ste[1].toString(); 510 throw new Error(s+" Cannot create bytecode for:"+getClass().getName()); 511 } 512 /** 513 * @ast method 514 * @aspect CreateBCode 515 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CreateBCode.jrag:202 516 */ 517 public void createBCode(CodeGeneration gen) { 518 for (int i=0; i<getNumChild(); i++) 519 getChild(i).createBCode(gen); 520 } 521 /** 522 * @ast method 523 * @aspect FlushCaches 524 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/FlushCaches.jrag:3 525 */ 526 public void flushCaches() { 527 flushCache(); 528 for(int i = 0; i < getNumChild(); i++) 529 getChild(i).flushCaches(); 530 } 531 /** 532 * @ast method 533 * @aspect GenerateClassfile 534 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/GenerateClassfile.jrag:303 535 */ 536 public boolean clear() { 537 boolean empty = true; 538 for(int i = 0; i < getNumChild(); i++) { 539 ASTNode child = getChild(i); 540 if(!child.clear()) 541 empty = false; 542 else { 543 if(child instanceof List) 544 ((ASTNode)this).setChild(new List(), i); 545 else if(child instanceof Opt) 546 ((ASTNode)this).setChild(new Opt(), i); 547 //setChild(null, i); 548 } 549 } 550 if(empty) { 551 setParent(null); 552 } 553 if(flush()) 554 flushCache(); 555 return empty; 556 } 557 /** 558 * @ast method 559 * @aspect InnerClasses 560 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/InnerClasses.jrag:158 561 */ 562 public void collectEnclosingVariables(HashSet set, TypeDecl typeDecl) { 563 for(int i = 0; i < getNumChild(); i++) 564 getChild(i).collectEnclosingVariables(set, typeDecl); 565 } 566 /** 567 * @ast method 568 * @aspect Transformations 569 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Transformations.jrag:12 570 */ 571 public void transformation() { 572 for(int i = 0; i < getNumChild(); i++) { 573 getChild(i).transformation(); 574 } 575 } 576 /** 577 * @ast method 578 * @aspect Transformations 579 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Transformations.jrag:209 580 */ 581 protected ASTNode replace(ASTNode node) { 582 state().replacePos = node.getParent().getIndexOfChild(node); 583 node.getParent().in$Circle(true); 584 return node.getParent(); 585 } 586 /** 587 * @ast method 588 * @aspect Transformations 589 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Transformations.jrag:214 590 */ 591 protected ASTNode with(ASTNode node) { 592 ((ASTNode)this).setChild(node, state().replacePos); 593 in$Circle(false); 594 return node; 595 } 596 /** 597 * @ast method 598 * @aspect Enums 599 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Enums.jrag:131 600 */ 601 protected void transformEnumConstructors() { 602 for(int i = 0; i < getNumChildNoTransform(); i++) { 603 ASTNode child = getChildNoTransform(i); 604 if(child != null) 605 child.transformEnumConstructors(); 606 } 607 } 608 /** 609 * @ast method 610 * @aspect Enums 611 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Enums.jrag:444 612 */ 613 protected void checkEnum(EnumDecl enumDecl) { 614 for(int i = 0; i < getNumChild(); i++) 615 getChild(i).checkEnum(enumDecl); 616 } 617 /** 618 * Create a deep copy of this subtree. 619 * The copy is dangling, i.e. has no parent. 620 * 621 * @return a dangling copy of the subtree at this node 622 * @ast method 623 * @aspect JastAddExtensions 624 * @declaredat /home/jesper/svn/JastAddJ/Java7Frontend/JastAddExtensions.jadd:20 625 */ 626 public ASTNode cloneSubtree() { 627 try { 628 ASTNode tree = (ASTNode) clone(); 629 tree.setParent(null);// make dangling 630 if (children != null) { 631 tree.children = new ASTNode[children.length]; 632 for (int i = 0; i < children.length; ++i) { 633 if (children[i] == null) { 634 tree.children[i] = null; 635 } else { 636 tree.children[i] = children[i].cloneSubtree(); 637 tree.children[i].setParent(tree); 638 } 639 } 640 } 641 return tree; 642 } catch (CloneNotSupportedException e) { 643 throw new Error("Error: clone not supported for " + 644 getClass().getName()); 645 } 646 } 647 /** 648 * @ast method 649 * @aspect UncheckedConversion 650 * @declaredat /home/jesper/svn/JastAddJ/Java7Frontend/UncheckedConversion.jrag:40 651 */ 652 public void checkUncheckedConversion(TypeDecl source, TypeDecl dest) { 653 if (source.isUncheckedConversionTo(dest)) 654 warning("unchecked conversion from raw type "+source.typeName()+ 655 " to generic type "+dest.typeName()); 656 } 657 /** 658 * Checking of the SafeVarargs annotation is only needed for method 659 * declarations. 660 * @ast method 661 * @aspect Warnings 662 * @declaredat /home/jesper/svn/JastAddJ/Java7Frontend/Warnings.jadd:38 663 */ 664 public void checkWarnings() { 665 } 666 /** 667 * @ast method 668 * 669 */ 670 public ASTNode() { 671 super(); 672 673 init$Children(); 674 675 } 676 /** 677 * Initializes the child array to the correct size. 678 * Initializes List and Opt nta children. 679 * @apilevel internal 680 * @ast method 681 * @ast method 682 * 683 */ 684 public void init$Children() { 685 } 686 /** 687 * @apilevel internal 688 * @ast method 689 * 690 */ 691 692 /** 693 * @apilevel internal 694 */ 695 public static final boolean generatedWithCircularEnabled = true; 696 /** 697 * @apilevel internal 698 * @ast method 699 * 700 */ 701 702 /** 703 * @apilevel internal 704 */ 705 public static final boolean generatedWithCacheCycle = false; 706 /** 707 * @apilevel internal 708 * @ast method 709 * 710 */ 711 712 /** 713 * @apilevel internal 714 */ 715 public static final boolean generatedWithComponentCheck = false; 716 /** 717 * @apilevel internal 718 * @ast method 719 * 720 */ 721 722 /** 723 * @apilevel internal 724 */ 725 protected static ASTNode$State state = new ASTNode$State(); 726 /** 727 * @apilevel internal 728 * @ast method 729 * 730 */ 731 public final ASTNode$State state() { return state; } 732 /** 733 * @apilevel internal 734 * @ast method 735 * 736 */ 737 738 /** 739 * @apilevel internal 740 */ 741 public boolean in$Circle = false; 742 /** 743 * @apilevel internal 744 * @ast method 745 * 746 */ 747 public boolean in$Circle() { return in$Circle; } 748 /** 749 * @apilevel internal 750 * @ast method 751 * 752 */ 753 public void in$Circle(boolean b) { in$Circle = b; } 754 /** 755 * @apilevel internal 756 * @ast method 757 * 758 */ 759 760 /** 761 * @apilevel internal 762 */ 763 public boolean is$Final = false; 764 /** 765 * @apilevel internal 766 * @ast method 767 * 768 */ 769 public boolean is$Final() { return is$Final; } 770 /** 771 * @apilevel internal 772 * @ast method 773 * 774 */ 775 public void is$Final(boolean b) { is$Final = b; } 776 /** 777 * @apilevel low-level 778 * @ast method 779 * 780 */ 781 @SuppressWarnings("cast") public T getChild(int i) { 782 ASTNode node = this.getChildNoTransform(i); 783 if(node == null) return null; 784 if(node.is$Final()) { 785 return (T) node; 786 } 787 if(!node.mayHaveRewrite()) { 788 node.is$Final(this.is$Final()); 789 return (T) node; 790 } 791 if(!node.in$Circle()) { 792 int rewriteState; 793 int num = this.state().boundariesCrossed; 794 do { 795 this.state().push(ASTNode$State.REWRITE_CHANGE); 796 ASTNode oldNode = node; 797 oldNode.in$Circle(true); 798 node = node.rewriteTo(); 799 if(node != oldNode) { 800 this.setChild(node, i); 801 } 802 oldNode.in$Circle(false); 803 rewriteState = this.state().pop(); 804 } while(rewriteState == ASTNode$State.REWRITE_CHANGE); 805 if(rewriteState == ASTNode$State.REWRITE_NOCHANGE && this.is$Final()) { 806 node.is$Final(true); 807 this.state().boundariesCrossed = num; 808 } 809 } 810 else if(this.is$Final() != node.is$Final()) this.state().boundariesCrossed++; 811 return (T) node; 812 } 813 /** 814 * @apilevel internal 815 * @ast method 816 * 817 */ 818 819 /** 820 * @apilevel internal 821 */ 822 private int childIndex; 823 /** 824 * @apilevel low-level 825 * @ast method 826 * 827 */ 828 public int getIndexOfChild(ASTNode node) { 829 if(node != null && node.childIndex < getNumChildNoTransform() && node == getChildNoTransform(node.childIndex)) 830 return node.childIndex; 831 for(int i = 0; i < getNumChildNoTransform(); i++) 832 if(getChildNoTransform(i) == node) { 833 node.childIndex = i; 834 return i; 835 } 836 return -1; 837 } 838 /** 839 * @apilevel low-level 840 * @ast method 841 * 842 */ 843 public void addChild(T node) { 844 setChild(node, getNumChildNoTransform()); 845 } 846 /** 847 * <p><em>This method does not invoke AST transformations.</em></p> 848 * @apilevel low-level 849 * @ast method 850 * 851 */ 852 @SuppressWarnings("cast") 853 public final T getChildNoTransform(int i) { 854 return (T) (children != null ? children[i] : null); 855 } 856 /** 857 * @apilevel low-level 858 * @ast method 859 * 860 */ 861 862 /** 863 * @apilevel low-level 864 */ 865 protected int numChildren; 866 /** 867 * @apilevel low-level 868 * @ast method 869 * 870 */ 871 protected int numChildren() { 872 return numChildren; 873 } 874 /** 875 * @apilevel low-level 876 * @ast method 877 * 878 */ 879 public int getNumChild() { 880 return numChildren(); 881 } 882 /** 883 * <p><em>This method does not invoke AST transformations.</em></p> 884 * @apilevel low-level 885 * @ast method 886 * 887 */ 888 public final int getNumChildNoTransform() { 889 return numChildren(); 890 } 891 /** 892 * @apilevel low-level 893 * @ast method 894 * 895 */ 896 public void setChild(ASTNode node, int i) { 897 if(children == null) { 898 children = new ASTNode[i+1>4?i+1:4]; 899 } else if (i >= children.length) { 900 ASTNode c[] = new ASTNode[i << 1]; 901 System.arraycopy(children, 0, c, 0, children.length); 902 children = c; 903 } 904 children[i] = node; 905 if(i >= numChildren) numChildren = i+1; 906 if(node != null) { node.setParent(this); node.childIndex = i; } 907 } 908 /** 909 * @apilevel low-level 910 * @ast method 911 * 912 */ 913 public void insertChild(ASTNode node, int i) { 914 if(children == null) { 915 children = new ASTNode[i+1>4?i+1:4]; 916 children[i] = node; 917 } else { 918 ASTNode c[] = new ASTNode[children.length + 1]; 919 System.arraycopy(children, 0, c, 0, i); 920 c[i] = node; 921 if(i < children.length) { 922 System.arraycopy(children, i, c, i+1, children.length-i); 923 for(int j = i+1; j < c.length; ++j) { 924 if(c[j] != null) 925 c[j].childIndex = j; 926 } 927 } 928 children = c; 929 } 930 numChildren++; 931 if(node != null) { node.setParent(this); node.childIndex = i; } 932 } 933 /** 934 * @apilevel low-level 935 * @ast method 936 * 937 */ 938 public void removeChild(int i) { 939 if(children != null) { 940 ASTNode child = (ASTNode)children[i]; 941 if(child != null) { 942 child.parent = null; 943 child.childIndex = -1; 944 } 945 if (this instanceof List || this instanceof Opt) { 946 System.arraycopy(children, i+1, children, i, children.length-i-1); 947 children[children.length-1] = null; 948 numChildren--; 949 for(int j = i; j < numChildren; ++j) { 950 if(children[j] != null) { 951 child = (ASTNode) children[j]; 952 child.childIndex = j; 953 } 954 } 955 } else { 956 children[i] = null; 957 } 958 } 959 } 960 /** 961 * @apilevel low-level 962 * @ast method 963 * 964 */ 965 public ASTNode getParent() { 966 if(parent != null && ((ASTNode)parent).is$Final() != is$Final()) { 967 state().boundariesCrossed++; 968 } 969 return (ASTNode)parent; 970 } 971 /** 972 * @apilevel low-level 973 * @ast method 974 * 975 */ 976 public void setParent(ASTNode node) { 977 parent = node; 978 } 979 /** 980 * @apilevel low-level 981 * @ast method 982 * 983 */ 984 985 /** 986 * @apilevel low-level 987 */ 988 protected ASTNode parent; 989 /** 990 * @apilevel low-level 991 * @ast method 992 * 993 */ 994 995 /** 996 * @apilevel low-level 997 */ 998 protected ASTNode[] children; 999 /** 1000 * @ast method 1001 * 1002 */ 1003 protected boolean duringImplicitConstructor() { 1004 if(state().duringImplicitConstructor == 0) { 1005 return false; 1006 } 1007 else { 1008 state().pop(); 1009 state().push(ASTNode$State.REWRITE_INTERRUPT); 1010 return true; 1011 } 1012 } 1013 /** 1014 * @ast method 1015 * 1016 */ 1017 protected boolean duringBoundNames() { 1018 if(state().duringBoundNames == 0) { 1019 return false; 1020 } 1021 else { 1022 state().pop(); 1023 state().push(ASTNode$State.REWRITE_INTERRUPT); 1024 return true; 1025 } 1026 } 1027 /** 1028 * @ast method 1029 * 1030 */ 1031 protected boolean duringNameResolution() { 1032 if(state().duringNameResolution == 0) { 1033 return false; 1034 } 1035 else { 1036 state().pop(); 1037 state().push(ASTNode$State.REWRITE_INTERRUPT); 1038 return true; 1039 } 1040 } 1041 /** 1042 * @ast method 1043 * 1044 */ 1045 protected boolean duringSyntacticClassification() { 1046 if(state().duringSyntacticClassification == 0) { 1047 return false; 1048 } 1049 else { 1050 state().pop(); 1051 state().push(ASTNode$State.REWRITE_INTERRUPT); 1052 return true; 1053 } 1054 } 1055 /** 1056 * @ast method 1057 * 1058 */ 1059 protected boolean duringAnonymousClasses() { 1060 if(state().duringAnonymousClasses == 0) { 1061 return false; 1062 } 1063 else { 1064 state().pop(); 1065 state().push(ASTNode$State.REWRITE_INTERRUPT); 1066 return true; 1067 } 1068 } 1069 /** 1070 * @ast method 1071 * 1072 */ 1073 protected boolean duringVariableDeclarationTransformation() { 1074 if(state().duringVariableDeclarationTransformation == 0) { 1075 return false; 1076 } 1077 else { 1078 state().pop(); 1079 state().push(ASTNode$State.REWRITE_INTERRUPT); 1080 return true; 1081 } 1082 } 1083 /** 1084 * @ast method 1085 * 1086 */ 1087 protected boolean duringLiterals() { 1088 if(state().duringLiterals == 0) { 1089 return false; 1090 } 1091 else { 1092 state().pop(); 1093 state().push(ASTNode$State.REWRITE_INTERRUPT); 1094 return true; 1095 } 1096 } 1097 /** 1098 * @ast method 1099 * 1100 */ 1101 protected boolean duringDU() { 1102 if(state().duringDU == 0) { 1103 return false; 1104 } 1105 else { 1106 state().pop(); 1107 state().push(ASTNode$State.REWRITE_INTERRUPT); 1108 return true; 1109 } 1110 } 1111 /** 1112 * @ast method 1113 * 1114 */ 1115 protected boolean duringAnnotations() { 1116 if(state().duringAnnotations == 0) { 1117 return false; 1118 } 1119 else { 1120 state().pop(); 1121 state().push(ASTNode$State.REWRITE_INTERRUPT); 1122 return true; 1123 } 1124 } 1125 /** 1126 * @ast method 1127 * 1128 */ 1129 protected boolean duringEnums() { 1130 if(state().duringEnums == 0) { 1131 return false; 1132 } 1133 else { 1134 state().pop(); 1135 state().push(ASTNode$State.REWRITE_INTERRUPT); 1136 return true; 1137 } 1138 } 1139 /** 1140 * @ast method 1141 * 1142 */ 1143 protected boolean duringGenericTypeVariables() { 1144 if(state().duringGenericTypeVariables == 0) { 1145 return false; 1146 } 1147 else { 1148 state().pop(); 1149 state().push(ASTNode$State.REWRITE_INTERRUPT); 1150 return true; 1151 } 1152 } 1153 /** 1154 * @apilevel low-level 1155 * @ast method 1156 * 1157 */ 1158 public java.util.Iterator<T> iterator() { 1159 return new java.util.Iterator<T>() { 1160 private int counter = 0; 1161 public boolean hasNext() { 1162 return counter < getNumChild(); 1163 } 1164 @SuppressWarnings("unchecked") public T next() { 1165 if(hasNext()) 1166 return (T)getChild(counter++); 1167 else 1168 return null; 1169 } 1170 public void remove() { 1171 throw new UnsupportedOperationException(); 1172 } 1173 }; 1174 } 1175 /** 1176 * @apilevel internal 1177 * @ast method 1178 * 1179 */ 1180 public boolean mayHaveRewrite() { 1181 return false; 1182 } 1183 /** 1184 * The collectErrors method is refined so that it calls 1185 * the checkWarnings method on each ASTNode to report 1186 * unchecked warnings. 1187 * @ast method 1188 * @aspect Warnings 1189 * @declaredat /home/jesper/svn/JastAddJ/Java7Frontend/Warnings.jadd:20 1190 */ 1191 public void collectErrors() { 1192 nameCheck(); 1193 typeCheck(); 1194 accessControl(); 1195 exceptionHandling(); 1196 checkUnreachableStmt(); 1197 definiteAssignment(); 1198 checkModifiers(); 1199 checkWarnings(); 1200 for(int i = 0; i < getNumChild(); i++) { 1201 getChild(i).collectErrors(); 1202 } 1203 } 1204 /** 1205 * @attribute syn 1206 * @aspect DU 1207 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/DefiniteAssignment.jrag:1196 1208 */ 1209 public boolean unassignedEverywhere(Variable v, TryStmt stmt) { 1210 ASTNode$State state = state(); 1211 try { 1212 for(int i = 0; i < getNumChild(); i++) { 1213 if(!getChild(i).unassignedEverywhere(v, stmt)) 1214 return false; 1215 } 1216 return true; 1217 } 1218 finally { 1219 } 1220 } 1221 /** 1222 * @attribute syn 1223 * @aspect ErrorCheck 1224 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/ErrorCheck.jrag:22 1225 */ 1226 public int lineNumber() { 1227 ASTNode$State state = state(); 1228 try { 1229 ASTNode n = this; 1230 while(n.getParent() != null && n.getStart() == 0) { 1231 n = n.getParent(); 1232 } 1233 return getLine(n.getStart()); 1234 } 1235 finally { 1236 } 1237 } 1238 /** 1239 * @attribute syn 1240 * @aspect PrettyPrint 1241 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:744 1242 */ 1243 public String indent() { 1244 ASTNode$State state = state(); 1245 try { 1246 String indent = extractIndent(); 1247 return indent.startsWith("\n") ? indent : ("\n" + indent); 1248 } 1249 finally { 1250 } 1251 } 1252 /** 1253 * @attribute syn 1254 * @aspect PrettyPrint 1255 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:749 1256 */ 1257 public String extractIndent() { 1258 ASTNode$State state = state(); 1259 try { 1260 if(getParent() == null) 1261 return ""; 1262 String indent = getParent().extractIndent(); 1263 if(getParent().addsIndentationLevel()) 1264 indent += " "; 1265 return indent; 1266 } 1267 finally { 1268 } 1269 } 1270 /** 1271 * @attribute syn 1272 * @aspect PrettyPrint 1273 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:758 1274 */ 1275 public boolean addsIndentationLevel() { 1276 ASTNode$State state = state(); 1277 try { return false; } 1278 finally { 1279 } 1280 } 1281 /** 1282 * @attribute syn 1283 * @aspect PrettyPrint 1284 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800 1285 */ 1286 public String dumpString() { 1287 ASTNode$State state = state(); 1288 try { return getClass().getName(); } 1289 finally { 1290 } 1291 } 1292 /** 1293 * @attribute syn 1294 * @aspect CodeGeneration 1295 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:15 1296 */ 1297 public int sourceLineNumber() { 1298 ASTNode$State state = state(); 1299 try { return getStart() != 0 ? getLine(getStart()) : -1; } 1300 finally { 1301 } 1302 } 1303 /** 1304 * @attribute syn 1305 * @aspect CreateBCode 1306 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CreateBCode.jrag:946 1307 */ 1308 public boolean definesLabel() { 1309 ASTNode$State state = state(); 1310 try { return false; } 1311 finally { 1312 } 1313 } 1314 /** 1315 * @attribute syn 1316 * @aspect GenerateClassfile 1317 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/GenerateClassfile.jrag:325 1318 */ 1319 public boolean flush() { 1320 ASTNode$State state = state(); 1321 try { return true; } 1322 finally { 1323 } 1324 } 1325 /** 1326 * @attribute syn 1327 * @aspect InnerClasses 1328 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/InnerClasses.jrag:88 1329 */ 1330 public boolean isStringAdd() { 1331 ASTNode$State state = state(); 1332 try { return false; } 1333 finally { 1334 } 1335 } 1336 /** 1337 * @attribute syn 1338 * @aspect LookupParTypeDecl 1339 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1056 1340 */ 1341 public boolean usesTypeVariable() { 1342 ASTNode$State state = state(); 1343 try { 1344 for(int i = 0; i < getNumChild(); i++) 1345 if(getChild(i).usesTypeVariable()) 1346 return true; 1347 return false; 1348 } 1349 finally { 1350 } 1351 } 1352 /** 1353 * Fetches the immediately enclosing compilation unit. 1354 * @attribute inh 1355 * @aspect Literals 1356 * @declaredat /home/jesper/svn/JastAddJ/Java7Frontend/Literals.jrag:451 1357 */ 1358 @SuppressWarnings({"unchecked", "cast"}) 1359 public CompilationUnit compilationUnit() { 1360 ASTNode$State state = state(); 1361 CompilationUnit compilationUnit_value = getParent().Define_CompilationUnit_compilationUnit(this, null); 1362 return compilationUnit_value; 1363 } 1364 /** 1365 * @apilevel internal 1366 */ 1367 public ASTNode rewriteTo() { 1368 if(state().peek() == ASTNode$State.REWRITE_CHANGE) { 1369 state().pop(); 1370 state().push(ASTNode$State.REWRITE_NOCHANGE); 1371 } 1372 return this; 1373 } 1374 /** 1375 * @apilevel internal 1376 */ 1377 public TypeDecl Define_TypeDecl_superType(ASTNode caller, ASTNode child) { 1378 return getParent().Define_TypeDecl_superType(this, caller); 1379 } 1380 /** 1381 * @apilevel internal 1382 */ 1383 public ConstructorDecl Define_ConstructorDecl_constructorDecl(ASTNode caller, ASTNode child) { 1384 return getParent().Define_ConstructorDecl_constructorDecl(this, caller); 1385 } 1386 /** 1387 * @apilevel internal 1388 */ 1389 public TypeDecl Define_TypeDecl_componentType(ASTNode caller, ASTNode child) { 1390 return getParent().Define_TypeDecl_componentType(this, caller); 1391 } 1392 /** 1393 * @apilevel internal 1394 */ 1395 public LabeledStmt Define_LabeledStmt_lookupLabel(ASTNode caller, ASTNode child, String name) { 1396 return getParent().Define_LabeledStmt_lookupLabel(this, caller, name); 1397 } 1398 /** 1399 * @apilevel internal 1400 */ 1401 public boolean Define_boolean_isDest(ASTNode caller, ASTNode child) { 1402 return getParent().Define_boolean_isDest(this, caller); 1403 } 1404 /** 1405 * @apilevel internal 1406 */ 1407 public boolean Define_boolean_isSource(ASTNode caller, ASTNode child) { 1408 return getParent().Define_boolean_isSource(this, caller); 1409 } 1410 /** 1411 * @apilevel internal 1412 */ 1413 public boolean Define_boolean_isIncOrDec(ASTNode caller, ASTNode child) { 1414 return getParent().Define_boolean_isIncOrDec(this, caller); 1415 } 1416 /** 1417 * @apilevel internal 1418 */ 1419 public boolean Define_boolean_isDAbefore(ASTNode caller, ASTNode child, Variable v) { 1420 return getParent().Define_boolean_isDAbefore(this, caller, v); 1421 } 1422 /** 1423 * @apilevel internal 1424 */ 1425 public boolean Define_boolean_isDUbefore(ASTNode caller, ASTNode child, Variable v) { 1426 return getParent().Define_boolean_isDUbefore(this, caller, v); 1427 } 1428 /** 1429 * @apilevel internal 1430 */ 1431 public TypeDecl Define_TypeDecl_typeException(ASTNode caller, ASTNode child) { 1432 return getParent().Define_TypeDecl_typeException(this, caller); 1433 } 1434 /** 1435 * @apilevel internal 1436 */ 1437 public TypeDecl Define_TypeDecl_typeRuntimeException(ASTNode caller, ASTNode child) { 1438 return getParent().Define_TypeDecl_typeRuntimeException(this, caller); 1439 } 1440 /** 1441 * @apilevel internal 1442 */ 1443 public TypeDecl Define_TypeDecl_typeError(ASTNode caller, ASTNode child) { 1444 return getParent().Define_TypeDecl_typeError(this, caller); 1445 } 1446 /** 1447 * @apilevel internal 1448 */ 1449 public TypeDecl Define_TypeDecl_typeNullPointerException(ASTNode caller, ASTNode child) { 1450 return getParent().Define_TypeDecl_typeNullPointerException(this, caller); 1451 } 1452 /** 1453 * @apilevel internal 1454 */ 1455 public TypeDecl Define_TypeDecl_typeThrowable(ASTNode caller, ASTNode child) { 1456 return getParent().Define_TypeDecl_typeThrowable(this, caller); 1457 } 1458 /** 1459 * @apilevel internal 1460 */ 1461 public boolean Define_boolean_handlesException(ASTNode caller, ASTNode child, TypeDecl exceptionType) { 1462 return getParent().Define_boolean_handlesException(this, caller, exceptionType); 1463 } 1464 /** 1465 * @apilevel internal 1466 */ 1467 public Collection Define_Collection_lookupConstructor(ASTNode caller, ASTNode child) { 1468 return getParent().Define_Collection_lookupConstructor(this, caller); 1469 } 1470 /** 1471 * @apilevel internal 1472 */ 1473 public Collection Define_Collection_lookupSuperConstructor(ASTNode caller, ASTNode child) { 1474 return getParent().Define_Collection_lookupSuperConstructor(this, caller); 1475 } 1476 /** 1477 * @apilevel internal 1478 */ 1479 public Expr Define_Expr_nestedScope(ASTNode caller, ASTNode child) { 1480 return getParent().Define_Expr_nestedScope(this, caller); 1481 } 1482 /** 1483 * @apilevel internal 1484 */ 1485 public Collection Define_Collection_lookupMethod(ASTNode caller, ASTNode child, String name) { 1486 return getParent().Define_Collection_lookupMethod(this, caller, name); 1487 } 1488 /** 1489 * @apilevel internal 1490 */ 1491 public TypeDecl Define_TypeDecl_typeObject(ASTNode caller, ASTNode child) { 1492 return getParent().Define_TypeDecl_typeObject(this, caller); 1493 } 1494 /** 1495 * @apilevel internal 1496 */ 1497 public TypeDecl Define_TypeDecl_typeCloneable(ASTNode caller, ASTNode child) { 1498 return getParent().Define_TypeDecl_typeCloneable(this, caller); 1499 } 1500 /** 1501 * @apilevel internal 1502 */ 1503 public TypeDecl Define_TypeDecl_typeSerializable(ASTNode caller, ASTNode child) { 1504 return getParent().Define_TypeDecl_typeSerializable(this, caller); 1505 } 1506 /** 1507 * @apilevel internal 1508 */ 1509 public TypeDecl Define_TypeDecl_typeBoolean(ASTNode caller, ASTNode child) { 1510 return getParent().Define_TypeDecl_typeBoolean(this, caller); 1511 } 1512 /** 1513 * @apilevel internal 1514 */ 1515 public TypeDecl Define_TypeDecl_typeByte(ASTNode caller, ASTNode child) { 1516 return getParent().Define_TypeDecl_typeByte(this, caller); 1517 } 1518 /** 1519 * @apilevel internal 1520 */ 1521 public TypeDecl Define_TypeDecl_typeShort(ASTNode caller, ASTNode child) { 1522 return getParent().Define_TypeDecl_typeShort(this, caller); 1523 } 1524 /** 1525 * @apilevel internal 1526 */ 1527 public TypeDecl Define_TypeDecl_typeChar(ASTNode caller, ASTNode child) { 1528 return getParent().Define_TypeDecl_typeChar(this, caller); 1529 } 1530 /** 1531 * @apilevel internal 1532 */ 1533 public TypeDecl Define_TypeDecl_typeInt(ASTNode caller, ASTNode child) { 1534 return getParent().Define_TypeDecl_typeInt(this, caller); 1535 } 1536 /** 1537 * @apilevel internal 1538 */ 1539 public TypeDecl Define_TypeDecl_typeLong(ASTNode caller, ASTNode child) { 1540 return getParent().Define_TypeDecl_typeLong(this, caller); 1541 } 1542 /** 1543 * @apilevel internal 1544 */ 1545 public TypeDecl Define_TypeDecl_typeFloat(ASTNode caller, ASTNode child) { 1546 return getParent().Define_TypeDecl_typeFloat(this, caller); 1547 } 1548 /** 1549 * @apilevel internal 1550 */ 1551 public TypeDecl Define_TypeDecl_typeDouble(ASTNode caller, ASTNode child) { 1552 return getParent().Define_TypeDecl_typeDouble(this, caller); 1553 } 1554 /** 1555 * @apilevel internal 1556 */ 1557 public TypeDecl Define_TypeDecl_typeString(ASTNode caller, ASTNode child) { 1558 return getParent().Define_TypeDecl_typeString(this, caller); 1559 } 1560 /** 1561 * @apilevel internal 1562 */ 1563 public TypeDecl Define_TypeDecl_typeVoid(ASTNode caller, ASTNode child) { 1564 return getParent().Define_TypeDecl_typeVoid(this, caller); 1565 } 1566 /** 1567 * @apilevel internal 1568 */ 1569 public TypeDecl Define_TypeDecl_typeNull(ASTNode caller, ASTNode child) { 1570 return getParent().Define_TypeDecl_typeNull(this, caller); 1571 } 1572 /** 1573 * @apilevel internal 1574 */ 1575 public TypeDecl Define_TypeDecl_unknownType(ASTNode caller, ASTNode child) { 1576 return getParent().Define_TypeDecl_unknownType(this, caller); 1577 } 1578 /** 1579 * @apilevel internal 1580 */ 1581 public boolean Define_boolean_hasPackage(ASTNode caller, ASTNode child, String packageName) { 1582 return getParent().Define_boolean_hasPackage(this, caller, packageName); 1583 } 1584 /** 1585 * @apilevel internal 1586 */ 1587 public TypeDecl Define_TypeDecl_lookupType(ASTNode caller, ASTNode child, String packageName, String typeName) { 1588 return getParent().Define_TypeDecl_lookupType(this, caller, packageName, typeName); 1589 } 1590 /** 1591 * @apilevel internal 1592 */ 1593 public SimpleSet Define_SimpleSet_lookupType(ASTNode caller, ASTNode child, String name) { 1594 return getParent().Define_SimpleSet_lookupType(this, caller, name); 1595 } 1596 /** 1597 * @apilevel internal 1598 */ 1599 public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, String name) { 1600 return getParent().Define_SimpleSet_lookupVariable(this, caller, name); 1601 } 1602 /** 1603 * @apilevel internal 1604 */ 1605 public boolean Define_boolean_mayBePublic(ASTNode caller, ASTNode child) { 1606 return getParent().Define_boolean_mayBePublic(this, caller); 1607 } 1608 /** 1609 * @apilevel internal 1610 */ 1611 public boolean Define_boolean_mayBeProtected(ASTNode caller, ASTNode child) { 1612 return getParent().Define_boolean_mayBeProtected(this, caller); 1613 } 1614 /** 1615 * @apilevel internal 1616 */ 1617 public boolean Define_boolean_mayBePrivate(ASTNode caller, ASTNode child) { 1618 return getParent().Define_boolean_mayBePrivate(this, caller); 1619 } 1620 /** 1621 * @apilevel internal 1622 */ 1623 public boolean Define_boolean_mayBeStatic(ASTNode caller, ASTNode child) { 1624 return getParent().Define_boolean_mayBeStatic(this, caller); 1625 } 1626 /** 1627 * @apilevel internal 1628 */ 1629 public boolean Define_boolean_mayBeFinal(ASTNode caller, ASTNode child) { 1630 return getParent().Define_boolean_mayBeFinal(this, caller); 1631 } 1632 /** 1633 * @apilevel internal 1634 */ 1635 public boolean Define_boolean_mayBeAbstract(ASTNode caller, ASTNode child) { 1636 return getParent().Define_boolean_mayBeAbstract(this, caller); 1637 } 1638 /** 1639 * @apilevel internal 1640 */ 1641 public boolean Define_boolean_mayBeVolatile(ASTNode caller, ASTNode child) { 1642 return getParent().Define_boolean_mayBeVolatile(this, caller); 1643 } 1644 /** 1645 * @apilevel internal 1646 */ 1647 public boolean Define_boolean_mayBeTransient(ASTNode caller, ASTNode child) { 1648 return getParent().Define_boolean_mayBeTransient(this, caller); 1649 } 1650 /** 1651 * @apilevel internal 1652 */ 1653 public boolean Define_boolean_mayBeStrictfp(ASTNode caller, ASTNode child) { 1654 return getParent().Define_boolean_mayBeStrictfp(this, caller); 1655 } 1656 /** 1657 * @apilevel internal 1658 */ 1659 public boolean Define_boolean_mayBeSynchronized(ASTNode caller, ASTNode child) { 1660 return getParent().Define_boolean_mayBeSynchronized(this, caller); 1661 } 1662 /** 1663 * @apilevel internal 1664 */ 1665 public boolean Define_boolean_mayBeNative(ASTNode caller, ASTNode child) { 1666 return getParent().Define_boolean_mayBeNative(this, caller); 1667 } 1668 /** 1669 * @apilevel internal 1670 */ 1671 public ASTNode Define_ASTNode_enclosingBlock(ASTNode caller, ASTNode child) { 1672 return getParent().Define_ASTNode_enclosingBlock(this, caller); 1673 } 1674 /** 1675 * @apilevel internal 1676 */ 1677 public VariableScope Define_VariableScope_outerScope(ASTNode caller, ASTNode child) { 1678 return getParent().Define_VariableScope_outerScope(this, caller); 1679 } 1680 /** 1681 * @apilevel internal 1682 */ 1683 public boolean Define_boolean_insideLoop(ASTNode caller, ASTNode child) { 1684 return getParent().Define_boolean_insideLoop(this, caller); 1685 } 1686 /** 1687 * @apilevel internal 1688 */ 1689 public boolean Define_boolean_insideSwitch(ASTNode caller, ASTNode child) { 1690 return getParent().Define_boolean_insideSwitch(this, caller); 1691 } 1692 /** 1693 * @apilevel internal 1694 */ 1695 public Case Define_Case_bind(ASTNode caller, ASTNode child, Case c) { 1696 return getParent().Define_Case_bind(this, caller, c); 1697 } 1698 /** 1699 * @apilevel internal 1700 */ 1701 public String Define_String_typeDeclIndent(ASTNode caller, ASTNode child) { 1702 return getParent().Define_String_typeDeclIndent(this, caller); 1703 } 1704 /** 1705 * @apilevel internal 1706 */ 1707 public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { 1708 return getParent().Define_NameType_nameType(this, caller); 1709 } 1710 /** 1711 * @apilevel internal 1712 */ 1713 public boolean Define_boolean_isAnonymous(ASTNode caller, ASTNode child) { 1714 return getParent().Define_boolean_isAnonymous(this, caller); 1715 } 1716 /** 1717 * @apilevel internal 1718 */ 1719 public Variable Define_Variable_unknownField(ASTNode caller, ASTNode child) { 1720 return getParent().Define_Variable_unknownField(this, caller); 1721 } 1722 /** 1723 * @apilevel internal 1724 */ 1725 public MethodDecl Define_MethodDecl_unknownMethod(ASTNode caller, ASTNode child) { 1726 return getParent().Define_MethodDecl_unknownMethod(this, caller); 1727 } 1728 /** 1729 * @apilevel internal 1730 */ 1731 public ConstructorDecl Define_ConstructorDecl_unknownConstructor(ASTNode caller, ASTNode child) { 1732 return getParent().Define_ConstructorDecl_unknownConstructor(this, caller); 1733 } 1734 /** 1735 * @apilevel internal 1736 */ 1737 public TypeDecl Define_TypeDecl_declType(ASTNode caller, ASTNode child) { 1738 return getParent().Define_TypeDecl_declType(this, caller); 1739 } 1740 /** 1741 * @apilevel internal 1742 */ 1743 public BodyDecl Define_BodyDecl_enclosingBodyDecl(ASTNode caller, ASTNode child) { 1744 return getParent().Define_BodyDecl_enclosingBodyDecl(this, caller); 1745 } 1746 /** 1747 * @apilevel internal 1748 */ 1749 public boolean Define_boolean_isMemberType(ASTNode caller, ASTNode child) { 1750 return getParent().Define_boolean_isMemberType(this, caller); 1751 } 1752 /** 1753 * @apilevel internal 1754 */ 1755 public TypeDecl Define_TypeDecl_hostType(ASTNode caller, ASTNode child) { 1756 return getParent().Define_TypeDecl_hostType(this, caller); 1757 } 1758 /** 1759 * @apilevel internal 1760 */ 1761 public TypeDecl Define_TypeDecl_switchType(ASTNode caller, ASTNode child) { 1762 return getParent().Define_TypeDecl_switchType(this, caller); 1763 } 1764 /** 1765 * @apilevel internal 1766 */ 1767 public TypeDecl Define_TypeDecl_returnType(ASTNode caller, ASTNode child) { 1768 return getParent().Define_TypeDecl_returnType(this, caller); 1769 } 1770 /** 1771 * @apilevel internal 1772 */ 1773 public TypeDecl Define_TypeDecl_enclosingInstance(ASTNode caller, ASTNode child) { 1774 return getParent().Define_TypeDecl_enclosingInstance(this, caller); 1775 } 1776 /** 1777 * @apilevel internal 1778 */ 1779 public String Define_String_methodHost(ASTNode caller, ASTNode child) { 1780 return getParent().Define_String_methodHost(this, caller); 1781 } 1782 /** 1783 * @apilevel internal 1784 */ 1785 public boolean Define_boolean_inExplicitConstructorInvocation(ASTNode caller, ASTNode child) { 1786 return getParent().Define_boolean_inExplicitConstructorInvocation(this, caller); 1787 } 1788 /** 1789 * @apilevel internal 1790 */ 1791 public boolean Define_boolean_inStaticContext(ASTNode caller, ASTNode child) { 1792 return getParent().Define_boolean_inStaticContext(this, caller); 1793 } 1794 /** 1795 * @apilevel internal 1796 */ 1797 public boolean Define_boolean_reportUnreachable(ASTNode caller, ASTNode child) { 1798 return getParent().Define_boolean_reportUnreachable(this, caller); 1799 } 1800 /** 1801 * @apilevel internal 1802 */ 1803 public boolean Define_boolean_isMethodParameter(ASTNode caller, ASTNode child) { 1804 return getParent().Define_boolean_isMethodParameter(this, caller); 1805 } 1806 /** 1807 * @apilevel internal 1808 */ 1809 public boolean Define_boolean_isConstructorParameter(ASTNode caller, ASTNode child) { 1810 return getParent().Define_boolean_isConstructorParameter(this, caller); 1811 } 1812 /** 1813 * @apilevel internal 1814 */ 1815 public boolean Define_boolean_isExceptionHandlerParameter(ASTNode caller, ASTNode child) { 1816 return getParent().Define_boolean_isExceptionHandlerParameter(this, caller); 1817 } 1818 /** 1819 * @apilevel internal 1820 */ 1821 public int Define_int_variableScopeEndLabel(ASTNode caller, ASTNode child, CodeGeneration gen) { 1822 return getParent().Define_int_variableScopeEndLabel(this, caller, gen); 1823 } 1824 /** 1825 * @apilevel internal 1826 */ 1827 public int Define_int_condition_false_label(ASTNode caller, ASTNode child) { 1828 return getParent().Define_int_condition_false_label(this, caller); 1829 } 1830 /** 1831 * @apilevel internal 1832 */ 1833 public int Define_int_condition_true_label(ASTNode caller, ASTNode child) { 1834 return getParent().Define_int_condition_true_label(this, caller); 1835 } 1836 /** 1837 * @apilevel internal 1838 */ 1839 public TypeDecl Define_TypeDecl_expectedType(ASTNode caller, ASTNode child) { 1840 return getParent().Define_TypeDecl_expectedType(this, caller); 1841 } 1842 /** 1843 * @apilevel internal 1844 */ 1845 public int Define_int_localNum(ASTNode caller, ASTNode child) { 1846 return getParent().Define_int_localNum(this, caller); 1847 } 1848 /** 1849 * @apilevel internal 1850 */ 1851 public int Define_int_resultSaveLocalNum(ASTNode caller, ASTNode child) { 1852 return getParent().Define_int_resultSaveLocalNum(this, caller); 1853 } 1854 /** 1855 * @apilevel internal 1856 */ 1857 public boolean Define_boolean_mayUseAnnotationTarget(ASTNode caller, ASTNode child, String name) { 1858 return getParent().Define_boolean_mayUseAnnotationTarget(this, caller, name); 1859 } 1860 /** 1861 * @apilevel internal 1862 */ 1863 public ElementValue Define_ElementValue_lookupElementTypeValue(ASTNode caller, ASTNode child, String name) { 1864 return getParent().Define_ElementValue_lookupElementTypeValue(this, caller, name); 1865 } 1866 /** 1867 * @apilevel internal 1868 */ 1869 public boolean Define_boolean_withinSuppressWarnings(ASTNode caller, ASTNode child, String s) { 1870 return getParent().Define_boolean_withinSuppressWarnings(this, caller, s); 1871 } 1872 /** 1873 * @apilevel internal 1874 */ 1875 public boolean Define_boolean_withinDeprecatedAnnotation(ASTNode caller, ASTNode child) { 1876 return getParent().Define_boolean_withinDeprecatedAnnotation(this, caller); 1877 } 1878 /** 1879 * @apilevel internal 1880 */ 1881 public Annotation Define_Annotation_lookupAnnotation(ASTNode caller, ASTNode child, TypeDecl typeDecl) { 1882 return getParent().Define_Annotation_lookupAnnotation(this, caller, typeDecl); 1883 } 1884 /** 1885 * @apilevel internal 1886 */ 1887 public TypeDecl Define_TypeDecl_enclosingAnnotationDecl(ASTNode caller, ASTNode child) { 1888 return getParent().Define_TypeDecl_enclosingAnnotationDecl(this, caller); 1889 } 1890 /** 1891 * @apilevel internal 1892 */ 1893 public TypeDecl Define_TypeDecl_assignConvertedType(ASTNode caller, ASTNode child) { 1894 return getParent().Define_TypeDecl_assignConvertedType(this, caller); 1895 } 1896 /** 1897 * @apilevel internal 1898 */ 1899 public boolean Define_boolean_inExtendsOrImplements(ASTNode caller, ASTNode child) { 1900 return getParent().Define_boolean_inExtendsOrImplements(this, caller); 1901 } 1902 /** 1903 * @apilevel internal 1904 */ 1905 public TypeDecl Define_TypeDecl_typeWildcard(ASTNode caller, ASTNode child) { 1906 return getParent().Define_TypeDecl_typeWildcard(this, caller); 1907 } 1908 /** 1909 * @apilevel internal 1910 */ 1911 public TypeDecl Define_TypeDecl_lookupWildcardExtends(ASTNode caller, ASTNode child, TypeDecl typeDecl) { 1912 return getParent().Define_TypeDecl_lookupWildcardExtends(this, caller, typeDecl); 1913 } 1914 /** 1915 * @apilevel internal 1916 */ 1917 public TypeDecl Define_TypeDecl_lookupWildcardSuper(ASTNode caller, ASTNode child, TypeDecl typeDecl) { 1918 return getParent().Define_TypeDecl_lookupWildcardSuper(this, caller, typeDecl); 1919 } 1920 /** 1921 * @apilevel internal 1922 */ 1923 public LUBType Define_LUBType_lookupLUBType(ASTNode caller, ASTNode child, Collection bounds) { 1924 return getParent().Define_LUBType_lookupLUBType(this, caller, bounds); 1925 } 1926 /** 1927 * @apilevel internal 1928 */ 1929 public GLBType Define_GLBType_lookupGLBType(ASTNode caller, ASTNode child, ArrayList bounds) { 1930 return getParent().Define_GLBType_lookupGLBType(this, caller, bounds); 1931 } 1932 /** 1933 * @apilevel internal 1934 */ 1935 public TypeDecl Define_TypeDecl_genericDecl(ASTNode caller, ASTNode child) { 1936 return getParent().Define_TypeDecl_genericDecl(this, caller); 1937 } 1938 /** 1939 * @apilevel internal 1940 */ 1941 public boolean Define_boolean_variableArityValid(ASTNode caller, ASTNode child) { 1942 return getParent().Define_boolean_variableArityValid(this, caller); 1943 } 1944 /** 1945 * @apilevel internal 1946 */ 1947 public boolean Define_boolean_isCatchParam(ASTNode caller, ASTNode child) { 1948 return getParent().Define_boolean_isCatchParam(this, caller); 1949 } 1950 /** 1951 * @apilevel internal 1952 */ 1953 public CatchClause Define_CatchClause_catchClause(ASTNode caller, ASTNode child) { 1954 return getParent().Define_CatchClause_catchClause(this, caller); 1955 } 1956 /** 1957 * @apilevel internal 1958 */ 1959 public boolean Define_boolean_resourcePreviouslyDeclared(ASTNode caller, ASTNode child, String name) { 1960 return getParent().Define_boolean_resourcePreviouslyDeclared(this, caller, name); 1961 } 1962 /** 1963 * @apilevel internal 1964 */ 1965 public ClassInstanceExpr Define_ClassInstanceExpr_getClassInstanceExpr(ASTNode caller, ASTNode child) { 1966 return getParent().Define_ClassInstanceExpr_getClassInstanceExpr(this, caller); 1967 } 1968 /** 1969 * @apilevel internal 1970 */ 1971 public boolean Define_boolean_isAnonymousDecl(ASTNode caller, ASTNode child) { 1972 return getParent().Define_boolean_isAnonymousDecl(this, caller); 1973 } 1974 /** 1975 * @apilevel internal 1976 */ 1977 public boolean Define_boolean_isExplicitGenericConstructorAccess(ASTNode caller, ASTNode child) { 1978 return getParent().Define_boolean_isExplicitGenericConstructorAccess(this, caller); 1979 } 1980 /** 1981 * @apilevel internal 1982 */ 1983 public CompilationUnit Define_CompilationUnit_compilationUnit(ASTNode caller, ASTNode child) { 1984 return getParent().Define_CompilationUnit_compilationUnit(this, caller); 1985 } 1986 /** 1987 * @apilevel internal 1988 */ 1989 public SimpleSet Define_SimpleSet_allImportedTypes(ASTNode caller, ASTNode child, String name) { 1990 return getParent().Define_SimpleSet_allImportedTypes(this, caller, name); 1991 } 1992 /** 1993 * @apilevel internal 1994 */ 1995 public String Define_String_packageName(ASTNode caller, ASTNode child) { 1996 return getParent().Define_String_packageName(this, caller); 1997 } 1998 /** 1999 * @apilevel internal 2000 */ 2001 public TypeDecl Define_TypeDecl_enclosingType(ASTNode caller, ASTNode child) { 2002 return getParent().Define_TypeDecl_enclosingType(this, caller); 2003 } 2004 /** 2005 * @apilevel internal 2006 */ 2007 public boolean Define_boolean_isNestedType(ASTNode caller, ASTNode child) { 2008 return getParent().Define_boolean_isNestedType(this, caller); 2009 } 2010 /** 2011 * @apilevel internal 2012 */ 2013 public boolean Define_boolean_isLocalClass(ASTNode caller, ASTNode child) { 2014 return getParent().Define_boolean_isLocalClass(this, caller); 2015 } 2016 /** 2017 * @apilevel internal 2018 */ 2019 public String Define_String_hostPackage(ASTNode caller, ASTNode child) { 2020 return getParent().Define_String_hostPackage(this, caller); 2021 } 2022 /** 2023 * @apilevel internal 2024 */ 2025 public String Define_String_destinationPath(ASTNode caller, ASTNode child) { 2026 return getParent().Define_String_destinationPath(this, caller); 2027 } 2028 /** 2029 * @apilevel internal 2030 */ 2031 public boolean Define_boolean_reachable(ASTNode caller, ASTNode child) { 2032 return getParent().Define_boolean_reachable(this, caller); 2033 } 2034 /** 2035 * @apilevel internal 2036 */ 2037 public boolean Define_boolean_inhModifiedInScope(ASTNode caller, ASTNode child, Variable var) { 2038 return getParent().Define_boolean_inhModifiedInScope(this, caller, var); 2039 } 2040 /** 2041 * @apilevel internal 2042 */ 2043 public boolean Define_boolean_reachableCatchClause(ASTNode caller, ASTNode child, TypeDecl exceptionType) { 2044 return getParent().Define_boolean_reachableCatchClause(this, caller, exceptionType); 2045 } 2046 /** 2047 * @apilevel internal 2048 */ 2049 public Collection<TypeDecl> Define_Collection_TypeDecl__caughtExceptions(ASTNode caller, ASTNode child) { 2050 return getParent().Define_Collection_TypeDecl__caughtExceptions(this, caller); 2051 } 2052 }