bitnotexpr.java
来自「JDK1.4编译器后端」· Java 代码 · 共 142 行
JAVA
142 行
package AST;
import java.util.HashSet;import java.util.LinkedHashSet;import java.io.FileNotFoundException;import java.io.File;import java.util.*;import beaver.*;import java.util.ArrayList;import java.util.zip.*;import java.io.*;public class BitNotExpr extends Unary implements Cloneable {
public void flushCache() { super.flushCache(); type_computed = false; type_value = null; } @SuppressWarnings({"unchecked", "cast"}) public BitNotExpr clone() throws CloneNotSupportedException { BitNotExpr node = (BitNotExpr)super.clone(); node.type_computed = false; node.type_value = null; node.in$Circle(false); node.is$Final(false); return node; } @SuppressWarnings({"unchecked", "cast"}) public BitNotExpr copy() { try { BitNotExpr node = (BitNotExpr)clone(); if(children != null) node.children = (ASTNode[])children.clone(); return node; } catch (CloneNotSupportedException e) { } System.err.println("Error: Could not clone node of type " + getClass().getName() + "!"); return null; } @SuppressWarnings({"unchecked", "cast"}) public BitNotExpr fullCopy() { BitNotExpr res = (BitNotExpr)copy(); for(int i = 0; i < getNumChildNoTransform(); i++) { ASTNode node = getChildNoTransform(i); if(node != null) node = node.fullCopy(); res.setChild(node, i); } return res; } // Declared in TypeCheck.jrag at line 281 // 15.15.5 public void typeCheck() { if(!getOperand().type().isIntegralType()) error("unary ~ only operates on integral types"); } // Declared in CodeGeneration.jrag at line 1025 void emitOperation(CodeGeneration gen) { type().bitNot(gen); } // Declared in java.ast at line 3 // Declared in java.ast line 144
public BitNotExpr() { super();
} // Declared in java.ast at line 10
// Declared in java.ast line 144 public BitNotExpr(Expr p0) { setChild(p0, 0); } // Declared in java.ast at line 14 protected int numChildren() {
return 1;
} // Declared in java.ast at line 17
public boolean mayHaveRewrite() { return false; } // Declared in java.ast at line 2 // Declared in java.ast line 139 public void setOperand(Expr node) { setChild(node, 0); } // Declared in java.ast at line 5 public Expr getOperand() { return (Expr)getChild(0); } // Declared in java.ast at line 9 public Expr getOperandNoTransform() { return (Expr)getChildNoTransform(0); } // Declared in ConstantExpression.jrag at line 115 @SuppressWarnings({"unchecked", "cast"}) public Constant constant() { Constant constant_value = constant_compute(); return constant_value; } private Constant constant_compute() { return type().bitNot(getOperand().constant()); } // Declared in ConstantExpression.jrag at line 473 @SuppressWarnings({"unchecked", "cast"}) public boolean isConstant() { boolean isConstant_value = isConstant_compute(); return isConstant_value; } private boolean isConstant_compute() { return getOperand().isConstant(); } // Declared in PrettyPrint.jadd at line 397 @SuppressWarnings({"unchecked", "cast"}) public String printPreOp() { String printPreOp_value = printPreOp_compute(); return printPreOp_value; } private String printPreOp_compute() { return "~"; } // Declared in TypeAnalysis.jrag at line 318 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl type() { if(type_computed) return type_value; int num = boundariesCrossed; boolean isFinal = this.is$Final(); type_value = type_compute(); if(isFinal && num == boundariesCrossed) type_computed = true; return type_value; } private TypeDecl type_compute() { return getOperand().type().unaryNumericPromotion(); }public ASTNode rewriteTo() { return super.rewriteTo();}}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?