001 /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.3 */ 002 package AST; 003 004 import java.util.Collection; 005 import java.util.ArrayList; 006 import java.util.HashSet; 007 /** 008 * @ast node 009 * @declaredat /home/csz-naf/examples/PicoJava/spec/picojava.ast:24 010 * @production TypeUse : {@link IdUse}; 011 012 */ 013 public class TypeUse extends IdUse implements Cloneable { 014 /** 015 * @apilevel internal 016 */ 017 public TypeUse clone() throws CloneNotSupportedException { 018 TypeUse node = (TypeUse) super.clone(); 019 node.isValue_visited = -1; 020 node.in$Circle(false); 021 node.is$Final(false); 022 return node; 023 } 024 /** 025 * @apilevel internal 026 */ 027 public TypeUse copy() { 028 try { 029 TypeUse node = (TypeUse) clone(); 030 node.parent = null; 031 if(children != null) { 032 node.children = (ASTNode[]) children.clone(); 033 } 034 return node; 035 } catch (CloneNotSupportedException e) { 036 throw new Error("Error: clone not supported for " + getClass().getName()); 037 } 038 } 039 /** 040 * Create a deep copy of the AST subtree at this node. 041 * The copy is dangling, i.e. has no parent. 042 * @return dangling copy of the subtree at this node 043 * @apilevel low-level 044 */ 045 public TypeUse fullCopy() { 046 TypeUse tree = (TypeUse) copy(); 047 if (children != null) { 048 for (int i = 0; i < children.length; ++i) { 049 ASTNode child = (ASTNode) children[i]; 050 if(child != null) { 051 child = child.fullCopy(); 052 tree.setChild(child, i); 053 } 054 } 055 } 056 return tree; 057 } 058 /** 059 */ 060 public TypeUse() { 061 super(); 062 } 063 /** 064 * Initializes the child array to the correct size. 065 * Initializes List and Opt nta children. 066 * @apilevel internal 067 * @ast method 068 */ 069 public void init$Children() { 070 } 071 /** 072 */ 073 public TypeUse(String p0) { 074 setName(p0); 075 } 076 /** 077 * @apilevel low-level 078 */ 079 protected int numChildren() { 080 return 0; 081 } 082 /** 083 * @apilevel internal 084 */ 085 public boolean mayHaveRewrite() { 086 return false; 087 } 088 /** 089 * @apilevel low-level 090 */ 091 public void flushCache() { 092 super.flushCache(); 093 isValue_visited = -1; 094 } 095 /** 096 * @apilevel internal 097 */ 098 public void flushCollectionCache() { 099 super.flushCollectionCache(); 100 } 101 /** 102 * Replaces the lexeme Name. 103 * @param value The new value for the lexeme Name. 104 * @apilevel high-level 105 */ 106 public void setName(String value) { 107 tokenString_Name = value; 108 } 109 /** 110 * Retrieves the value for the lexeme Name. 111 * @return The value for the lexeme Name. 112 * @apilevel high-level 113 */ 114 public String getName() { 115 return tokenString_Name != null ? tokenString_Name : ""; 116 } 117 /** 118 * @apilevel internal 119 */ 120 protected int isValue_visited = -1; 121 /** 122 * @attribute syn 123 * @aspect TypeAnalysis 124 * @declaredat /home/csz-naf/examples/PicoJava/spec/TypeAnalysis.jrag:18 125 */ 126 public boolean isValue() { 127 ASTNode$State state = state(); 128 if (isValue_visited == state().boundariesCrossed) { 129 throw new RuntimeException("Circular definition of attr: isValue in class: org.jastadd.ast.AST.SynDecl"); 130 } 131 isValue_visited = state().boundariesCrossed; 132 try { return false; } 133 finally { 134 isValue_visited = -1; 135 } 136 } 137 /** 138 * @apilevel internal 139 */ 140 public ASTNode rewriteTo() { return super.rewriteTo(); 141 }}