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:121 027 * @production AssignBitwiseExpr : {@link AssignExpr}; 028 029 */ 030 public abstract class AssignBitwiseExpr extends AssignExpr implements Cloneable { 031 /** 032 * @aspect TypeCheck 033 * @declaredat /home/jesper/git/extendj/java4/frontend/TypeCheck.jrag:127 034 */ 035 public void typeCheck() { 036 TypeDecl source = getSource().type(); 037 TypeDecl dest = getDest().type(); 038 if (source.isIntegralType() && dest.isIntegralType()) { 039 super.typeCheck(); 040 } else if (source.isBoolean() && dest.isBoolean()) { 041 super.typeCheck(); 042 } else { 043 error("Operator only operates on integral and boolean types"); 044 } 045 } 046 /** 047 * @declaredat ASTNode:1 048 */ 049 public AssignBitwiseExpr() { 050 super(); 051 } 052 /** 053 * Initializes the child array to the correct size. 054 * Initializes List and Opt nta children. 055 * @apilevel internal 056 * @ast method 057 * @declaredat ASTNode:10 058 */ 059 public void init$Children() { 060 children = new ASTNode[2]; 061 } 062 /** 063 * @declaredat ASTNode:13 064 */ 065 public AssignBitwiseExpr(Expr p0, Expr p1) { 066 setChild(p0, 0); 067 setChild(p1, 1); 068 } 069 /** 070 * @apilevel low-level 071 * @declaredat ASTNode:20 072 */ 073 protected int numChildren() { 074 return 2; 075 } 076 /** 077 * @apilevel internal 078 * @declaredat ASTNode:26 079 */ 080 public boolean mayHaveRewrite() { 081 return false; 082 } 083 /** 084 * @apilevel internal 085 * @declaredat ASTNode:32 086 */ 087 public void flushAttrCache() { 088 super.flushAttrCache(); 089 } 090 /** 091 * @apilevel internal 092 * @declaredat ASTNode:38 093 */ 094 public void flushCollectionCache() { 095 super.flushCollectionCache(); 096 } 097 /** 098 * @apilevel internal 099 * @declaredat ASTNode:44 100 */ 101 public void flushRewriteCache() { 102 super.flushRewriteCache(); 103 } 104 /** 105 * @apilevel internal 106 * @declaredat ASTNode:50 107 */ 108 public AssignBitwiseExpr clone() throws CloneNotSupportedException { 109 AssignBitwiseExpr node = (AssignBitwiseExpr) super.clone(); 110 return node; 111 } 112 /** 113 * Create a deep copy of the AST subtree at this node. 114 * The copy is dangling, i.e. has no parent. 115 * @return dangling copy of the subtree at this node 116 * @apilevel low-level 117 * @deprecated Please use treeCopy or treeCopyNoTransform instead 118 * @declaredat ASTNode:61 119 */ 120 @Deprecated 121 public abstract AssignBitwiseExpr fullCopy(); 122 /** 123 * Create a deep copy of the AST subtree at this node. 124 * The copy is dangling, i.e. has no parent. 125 * @return dangling copy of the subtree at this node 126 * @apilevel low-level 127 * @declaredat ASTNode:69 128 */ 129 public abstract AssignBitwiseExpr treeCopyNoTransform(); 130 /** 131 * Create a deep copy of the AST subtree at this node. 132 * The subtree of this node is traversed to trigger rewrites before copy. 133 * The copy is dangling, i.e. has no parent. 134 * @return dangling copy of the subtree at this node 135 * @apilevel low-level 136 * @declaredat ASTNode:77 137 */ 138 public abstract AssignBitwiseExpr treeCopy(); 139 /** 140 * Replaces the Dest child. 141 * @param node The new node to replace the Dest child. 142 * @apilevel high-level 143 */ 144 public void setDest(Expr node) { 145 setChild(node, 0); 146 } 147 /** 148 * Retrieves the Dest child. 149 * @return The current node used as the Dest child. 150 * @apilevel high-level 151 */ 152 @ASTNodeAnnotation.Child(name="Dest") 153 public Expr getDest() { 154 return (Expr) getChild(0); 155 } 156 /** 157 * Retrieves the Dest child. 158 * <p><em>This method does not invoke AST transformations.</em></p> 159 * @return The current node used as the Dest child. 160 * @apilevel low-level 161 */ 162 public Expr getDestNoTransform() { 163 return (Expr) getChildNoTransform(0); 164 } 165 /** 166 * Replaces the Source child. 167 * @param node The new node to replace the Source child. 168 * @apilevel high-level 169 */ 170 public void setSource(Expr node) { 171 setChild(node, 1); 172 } 173 /** 174 * Retrieves the Source child. 175 * @return The current node used as the Source child. 176 * @apilevel high-level 177 */ 178 @ASTNodeAnnotation.Child(name="Source") 179 public Expr getSource() { 180 return (Expr) getChild(1); 181 } 182 /** 183 * Retrieves the Source child. 184 * <p><em>This method does not invoke AST transformations.</em></p> 185 * @return The current node used as the Source child. 186 * @apilevel low-level 187 */ 188 public Expr getSourceNoTransform() { 189 return (Expr) getChildNoTransform(1); 190 } 191 /** 192 * @apilevel internal 193 */ 194 public ASTNode rewriteTo() { 195 return super.rewriteTo(); 196 } 197 }