00001 /*00002 * The Software License00003 * =================================================================================00004 * Copyright (c) 2003-.The Terimber Corporation. All rights reserved.00005 * =================================================================================00006 * Redistributions of source code must retain the above copyright notice, 00007 * this list of conditions and the following disclaimer.00008 * Redistributions in binary form must reproduce the above copyright notice, 00009 * this list of conditions and the following disclaimer in the documentation 00010 * and/or other materials provided with the distribution.00011 * The end-user documentation included with the redistribution, if any, 00012 * must include the following acknowledgment:00013 * "This product includes software developed by the Terimber Corporation."00014 * =================================================================================00015 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, 00016 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 00017 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00018 * IN NO EVENT SHALL THE TERIMBER CORPORATION OR ITS CONTRIBUTORS BE LIABLE FOR 00019 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00020 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00021 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00022 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT00023 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE00024 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.00025 * ================================================================================00026 */00027
00028 #ifndef _terimber_dtdxml_h_00029 #define _terimber_dtdxml_h_00030
00031 #include "xml/mngxml.h"00032
00033 BEGIN_TERIMBER_NAMESPACE00034 #pragma pack(4)00035
00039class dtd_processor : publicbyte_manager00040 {
00041 public:
00043 dtd_processor( byte_source& stream,
00044 xml_document& doc,
00045 mem_pool_t& small_pool,
00046 mem_pool_t& big_pool,
00047 size_t xml_size
00048 );
00049
00051 void00052 parse();
00053
00054 private:
00059 void00060 parseSubSet( char stopSymbol,
00061 bool include_allowed
00062 );
00063
00064
00070 voidparseElement();
00071
00074 void00075 parseContentSpec(elementDecl& decl
00076 );
00077
00080 dfa_token*
00081 parseMixed();
00082
00088 dfa_token*
00089 parseChildren();
00090
00093 void00094 parseAttrList();
00095
00098 void00099 parseAttDef( elementDecl& decl
00100 );
00101
00109 void00110 parseAttrEnumeration(attributeDecl& decl
00111 );
00112
00115 void00116 parseDefaultDecl(attributeDecl& decl
00117 );
00118
00124 void00125 parsePEReference(bool skip_junk_before,
00126 bool skip_junk_after
00127 );
00128
00131 void00132 parseEntity();
00133
00136 void00137 parseEntityDef( entityDecl& decl
00138 );
00146
00149 void00150 parseNotation();
00151
00158
00162 void00163 parseInclude();
00164
00166 // [63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'00167 // [64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)* 00168 // [65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*) 00169 void00170 parseIgnore();
00171
00173 dfa_token*
00174 checkRepeation( ub1_t symbol,
00175 dfa_token* token
00176 );
00177
00179 constentityDecl*
00180 expandPEReference(paged_buffer& buffer
00181 );
00182
00185 vt_types00186 convert_ctype( constchar* x
00187 );
00189 void00190 validate();
00192 void00193 deterministic_model(constdfa_token* token
00194 );
00195 };
00196
00197 #pragma pack()00198 END_TERIMBER_NAMESPACE00199
00200 #endif // _terimber_dtdxml_h_