当前位置: 首页>>代码示例>>Java>>正文


Java NodeCounterGenerator类代码示例

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


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

示例1: compileLocals

import com.sun.org.apache.xalan.internal.xsltc.compiler.util.NodeCounterGenerator; //导入依赖的package包/类
/**
 * This method compiles code that is common to matchesFrom() and
 * matchesCount() in the auxillary class.
 */
private void compileLocals(NodeCounterGenerator nodeCounterGen,
                           MatchGenerator matchGen,
                           InstructionList il)
{
    int field;
    LocalVariableGen local;
    ConstantPoolGen cpg = nodeCounterGen.getConstantPool();

    // Get NodeCounter._iterator and store locally
    local = matchGen.addLocalVariable("iterator",
                                      Util.getJCRefType(NODE_ITERATOR_SIG),
                                      null, null);
    field = cpg.addFieldref(NODE_COUNTER, "_iterator",
                            ITERATOR_FIELD_SIG);
    il.append(ALOAD_0); // 'this' pointer on stack
    il.append(new GETFIELD(field));
    local.setStart(il.append(new ASTORE(local.getIndex())));
    matchGen.setIteratorIndex(local.getIndex());

    // Get NodeCounter._translet and store locally
    local = matchGen.addLocalVariable("translet",
                              Util.getJCRefType(TRANSLET_SIG),
                              null, null);
    field = cpg.addFieldref(NODE_COUNTER, "_translet",
                            "Lcom/sun/org/apache/xalan/internal/xsltc/Translet;");
    il.append(ALOAD_0); // 'this' pointer on stack
    il.append(new GETFIELD(field));
    il.append(new CHECKCAST(cpg.addClass(TRANSLET_CLASS)));
    local.setStart(il.append(new ASTORE(local.getIndex())));
    nodeCounterGen.setTransletIndex(local.getIndex());

    // Get NodeCounter._document and store locally
    local = matchGen.addLocalVariable("document",
                                      Util.getJCRefType(DOM_INTF_SIG),
                                      null, null);
    field = cpg.addFieldref(_className, "_document", DOM_INTF_SIG);
    il.append(ALOAD_0); // 'this' pointer on stack
    il.append(new GETFIELD(field));
    // Make sure we have the correct DOM type on the stack!!!
    local.setStart(il.append(new ASTORE(local.getIndex())));
    matchGen.setDomIndex(local.getIndex());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:47,代码来源:Number.java


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