• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BooleanType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType的典型用法代码示例。如果您正苦于以下问题:Java BooleanType类的具体用法?Java BooleanType怎么用?Java BooleanType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BooleanType类属于com.sun.org.apache.xalan.internal.xsltc.compiler.util包,在下文中一共展示了BooleanType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: translateDesynthesized

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; //导入依赖的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: initialize

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; //导入依赖的package包/类
/**
 * This method is part of a little trick that is needed to use local
 * variables inside nested for-each loops. See the initializeVariables()
 * method in the ForEach class for an explanation
 */
public void initialize(ClassGenerator classGen, MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();

    // This is only done for local variables that are actually used
    if (isLocal() && !_refs.isEmpty()) {
        // Create a variable slot if none is allocated
        if (_local == null) {
            _local = methodGen.addLocalVariable2(getEscapedName(),
                                                 _type.toJCType(),
                                                 null);
        }
        // Push the default value on the JVM's stack
        if ((_type instanceof IntType) ||
            (_type instanceof NodeType) ||
            (_type instanceof BooleanType))
            il.append(new ICONST(0)); // 0 for node-id, integer and boolean
        else if (_type instanceof RealType)
            il.append(new DCONST(0)); // 0.0 for floating point numbers
        else
            il.append(new ACONST_NULL()); // and 'null' for anything else

        // Mark the store as the start of the live range of the variable
        _local.setStart(il.append(_type.STORE(_local.getIndex())));

    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:Variable.java


示例3: typeCheck

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; //导入依赖的package包/类
/**
 * Type-check the "test" expression and contents of this element.
 * The contents will be ignored if we know the test will always fail.
 */
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    // Type-check the "test" expression
    if (_test.typeCheck(stable) instanceof BooleanType == false) {
        _test = new CastExpr(_test, Type.Boolean);
    }
    // Type check the element contents
    if (!_ignore) {
        typeCheckContents(stable);
    }
    return Type.Void;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:If.java


示例4: translateDesynthesized

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; //导入依赖的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


示例5: translateDesynthesized

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; //导入依赖的package包/类
/**
 * Redefined by expressions of type boolean that use flow lists.
 */
public void translateDesynthesized(ClassGenerator classGen,
                                   MethodGenerator methodGen) {
    translate(classGen, methodGen);
    if (_type instanceof BooleanType) {
        desynthesize(classGen, methodGen);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:Expression.java


示例6: translateDesynthesized

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; //导入依赖的package包/类
public void translateDesynthesized(ClassGenerator classGen,
                                   MethodGenerator methodGen) {
    FlowList fl;
    final Type ltype = _left.getType();

    // This is a special case for the self:: axis. Instead of letting
    // the Step object create and iterator that we cast back to a single
    // node, we simply ask the DOM for the node type.
    if (_typeTest) {
        final ConstantPoolGen cpg = classGen.getConstantPool();
        final InstructionList il = methodGen.getInstructionList();

        final int idx = cpg.addInterfaceMethodref(DOM_INTF,
                                                  "getExpandedTypeID",
                                                  "(I)I");
        il.append(new SIPUSH((short)((Step)_left).getNodeType()));
        il.append(methodGen.loadDOM());
        il.append(methodGen.loadContextNode());
        il.append(new INVOKEINTERFACE(idx, 2));
        _falseList.add(il.append(new IF_ICMPNE(null)));
    }
    else {

        _left.translate(classGen, methodGen);
        if (_type != ltype) {
            _left.startIterator(classGen, methodGen);
            if (_type instanceof BooleanType) {
                fl = ltype.translateToDesynthesized(classGen, methodGen,
                                                    _type);
                if (fl != null) {
                    _falseList.append(fl);
                }
            }
            else {
                ltype.translateTo(classGen, methodGen, _type);
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:CastExpr.java


示例7: typeCheck

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType; //导入依赖的package包/类
/**
 * Type-check this when element. The test should always be type checked,
 * while we do not bother with the contents if we know the test fails.
 * This is important in cases where the "test" expression tests for
 * the support of a non-available element, and the <xsl:when> body contains
 * this non-available element.
 */
public Type typeCheck(SymbolTable stable) throws TypeCheckError {
    // Type-check the test expression
    if (_test.typeCheck(stable) instanceof BooleanType == false) {
        _test = new CastExpr(_test, Type.Boolean);
    }
    // Type-check the contents (if necessary)
    if (!_ignore) {
        typeCheckContents(stable);
    }

    return Type.Void;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:When.java



注:本文中的com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ErrorCoded类代码示例发布时间:2022-05-23
下一篇:
Java RemoteIpValve类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap