Java Code Examples for com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode#isNullable()
The following examples show how to use
com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode#isNullable() .
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: XSDFACM.java From jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 2
Source File: XSDFACM.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 3
Source File: XSDFACM.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 4
Source File: XSDFACM.java From JDKSourceCode1.8 with MIT License | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 5
Source File: XSDFACM.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 6
Source File: XSDFACM.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 7
Source File: XSDFACM.java From Bytecoder with Apache License 2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 8
Source File: XSDFACM.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 9
Source File: XSDFACM.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 10
Source File: XSDFACM.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }
Example 11
Source File: XSDFACM.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Dumps the tree of the current node to standard output. * * @param nodeCur The current node. * @param level The maximum levels to output. * * @exception RuntimeException Thrown on error. */ private void dumpTree(CMNode nodeCur, int level) { for (int index = 0; index < level; index++) System.out.print(" "); int type = nodeCur.type(); switch(type ) { case XSModelGroupImpl.MODELGROUP_CHOICE: case XSModelGroupImpl.MODELGROUP_SEQUENCE: { if (type == XSModelGroupImpl.MODELGROUP_CHOICE) System.out.print("Choice Node "); else System.out.print("Seq Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMBinOp)nodeCur).getLeft(), level+1); dumpTree(((XSCMBinOp)nodeCur).getRight(), level+1); break; } case XSParticleDecl.PARTICLE_ZERO_OR_MORE: case XSParticleDecl.PARTICLE_ONE_OR_MORE: case XSParticleDecl.PARTICLE_ZERO_OR_ONE: { System.out.print("Rep Node "); if (nodeCur.isNullable()) System.out.print("Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); dumpTree(((XSCMUniOp)nodeCur).getChild(), level+1); break; } case XSParticleDecl.PARTICLE_ELEMENT: { System.out.print ( "Leaf: (pos=" + ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " ); if (nodeCur.isNullable()) System.out.print(" Nullable "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; } case XSParticleDecl.PARTICLE_WILDCARD: System.out.print("Any Node: "); System.out.print("firstPos="); System.out.print(nodeCur.firstPos().toString()); System.out.print(" lastPos="); System.out.println(nodeCur.lastPos().toString()); break; default: { throw new RuntimeException("ImplementationMessages.VAL_NIICM"); } } }