[358] | 1 | /*
|
---|
| 2 | * Copyright 2001,2004 The Apache Software Foundation.
|
---|
| 3 | *
|
---|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
| 5 | * you may not use this file except in compliance with the License.
|
---|
| 6 | * You may obtain a copy of the License at
|
---|
| 7 | *
|
---|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 9 | *
|
---|
| 10 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
| 13 | * See the License for the specific language governing permissions and
|
---|
| 14 | * limitations under the License.
|
---|
| 15 | */
|
---|
| 16 |
|
---|
| 17 | /*
|
---|
| 18 | * $Log: CMAny.hpp,v $
|
---|
| 19 | * Revision 1.6 2004/09/08 13:56:51 peiyongz
|
---|
| 20 | * Apache License Version 2.0
|
---|
| 21 | *
|
---|
| 22 | * Revision 1.5 2004/01/29 11:51:21 cargilld
|
---|
| 23 | * Code cleanup changes to get rid of various compiler diagnostic messages.
|
---|
| 24 | *
|
---|
| 25 | * Revision 1.4 2003/05/16 21:43:20 knoaman
|
---|
| 26 | * Memory manager implementation: Modify constructors to pass in the memory manager.
|
---|
| 27 | *
|
---|
| 28 | * Revision 1.3 2003/05/15 18:48:27 knoaman
|
---|
| 29 | * Partial implementation of the configurable memory manager.
|
---|
| 30 | *
|
---|
| 31 | * Revision 1.2 2002/11/04 14:54:58 tng
|
---|
| 32 | * C++ Namespace Support.
|
---|
| 33 | *
|
---|
| 34 | * Revision 1.1.1.1 2002/02/01 22:22:37 peiyongz
|
---|
| 35 | * sane_include
|
---|
| 36 | *
|
---|
| 37 | * Revision 1.2 2001/05/11 13:27:14 tng
|
---|
| 38 | * Copyright update.
|
---|
| 39 | *
|
---|
| 40 | * Revision 1.1 2001/02/27 14:48:46 tng
|
---|
| 41 | * Schema: Add CMAny and ContentLeafNameTypeVector, by Pei Yong Zhang
|
---|
| 42 | *
|
---|
| 43 | */
|
---|
| 44 |
|
---|
| 45 | #if !defined(CMANY_HPP)
|
---|
| 46 | #define CMANY_HPP
|
---|
| 47 |
|
---|
| 48 | #include <xercesc/validators/common/CMNode.hpp>
|
---|
| 49 |
|
---|
| 50 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
| 51 |
|
---|
| 52 | class CMStateSet;
|
---|
| 53 |
|
---|
| 54 | class CMAny : public CMNode
|
---|
| 55 | {
|
---|
| 56 | public :
|
---|
| 57 | // -----------------------------------------------------------------------
|
---|
| 58 | // Constructors
|
---|
| 59 | // -----------------------------------------------------------------------
|
---|
| 60 | CMAny
|
---|
| 61 | (
|
---|
| 62 | const ContentSpecNode::NodeTypes type
|
---|
| 63 | , const unsigned int URI
|
---|
| 64 | , const unsigned int position
|
---|
| 65 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
| 66 | );
|
---|
| 67 | ~CMAny();
|
---|
| 68 |
|
---|
| 69 | // -----------------------------------------------------------------------
|
---|
| 70 | // Getter methods
|
---|
| 71 | // -----------------------------------------------------------------------
|
---|
| 72 | unsigned int getURI() const;
|
---|
| 73 |
|
---|
| 74 | unsigned int getPosition() const;
|
---|
| 75 |
|
---|
| 76 | // -----------------------------------------------------------------------
|
---|
| 77 | // Setter methods
|
---|
| 78 | // -----------------------------------------------------------------------
|
---|
| 79 | void setPosition(const unsigned int newPosition);
|
---|
| 80 |
|
---|
| 81 | // -----------------------------------------------------------------------
|
---|
| 82 | // Implementation of the public CMNode virtual interface
|
---|
| 83 | // -----------------------------------------------------------------------
|
---|
| 84 | bool isNullable() const;
|
---|
| 85 |
|
---|
| 86 |
|
---|
| 87 | protected :
|
---|
| 88 | // -----------------------------------------------------------------------
|
---|
| 89 | // Implementation of the protected CMNode virtual interface
|
---|
| 90 | // -----------------------------------------------------------------------
|
---|
| 91 | void calcFirstPos(CMStateSet& toSet) const;
|
---|
| 92 | void calcLastPos(CMStateSet& toSet) const;
|
---|
| 93 |
|
---|
| 94 | private :
|
---|
| 95 | // -----------------------------------------------------------------------
|
---|
| 96 | // Private data members
|
---|
| 97 | //
|
---|
| 98 | // fURI;
|
---|
| 99 | // URI of the any content model. This value is set if the type is
|
---|
| 100 | // of the following:
|
---|
| 101 | // XMLContentSpec.CONTENTSPECNODE_ANY,
|
---|
| 102 | // XMLContentSpec.CONTENTSPECNODE_ANY_OTHER.
|
---|
| 103 | //
|
---|
| 104 | // fPosition
|
---|
| 105 | // Part of the algorithm to convert a regex directly to a DFA
|
---|
| 106 | // numbers each leaf sequentially. If its -1, that means its an
|
---|
| 107 | // epsilon node. Zero and greater are non-epsilon positions.
|
---|
| 108 | // -----------------------------------------------------------------------
|
---|
| 109 | unsigned int fURI;
|
---|
| 110 | unsigned int fPosition;
|
---|
| 111 |
|
---|
| 112 | // -----------------------------------------------------------------------
|
---|
| 113 | // Unimplemented constructors and operators
|
---|
| 114 | // -----------------------------------------------------------------------
|
---|
| 115 | CMAny(const CMAny&);
|
---|
| 116 | CMAny& operator=(const CMAny&);
|
---|
| 117 | };
|
---|
| 118 |
|
---|
| 119 | XERCES_CPP_NAMESPACE_END
|
---|
| 120 |
|
---|
| 121 | #endif
|
---|