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 /** 015 * @production ReferenceType : {@link TypeDecl}; 016 * @ast node 017 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:44 018 */ 019 public abstract class ReferenceType extends TypeDecl 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 ReferenceType clone() throws CloneNotSupportedException { 035 ReferenceType node = (ReferenceType)super.clone(); 036 node.narrowingConversionTo_TypeDecl_values = null; 037 node.bcFields_computed = false; 038 node.bcFields_value = null; 039 node.jvmName_computed = false; 040 node.jvmName_value = null; 041 node.unboxed_computed = false; 042 node.unboxed_value = null; 043 node.in$Circle(false); 044 node.is$Final(false); 045 return node; 046 } 047 /** 048 * @ast method 049 * @aspect CodeGeneration 050 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:618 051 */ 052 public void emitReturn(CodeGeneration gen) { gen.emit(Bytecode.ARETURN);} 053 /** 054 * @ast method 055 * @aspect CodeGeneration 056 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:671 057 */ 058 public void emitLoadLocal(CodeGeneration gen, int pos) { 059 gen.emitLoadReference(pos); 060 } 061 /** 062 * @ast method 063 * @aspect CodeGeneration 064 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:784 065 */ 066 public void emitStoreLocal(CodeGeneration gen, int pos) { 067 gen.emitStoreReference(pos); 068 } 069 /** 070 * @ast method 071 * @aspect CodeGenerationConversions 072 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:942 073 */ 074 void refined_CodeGenerationConversions_ReferenceType_emitCastTo(CodeGeneration gen, TypeDecl type) { if(!instanceOf(type) && !type.isNull()) gen.emitCheckCast(type); } 075 /** 076 * @ast method 077 * @aspect CodeGenerationBranch 078 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:1139 079 */ 080 public void branchEQ(CodeGeneration gen, int label) { gen.emitCompare(Bytecode.IF_ACMPEQ, label); } 081 /** 082 * @ast method 083 * @aspect CodeGenerationBranch 084 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:1148 085 */ 086 public void branchNE(CodeGeneration gen, int label) { gen.emitCompare(Bytecode.IF_ACMPNE, label); } 087 /** 088 * @ast method 089 * @aspect AutoBoxingCodegen 090 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AutoBoxingCodegen.jrag:16 091 */ 092 void byteToThis(CodeGeneration gen) { 093 if(isUnknown()) throw new Error("Trying to cast to Unknown"); 094 if(!isNumericType()) 095 typeByte().boxed().byteToThis(gen); 096 else { 097 unboxed().byteToThis(gen); 098 emitBoxingOperation(gen); 099 } 100 } 101 /** 102 * @ast method 103 * @aspect AutoBoxingCodegen 104 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AutoBoxingCodegen.jrag:25 105 */ 106 void charToThis(CodeGeneration gen) { 107 if(isUnknown()) throw new Error("Trying to cast to Unknown"); 108 if(!isNumericType()) 109 typeChar().boxed().charToThis(gen); 110 else { 111 unboxed().charToThis(gen); 112 emitBoxingOperation(gen); 113 } 114 } 115 /** 116 * @ast method 117 * @aspect AutoBoxingCodegen 118 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AutoBoxingCodegen.jrag:34 119 */ 120 void shortToThis(CodeGeneration gen) { 121 if(isUnknown()) throw new Error("Trying to cast to Unknown"); 122 if(!isNumericType()) 123 typeShort().boxed().shortToThis(gen); 124 else { 125 unboxed().shortToThis(gen); 126 emitBoxingOperation(gen); 127 } 128 } 129 /** 130 * @ast method 131 * @aspect AutoBoxingCodegen 132 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AutoBoxingCodegen.jrag:43 133 */ 134 void intToThis(CodeGeneration gen) { 135 if(isUnknown()) throw new Error("Trying to cast to Unknown"); 136 if(!isNumericType()) 137 typeInt().boxed().intToThis(gen); 138 else { 139 unboxed().intToThis(gen); 140 emitBoxingOperation(gen); 141 } 142 } 143 /** 144 * @ast method 145 * @aspect AutoBoxingCodegen 146 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AutoBoxingCodegen.jrag:52 147 */ 148 void longToThis(CodeGeneration gen) { 149 if(isUnknown()) throw new Error("Trying to cast to Unknown"); 150 if(!isNumericType()) 151 typeLong().boxed().longToThis(gen); 152 else { 153 unboxed().longToThis(gen); 154 emitBoxingOperation(gen); 155 } 156 } 157 /** 158 * @ast method 159 * @aspect AutoBoxingCodegen 160 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AutoBoxingCodegen.jrag:61 161 */ 162 void floatToThis(CodeGeneration gen) { 163 if(isUnknown()) throw new Error("Trying to cast to Unknown"); 164 if(!isNumericType()) 165 typeFloat().boxed().floatToThis(gen); 166 else { 167 unboxed().floatToThis(gen); 168 emitBoxingOperation(gen); 169 } 170 } 171 /** 172 * @ast method 173 * @aspect AutoBoxingCodegen 174 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AutoBoxingCodegen.jrag:70 175 */ 176 void doubleToThis(CodeGeneration gen) { 177 if(isUnknown()) throw new Error("Trying to cast to Unknown"); 178 if(!isNumericType()) 179 typeDouble().boxed().doubleToThis(gen); 180 else { 181 unboxed().doubleToThis(gen); 182 emitBoxingOperation(gen); 183 } 184 } 185 /** 186 * @ast method 187 * 188 */ 189 public ReferenceType() { 190 super(); 191 192 193 } 194 /** 195 * Initializes the child array to the correct size. 196 * Initializes List and Opt nta children. 197 * @apilevel internal 198 * @ast method 199 * @ast method 200 * 201 */ 202 public void init$Children() { 203 children = new ASTNode[2]; 204 setChild(new List(), 1); 205 } 206 /** 207 * @ast method 208 * 209 */ 210 public ReferenceType(Modifiers p0, String p1, List<BodyDecl> p2) { 211 setChild(p0, 0); 212 setID(p1); 213 setChild(p2, 1); 214 } 215 /** 216 * @ast method 217 * 218 */ 219 public ReferenceType(Modifiers p0, beaver.Symbol p1, List<BodyDecl> p2) { 220 setChild(p0, 0); 221 setID(p1); 222 setChild(p2, 1); 223 } 224 /** 225 * @apilevel low-level 226 * @ast method 227 * 228 */ 229 protected int numChildren() { 230 return 2; 231 } 232 /** 233 * @apilevel internal 234 * @ast method 235 * 236 */ 237 public boolean mayHaveRewrite() { 238 return false; 239 } 240 /** 241 * Replaces the Modifiers child. 242 * @param node The new node to replace the Modifiers child. 243 * @apilevel high-level 244 * @ast method 245 * 246 */ 247 public void setModifiers(Modifiers node) { 248 setChild(node, 0); 249 } 250 /** 251 * Retrieves the Modifiers child. 252 * @return The current node used as the Modifiers child. 253 * @apilevel high-level 254 * @ast method 255 * 256 */ 257 public Modifiers getModifiers() { 258 return (Modifiers)getChild(0); 259 } 260 /** 261 * Retrieves the Modifiers child. 262 * <p><em>This method does not invoke AST transformations.</em></p> 263 * @return The current node used as the Modifiers child. 264 * @apilevel low-level 265 * @ast method 266 * 267 */ 268 public Modifiers getModifiersNoTransform() { 269 return (Modifiers)getChildNoTransform(0); 270 } 271 /** 272 * Replaces the lexeme ID. 273 * @param value The new value for the lexeme ID. 274 * @apilevel high-level 275 * @ast method 276 * 277 */ 278 public void setID(String value) { 279 tokenString_ID = value; 280 } 281 /** 282 * JastAdd-internal setter for lexeme ID using the Beaver parser. 283 * @apilevel internal 284 * @ast method 285 * 286 */ 287 public void setID(beaver.Symbol symbol) { 288 if(symbol.value != null && !(symbol.value instanceof String)) 289 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 290 tokenString_ID = (String)symbol.value; 291 IDstart = symbol.getStart(); 292 IDend = symbol.getEnd(); 293 } 294 /** 295 * Retrieves the value for the lexeme ID. 296 * @return The value for the lexeme ID. 297 * @apilevel high-level 298 * @ast method 299 * 300 */ 301 public String getID() { 302 return tokenString_ID != null ? tokenString_ID : ""; 303 } 304 /** 305 * Replaces the BodyDecl list. 306 * @param list The new list node to be used as the BodyDecl list. 307 * @apilevel high-level 308 * @ast method 309 * 310 */ 311 public void setBodyDeclList(List<BodyDecl> list) { 312 setChild(list, 1); 313 } 314 /** 315 * Retrieves the number of children in the BodyDecl list. 316 * @return Number of children in the BodyDecl list. 317 * @apilevel high-level 318 * @ast method 319 * 320 */ 321 public int getNumBodyDecl() { 322 return getBodyDeclList().getNumChild(); 323 } 324 /** 325 * Retrieves the number of children in the BodyDecl list. 326 * Calling this method will not trigger rewrites.. 327 * @return Number of children in the BodyDecl list. 328 * @apilevel low-level 329 * @ast method 330 * 331 */ 332 public int getNumBodyDeclNoTransform() { 333 return getBodyDeclListNoTransform().getNumChildNoTransform(); 334 } 335 /** 336 * Retrieves the element at index {@code i} in the BodyDecl list.. 337 * @param i Index of the element to return. 338 * @return The element at position {@code i} in the BodyDecl list. 339 * @apilevel high-level 340 * @ast method 341 * 342 */ 343 @SuppressWarnings({"unchecked", "cast"}) 344 public BodyDecl getBodyDecl(int i) { 345 return (BodyDecl)getBodyDeclList().getChild(i); 346 } 347 /** 348 * Append an element to the BodyDecl list. 349 * @param node The element to append to the BodyDecl list. 350 * @apilevel high-level 351 * @ast method 352 * 353 */ 354 public void addBodyDecl(BodyDecl node) { 355 List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); 356 list.addChild(node); 357 } 358 /** 359 * @apilevel low-level 360 * @ast method 361 * 362 */ 363 public void addBodyDeclNoTransform(BodyDecl node) { 364 List<BodyDecl> list = getBodyDeclListNoTransform(); 365 list.addChild(node); 366 } 367 /** 368 * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. 369 * @param node The new node to replace the old list element. 370 * @param i The list index of the node to be replaced. 371 * @apilevel high-level 372 * @ast method 373 * 374 */ 375 public void setBodyDecl(BodyDecl node, int i) { 376 List<BodyDecl> list = getBodyDeclList(); 377 list.setChild(node, i); 378 } 379 /** 380 * Retrieves the BodyDecl list. 381 * @return The node representing the BodyDecl list. 382 * @apilevel high-level 383 * @ast method 384 * 385 */ 386 public List<BodyDecl> getBodyDecls() { 387 return getBodyDeclList(); 388 } 389 /** 390 * Retrieves the BodyDecl list. 391 * <p><em>This method does not invoke AST transformations.</em></p> 392 * @return The node representing the BodyDecl list. 393 * @apilevel low-level 394 * @ast method 395 * 396 */ 397 public List<BodyDecl> getBodyDeclsNoTransform() { 398 return getBodyDeclListNoTransform(); 399 } 400 /** 401 * Retrieves the BodyDecl list. 402 * @return The node representing the BodyDecl list. 403 * @apilevel high-level 404 * @ast method 405 * 406 */ 407 @SuppressWarnings({"unchecked", "cast"}) 408 public List<BodyDecl> getBodyDeclList() { 409 List<BodyDecl> list = (List<BodyDecl>)getChild(1); 410 list.getNumChild(); 411 return list; 412 } 413 /** 414 * Retrieves the BodyDecl list. 415 * <p><em>This method does not invoke AST transformations.</em></p> 416 * @return The node representing the BodyDecl list. 417 * @apilevel low-level 418 * @ast method 419 * 420 */ 421 @SuppressWarnings({"unchecked", "cast"}) 422 public List<BodyDecl> getBodyDeclListNoTransform() { 423 return (List<BodyDecl>)getChildNoTransform(1); 424 } 425 /** 426 * @ast method 427 * @aspect AutoBoxingCodegen 428 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/AutoBoxingCodegen.jrag:89 429 */ 430 public void emitCastTo(CodeGeneration gen, TypeDecl type) { 431 if(type instanceof PrimitiveType) { 432 emitUnboxingOperation(gen); 433 unboxed().emitCastTo(gen, type); 434 } 435 else 436 refined_CodeGenerationConversions_ReferenceType_emitCastTo(gen, type); 437 } 438 /** 439 * @attribute syn 440 * @aspect TypeConversion 441 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:17 442 */ 443 public boolean wideningConversionTo(TypeDecl type) { 444 ASTNode$State state = state(); 445 try { return instanceOf(type); } 446 finally { 447 } 448 } 449 protected java.util.Map narrowingConversionTo_TypeDecl_values; 450 /** 451 * @attribute syn 452 * @aspect TypeConversion 453 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:36 454 */ 455 @SuppressWarnings({"unchecked", "cast"}) 456 public boolean narrowingConversionTo(TypeDecl type) { 457 Object _parameters = type; 458 if(narrowingConversionTo_TypeDecl_values == null) narrowingConversionTo_TypeDecl_values = new java.util.HashMap(4); 459 if(narrowingConversionTo_TypeDecl_values.containsKey(_parameters)) { 460 return ((Boolean)narrowingConversionTo_TypeDecl_values.get(_parameters)).booleanValue(); 461 } 462 ASTNode$State state = state(); 463 int num = state.boundariesCrossed; 464 boolean isFinal = this.is$Final(); 465 boolean narrowingConversionTo_TypeDecl_value = narrowingConversionTo_compute(type); 466 if(isFinal && num == state().boundariesCrossed){ narrowingConversionTo_TypeDecl_values.put(_parameters, Boolean.valueOf(narrowingConversionTo_TypeDecl_value)); } 467 return narrowingConversionTo_TypeDecl_value; 468 } 469 /** 470 * @apilevel internal 471 */ 472 private boolean narrowingConversionTo_compute(TypeDecl type) { 473 if(type.instanceOf(this)) 474 return true; 475 if(isClassDecl() && !getModifiers().isFinal() && type.isInterfaceDecl()) 476 return true; 477 if(isInterfaceDecl() && type.isClassDecl() && !type.getModifiers().isFinal()) 478 return true; 479 if(isInterfaceDecl() && type.instanceOf(this)) 480 return true; 481 if(fullName().equals("java.lang.Object") && type.isInterfaceDecl()) 482 return true; 483 // Dragons 484 // TODO: Check if both are interfaces with compatible methods 485 if(isArrayDecl() && type.isArrayDecl() && elementType().instanceOf(type.elementType())) 486 return true; 487 return false; 488 } 489 /** 490 * @attribute syn 491 * @aspect TypeAnalysis 492 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:165 493 */ 494 public boolean isReferenceType() { 495 ASTNode$State state = state(); 496 try { return true; } 497 finally { 498 } 499 } 500 /** 501 * @attribute syn 502 * @aspect TypeWideningAndIdentity 503 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:482 504 */ 505 public boolean isSupertypeOfNullType(NullType type) { 506 ASTNode$State state = state(); 507 try { return true; } 508 finally { 509 } 510 } 511 /** 512 * @attribute syn 513 * @aspect CodeGeneration 514 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:621 515 */ 516 public byte arrayLoad() { 517 ASTNode$State state = state(); 518 try { return Bytecode.AALOAD; } 519 finally { 520 } 521 } 522 /** 523 * @attribute syn 524 * @aspect CodeGeneration 525 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CodeGeneration.jrag:723 526 */ 527 public byte arrayStore() { 528 ASTNode$State state = state(); 529 try { return Bytecode.AASTORE; } 530 finally { 531 } 532 } 533 /** 534 * @apilevel internal 535 */ 536 protected boolean bcFields_computed = false; 537 /** 538 * @apilevel internal 539 */ 540 protected Collection bcFields_value; 541 /** 542 * @attribute syn 543 * @aspect GenerateClassfile 544 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/GenerateClassfile.jrag:276 545 */ 546 @SuppressWarnings({"unchecked", "cast"}) 547 public Collection bcFields() { 548 if(bcFields_computed) { 549 return bcFields_value; 550 } 551 ASTNode$State state = state(); 552 int num = state.boundariesCrossed; 553 boolean isFinal = this.is$Final(); 554 bcFields_value = bcFields_compute(); 555 if(isFinal && num == state().boundariesCrossed){ bcFields_computed = true; } 556 return bcFields_value; 557 } 558 /** 559 * @apilevel internal 560 */ 561 private Collection bcFields_compute() { 562 ArrayList l = new ArrayList(); 563 for(int i = 0; i < getNumBodyDecl(); i++) 564 if(getBodyDecl(i).isBytecodeField() && getBodyDecl(i).generate()) 565 l.add(getBodyDecl(i)); 566 return l; 567 } 568 /** 569 * @attribute syn 570 * @aspect GenerateClassfile 571 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/GenerateClassfile.jrag:284 572 */ 573 public Collection bcMethods() { 574 ASTNode$State state = state(); 575 try { 576 ArrayList l = new ArrayList(); 577 constructors(); 578 for(int i = 0; i < getNumBodyDecl(); i++) 579 if(getBodyDecl(i).isBytecodeMethod() && getBodyDecl(i).generate()) 580 l.add(getBodyDecl(i)); 581 return l; 582 } 583 finally { 584 } 585 } 586 /** 587 * @attribute syn 588 * @aspect InnerClasses 589 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/InnerClasses.jrag:82 590 */ 591 public TypeDecl stringPromotion() { 592 ASTNode$State state = state(); 593 try { return typeObject(); } 594 finally { 595 } 596 } 597 /** 598 * @apilevel internal 599 */ 600 protected boolean jvmName_computed = false; 601 /** 602 * @apilevel internal 603 */ 604 protected String jvmName_value; 605 /** 606 * @attribute syn 607 * @aspect Java2Rewrites 608 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:18 609 */ 610 @SuppressWarnings({"unchecked", "cast"}) 611 public String jvmName() { 612 if(jvmName_computed) { 613 return jvmName_value; 614 } 615 ASTNode$State state = state(); 616 int num = state.boundariesCrossed; 617 boolean isFinal = this.is$Final(); 618 jvmName_value = jvmName_compute(); 619 if(isFinal && num == state().boundariesCrossed){ jvmName_computed = true; } 620 return jvmName_value; 621 } 622 /** 623 * @apilevel internal 624 */ 625 private String jvmName_compute() { 626 if(!isNestedType()) 627 return fullName(); 628 else if(isAnonymous() || isLocalClass()) 629 return enclosingType().jvmName() + "$" + uniqueIndex() + name(); 630 else 631 return enclosingType().jvmName() + "$" + name(); 632 } 633 /** 634 * @attribute syn 635 * @aspect Java2Rewrites 636 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/Java2Rewrites.jrag:57 637 */ 638 public String referenceClassFieldName() { 639 ASTNode$State state = state(); 640 try { return "class$" + jvmName().replace('[', '$').replace('.', '$').replace(';', ' ').trim(); } 641 finally { 642 } 643 } 644 /** 645 * @attribute syn 646 * @aspect LocalNum 647 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/LocalNum.jrag:124 648 */ 649 public int variableSize() { 650 ASTNode$State state = state(); 651 try { return 1; } 652 finally { 653 } 654 } 655 /* It is a compile-time error if the return type of a method declared in an 656 annotation type is any type other than one of the following: one of the 657 primitive types, String, Class and any invocation of Class, an enum type 658 (\ufffd8.9), an annotation type, or an array (\ufffd10) of one of the preceding types.* @attribute syn 659 * @aspect Annotations 660 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Annotations.jrag:121 661 */ 662 public boolean isValidAnnotationMethodReturnType() { 663 ASTNode$State state = state(); 664 try { 665 if(isString()) return true; 666 if(fullName().equals("java.lang.Class")) 667 return true; 668 // include generic versions of Class 669 if(erasure().fullName().equals("java.lang.Class")) 670 return true; 671 return false; 672 } 673 finally { 674 } 675 } 676 /** 677 * @attribute syn 678 * @aspect AutoBoxing 679 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:47 680 */ 681 public boolean unboxingConversionTo(TypeDecl typeDecl) { 682 ASTNode$State state = state(); 683 try { return unboxed() == typeDecl; } 684 finally { 685 } 686 } 687 /** 688 * @apilevel internal 689 */ 690 protected boolean unboxed_computed = false; 691 /** 692 * @apilevel internal 693 */ 694 protected TypeDecl unboxed_value; 695 /** 696 * @attribute syn 697 * @aspect AutoBoxing 698 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:52 699 */ 700 @SuppressWarnings({"unchecked", "cast"}) 701 public TypeDecl unboxed() { 702 if(unboxed_computed) { 703 return unboxed_value; 704 } 705 ASTNode$State state = state(); 706 int num = state.boundariesCrossed; 707 boolean isFinal = this.is$Final(); 708 unboxed_value = unboxed_compute(); 709 if(isFinal && num == state().boundariesCrossed){ unboxed_computed = true; } 710 return unboxed_value; 711 } 712 /** 713 * @apilevel internal 714 */ 715 private TypeDecl unboxed_compute() { 716 if(packageName().equals("java.lang") && isTopLevelType()) { 717 String n = name(); 718 if(n.equals("Boolean")) return typeBoolean(); 719 if(n.equals("Byte")) return typeByte(); 720 if(n.equals("Character")) return typeChar(); 721 if(n.equals("Short")) return typeShort(); 722 if(n.equals("Integer")) return typeInt(); 723 if(n.equals("Long")) return typeLong(); 724 if(n.equals("Float")) return typeFloat(); 725 if(n.equals("Double")) return typeDouble(); 726 } 727 return unknownType(); 728 } 729 /** 730 * @attribute syn 731 * @aspect NumericPromotion 732 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:146 733 */ 734 public TypeDecl unaryNumericPromotion() { 735 ASTNode$State state = state(); 736 try { return isNumericType() && !isUnknown() ? unboxed().unaryNumericPromotion() : this; } 737 finally { 738 } 739 } 740 /** 741 * @attribute syn 742 * @aspect NumericPromotion 743 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:154 744 */ 745 public TypeDecl binaryNumericPromotion(TypeDecl type) { 746 ASTNode$State state = state(); 747 try { return unboxed().binaryNumericPromotion(type); } 748 finally { 749 } 750 } 751 /** 752 * @attribute syn 753 * @aspect TypeAnalysis 754 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:173 755 */ 756 public boolean isNumericType() { 757 ASTNode$State state = state(); 758 try { return !unboxed().isUnknown() && unboxed().isNumericType(); } 759 finally { 760 } 761 } 762 /** 763 * @attribute syn 764 * @aspect TypeAnalysis 765 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:177 766 */ 767 public boolean isIntegralType() { 768 ASTNode$State state = state(); 769 try { return !unboxed().isUnknown() && unboxed().isIntegralType(); } 770 finally { 771 } 772 } 773 /** 774 * @attribute syn 775 * @aspect TypeAnalysis 776 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:221 777 */ 778 public boolean isPrimitive() { 779 ASTNode$State state = state(); 780 try { return !unboxed().isUnknown() && unboxed().isPrimitive(); } 781 finally { 782 } 783 } 784 /** 785 * @attribute syn 786 * @aspect TypeAnalysis 787 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:181 788 */ 789 public boolean isBoolean() { 790 ASTNode$State state = state(); 791 try { return fullName().equals("java.lang.Boolean") && unboxed().isBoolean(); } 792 finally { 793 } 794 } 795 /** 796 * @attribute syn 797 * @aspect GenericsSubtype 798 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:479 799 */ 800 public boolean supertypeNullType(NullType type) { 801 ASTNode$State state = state(); 802 try { return true; } 803 finally { 804 } 805 } 806 /** 807 * @attribute inh 808 * @aspect AutoBoxing 809 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:66 810 */ 811 @SuppressWarnings({"unchecked", "cast"}) 812 public TypeDecl typeBoolean() { 813 ASTNode$State state = state(); 814 TypeDecl typeBoolean_value = getParent().Define_TypeDecl_typeBoolean(this, null); 815 return typeBoolean_value; 816 } 817 /** 818 * @attribute inh 819 * @aspect AutoBoxing 820 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:67 821 */ 822 @SuppressWarnings({"unchecked", "cast"}) 823 public TypeDecl typeByte() { 824 ASTNode$State state = state(); 825 TypeDecl typeByte_value = getParent().Define_TypeDecl_typeByte(this, null); 826 return typeByte_value; 827 } 828 /** 829 * @attribute inh 830 * @aspect AutoBoxing 831 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:68 832 */ 833 @SuppressWarnings({"unchecked", "cast"}) 834 public TypeDecl typeChar() { 835 ASTNode$State state = state(); 836 TypeDecl typeChar_value = getParent().Define_TypeDecl_typeChar(this, null); 837 return typeChar_value; 838 } 839 /** 840 * @attribute inh 841 * @aspect AutoBoxing 842 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:69 843 */ 844 @SuppressWarnings({"unchecked", "cast"}) 845 public TypeDecl typeShort() { 846 ASTNode$State state = state(); 847 TypeDecl typeShort_value = getParent().Define_TypeDecl_typeShort(this, null); 848 return typeShort_value; 849 } 850 /** 851 * @attribute inh 852 * @aspect AutoBoxing 853 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:70 854 */ 855 @SuppressWarnings({"unchecked", "cast"}) 856 public TypeDecl typeInt() { 857 ASTNode$State state = state(); 858 TypeDecl typeInt_value = getParent().Define_TypeDecl_typeInt(this, null); 859 return typeInt_value; 860 } 861 /** 862 * @attribute inh 863 * @aspect AutoBoxing 864 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:71 865 */ 866 @SuppressWarnings({"unchecked", "cast"}) 867 public TypeDecl typeLong() { 868 ASTNode$State state = state(); 869 TypeDecl typeLong_value = getParent().Define_TypeDecl_typeLong(this, null); 870 return typeLong_value; 871 } 872 /** 873 * @attribute inh 874 * @aspect AutoBoxing 875 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:72 876 */ 877 @SuppressWarnings({"unchecked", "cast"}) 878 public TypeDecl typeFloat() { 879 ASTNode$State state = state(); 880 TypeDecl typeFloat_value = getParent().Define_TypeDecl_typeFloat(this, null); 881 return typeFloat_value; 882 } 883 /** 884 * @attribute inh 885 * @aspect AutoBoxing 886 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/AutoBoxing.jrag:73 887 */ 888 @SuppressWarnings({"unchecked", "cast"}) 889 public TypeDecl typeDouble() { 890 ASTNode$State state = state(); 891 TypeDecl typeDouble_value = getParent().Define_TypeDecl_typeDouble(this, null); 892 return typeDouble_value; 893 } 894 /** 895 * @apilevel internal 896 */ 897 public ASTNode rewriteTo() { 898 return super.rewriteTo(); 899 } 900 }