Methods Summary |
---|
public com.sun.org.apache.bcel.internal.generic.BranchInstruction | GE(boolean tozero)
return tozero ? (BranchInstruction) new IFGE(null) :
(BranchInstruction) new IF_ICMPGE(null);
|
public com.sun.org.apache.bcel.internal.generic.BranchInstruction | GT(boolean tozero)
return tozero ? (BranchInstruction) new IFGT(null) :
(BranchInstruction) new IF_ICMPGT(null);
|
public com.sun.org.apache.bcel.internal.generic.BranchInstruction | LE(boolean tozero)
return tozero ? (BranchInstruction) new IFLE(null) :
(BranchInstruction) new IF_ICMPLE(null);
|
public com.sun.org.apache.bcel.internal.generic.Instruction | LOAD(int slot)
return new ILOAD(slot);
|
public com.sun.org.apache.bcel.internal.generic.BranchInstruction | LT(boolean tozero)
return tozero ? (BranchInstruction) new IFLT(null) :
(BranchInstruction) new IF_ICMPLT(null);
|
public com.sun.org.apache.bcel.internal.generic.Instruction | STORE(int slot)
return new ISTORE(slot);
|
public boolean | identicalTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type other)
return this == other;
|
public boolean | isSimple()
return true;
|
public com.sun.org.apache.bcel.internal.generic.Type | toJCType()
return com.sun.org.apache.bcel.internal.generic.Type.BOOLEAN;
|
public java.lang.String | toSignature()
return "Z";
|
public java.lang.String | toString()
return "boolean";
|
public void | translateBox(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)Translates an object of this type to its boxed representation.
translateTo(classGen, methodGen, Type.Reference);
|
public void | translateFrom(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, java.lang.Class clazz)Translates an external (Java) boolean into internal boolean.
translateTo(classGen, methodGen, clazz);
|
public void | translateTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ReferenceType type)Expects a boolean on the stack and pushes a boxed boolean.
Boxed booleans are represented by an instance of
java.lang.Boolean .
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
il.append(new NEW(cpg.addClass(BOOLEAN_CLASS)));
il.append(DUP_X1);
il.append(SWAP);
il.append(new INVOKESPECIAL(cpg.addMethodref(BOOLEAN_CLASS,
"<init>",
"(Z)V")));
|
public void | translateTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, java.lang.Class clazz)Translates an internal boolean into an external (Java) boolean.
if (clazz == java.lang.Boolean.TYPE) {
methodGen.getInstructionList().append(NOP);
}
// Is Boolean <: clazz? I.e. clazz in { Boolean, Object }
else if (clazz.isAssignableFrom(java.lang.Boolean.class)) {
translateTo(classGen, methodGen, Type.Reference);
}
else {
ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
toString(), clazz.getName());
classGen.getParser().reportError(Constants.FATAL, err);
}
|
public void | translateTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type type)Translates a real into an object of internal type type . The
translation to int is undefined since booleans are always converted to
reals in arithmetic expressions.
if (type == Type.String) {
translateTo(classGen, methodGen, (StringType) type);
}
else if (type == Type.Real) {
translateTo(classGen, methodGen, (RealType) type);
}
else if (type == Type.Reference) {
translateTo(classGen, methodGen, (ReferenceType) type);
}
else {
ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
toString(), type.toString());
classGen.getParser().reportError(Constants.FATAL, err);
}
|
public void | translateTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType type)Expects a boolean on the stack and pushes a string. If the value on the
stack is zero, then the string 'false' is pushed. Otherwise, the string
'true' is pushed.
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
final BranchHandle falsec = il.append(new IFEQ(null));
il.append(new PUSH(cpg, "true"));
final BranchHandle truec = il.append(new GOTO(null));
falsec.setTarget(il.append(new PUSH(cpg, "false")));
truec.setTarget(il.append(NOP));
|
public void | translateTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.RealType type)Expects a boolean on the stack and pushes a real. The value "true" is
converted to 1.0 and the value "false" to 0.0.
methodGen.getInstructionList().append(I2D);
|
public void | translateUnBox(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)Translates an object of this type to its unboxed representation.
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
il.append(new CHECKCAST(cpg.addClass(BOOLEAN_CLASS)));
il.append(new INVOKEVIRTUAL(cpg.addMethodref(BOOLEAN_CLASS,
BOOLEAN_VALUE,
BOOLEAN_VALUE_SIG)));
|