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


Java XSParticleDecl.PARTICLE_ZERO_OR_ONE属性代码示例

本文整理汇总了Java中com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl.PARTICLE_ZERO_OR_ONE属性的典型用法代码示例。如果您正苦于以下问题:Java XSParticleDecl.PARTICLE_ZERO_OR_ONE属性的具体用法?Java XSParticleDecl.PARTICLE_ZERO_OR_ONE怎么用?Java XSParticleDecl.PARTICLE_ZERO_OR_ONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.sun.org.apache.xerces.internal.impl.xs.XSParticleDecl的用法示例。


在下文中一共展示了XSParticleDecl.PARTICLE_ZERO_OR_ONE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: copyNode

private CMNode copyNode(CMNode node) {
    int type = node.type();
    // for choice or sequence, copy the two subtrees, and combine them
    if (type == XSModelGroupImpl.MODELGROUP_CHOICE ||
        type == XSModelGroupImpl.MODELGROUP_SEQUENCE) {
        XSCMBinOp bin = (XSCMBinOp)node;
        node = fNodeFactory.getCMBinOpNode(type, copyNode(bin.getLeft()),
                             copyNode(bin.getRight()));
    }
    // for ?+*, copy the subtree, and put it in a new ?+* node
    else if (type == XSParticleDecl.PARTICLE_ZERO_OR_MORE ||
             type == XSParticleDecl.PARTICLE_ONE_OR_MORE ||
             type == XSParticleDecl.PARTICLE_ZERO_OR_ONE) {
        XSCMUniOp uni = (XSCMUniOp)node;
        node = fNodeFactory.getCMUniOpNode(type, copyNode(uni.getChild()));
    }
    // for element/wildcard (leaf), make a new leaf node,
    // with a distinct position
    else if (type == XSParticleDecl.PARTICLE_ELEMENT ||
             type == XSParticleDecl.PARTICLE_WILDCARD) {
        XSCMLeaf leaf = (XSCMLeaf)node;
        node = fNodeFactory.getCMLeafNode(leaf.type(), leaf.getLeaf(), leaf.getParticleId(), fLeafCount++);
    }

    return node;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:CMBuilder.java

示例2: XSCMUniOp

public XSCMUniOp(int type, CMNode childNode) {
    super(type);

    // Insure that its one of the types we require
    if ((type() != XSParticleDecl.PARTICLE_ZERO_OR_ONE)
    &&  (type() != XSParticleDecl.PARTICLE_ZERO_OR_MORE)
    &&  (type() != XSParticleDecl.PARTICLE_ONE_OR_MORE)) {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:XSCMUniOp.java

示例3: postTreeBuildInit

/** Post tree build initialization. */
private void postTreeBuildInit(CMNode nodeCur) throws RuntimeException {
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    XSCMLeaf leaf = null;
    int pos = 0;
    // Recurse as required
    if (nodeCur.type() == XSParticleDecl.PARTICLE_WILDCARD) {
        leaf = (XSCMLeaf)nodeCur;
        pos = leaf.getPosition();
        fLeafList[pos] = leaf;
        fLeafListType[pos] = XSParticleDecl.PARTICLE_WILDCARD;
    }
    else if ((nodeCur.type() == XSModelGroupImpl.MODELGROUP_CHOICE) ||
             (nodeCur.type() == XSModelGroupImpl.MODELGROUP_SEQUENCE)) {
        postTreeBuildInit(((XSCMBinOp)nodeCur).getLeft());
        postTreeBuildInit(((XSCMBinOp)nodeCur).getRight());
    }
    else if (nodeCur.type() == XSParticleDecl.PARTICLE_ZERO_OR_MORE ||
             nodeCur.type() == XSParticleDecl.PARTICLE_ONE_OR_MORE ||
             nodeCur.type() == XSParticleDecl.PARTICLE_ZERO_OR_ONE) {
        postTreeBuildInit(((XSCMUniOp)nodeCur).getChild());
    }
    else if (nodeCur.type() == XSParticleDecl.PARTICLE_ELEMENT) {
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        leaf = (XSCMLeaf)nodeCur;
        pos = leaf.getPosition();
        fLeafList[pos] = leaf;
        fLeafListType[pos] = XSParticleDecl.PARTICLE_ELEMENT;
    }
    else {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:XSDFACM.java


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