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