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:25
010     * @production VariableUse : {@link IdUse};
011    
012     */
013    public class VariableUse extends IdUse implements Cloneable {
014      /**
015       * @apilevel internal
016       */
017      public VariableUse clone() throws CloneNotSupportedException {
018        VariableUse node = (VariableUse) super.clone();
019        node.in$Circle(false);
020        node.is$Final(false);
021        return node;
022      }
023      /**
024       * @apilevel internal
025       */
026      public VariableUse copy() {
027        try {
028          VariableUse node = (VariableUse) clone();
029          node.parent = null;
030          if(children != null) {
031            node.children = (ASTNode[]) children.clone();
032          }
033          return node;
034        } catch (CloneNotSupportedException e) {
035          throw new Error("Error: clone not supported for " + getClass().getName());
036        }
037      }
038      /**
039       * Create a deep copy of the AST subtree at this node.
040       * The copy is dangling, i.e. has no parent.
041       * @return dangling copy of the subtree at this node
042       * @apilevel low-level
043       */
044      public VariableUse fullCopy() {
045        VariableUse tree = (VariableUse) copy();
046        if (children != null) {
047          for (int i = 0; i < children.length; ++i) {
048            ASTNode child = (ASTNode) children[i];
049            if(child != null) {
050              child = child.fullCopy();
051              tree.setChild(child, i);
052            }
053          }
054        }
055        return tree;
056      }
057      /**
058       */
059      public VariableUse() {
060        super();
061      }
062      /**
063       * Initializes the child array to the correct size.
064       * Initializes List and Opt nta children.
065       * @apilevel internal
066       * @ast method
067       */
068      public void init$Children() {
069      }
070      /**
071       */
072      public VariableUse(String p0) {
073        setName(p0);
074      }
075      /**
076       * @apilevel low-level
077       */
078      protected int numChildren() {
079        return 0;
080      }
081      /**
082       * @apilevel internal
083       */
084      public boolean mayHaveRewrite() {
085        return false;
086      }
087      /**
088       * @apilevel low-level
089       */
090      public void flushCache() {
091        super.flushCache();
092      }
093      /**
094       * @apilevel internal
095       */
096      public void flushCollectionCache() {
097        super.flushCollectionCache();
098      }
099      /**
100       * Replaces the lexeme Name.
101       * @param value The new value for the lexeme Name.
102       * @apilevel high-level
103       */
104      public void setName(String value) {
105        tokenString_Name = value;
106      }
107      /**
108       * Retrieves the value for the lexeme Name.
109       * @return The value for the lexeme Name.
110       * @apilevel high-level
111       */
112      public String getName() {
113        return tokenString_Name != null ? tokenString_Name : "";
114      }
115      /**
116       * @apilevel internal
117       */
118      public ASTNode rewriteTo() {    return super.rewriteTo();
119      }}