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