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 AssignMinusExpr : {@link AssignAdditiveExpr};
015     * @ast node
016     * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/java.ast:117
017     */
018    public class AssignMinusExpr extends AssignAdditiveExpr 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 AssignMinusExpr clone() throws CloneNotSupportedException {
034        AssignMinusExpr node = (AssignMinusExpr)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 AssignMinusExpr copy() {
044      
045      try {
046        AssignMinusExpr node = (AssignMinusExpr) 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 AssignMinusExpr fullCopy() {
064      
065      AssignMinusExpr tree = (AssignMinusExpr) 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 TypeCheck
081       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeCheck.jrag:86
082       */
083      public void typeCheck() {
084        if(sourceType().isBoolean() || getDest().type().isBoolean())
085          error("Operator - does not operate on boolean types");
086        super.typeCheck();
087      }
088      /**
089       * @ast method 
090       * @aspect CreateBCode
091       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CreateBCode.jrag:426
092       */
093      public void createAssignOp(CodeGeneration gen, TypeDecl type)   { type.sub(gen); }
094      /**
095       * @ast method 
096       * 
097       */
098      public AssignMinusExpr() {
099        super();
100    
101    
102      }
103      /**
104       * Initializes the child array to the correct size.
105       * Initializes List and Opt nta children.
106       * @apilevel internal
107       * @ast method
108       * @ast method 
109       * 
110       */
111      public void init$Children() {
112        children = new ASTNode[2];
113      }
114      /**
115       * @ast method 
116       * 
117       */
118      public AssignMinusExpr(Expr p0, Expr p1) {
119        setChild(p0, 0);
120        setChild(p1, 1);
121      }
122      /**
123       * @apilevel low-level
124       * @ast method 
125       * 
126       */
127      protected int numChildren() {
128        return 2;
129      }
130      /**
131       * @apilevel internal
132       * @ast method 
133       * 
134       */
135      public boolean mayHaveRewrite() {
136        return false;
137      }
138      /**
139       * Replaces the Dest child.
140       * @param node The new node to replace the Dest child.
141       * @apilevel high-level
142       * @ast method 
143       * 
144       */
145      public void setDest(Expr node) {
146        setChild(node, 0);
147      }
148      /**
149       * Retrieves the Dest child.
150       * @return The current node used as the Dest child.
151       * @apilevel high-level
152       * @ast method 
153       * 
154       */
155      public Expr getDest() {
156        return (Expr)getChild(0);
157      }
158      /**
159       * Retrieves the Dest child.
160       * <p><em>This method does not invoke AST transformations.</em></p>
161       * @return The current node used as the Dest child.
162       * @apilevel low-level
163       * @ast method 
164       * 
165       */
166      public Expr getDestNoTransform() {
167        return (Expr)getChildNoTransform(0);
168      }
169      /**
170       * Replaces the Source child.
171       * @param node The new node to replace the Source child.
172       * @apilevel high-level
173       * @ast method 
174       * 
175       */
176      public void setSource(Expr node) {
177        setChild(node, 1);
178      }
179      /**
180       * Retrieves the Source child.
181       * @return The current node used as the Source child.
182       * @apilevel high-level
183       * @ast method 
184       * 
185       */
186      public Expr getSource() {
187        return (Expr)getChild(1);
188      }
189      /**
190       * Retrieves the Source child.
191       * <p><em>This method does not invoke AST transformations.</em></p>
192       * @return The current node used as the Source child.
193       * @apilevel low-level
194       * @ast method 
195       * 
196       */
197      public Expr getSourceNoTransform() {
198        return (Expr)getChildNoTransform(1);
199      }
200      /**
201       * @attribute syn
202       * @aspect PrettyPrint
203       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/PrettyPrint.jadd:247
204       */
205      public String printOp() {
206        ASTNode$State state = state();
207        try {  return " -= ";  }
208        finally {
209        }
210      }
211      /**
212       * @apilevel internal
213       */
214      public ASTNode rewriteTo() {
215        return super.rewriteTo();
216      }
217    }