本文整理汇总了Java中com.sun.org.apache.bcel.internal.generic.IFEQ类的典型用法代码示例。如果您正苦于以下问题:Java IFEQ类的具体用法?Java IFEQ怎么用?Java IFEQ使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFEQ类属于com.sun.org.apache.bcel.internal.generic包,在下文中一共展示了IFEQ类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: translateDesynthesized
import com.sun.org.apache.bcel.internal.generic.IFEQ; //导入依赖的package包/类
/**
* Compile the function call and treat as an expression
* Update true/false-lists.
*/
@Override
public void translateDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen)
{
Type type = Type.Boolean;
if (_chosenMethodType != null)
type = _chosenMethodType.resultType();
final InstructionList il = methodGen.getInstructionList();
translate(classGen, methodGen);
if ((type instanceof BooleanType) || (type instanceof IntType)) {
_falseList.add(il.append(new IFEQ(null)));
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:FunctionCall.java
示例2: translateDesynthesized
import com.sun.org.apache.bcel.internal.generic.IFEQ; //导入依赖的package包/类
public void translateDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen) {
final Type tleft = _left.getType();
final InstructionList il = methodGen.getInstructionList();
if (tleft instanceof BooleanType) {
_left.translate(classGen, methodGen);
_right.translate(classGen, methodGen);
_falseList.add(il.append(_op == Operators.EQ ?
(BranchInstruction)new IF_ICMPNE(null) :
(BranchInstruction)new IF_ICMPEQ(null)));
}
else if (tleft instanceof NumberType) {
_left.translate(classGen, methodGen);
_right.translate(classGen, methodGen);
if (tleft instanceof RealType) {
il.append(DCMPG);
_falseList.add(il.append(_op == Operators.EQ ?
(BranchInstruction)new IFNE(null) :
(BranchInstruction)new IFEQ(null)));
}
else {
_falseList.add(il.append(_op == Operators.EQ ?
(BranchInstruction)new IF_ICMPNE(null) :
(BranchInstruction)new IF_ICMPEQ(null)));
}
}
else {
translate(classGen, methodGen);
desynthesize(classGen, methodGen);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:EqualityExpr.java
示例3: translateToDesynthesized
import com.sun.org.apache.bcel.internal.generic.IFEQ; //导入依赖的package包/类
/**
* Translates a string into a non-synthesized boolean. It does not push a
* 0 or a 1 but instead returns branchhandle list to be appended to the
* false list.
*
* @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
*/
public FlowList translateToDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen,
BooleanType type) {
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS,
"length", "()I")));
return new FlowList(il.append(new IFEQ(null)));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:StringType.java
示例4: translateTo
import com.sun.org.apache.bcel.internal.generic.IFEQ; //导入依赖的package包/类
/**
* Expects an integer on the stack and pushes a 0 if its value is 0 and
* a 1 otherwise.
*
* @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
*/
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
BooleanType type) {
final InstructionList il = methodGen.getInstructionList();
final BranchHandle falsec = il.append(new IFEQ(null));
il.append(ICONST_1);
final BranchHandle truec = il.append(new GOTO(null));
falsec.setTarget(il.append(ICONST_0));
truec.setTarget(il.append(NOP));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:IntType.java
示例5: translateToDesynthesized
import com.sun.org.apache.bcel.internal.generic.IFEQ; //导入依赖的package包/类
/**
* Translates a real into a non-synthesized boolean. It does not push a
* 0 or a 1 but instead returns branchhandle list to be appended to the
* false list. A NaN must be converted to "false".
*
* @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
*/
public FlowList translateToDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen,
BooleanType type) {
LocalVariableGen local;
final FlowList flowlist = new FlowList();
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
// Store real into a local variable
il.append(DUP2);
local = methodGen.addLocalVariable("real_to_boolean_tmp",
com.sun.org.apache.bcel.internal.generic.Type.DOUBLE,
null, null);
local.setStart(il.append(new DSTORE(local.getIndex())));
// Compare it to 0.0
il.append(DCONST_0);
il.append(DCMPG);
flowlist.add(il.append(new IFEQ(null)));
//!!! call isNaN
// Compare it to itself to see if NaN
il.append(new DLOAD(local.getIndex()));
local.setEnd(il.append(new DLOAD(local.getIndex())));
il.append(DCMPG);
flowlist.add(il.append(new IFNE(null))); // NaN != NaN
return flowlist;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:RealType.java
示例6: translateToDesynthesized
import com.sun.org.apache.bcel.internal.generic.IFEQ; //导入依赖的package包/类
/**
* Expects a reference on the stack and translates it to a non-synthesized
* boolean. It does not push a 0 or a 1 but instead returns branchhandle
* list to be appended to the false list.
*
* @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateToDesynthesized
*/
public FlowList translateToDesynthesized(ClassGenerator classGen,
MethodGenerator methodGen,
BooleanType type) {
InstructionList il = methodGen.getInstructionList();
translateTo(classGen, methodGen, type);
return new FlowList(il.append(new IFEQ(null)));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:ReferenceType.java
示例7: translateTo
import com.sun.org.apache.bcel.internal.generic.IFEQ; //导入依赖的package包/类
/**
* 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.
*
* @see com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
*/
public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
StringType type) {
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));
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:BooleanType.java
注:本文中的com.sun.org.apache.bcel.internal.generic.IFEQ类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论