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/PicoJavaMethods/spec/picojava-method.ast:3
010     * @production ParamDecl : {@link VarDecl};
011    
012     */
013    public class ParamDecl extends VarDecl implements Cloneable {
014      /**
015       * @apilevel internal
016       */
017      public ParamDecl clone() throws CloneNotSupportedException {
018        ParamDecl node = (ParamDecl) super.clone();
019        node.in$Circle(false);
020        node.is$Final(false);
021        return node;
022      }
023      /**
024       * @apilevel internal
025       */
026      public ParamDecl copy() {
027        try {
028          ParamDecl node = (ParamDecl) 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 ParamDecl fullCopy() {
045        ParamDecl tree = (ParamDecl) 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 ParamDecl() {
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        children = new ASTNode[1];
070      }
071      /**
072       */
073      public ParamDecl(String p0, Access p1) {
074        setName(p0);
075        setChild(p1, 0);
076      }
077      /**
078       * @apilevel low-level
079       */
080      protected int numChildren() {
081        return 1;
082      }
083      /**
084       * @apilevel internal
085       */
086      public boolean mayHaveRewrite() {
087        return false;
088      }
089      /**
090       * @apilevel low-level
091       */
092      public void flushCache() {
093        super.flushCache();
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       * Replaces the Type child.
119       * @param node The new node to replace the Type child.
120       * @apilevel high-level
121       */
122      public void setType(Access node) {
123        setChild(node, 0);
124      }
125      /**
126       * Retrieves the Type child.
127       * @return The current node used as the Type child.
128       * @apilevel high-level
129       */
130      public Access getType() {
131        return (Access) getChild(0);
132      }
133      /**
134       * Retrieves the Type child.
135       * <p><em>This method does not invoke AST transformations.</em></p>
136       * @return The current node used as the Type child.
137       * @apilevel low-level
138       */
139      public Access getTypeNoTransform() {
140        return (Access) getChildNoTransform(0);
141      }
142      /**
143       * @apilevel internal
144       */
145      public ASTNode rewriteTo() {    return super.rewriteTo();
146      }}