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