001    /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.13-12-g880e696 */
002    package org.extendj.ast;
003    
004    import java.util.HashSet;
005    import java.io.File;
006    import java.util.Set;
007    import java.util.Collections;
008    import java.util.Collection;
009    import java.util.ArrayList;
010    import beaver.*;
011    import java.util.*;
012    import java.io.ByteArrayOutputStream;
013    import java.io.PrintStream;
014    import java.lang.reflect.InvocationTargetException;
015    import java.lang.reflect.Method;
016    import org.jastadd.util.*;
017    import java.util.zip.*;
018    import java.io.*;
019    import org.jastadd.util.PrettyPrintable;
020    import org.jastadd.util.PrettyPrinter;
021    import java.io.FileNotFoundException;
022    import java.io.BufferedInputStream;
023    import java.io.DataInputStream;
024    /**
025     * @ast node
026     * @declaredat /home/jesper/git/extendj/java4/grammar/Java.ast:124
027     * @production AssignOrExpr : {@link AssignBitwiseExpr};
028    
029     */
030    public class AssignOrExpr extends AssignBitwiseExpr implements Cloneable {
031      /**
032       * @aspect CreateBCode
033       * @declaredat /home/jesper/git/extendj/java4/backend/CreateBCode.jrag:512
034       */
035      public void createAssignOp(CodeGeneration gen, TypeDecl type)      { type.bitor(gen); }
036      /**
037       * @declaredat ASTNode:1
038       */
039      public AssignOrExpr() {
040        super();
041      }
042      /**
043       * Initializes the child array to the correct size.
044       * Initializes List and Opt nta children.
045       * @apilevel internal
046       * @ast method
047       * @declaredat ASTNode:10
048       */
049      public void init$Children() {
050        children = new ASTNode[2];
051      }
052      /**
053       * @declaredat ASTNode:13
054       */
055      public AssignOrExpr(Expr p0, Expr p1) {
056        setChild(p0, 0);
057        setChild(p1, 1);
058      }
059      /**
060       * @apilevel low-level
061       * @declaredat ASTNode:20
062       */
063      protected int numChildren() {
064        return 2;
065      }
066      /**
067       * @apilevel internal
068       * @declaredat ASTNode:26
069       */
070      public boolean mayHaveRewrite() {
071        return false;
072      }
073      /**
074       * @apilevel internal
075       * @declaredat ASTNode:32
076       */
077      public void flushAttrCache() {
078        super.flushAttrCache();
079      }
080      /**
081       * @apilevel internal
082       * @declaredat ASTNode:38
083       */
084      public void flushCollectionCache() {
085        super.flushCollectionCache();
086      }
087      /**
088       * @apilevel internal
089       * @declaredat ASTNode:44
090       */
091      public void flushRewriteCache() {
092        super.flushRewriteCache();
093      }
094      /**
095       * @apilevel internal
096       * @declaredat ASTNode:50
097       */
098      public AssignOrExpr clone() throws CloneNotSupportedException {
099        AssignOrExpr node = (AssignOrExpr) super.clone();
100        return node;
101      }
102      /**
103       * @apilevel internal
104       * @declaredat ASTNode:57
105       */
106      public AssignOrExpr copy() {
107        try {
108          AssignOrExpr node = (AssignOrExpr) clone();
109          node.parent = null;
110          if (children != null) {
111            node.children = (ASTNode[]) children.clone();
112          }
113          return node;
114        } catch (CloneNotSupportedException e) {
115          throw new Error("Error: clone not supported for " + getClass().getName());
116        }
117      }
118      /**
119       * Create a deep copy of the AST subtree at this node.
120       * The copy is dangling, i.e. has no parent.
121       * @return dangling copy of the subtree at this node
122       * @apilevel low-level
123       * @deprecated Please use treeCopy or treeCopyNoTransform instead
124       * @declaredat ASTNode:76
125       */
126      @Deprecated
127      public AssignOrExpr fullCopy() {
128        return treeCopyNoTransform();
129      }
130      /**
131       * Create a deep copy of the AST subtree at this node.
132       * The copy is dangling, i.e. has no parent.
133       * @return dangling copy of the subtree at this node
134       * @apilevel low-level
135       * @declaredat ASTNode:86
136       */
137      public AssignOrExpr treeCopyNoTransform() {
138        AssignOrExpr tree = (AssignOrExpr) copy();
139        if (children != null) {
140          for (int i = 0; i < children.length; ++i) {
141            ASTNode child = (ASTNode) children[i];
142            if (child != null) {
143              child = child.treeCopyNoTransform();
144              tree.setChild(child, i);
145            }
146          }
147        }
148        return tree;
149      }
150      /**
151       * Create a deep copy of the AST subtree at this node.
152       * The subtree of this node is traversed to trigger rewrites before copy.
153       * The copy is dangling, i.e. has no parent.
154       * @return dangling copy of the subtree at this node
155       * @apilevel low-level
156       * @declaredat ASTNode:106
157       */
158      public AssignOrExpr treeCopy() {
159        doFullTraversal();
160        return treeCopyNoTransform();
161      }
162      /**
163       * @apilevel internal
164       * @declaredat ASTNode:113
165       */
166      protected boolean is$Equal(ASTNode node) {
167        return super.is$Equal(node);    
168      }
169      /**
170       * Replaces the Dest child.
171       * @param node The new node to replace the Dest child.
172       * @apilevel high-level
173       */
174      public void setDest(Expr node) {
175        setChild(node, 0);
176      }
177      /**
178       * Retrieves the Dest child.
179       * @return The current node used as the Dest child.
180       * @apilevel high-level
181       */
182      @ASTNodeAnnotation.Child(name="Dest")
183      public Expr getDest() {
184        return (Expr) getChild(0);
185      }
186      /**
187       * Retrieves the Dest child.
188       * <p><em>This method does not invoke AST transformations.</em></p>
189       * @return The current node used as the Dest child.
190       * @apilevel low-level
191       */
192      public Expr getDestNoTransform() {
193        return (Expr) getChildNoTransform(0);
194      }
195      /**
196       * Replaces the Source child.
197       * @param node The new node to replace the Source child.
198       * @apilevel high-level
199       */
200      public void setSource(Expr node) {
201        setChild(node, 1);
202      }
203      /**
204       * Retrieves the Source child.
205       * @return The current node used as the Source child.
206       * @apilevel high-level
207       */
208      @ASTNodeAnnotation.Child(name="Source")
209      public Expr getSource() {
210        return (Expr) getChild(1);
211      }
212      /**
213       * Retrieves the Source child.
214       * <p><em>This method does not invoke AST transformations.</em></p>
215       * @return The current node used as the Source child.
216       * @apilevel low-level
217       */
218      public Expr getSourceNoTransform() {
219        return (Expr) getChildNoTransform(1);
220      }
221      /** The operator string used for pretty printing this expression. 
222       * @attribute syn
223       * @aspect PrettyPrintUtil
224       * @declaredat /home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag:292
225       */
226      @ASTNodeAnnotation.Attribute
227      public String printOp() {
228        String printOp_value = "|=";
229    
230        return printOp_value;
231      }
232      /**
233       * @apilevel internal
234       */
235      public ASTNode rewriteTo() {
236        return super.rewriteTo();
237      }
238    }