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