Java Code Examples for com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec#CONTENTSPECNODE_ZERO_OR_ONE

The following examples show how to use com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec#CONTENTSPECNODE_ZERO_OR_ONE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CMUniOp.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 2
Source File: CMUniOp.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 3
Source File: CMUniOp.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 4
Source File: CMUniOp.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 5
Source File: CMUniOp.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 6
Source File: CMUniOp.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 7
Source File: CMUniOp.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 8
Source File: CMUniOp.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 9
Source File: CMUniOp.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 10
Source File: CMUniOp.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 11
Source File: CMUniOp.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public CMUniOp(int type, CMNode childNode)
{
    super(type);

    // Insure that its one of the types we require
    if ((type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE)
    &&  (type() != XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE))
    {
        throw new RuntimeException("ImplementationMessages.VAL_UST");
    }

    // Store the node and init any data that needs it
    fChild = childNode;
}
 
Example 12
Source File: DFAContentModel.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}
 
Example 13
Source File: DFAContentModel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}
 
Example 14
Source File: DFAContentModel.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}
 
Example 15
Source File: DFAContentModel.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}
 
Example 16
Source File: DFAContentModel.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}
 
Example 17
Source File: DFAContentModel.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}
 
Example 18
Source File: DFAContentModel.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}
 
Example 19
Source File: DFAContentModel.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}
 
Example 20
Source File: DFAContentModel.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
/** Post tree build initialization. */
private int postTreeBuildInit(CMNode nodeCur, int curIndex)
{
    // Set the maximum states on this node
    nodeCur.setMaxStates(fLeafCount);

    // Recurse as required
    if ((nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_LOCAL ||
        (nodeCur.type() & 0x0f) == XMLContentSpec.CONTENTSPECNODE_ANY_OTHER) {
        // REVISIT: Don't waste these structures.
        QName qname = new QName(null, null, null, ((CMAny)nodeCur).getURI());
        fLeafList[curIndex] = new CMLeaf(qname, ((CMAny)nodeCur).getPosition());
        fLeafListType[curIndex] = nodeCur.type();
        curIndex++;
    }
    else if ((nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_CHOICE)
    ||  (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_SEQ))
    {
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getLeft(), curIndex);
        curIndex = postTreeBuildInit(((CMBinOp)nodeCur).getRight(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE
         || nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE)
    {
        curIndex = postTreeBuildInit(((CMUniOp)nodeCur).getChild(), curIndex);
    }
     else if (nodeCur.type() == XMLContentSpec.CONTENTSPECNODE_LEAF)
    {
        //
        //  Put this node in the leaf list at the current index if its
        //  a non-epsilon leaf.
        //
         final QName node = ((CMLeaf)nodeCur).getElement();
        if (node.localpart != fEpsilonString) {
            fLeafList[curIndex] = (CMLeaf)nodeCur;
            fLeafListType[curIndex] = XMLContentSpec.CONTENTSPECNODE_LEAF;
            curIndex++;
        }
    }
     else
    {
        throw new RuntimeException("ImplementationMessages.VAL_NIICM: type="+nodeCur.type());
    }
    return curIndex;
}