public CMNode getCMLeafNode(int type, Object leaf, int id, int position) { nodeCountCheck(); return new XSCMLeaf(type, leaf, id, position) ; }
XSCMLeaf nodeEOC = new XSCMLeaf(XSParticleDecl.PARTICLE_ELEMENT, null, -1, fLeafCount++); fHeadNode = new XSCMBinOp( XSModelGroupImpl.MODELGROUP_SEQUENCE, final int id = fLeafList[outIndex].getParticleId(); for (; inIndex < fElemMapSize; inIndex++) { if (id == fElemMapId[inIndex]) fElemMap[fElemMapSize] = leaf.getLeaf(); if (leaf instanceof XSCMRepeatingLeaf) { if (elemOccurenceMap == null) { final int id = fElemMapId[elemIndex]; for (int leafIndex = 0; leafIndex < fLeafCount; leafIndex++) { if (id == fLeafList[leafIndex].getParticleId()) fLeafSorter[fSortCount++] = leafIndex;
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; }
+ ((XSCMLeaf)nodeCur).getPosition() + "), " + "(elemIndex=" + ((XSCMLeaf)nodeCur).getLeaf() + ") " );
pos = leaf.getPosition(); fLeafList[pos] = leaf; fLeafListType[pos] = XSParticleDecl.PARTICLE_WILDCARD; pos = leaf.getPosition(); fLeafList[pos] = leaf; fLeafListType[pos] = XSParticleDecl.PARTICLE_ELEMENT;