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 ParseName : {@link Access} ::= <span class="component"><ID:String></span>; 015 * @ast node 016 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:33 017 */ 018 public class ParseName extends Access implements Cloneable { 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 ParseName clone() throws CloneNotSupportedException { 034 ParseName node = (ParseName)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 ParseName copy() { 044 045 try { 046 ParseName node = (ParseName) 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 ParseName fullCopy() { 064 065 ParseName tree = (ParseName) 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 * Parser debug printout. 080 * @ast method 081 * @aspect PrettyPrint 082 * @declaredat /home/jesper/svn/JastAddJ/Java7Frontend/PrettyPrint.jrag:14 083 */ 084 public void toString(StringBuffer sb) { 085 sb.append(getID()); 086 } 087 /** 088 * @ast method 089 * 090 */ 091 public ParseName() { 092 super(); 093 094 095 } 096 /** 097 * Initializes the child array to the correct size. 098 * Initializes List and Opt nta children. 099 * @apilevel internal 100 * @ast method 101 * @ast method 102 * 103 */ 104 public void init$Children() { 105 } 106 /** 107 * @ast method 108 * 109 */ 110 public ParseName(String p0) { 111 setID(p0); 112 } 113 /** 114 * @ast method 115 * 116 */ 117 public ParseName(beaver.Symbol p0) { 118 setID(p0); 119 } 120 /** 121 * @apilevel low-level 122 * @ast method 123 * 124 */ 125 protected int numChildren() { 126 return 0; 127 } 128 /** 129 * @apilevel internal 130 * @ast method 131 * 132 */ 133 public boolean mayHaveRewrite() { 134 return true; 135 } 136 /** 137 * Replaces the lexeme ID. 138 * @param value The new value for the lexeme ID. 139 * @apilevel high-level 140 * @ast method 141 * 142 */ 143 public void setID(String value) { 144 tokenString_ID = value; 145 } 146 /** 147 * @apilevel internal 148 * @ast method 149 * 150 */ 151 152 /** 153 * @apilevel internal 154 */ 155 protected String tokenString_ID; 156 /** 157 * @ast method 158 * 159 */ 160 161 public int IDstart; 162 /** 163 * @ast method 164 * 165 */ 166 167 public int IDend; 168 /** 169 * JastAdd-internal setter for lexeme ID using the Beaver parser. 170 * @apilevel internal 171 * @ast method 172 * 173 */ 174 public void setID(beaver.Symbol symbol) { 175 if(symbol.value != null && !(symbol.value instanceof String)) 176 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 177 tokenString_ID = (String)symbol.value; 178 IDstart = symbol.getStart(); 179 IDend = symbol.getEnd(); 180 } 181 /** 182 * Retrieves the value for the lexeme ID. 183 * @return The value for the lexeme ID. 184 * @apilevel high-level 185 * @ast method 186 * 187 */ 188 public String getID() { 189 return tokenString_ID != null ? tokenString_ID : ""; 190 } 191 /** 192 * @attribute syn 193 * @aspect TypeScopePropagation 194 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupType.jrag:430 195 */ 196 public SimpleSet qualifiedLookupType(String name) { 197 ASTNode$State state = state(); 198 try { return SimpleSet.emptySet; } 199 finally { 200 } 201 } 202 /** 203 * @attribute syn 204 * @aspect VariableScope 205 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/LookupVariable.jrag:148 206 */ 207 public SimpleSet qualifiedLookupVariable(String name) { 208 ASTNode$State state = state(); 209 try { return SimpleSet.emptySet; } 210 finally { 211 } 212 } 213 /** 214 * @attribute syn 215 * @aspect PrettyPrint 216 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:800 217 */ 218 public String dumpString() { 219 ASTNode$State state = state(); 220 try { return getClass().getName() + " [" + getID() + "]"; } 221 finally { 222 } 223 } 224 /** 225 * @attribute syn 226 * @aspect Names 227 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/QualifiedNames.jrag:14 228 */ 229 public String name() { 230 ASTNode$State state = state(); 231 try { return getID(); } 232 finally { 233 } 234 } 235 /** 236 * @apilevel internal 237 */ 238 public ASTNode rewriteTo() { 239 // Declared in /home/jesper/svn/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag at line 15 240 state().duringSyntacticClassification++; 241 ASTNode result = rewriteRule0(); 242 state().duringSyntacticClassification--; 243 return result; 244 } 245 /** 246 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/SyntacticClassification.jrag:15 247 * @apilevel internal 248 */ private Access rewriteRule0() { 249 return nameType().reclassify(name(), start, end); 250 } 251 }