001 /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.13-12-g880e696 */ 002 package org.extendj.ast; 003 004 import java.util.HashSet; 005 import java.io.File; 006 import java.util.Set; 007 import java.util.Collections; 008 import java.util.Collection; 009 import java.util.ArrayList; 010 import beaver.*; 011 import java.util.*; 012 import java.io.ByteArrayOutputStream; 013 import java.io.PrintStream; 014 import java.lang.reflect.InvocationTargetException; 015 import java.lang.reflect.Method; 016 import org.jastadd.util.*; 017 import java.util.zip.*; 018 import java.io.*; 019 import org.jastadd.util.PrettyPrintable; 020 import org.jastadd.util.PrettyPrinter; 021 import java.io.FileNotFoundException; 022 import java.io.BufferedInputStream; 023 import java.io.DataInputStream; 024 /** 025 * @ast node 026 * @declaredat /home/jesper/git/extendj/java5/grammar/Generics.ast:26 027 * @production WildcardType : {@link AbstractWildcardType}; 028 029 */ 030 public class WildcardType extends AbstractWildcardType implements Cloneable { 031 /** 032 * @declaredat ASTNode:1 033 */ 034 public WildcardType() { 035 super(); 036 } 037 /** 038 * Initializes the child array to the correct size. 039 * Initializes List and Opt nta children. 040 * @apilevel internal 041 * @ast method 042 * @declaredat ASTNode:10 043 */ 044 public void init$Children() { 045 children = new ASTNode[2]; 046 setChild(new List(), 1); 047 } 048 /** 049 * @declaredat ASTNode:14 050 */ 051 public WildcardType(Modifiers p0, String p1, List<BodyDecl> p2) { 052 setChild(p0, 0); 053 setID(p1); 054 setChild(p2, 1); 055 } 056 /** 057 * @declaredat ASTNode:19 058 */ 059 public WildcardType(Modifiers p0, beaver.Symbol p1, List<BodyDecl> p2) { 060 setChild(p0, 0); 061 setID(p1); 062 setChild(p2, 1); 063 } 064 /** 065 * @apilevel low-level 066 * @declaredat ASTNode:27 067 */ 068 protected int numChildren() { 069 return 2; 070 } 071 /** 072 * @apilevel internal 073 * @declaredat ASTNode:33 074 */ 075 public boolean mayHaveRewrite() { 076 return false; 077 } 078 /** 079 * @apilevel internal 080 * @declaredat ASTNode:39 081 */ 082 public void flushAttrCache() { 083 super.flushAttrCache(); 084 subtype_TypeDecl_reset(); 085 containedIn_TypeDecl_reset(); 086 instanceOf_TypeDecl_reset(); 087 fieldTypeSignature_reset(); 088 strictSubtype_TypeDecl_reset(); 089 strictContainedIn_TypeDecl_reset(); 090 } 091 /** 092 * @apilevel internal 093 * @declaredat ASTNode:51 094 */ 095 public void flushCollectionCache() { 096 super.flushCollectionCache(); 097 } 098 /** 099 * @apilevel internal 100 * @declaredat ASTNode:57 101 */ 102 public void flushRewriteCache() { 103 super.flushRewriteCache(); 104 } 105 /** 106 * @apilevel internal 107 * @declaredat ASTNode:63 108 */ 109 public WildcardType clone() throws CloneNotSupportedException { 110 WildcardType node = (WildcardType) super.clone(); 111 return node; 112 } 113 /** 114 * @apilevel internal 115 * @declaredat ASTNode:70 116 */ 117 public WildcardType copy() { 118 try { 119 WildcardType node = (WildcardType) clone(); 120 node.parent = null; 121 if (children != null) { 122 node.children = (ASTNode[]) children.clone(); 123 } 124 return node; 125 } catch (CloneNotSupportedException e) { 126 throw new Error("Error: clone not supported for " + getClass().getName()); 127 } 128 } 129 /** 130 * Create a deep copy of the AST subtree at this node. 131 * The copy is dangling, i.e. has no parent. 132 * @return dangling copy of the subtree at this node 133 * @apilevel low-level 134 * @deprecated Please use treeCopy or treeCopyNoTransform instead 135 * @declaredat ASTNode:89 136 */ 137 @Deprecated 138 public WildcardType fullCopy() { 139 return treeCopyNoTransform(); 140 } 141 /** 142 * Create a deep copy of the AST subtree at this node. 143 * The copy is dangling, i.e. has no parent. 144 * @return dangling copy of the subtree at this node 145 * @apilevel low-level 146 * @declaredat ASTNode:99 147 */ 148 public WildcardType treeCopyNoTransform() { 149 WildcardType tree = (WildcardType) copy(); 150 if (children != null) { 151 for (int i = 0; i < children.length; ++i) { 152 ASTNode child = (ASTNode) children[i]; 153 if (child != null) { 154 child = child.treeCopyNoTransform(); 155 tree.setChild(child, i); 156 } 157 } 158 } 159 return tree; 160 } 161 /** 162 * Create a deep copy of the AST subtree at this node. 163 * The subtree of this node is traversed to trigger rewrites before copy. 164 * The copy is dangling, i.e. has no parent. 165 * @return dangling copy of the subtree at this node 166 * @apilevel low-level 167 * @declaredat ASTNode:119 168 */ 169 public WildcardType treeCopy() { 170 doFullTraversal(); 171 return treeCopyNoTransform(); 172 } 173 /** 174 * @apilevel internal 175 * @declaredat ASTNode:126 176 */ 177 protected boolean is$Equal(ASTNode node) { 178 return super.is$Equal(node) && (tokenString_ID == ((WildcardType)node).tokenString_ID); 179 } 180 /** 181 * Replaces the Modifiers child. 182 * @param node The new node to replace the Modifiers child. 183 * @apilevel high-level 184 */ 185 public void setModifiers(Modifiers node) { 186 setChild(node, 0); 187 } 188 /** 189 * Retrieves the Modifiers child. 190 * @return The current node used as the Modifiers child. 191 * @apilevel high-level 192 */ 193 @ASTNodeAnnotation.Child(name="Modifiers") 194 public Modifiers getModifiers() { 195 return (Modifiers) getChild(0); 196 } 197 /** 198 * Retrieves the Modifiers child. 199 * <p><em>This method does not invoke AST transformations.</em></p> 200 * @return The current node used as the Modifiers child. 201 * @apilevel low-level 202 */ 203 public Modifiers getModifiersNoTransform() { 204 return (Modifiers) getChildNoTransform(0); 205 } 206 /** 207 * Replaces the lexeme ID. 208 * @param value The new value for the lexeme ID. 209 * @apilevel high-level 210 */ 211 public void setID(String value) { 212 tokenString_ID = value; 213 } 214 /** 215 * JastAdd-internal setter for lexeme ID using the Beaver parser. 216 * @param symbol Symbol containing the new value for the lexeme ID 217 * @apilevel internal 218 */ 219 public void setID(beaver.Symbol symbol) { 220 if (symbol.value != null && !(symbol.value instanceof String)) 221 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 222 tokenString_ID = (String)symbol.value; 223 IDstart = symbol.getStart(); 224 IDend = symbol.getEnd(); 225 } 226 /** 227 * Retrieves the value for the lexeme ID. 228 * @return The value for the lexeme ID. 229 * @apilevel high-level 230 */ 231 @ASTNodeAnnotation.Token(name="ID") 232 public String getID() { 233 return tokenString_ID != null ? tokenString_ID : ""; 234 } 235 /** 236 * Replaces the BodyDecl list. 237 * @param list The new list node to be used as the BodyDecl list. 238 * @apilevel high-level 239 */ 240 public void setBodyDeclList(List<BodyDecl> list) { 241 setChild(list, 1); 242 } 243 /** 244 * Retrieves the number of children in the BodyDecl list. 245 * @return Number of children in the BodyDecl list. 246 * @apilevel high-level 247 */ 248 public int getNumBodyDecl() { 249 return getBodyDeclList().getNumChild(); 250 } 251 /** 252 * Retrieves the number of children in the BodyDecl list. 253 * Calling this method will not trigger rewrites. 254 * @return Number of children in the BodyDecl list. 255 * @apilevel low-level 256 */ 257 public int getNumBodyDeclNoTransform() { 258 return getBodyDeclListNoTransform().getNumChildNoTransform(); 259 } 260 /** 261 * Retrieves the element at index {@code i} in the BodyDecl list. 262 * @param i Index of the element to return. 263 * @return The element at position {@code i} in the BodyDecl list. 264 * @apilevel high-level 265 */ 266 public BodyDecl getBodyDecl(int i) { 267 return (BodyDecl) getBodyDeclList().getChild(i); 268 } 269 /** 270 * Check whether the BodyDecl list has any children. 271 * @return {@code true} if it has at least one child, {@code false} otherwise. 272 * @apilevel high-level 273 */ 274 public boolean hasBodyDecl() { 275 return getBodyDeclList().getNumChild() != 0; 276 } 277 /** 278 * Append an element to the BodyDecl list. 279 * @param node The element to append to the BodyDecl list. 280 * @apilevel high-level 281 */ 282 public void addBodyDecl(BodyDecl node) { 283 List<BodyDecl> list = (parent == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); 284 list.addChild(node); 285 } 286 /** 287 * @apilevel low-level 288 */ 289 public void addBodyDeclNoTransform(BodyDecl node) { 290 List<BodyDecl> list = getBodyDeclListNoTransform(); 291 list.addChild(node); 292 } 293 /** 294 * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. 295 * @param node The new node to replace the old list element. 296 * @param i The list index of the node to be replaced. 297 * @apilevel high-level 298 */ 299 public void setBodyDecl(BodyDecl node, int i) { 300 List<BodyDecl> list = getBodyDeclList(); 301 list.setChild(node, i); 302 } 303 /** 304 * Retrieves the BodyDecl list. 305 * @return The node representing the BodyDecl list. 306 * @apilevel high-level 307 */ 308 @ASTNodeAnnotation.ListChild(name="BodyDecl") 309 public List<BodyDecl> getBodyDeclList() { 310 List<BodyDecl> list = (List<BodyDecl>) getChild(1); 311 return list; 312 } 313 /** 314 * Retrieves the BodyDecl list. 315 * <p><em>This method does not invoke AST transformations.</em></p> 316 * @return The node representing the BodyDecl list. 317 * @apilevel low-level 318 */ 319 public List<BodyDecl> getBodyDeclListNoTransform() { 320 return (List<BodyDecl>) getChildNoTransform(1); 321 } 322 /** 323 * Retrieves the BodyDecl list. 324 * @return The node representing the BodyDecl list. 325 * @apilevel high-level 326 */ 327 public List<BodyDecl> getBodyDecls() { 328 return getBodyDeclList(); 329 } 330 /** 331 * Retrieves the BodyDecl list. 332 * <p><em>This method does not invoke AST transformations.</em></p> 333 * @return The node representing the BodyDecl list. 334 * @apilevel low-level 335 */ 336 public List<BodyDecl> getBodyDeclsNoTransform() { 337 return getBodyDeclListNoTransform(); 338 } 339 /** 340 * @param bound the bounded type variable 341 * @param par a parameterization of the type for which the type variable 342 * occurs in the type parameter list 343 * @return {@code true} if this type is within the bounds of the parameter type 344 * @attribute syn 345 * @aspect GenericBoundCheck 346 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericBoundCheck.jrag:42 347 */ 348 @ASTNodeAnnotation.Attribute 349 public boolean withinBounds(TypeDecl bound, Parameterization par) { 350 boolean withinBounds_TypeDecl_Parameterization_value = true; 351 352 return withinBounds_TypeDecl_Parameterization_value; 353 } 354 /** 355 * @attribute syn 356 * @aspect LookupParTypeDecl 357 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:806 358 */ 359 @ASTNodeAnnotation.Attribute 360 public boolean sameSignature(Access a) { 361 { 362 if (a instanceof Wildcard) { 363 return true; 364 } 365 return super.sameSignature(a); 366 } 367 } 368 /** 369 * @apilevel internal 370 */ 371 private void subtype_TypeDecl_reset() { 372 subtype_TypeDecl_values = null; 373 } 374 protected java.util.Map subtype_TypeDecl_values; 375 @ASTNodeAnnotation.Attribute 376 public boolean subtype(TypeDecl type) { 377 Object _parameters = type; 378 if (subtype_TypeDecl_values == null) subtype_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 379 ASTNode$State.CircularValue _value; 380 if (subtype_TypeDecl_values.containsKey(_parameters)) { 381 Object _o = subtype_TypeDecl_values.get(_parameters); 382 if (!(_o instanceof ASTNode$State.CircularValue)) { 383 return (Boolean) _o; 384 } else { 385 _value = (ASTNode$State.CircularValue) _o; 386 } 387 } else { 388 _value = new ASTNode$State.CircularValue(); 389 subtype_TypeDecl_values.put(_parameters, _value); 390 _value.value = true; 391 } 392 ASTNode$State state = state(); 393 boolean new_subtype_TypeDecl_value; 394 if (!state.IN_CIRCLE) { 395 state.IN_CIRCLE = true; 396 int num = state.boundariesCrossed; 397 boolean isFinal = this.is$Final(); 398 // TODO: fixme 399 // state().CIRCLE_INDEX = 1; 400 do { 401 _value.visited = state.CIRCLE_INDEX; 402 state.CHANGE = false; 403 new_subtype_TypeDecl_value = type.supertypeWildcard(this); 404 if (new_subtype_TypeDecl_value != ((Boolean)_value.value)) { 405 state.CHANGE = true; 406 _value.value = new_subtype_TypeDecl_value; 407 } 408 state.CIRCLE_INDEX++; 409 } while (state.CHANGE); 410 if (isFinal && num == state().boundariesCrossed) { 411 subtype_TypeDecl_values.put(_parameters, new_subtype_TypeDecl_value); 412 } else { 413 subtype_TypeDecl_values.remove(_parameters); 414 state.RESET_CYCLE = true; 415 boolean $tmp = type.supertypeWildcard(this); 416 state.RESET_CYCLE = false; 417 } 418 state.IN_CIRCLE = false; 419 state.INTERMEDIATE_VALUE = false; 420 return new_subtype_TypeDecl_value; 421 } 422 if (state.CIRCLE_INDEX != _value.visited) { 423 _value.visited = state.CIRCLE_INDEX; 424 new_subtype_TypeDecl_value = type.supertypeWildcard(this); 425 if (state.RESET_CYCLE) { 426 subtype_TypeDecl_values.remove(_parameters); 427 } 428 else if (new_subtype_TypeDecl_value != ((Boolean)_value.value)) { 429 state.CHANGE = true; 430 _value.value = new_subtype_TypeDecl_value; 431 } 432 state.INTERMEDIATE_VALUE = true; 433 return new_subtype_TypeDecl_value; 434 } 435 state.INTERMEDIATE_VALUE = true; 436 return (Boolean) _value.value; 437 } 438 /** 439 * @attribute syn 440 * @aspect GenericsSubtype 441 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:66 442 */ 443 @ASTNodeAnnotation.Attribute 444 public boolean supertypeWildcard(WildcardType type) { 445 boolean supertypeWildcard_WildcardType_value = true; 446 447 return supertypeWildcard_WildcardType_value; 448 } 449 /** 450 * @attribute syn 451 * @aspect GenericsSubtype 452 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:73 453 */ 454 @ASTNodeAnnotation.Attribute 455 public boolean supertypeWildcardExtends(WildcardExtendsType type) { 456 boolean supertypeWildcardExtends_WildcardExtendsType_value = true; 457 458 return supertypeWildcardExtends_WildcardExtendsType_value; 459 } 460 /** 461 * @attribute syn 462 * @aspect GenericsSubtype 463 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:81 464 */ 465 @ASTNodeAnnotation.Attribute 466 public boolean supertypeWildcardSuper(WildcardSuperType type) { 467 boolean supertypeWildcardSuper_WildcardSuperType_value = true; 468 469 return supertypeWildcardSuper_WildcardSuperType_value; 470 } 471 /** 472 * @attribute syn 473 * @aspect GenericsSubtype 474 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:448 475 */ 476 @ASTNodeAnnotation.Attribute 477 public boolean supertypeClassDecl(ClassDecl type) { 478 boolean supertypeClassDecl_ClassDecl_value = true; 479 480 return supertypeClassDecl_ClassDecl_value; 481 } 482 /** 483 * @attribute syn 484 * @aspect GenericsSubtype 485 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:465 486 */ 487 @ASTNodeAnnotation.Attribute 488 public boolean supertypeInterfaceDecl(InterfaceDecl type) { 489 boolean supertypeInterfaceDecl_InterfaceDecl_value = true; 490 491 return supertypeInterfaceDecl_InterfaceDecl_value; 492 } 493 /** 494 * @attribute syn 495 * @aspect GenericsSubtype 496 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:134 497 */ 498 @ASTNodeAnnotation.Attribute 499 public boolean supertypeParClassDecl(ParClassDecl type) { 500 boolean supertypeParClassDecl_ParClassDecl_value = true; 501 502 return supertypeParClassDecl_ParClassDecl_value; 503 } 504 /** 505 * @attribute syn 506 * @aspect GenericsSubtype 507 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:137 508 */ 509 @ASTNodeAnnotation.Attribute 510 public boolean supertypeParInterfaceDecl(ParInterfaceDecl type) { 511 boolean supertypeParInterfaceDecl_ParInterfaceDecl_value = true; 512 513 return supertypeParInterfaceDecl_ParInterfaceDecl_value; 514 } 515 /** 516 * @attribute syn 517 * @aspect GenericsSubtype 518 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:46 519 */ 520 @ASTNodeAnnotation.Attribute 521 public boolean supertypeRawClassDecl(RawClassDecl type) { 522 boolean supertypeRawClassDecl_RawClassDecl_value = true; 523 524 return supertypeRawClassDecl_RawClassDecl_value; 525 } 526 /** 527 * @attribute syn 528 * @aspect GenericsSubtype 529 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:50 530 */ 531 @ASTNodeAnnotation.Attribute 532 public boolean supertypeRawInterfaceDecl(RawInterfaceDecl type) { 533 boolean supertypeRawInterfaceDecl_RawInterfaceDecl_value = true; 534 535 return supertypeRawInterfaceDecl_RawInterfaceDecl_value; 536 } 537 /** 538 * @attribute syn 539 * @aspect GenericsSubtype 540 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:321 541 */ 542 @ASTNodeAnnotation.Attribute 543 public boolean supertypeTypeVariable(TypeVariable type) { 544 boolean supertypeTypeVariable_TypeVariable_value = true; 545 546 return supertypeTypeVariable_TypeVariable_value; 547 } 548 /** 549 * @attribute syn 550 * @aspect GenericsSubtype 551 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericsSubtype.jrag:480 552 */ 553 @ASTNodeAnnotation.Attribute 554 public boolean supertypeArrayDecl(ArrayDecl type) { 555 boolean supertypeArrayDecl_ArrayDecl_value = true; 556 557 return supertypeArrayDecl_ArrayDecl_value; 558 } 559 /** 560 * @apilevel internal 561 */ 562 private void containedIn_TypeDecl_reset() { 563 containedIn_TypeDecl_values = null; 564 } 565 protected java.util.Map containedIn_TypeDecl_values; 566 @ASTNodeAnnotation.Attribute 567 public boolean containedIn(TypeDecl type) { 568 Object _parameters = type; 569 if (containedIn_TypeDecl_values == null) containedIn_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 570 ASTNode$State.CircularValue _value; 571 if (containedIn_TypeDecl_values.containsKey(_parameters)) { 572 Object _o = containedIn_TypeDecl_values.get(_parameters); 573 if (!(_o instanceof ASTNode$State.CircularValue)) { 574 return (Boolean) _o; 575 } else { 576 _value = (ASTNode$State.CircularValue) _o; 577 } 578 } else { 579 _value = new ASTNode$State.CircularValue(); 580 containedIn_TypeDecl_values.put(_parameters, _value); 581 _value.value = true; 582 } 583 ASTNode$State state = state(); 584 boolean new_containedIn_TypeDecl_value; 585 if (!state.IN_CIRCLE) { 586 state.IN_CIRCLE = true; 587 int num = state.boundariesCrossed; 588 boolean isFinal = this.is$Final(); 589 // TODO: fixme 590 // state().CIRCLE_INDEX = 1; 591 do { 592 _value.visited = state.CIRCLE_INDEX; 593 state.CHANGE = false; 594 new_containedIn_TypeDecl_value = containedIn_compute(type); 595 if (new_containedIn_TypeDecl_value != ((Boolean)_value.value)) { 596 state.CHANGE = true; 597 _value.value = new_containedIn_TypeDecl_value; 598 } 599 state.CIRCLE_INDEX++; 600 } while (state.CHANGE); 601 if (isFinal && num == state().boundariesCrossed) { 602 containedIn_TypeDecl_values.put(_parameters, new_containedIn_TypeDecl_value); 603 } else { 604 containedIn_TypeDecl_values.remove(_parameters); 605 state.RESET_CYCLE = true; 606 boolean $tmp = containedIn_compute(type); 607 state.RESET_CYCLE = false; 608 } 609 state.IN_CIRCLE = false; 610 state.INTERMEDIATE_VALUE = false; 611 return new_containedIn_TypeDecl_value; 612 } 613 if (state.CIRCLE_INDEX != _value.visited) { 614 _value.visited = state.CIRCLE_INDEX; 615 new_containedIn_TypeDecl_value = containedIn_compute(type); 616 if (state.RESET_CYCLE) { 617 containedIn_TypeDecl_values.remove(_parameters); 618 } 619 else if (new_containedIn_TypeDecl_value != ((Boolean)_value.value)) { 620 state.CHANGE = true; 621 _value.value = new_containedIn_TypeDecl_value; 622 } 623 state.INTERMEDIATE_VALUE = true; 624 return new_containedIn_TypeDecl_value; 625 } 626 state.INTERMEDIATE_VALUE = true; 627 return (Boolean) _value.value; 628 } 629 /** 630 * @apilevel internal 631 */ 632 private boolean containedIn_compute(TypeDecl type) { 633 if (type == this) { 634 return true; 635 } else if (type instanceof WildcardExtendsType) { 636 return typeObject().subtype(((WildcardExtendsType) type).extendsType()); 637 } else { 638 return false; 639 } 640 } 641 /** 642 * @apilevel internal 643 */ 644 protected java.util.Map instanceOf_TypeDecl_values; 645 /** 646 * @apilevel internal 647 */ 648 private void instanceOf_TypeDecl_reset() { 649 instanceOf_TypeDecl_values = null; 650 } 651 /** 652 * @attribute syn 653 * @aspect TypeWideningAndIdentity 654 * @declaredat /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag:442 655 */ 656 @ASTNodeAnnotation.Attribute 657 public boolean instanceOf(TypeDecl type) { 658 Object _parameters = type; 659 if (instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 660 ASTNode$State state = state(); 661 if (instanceOf_TypeDecl_values.containsKey(_parameters)) { 662 return (Boolean) instanceOf_TypeDecl_values.get(_parameters); 663 } 664 boolean intermediate = state.INTERMEDIATE_VALUE; 665 state.INTERMEDIATE_VALUE = false; 666 int num = state.boundariesCrossed; 667 boolean isFinal = this.is$Final(); 668 boolean instanceOf_TypeDecl_value = subtype(type); 669 if (isFinal && num == state().boundariesCrossed) { 670 instanceOf_TypeDecl_values.put(_parameters, instanceOf_TypeDecl_value); 671 } else { 672 } 673 state.INTERMEDIATE_VALUE |= intermediate; 674 675 return instanceOf_TypeDecl_value; 676 } 677 /** 678 * @apilevel internal 679 */ 680 protected boolean fieldTypeSignature_computed = false; 681 /** 682 * @apilevel internal 683 */ 684 protected String fieldTypeSignature_value; 685 /** 686 * @apilevel internal 687 */ 688 private void fieldTypeSignature_reset() { 689 fieldTypeSignature_computed = false; 690 fieldTypeSignature_value = null; 691 } 692 /** 693 * @attribute syn 694 * @aspect GenericsCodegen 695 * @declaredat /home/jesper/git/extendj/java5/backend/GenericsCodegen.jrag:467 696 */ 697 @ASTNodeAnnotation.Attribute 698 public String fieldTypeSignature() { 699 ASTNode$State state = state(); 700 if (fieldTypeSignature_computed) { 701 return fieldTypeSignature_value; 702 } 703 boolean intermediate = state.INTERMEDIATE_VALUE; 704 state.INTERMEDIATE_VALUE = false; 705 int num = state.boundariesCrossed; 706 boolean isFinal = this.is$Final(); 707 fieldTypeSignature_value = "*"; 708 if (isFinal && num == state().boundariesCrossed) { 709 fieldTypeSignature_computed = true; 710 } else { 711 } 712 state.INTERMEDIATE_VALUE |= intermediate; 713 714 return fieldTypeSignature_value; 715 } 716 /** 717 * @apilevel internal 718 */ 719 private void strictSubtype_TypeDecl_reset() { 720 strictSubtype_TypeDecl_values = null; 721 } 722 protected java.util.Map strictSubtype_TypeDecl_values; 723 @ASTNodeAnnotation.Attribute 724 public boolean strictSubtype(TypeDecl type) { 725 Object _parameters = type; 726 if (strictSubtype_TypeDecl_values == null) strictSubtype_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 727 ASTNode$State.CircularValue _value; 728 if (strictSubtype_TypeDecl_values.containsKey(_parameters)) { 729 Object _o = strictSubtype_TypeDecl_values.get(_parameters); 730 if (!(_o instanceof ASTNode$State.CircularValue)) { 731 return (Boolean) _o; 732 } else { 733 _value = (ASTNode$State.CircularValue) _o; 734 } 735 } else { 736 _value = new ASTNode$State.CircularValue(); 737 strictSubtype_TypeDecl_values.put(_parameters, _value); 738 _value.value = true; 739 } 740 ASTNode$State state = state(); 741 boolean new_strictSubtype_TypeDecl_value; 742 if (!state.IN_CIRCLE) { 743 state.IN_CIRCLE = true; 744 int num = state.boundariesCrossed; 745 boolean isFinal = this.is$Final(); 746 // TODO: fixme 747 // state().CIRCLE_INDEX = 1; 748 do { 749 _value.visited = state.CIRCLE_INDEX; 750 state.CHANGE = false; 751 new_strictSubtype_TypeDecl_value = type.strictSupertypeWildcard(this); 752 if (new_strictSubtype_TypeDecl_value != ((Boolean)_value.value)) { 753 state.CHANGE = true; 754 _value.value = new_strictSubtype_TypeDecl_value; 755 } 756 state.CIRCLE_INDEX++; 757 } while (state.CHANGE); 758 if (isFinal && num == state().boundariesCrossed) { 759 strictSubtype_TypeDecl_values.put(_parameters, new_strictSubtype_TypeDecl_value); 760 } else { 761 strictSubtype_TypeDecl_values.remove(_parameters); 762 state.RESET_CYCLE = true; 763 boolean $tmp = type.strictSupertypeWildcard(this); 764 state.RESET_CYCLE = false; 765 } 766 state.IN_CIRCLE = false; 767 state.INTERMEDIATE_VALUE = false; 768 return new_strictSubtype_TypeDecl_value; 769 } 770 if (state.CIRCLE_INDEX != _value.visited) { 771 _value.visited = state.CIRCLE_INDEX; 772 new_strictSubtype_TypeDecl_value = type.strictSupertypeWildcard(this); 773 if (state.RESET_CYCLE) { 774 strictSubtype_TypeDecl_values.remove(_parameters); 775 } 776 else if (new_strictSubtype_TypeDecl_value != ((Boolean)_value.value)) { 777 state.CHANGE = true; 778 _value.value = new_strictSubtype_TypeDecl_value; 779 } 780 state.INTERMEDIATE_VALUE = true; 781 return new_strictSubtype_TypeDecl_value; 782 } 783 state.INTERMEDIATE_VALUE = true; 784 return (Boolean) _value.value; 785 } 786 /** 787 * @attribute syn 788 * @aspect StrictSubtype 789 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:68 790 */ 791 @ASTNodeAnnotation.Attribute 792 public boolean strictSupertypeWildcard(WildcardType type) { 793 boolean strictSupertypeWildcard_WildcardType_value = true; 794 795 return strictSupertypeWildcard_WildcardType_value; 796 } 797 /** 798 * @attribute syn 799 * @aspect StrictSubtype 800 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:77 801 */ 802 @ASTNodeAnnotation.Attribute 803 public boolean strictSupertypeWildcardExtends(WildcardExtendsType type) { 804 boolean strictSupertypeWildcardExtends_WildcardExtendsType_value = true; 805 806 return strictSupertypeWildcardExtends_WildcardExtendsType_value; 807 } 808 /** 809 * @attribute syn 810 * @aspect StrictSubtype 811 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:85 812 */ 813 @ASTNodeAnnotation.Attribute 814 public boolean strictSupertypeWildcardSuper(WildcardSuperType type) { 815 boolean strictSupertypeWildcardSuper_WildcardSuperType_value = true; 816 817 return strictSupertypeWildcardSuper_WildcardSuperType_value; 818 } 819 /** 820 * @attribute syn 821 * @aspect StrictSubtype 822 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:370 823 */ 824 @ASTNodeAnnotation.Attribute 825 public boolean strictSupertypeClassDecl(ClassDecl type) { 826 boolean strictSupertypeClassDecl_ClassDecl_value = true; 827 828 return strictSupertypeClassDecl_ClassDecl_value; 829 } 830 /** 831 * @attribute syn 832 * @aspect StrictSubtype 833 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:390 834 */ 835 @ASTNodeAnnotation.Attribute 836 public boolean strictSupertypeInterfaceDecl(InterfaceDecl type) { 837 boolean strictSupertypeInterfaceDecl_InterfaceDecl_value = true; 838 839 return strictSupertypeInterfaceDecl_InterfaceDecl_value; 840 } 841 /** 842 * @attribute syn 843 * @aspect StrictSubtype 844 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:155 845 */ 846 @ASTNodeAnnotation.Attribute 847 public boolean strictSupertypeParClassDecl(ParClassDecl type) { 848 boolean strictSupertypeParClassDecl_ParClassDecl_value = true; 849 850 return strictSupertypeParClassDecl_ParClassDecl_value; 851 } 852 /** 853 * @attribute syn 854 * @aspect StrictSubtype 855 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:159 856 */ 857 @ASTNodeAnnotation.Attribute 858 public boolean strictSupertypeParInterfaceDecl(ParInterfaceDecl type) { 859 boolean strictSupertypeParInterfaceDecl_ParInterfaceDecl_value = true; 860 861 return strictSupertypeParInterfaceDecl_ParInterfaceDecl_value; 862 } 863 /** 864 * @attribute syn 865 * @aspect StrictSubtype 866 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:52 867 */ 868 @ASTNodeAnnotation.Attribute 869 public boolean strictSupertypeRawClassDecl(RawClassDecl type) { 870 boolean strictSupertypeRawClassDecl_RawClassDecl_value = true; 871 872 return strictSupertypeRawClassDecl_RawClassDecl_value; 873 } 874 /** 875 * @attribute syn 876 * @aspect StrictSubtype 877 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:56 878 */ 879 @ASTNodeAnnotation.Attribute 880 public boolean strictSupertypeRawInterfaceDecl(RawInterfaceDecl type) { 881 boolean strictSupertypeRawInterfaceDecl_RawInterfaceDecl_value = true; 882 883 return strictSupertypeRawInterfaceDecl_RawInterfaceDecl_value; 884 } 885 /** 886 * @attribute syn 887 * @aspect StrictSubtype 888 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:276 889 */ 890 @ASTNodeAnnotation.Attribute 891 public boolean strictSupertypeTypeVariable(TypeVariable type) { 892 boolean strictSupertypeTypeVariable_TypeVariable_value = true; 893 894 return strictSupertypeTypeVariable_TypeVariable_value; 895 } 896 /** 897 * @attribute syn 898 * @aspect StrictSubtype 899 * @declaredat /home/jesper/git/extendj/java8/frontend/GenericsSubtype.jrag:407 900 */ 901 @ASTNodeAnnotation.Attribute 902 public boolean strictSupertypeArrayDecl(ArrayDecl type) { 903 boolean strictSupertypeArrayDecl_ArrayDecl_value = true; 904 905 return strictSupertypeArrayDecl_ArrayDecl_value; 906 } 907 /** 908 * @apilevel internal 909 */ 910 private void strictContainedIn_TypeDecl_reset() { 911 strictContainedIn_TypeDecl_values = null; 912 } 913 protected java.util.Map strictContainedIn_TypeDecl_values; 914 @ASTNodeAnnotation.Attribute 915 public boolean strictContainedIn(TypeDecl type) { 916 Object _parameters = type; 917 if (strictContainedIn_TypeDecl_values == null) strictContainedIn_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 918 ASTNode$State.CircularValue _value; 919 if (strictContainedIn_TypeDecl_values.containsKey(_parameters)) { 920 Object _o = strictContainedIn_TypeDecl_values.get(_parameters); 921 if (!(_o instanceof ASTNode$State.CircularValue)) { 922 return (Boolean) _o; 923 } else { 924 _value = (ASTNode$State.CircularValue) _o; 925 } 926 } else { 927 _value = new ASTNode$State.CircularValue(); 928 strictContainedIn_TypeDecl_values.put(_parameters, _value); 929 _value.value = true; 930 } 931 ASTNode$State state = state(); 932 boolean new_strictContainedIn_TypeDecl_value; 933 if (!state.IN_CIRCLE) { 934 state.IN_CIRCLE = true; 935 int num = state.boundariesCrossed; 936 boolean isFinal = this.is$Final(); 937 // TODO: fixme 938 // state().CIRCLE_INDEX = 1; 939 do { 940 _value.visited = state.CIRCLE_INDEX; 941 state.CHANGE = false; 942 new_strictContainedIn_TypeDecl_value = strictContainedIn_compute(type); 943 if (new_strictContainedIn_TypeDecl_value != ((Boolean)_value.value)) { 944 state.CHANGE = true; 945 _value.value = new_strictContainedIn_TypeDecl_value; 946 } 947 state.CIRCLE_INDEX++; 948 } while (state.CHANGE); 949 if (isFinal && num == state().boundariesCrossed) { 950 strictContainedIn_TypeDecl_values.put(_parameters, new_strictContainedIn_TypeDecl_value); 951 } else { 952 strictContainedIn_TypeDecl_values.remove(_parameters); 953 state.RESET_CYCLE = true; 954 boolean $tmp = strictContainedIn_compute(type); 955 state.RESET_CYCLE = false; 956 } 957 state.IN_CIRCLE = false; 958 state.INTERMEDIATE_VALUE = false; 959 return new_strictContainedIn_TypeDecl_value; 960 } 961 if (state.CIRCLE_INDEX != _value.visited) { 962 _value.visited = state.CIRCLE_INDEX; 963 new_strictContainedIn_TypeDecl_value = strictContainedIn_compute(type); 964 if (state.RESET_CYCLE) { 965 strictContainedIn_TypeDecl_values.remove(_parameters); 966 } 967 else if (new_strictContainedIn_TypeDecl_value != ((Boolean)_value.value)) { 968 state.CHANGE = true; 969 _value.value = new_strictContainedIn_TypeDecl_value; 970 } 971 state.INTERMEDIATE_VALUE = true; 972 return new_strictContainedIn_TypeDecl_value; 973 } 974 state.INTERMEDIATE_VALUE = true; 975 return (Boolean) _value.value; 976 } 977 /** 978 * @apilevel internal 979 */ 980 private boolean strictContainedIn_compute(TypeDecl type) { 981 if (type == this) { 982 return true; 983 } else if (type instanceof WildcardExtendsType) { 984 return typeObject().strictSubtype(((WildcardExtendsType) type).extendsType()); 985 } else { 986 return false; 987 } 988 } 989 /** 990 * @apilevel internal 991 */ 992 public ASTNode rewriteTo() { 993 return super.rewriteTo(); 994 } 995 }