You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2003/11/20 19:12:20 UTC
cvs commit: xml-xerces/c/src/xercesc/validators/schema SchemaValidator.cpp
knoaman 2003/11/20 10:12:20
Modified: c/src/xercesc/validators/common CMBinaryOp.cpp
DFAContentModel.cpp MixedContentModel.cpp
SimpleContentModel.cpp
c/src/xercesc/validators/schema SchemaValidator.cpp
Log:
Use a bitwise operation to check the node type.
Revision Changes Path
1.5 +6 -3 xml-xerces/c/src/xercesc/validators/common/CMBinaryOp.cpp
Index: CMBinaryOp.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/CMBinaryOp.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CMBinaryOp.cpp 7 Nov 2003 17:08:11 -0000 1.4
+++ CMBinaryOp.cpp 20 Nov 2003 18:12:20 -0000 1.5
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.5 2003/11/20 18:12:20 knoaman
+ * Use a bitwise operation to check the node type.
+ *
* Revision 1.4 2003/11/07 17:08:11 knoaman
* For PSVI support, distinguish wildcard elements with namespace lists.
*
@@ -120,7 +123,7 @@
{
// Insure that its one of the types we require
if (((type & 0x0f) != ContentSpecNode::Choice)
- && (type != ContentSpecNode::Sequence))
+ && ((type & 0x0f) != ContentSpecNode::Sequence))
{
ThrowXML(RuntimeException, XMLExcepts::CM_BinOpHadUnaryType);
}
@@ -185,7 +188,7 @@
toSet = fLeftChild->getFirstPos();
toSet |= fRightChild->getFirstPos();
}
- else if (getType() == ContentSpecNode::Sequence)
+ else if ((getType() & 0x0f) == ContentSpecNode::Sequence)
{
//
// If our left child is nullable, then its the union of our
@@ -206,7 +209,7 @@
toSet = fLeftChild->getLastPos();
toSet |= fRightChild->getLastPos();
}
- else if (getType() == ContentSpecNode::Sequence)
+ else if ((getType() & 0x0f) == ContentSpecNode::Sequence)
{
//
// If our right child is nullable, then its the union of our
1.9 +6 -3 xml-xerces/c/src/xercesc/validators/common/DFAContentModel.cpp
Index: DFAContentModel.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/DFAContentModel.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DFAContentModel.cpp 7 Nov 2003 17:08:11 -0000 1.8
+++ DFAContentModel.cpp 20 Nov 2003 18:12:20 -0000 1.9
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.9 2003/11/20 18:12:20 knoaman
+ * Use a bitwise operation to check the node type.
+ *
* Revision 1.8 2003/11/07 17:08:11 knoaman
* For PSVI support, distinguish wildcard elements with namespace lists.
*
@@ -1094,7 +1097,7 @@
ContentSpecNode* rightNode = curNode->getSecond();
if (((curType & 0x0f) == ContentSpecNode::Choice)
- || (curType == ContentSpecNode::Sequence))
+ || ((curType & 0x0f) == ContentSpecNode::Sequence))
{
//
// Recurse on both children, and return a binary op node with the
@@ -1143,7 +1146,7 @@
calcFollowList(((CMBinaryOp*)curNode)->getLeft());
calcFollowList(((CMBinaryOp*)curNode)->getRight());
}
- else if (curType == ContentSpecNode::Sequence)
+ else if ((curType & 0x0f) == ContentSpecNode::Sequence)
{
// Recurse before we process this node
calcFollowList(((CMBinaryOp*)curNode)->getLeft());
@@ -1250,7 +1253,7 @@
++newIndex;
}
else if (((curType & 0x0f) == ContentSpecNode::Choice)
- || (curType == ContentSpecNode::Sequence))
+ || ((curType & 0x0f) == ContentSpecNode::Sequence))
{
newIndex = postTreeBuildInit(((CMBinaryOp*)nodeCur)->getLeft(), newIndex);
newIndex = postTreeBuildInit(((CMBinaryOp*)nodeCur)->getRight(), newIndex);
1.8 +4 -1 xml-xerces/c/src/xercesc/validators/common/MixedContentModel.cpp
Index: MixedContentModel.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/MixedContentModel.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- MixedContentModel.cpp 7 Nov 2003 17:08:11 -0000 1.7
+++ MixedContentModel.cpp 20 Nov 2003 18:12:20 -0000 1.8
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.8 2003/11/20 18:12:20 knoaman
+ * Use a bitwise operation to check the node type.
+ *
* Revision 1.7 2003/11/07 17:08:11 knoaman
* For PSVI support, distinguish wildcard elements with namespace lists.
*
@@ -485,7 +488,7 @@
// And recurse according to the type of node
if (((curType & 0x0f) == ContentSpecNode::Choice)
- || (curType == ContentSpecNode::Sequence))
+ || ((curType & 0x0f) == ContentSpecNode::Sequence))
{
// Recurse on the left and right nodes
buildChildList(leftNode, toFill, toType);
1.6 +5 -4 xml-xerces/c/src/xercesc/validators/common/SimpleContentModel.cpp
Index: SimpleContentModel.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/SimpleContentModel.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SimpleContentModel.cpp 7 Nov 2003 17:08:11 -0000 1.5
+++ SimpleContentModel.cpp 20 Nov 2003 18:12:20 -0000 1.6
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.6 2003/11/20 18:12:20 knoaman
+ * Use a bitwise operation to check the node type.
+ *
* Revision 1.5 2003/11/07 17:08:11 knoaman
* For PSVI support, distinguish wildcard elements with namespace lists.
*
@@ -156,7 +159,7 @@
// content check.
//
unsigned int index;
- switch(fOp)
+ switch(fOp & 0x0f)
{
case ContentSpecNode::Leaf :
//
@@ -261,7 +264,6 @@
break;
case ContentSpecNode::Choice :
- case ContentSpecNode::Any_NS_Choice :
//
// There can only be one child, and it must be one of the
// two types we stored.
@@ -349,7 +351,7 @@
// content check.
//
unsigned int index;
- switch(fOp)
+ switch(fOp & 0x0f)
{
case ContentSpecNode::Leaf :
//
@@ -429,7 +431,6 @@
break;
case ContentSpecNode::Choice :
- case ContentSpecNode::Any_NS_Choice :
//
// There can only be one child, and it must be one of the
// two types we stored.
1.43 +6 -9 xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp
Index: SchemaValidator.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- SchemaValidator.cpp 12 Nov 2003 20:35:31 -0000 1.42
+++ SchemaValidator.cpp 20 Nov 2003 18:12:20 -0000 1.43
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.43 2003/11/20 18:12:20 knoaman
+ * Use a bitwise operation to check the node type.
+ *
* Revision 1.42 2003/11/12 20:35:31 peiyongz
* Stateless Grammar: ValidationContext
*
@@ -1348,13 +1351,13 @@
ContentSpecNode::NodeTypes curNodeType = curSpecNode->getType();
ContentSpecNode::NodeTypes baseNodeType = baseSpecNode->getType();
- if (curNodeType == ContentSpecNode::Sequence ||
+ if ((curNodeType & 0x0f) == ContentSpecNode::Sequence ||
(curNodeType & 0x0f) == ContentSpecNode::Choice ||
curNodeType == ContentSpecNode::All) {
curSpecNode = checkForPointlessOccurrences(curSpecNode, curNodeType, &curVector);
}
- if (baseNodeType == ContentSpecNode::Sequence ||
+ if ((baseNodeType & 0x0f) == ContentSpecNode::Sequence ||
(baseNodeType & 0x0f) == ContentSpecNode::Choice ||
baseNodeType == ContentSpecNode::All) {
baseSpecNode = checkForPointlessOccurrences(baseSpecNode, baseNodeType, &baseVector);
@@ -1380,7 +1383,6 @@
return;
}
case ContentSpecNode::Choice:
- case ContentSpecNode::Any_NS_Choice:
case ContentSpecNode::Sequence:
case ContentSpecNode::All:
{
@@ -1407,7 +1409,6 @@
return;
}
case ContentSpecNode::Choice:
- case ContentSpecNode::Any_NS_Choice:
case ContentSpecNode::Sequence:
case ContentSpecNode::All:
case ContentSpecNode::Leaf:
@@ -1437,7 +1438,6 @@
return;
}
case ContentSpecNode::Choice:
- case ContentSpecNode::Any_NS_Choice:
case ContentSpecNode::Sequence:
case ContentSpecNode::Leaf:
{
@@ -1450,7 +1450,6 @@
}
}
case ContentSpecNode::Choice:
- case ContentSpecNode::Any_NS_Choice:
{
switch (baseNodeType & 0x0f) {
case ContentSpecNode::Any:
@@ -1461,7 +1460,6 @@
return;
}
case ContentSpecNode::Choice:
- case ContentSpecNode::Any_NS_Choice:
{
checkRecurse(aGrammar, curSpecNode, derivedScope, &curVector,
baseSpecNode, baseScope, &baseVector, baseInfo, true);
@@ -1502,7 +1500,6 @@
return;
}
case ContentSpecNode::Choice:
- case ContentSpecNode::Any_NS_Choice:
{
checkMapAndSum(aGrammar, curSpecNode, &curVector, derivedScope,
baseSpecNode, &baseVector, baseScope, baseInfo);
@@ -1572,7 +1569,7 @@
else if (!rightNode) {
gatherChildren(nodeType, specNode->getFirst(), nodes);
}
- else if (parentNodeType == nodeType) {
+ else if ((parentNodeType & 0x0f) == (nodeType & 0x0f)) {
gatherChildren(nodeType, specNode->getFirst(), nodes);
gatherChildren(nodeType, rightNode, nodes);
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org