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 IdUse : {@link ASTNode} ::= <span class="component">&lt;ID:String&gt;</span>;
015     * @ast node
016     * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:102
017     */
018    public class IdUse 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 IdUse clone() throws CloneNotSupportedException {
034        IdUse node = (IdUse)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 IdUse copy() {
044      
045      try {
046        IdUse node = (IdUse) 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 IdUse fullCopy() {
064      
065      IdUse tree = (IdUse) 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       * 
081       */
082      public IdUse() {
083        super();
084    
085        is$Final(true);
086    
087      }
088      /**
089       * Initializes the child array to the correct size.
090       * Initializes List and Opt nta children.
091       * @apilevel internal
092       * @ast method
093       * @ast method 
094       * 
095       */
096      public void init$Children() {
097      }
098      /**
099       * @ast method 
100       * 
101       */
102      public IdUse(String p0) {
103        setID(p0);
104        is$Final(true);
105      }
106      /**
107       * @ast method 
108       * 
109       */
110      public IdUse(beaver.Symbol p0) {
111        setID(p0);
112        is$Final(true);
113      }
114      /**
115       * @apilevel low-level
116       * @ast method 
117       * 
118       */
119      protected int numChildren() {
120        return 0;
121      }
122      /**
123       * @apilevel internal
124       * @ast method 
125       * 
126       */
127      public boolean mayHaveRewrite() {
128        return false;
129      }
130      /**
131       * Replaces the lexeme ID.
132       * @param value The new value for the lexeme ID.
133       * @apilevel high-level
134       * @ast method 
135       * 
136       */
137      public void setID(String value) {
138        tokenString_ID = value;
139      }
140      /**
141       * @apilevel internal
142       * @ast method 
143       * 
144       */
145      
146      /**
147       * @apilevel internal
148       */
149      protected String tokenString_ID;
150      /**
151       * @ast method 
152       * 
153       */
154      
155      public int IDstart;
156      /**
157       * @ast method 
158       * 
159       */
160      
161      public int IDend;
162      /**
163       * JastAdd-internal setter for lexeme ID using the Beaver parser.
164       * @apilevel internal
165       * @ast method 
166       * 
167       */
168      public void setID(beaver.Symbol symbol) {
169        if(symbol.value != null && !(symbol.value instanceof String))
170          throw new UnsupportedOperationException("setID is only valid for String lexemes");
171        tokenString_ID = (String)symbol.value;
172        IDstart = symbol.getStart();
173        IDend = symbol.getEnd();
174      }
175      /**
176       * Retrieves the value for the lexeme ID.
177       * @return The value for the lexeme ID.
178       * @apilevel high-level
179       * @ast method 
180       * 
181       */
182      public String getID() {
183        return tokenString_ID != null ? tokenString_ID : "";
184      }
185      /**
186       * @apilevel internal
187       */
188      public ASTNode rewriteTo() {
189        return super.rewriteTo();
190      }
191    }