|
Home / Open source / Terimber 2.0
xml_grammar Class ReferenceDTD rules internal presentation.
More...
#include <sxs.h>
List of all members.
|
Public Member Functions |
| | xml_grammar (mem_pool_t &small_manager, mem_pool_t &big_manager, size_t xml_size) |
| | constructor
|
| | ~xml_grammar () |
| | destructor
|
| xml_grammar & | copy (const xml_grammar &x) |
| | makes a full copy of external gramma
|
| elementDecl & | add_element_decl (const char *name, bool on_fly, bool fromDecl, bool modelAny) |
| | adds element declaration to the grammar
|
| elementDecl * | find_element_decl (const char *name) |
| | tries to find the element declaration by name
|
| const elementDecl * | find_element_decl (const char *name) const |
| | tries to find the const element declaration by name
|
| notationDecl & | add_notation_decl (const char *name) |
| | adds the notation declaration to the grammar
|
| const notationDecl * | find_notation_decl (const char *name) const |
| | tries to find the const by name
|
| entityDecl & | add_entity_decl (const char *name, bool &wasAdded) |
| | adds the entity declaration to the grammar
|
| entityDecl * | find_entity_decl (const char *name) |
| | finds the entity declaration by name
|
| const entityDecl * | find_entity_decl (const char *name) const |
| | finds the const entity declaration by name
|
| attributeDecl & | add_attribute_decl (const elementDecl &decl, const char *name, bool mustPresent, bool &wasAdded) |
| | adds/finds the attribute declaration to the grammar
|
| const attributeDecl * | find_attribute_decl (const elementDecl &decl, const char *name) const |
| | finds the attribute by name and parent element declaration
|
| attributeRefDecl & | add_reference_decl (const char *name, bool fromID) |
| | adds the reference to the declaration
|
| attributeRefDecl * | find_reference_decl (const char *name) |
| | finds the attribute refrence declaration
|
| void | resolve_references () |
| | resolves all refrences to the their attribute
|
| namedNodeDecl & | add_pi_decl (const char *name) |
| | adds PI declaration
|
| const namedNodeDecl * | find_pi_decl (const char *name) const |
| | tries to find the pi declaration by pi name
|
| byte_allocator & | get_data_allocator () |
| | gets the data allocator
|
| byte_allocator & | get_tmp_allocator () |
| | gets the temporary allocator
|
| const namedNodeDecl * | get_document_decl () const |
| | gets the document declaration
|
| const namedNodeDecl * | get_doctype_decl () const |
| | gets the DTD node declaration
|
| const namedNodeDecl * | get_comment_decl () const |
| | gets the comment declaration
|
| const namedNodeDecl * | get_cdata_decl () const |
| | gets the cdata declaration
|
| void | clear () |
| | clears resources
|
| const element_decl_map_t & | get_elementMap () const |
| | returns element map
|
| const namednode_decl_map_t & | get_piMap () const |
| | returns pi map
|
| const entity_decl_map_t & | get_entityMap () const |
| | returns entity map
|
| const notation_decl_map_t & | get_notationMap () const |
| | gets the notation map
|
Public Attributes |
| string_t | _doc_name |
| | document name
|
| string_t | _public_id |
| | public ident
|
| string_t | _system_id |
| | system ident
|
Protected Attributes |
| mem_pool_t & | _small_manager |
| | small memory pool
|
| mem_pool_t & | _big_manager |
| | big memory pool
|
| size_t | _xml_size |
| | xml size - just a tip
|
| byte_allocator & | _data_allocator |
| | data allocator
|
| byte_allocator & | _tmp_allocator |
| | temporary allocator
|
| element_decl_map_t | _elementMap |
| | element map
|
| notation_decl_map_t | _notationMap |
| | notation map
|
| entity_decl_map_t | _entityMap |
| | entity map
|
| attribute_ref_decl_map_t | _attributeRefMap |
| | attribute refrence map
|
| namednode_decl_map_t | _piMap |
| | pi map
|
| namedNodeDecl | _document_decl |
| | node declaration we need as a single instance
|
| namedNodeDecl | _doctype_decl |
| | dtd node declaration
|
| namedNodeDecl | _text_decl |
| | text node declaration
|
| namedNodeDecl | _comment_decl |
| | comment node declaration
|
| namedNodeDecl | _cdata_decl |
| | cdata node declaration
|
| bool | _read_only |
| | flag read-only grammar
|
Private Member Functions |
| | xml_grammar (const xml_grammar &x) |
| | copy constructor
|
| xml_grammar & | operator= (const xml_grammar &x) |
| | assign operator
|
| xml_forceinline void | check_readonly () |
| | checks if this grammar is read-only
|
Detailed Description
DTD rules internal presentation.
Definition at line 362 of file sxs.h.
Constructor & Destructor Documentation
| xml_grammar::xml_grammar |
( |
const xml_grammar & |
x |
) |
[private] |
copy constructor
prevent copy
constructor
- Parameters:
-
| small_manager |
small memory pool |
| big_manager |
big memory pool |
| xml_size |
xml size - just a tip |
Definition at line 278 of file sxs.cpp.
| xml_grammar::~xml_grammar |
( |
|
) |
|
Member Function Documentation
makes a full copy of external gramma
- Parameters:
-
Definition at line 304 of file sxs.cpp.
References _attributeRefMap, elementDecl::_attributes, attributeDecl::_atype, elementDecl::_content, attributeDecl::_ctype, _data_allocator, attributeRefDecl::_declared, attributeDecl::_defval, _doc_name, _elementMap, _entityMap, attributeDecl::_enum, enumNodeDecl::_id, entityDecl::_is_encoded_char, entityDecl::_is_in_subset, entityDecl::_is_parameter, entityDecl::_is_unparsed, namedNode::_name, entityDecl::_notation, _notationMap, _piMap, _public_id, entityDecl::_publicId, notationDecl::_publicId, _read_only, attributeRefDecl::_refered, attributeDecl::_rule, _system_id, entityDecl::_systemId, notationDecl::_systemId, elementDecl::_token, enumNodeDecl::_value, entityDecl::_value, byte_allocator::allocate(), dfa_token::assign(), base_map< K, T, Pr, M >::begin(), check_pointer(), base_map< K, T, Pr, M >::clear(), base_map< size_t, attributeDecl, less< size_t >, M >::const_iterator, base_map< size_t, elementDecl, less< size_t >, M >::const_iterator, base_map< size_t, namedNodeDecl, less< size_t >, M >::const_iterator, base_map< size_t, attributeRefDecl, less< size_t >, M >::const_iterator, base_map< size_t, entityDecl, less< size_t >, M >::const_iterator, base_map< size_t, notationDecl, less< size_t >, M >::const_iterator, base_map< K, T, Pr, M >::end(), _map< K, T, A, Pr, M >::insert(), PROCESSING_INSTRUCTION_NODE, and _list< T, A >::push_back().
Referenced by xml_document::xml_document().
| elementDecl & xml_grammar::add_element_decl |
( |
const char * |
name, |
|
|
bool |
on_fly, |
|
|
bool |
fromDecl, |
|
|
bool |
modelAny | |
|
) |
| | |
adds element declaration to the grammar
- Parameters:
-
| name |
element name |
| on_fly |
flag to create grammar on a fly |
| fromDecl |
flag creating from declaration |
| modelAny |
flag of ANY rules are allowed |
Definition at line 402 of file sxs.cpp.
References _data_allocator, _elementMap, check_readonly(), CONTENT_ANY, contentSpec_MIN, do_hash(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, _map< K, T, A, Pr, M >::insert(), base_map< size_t, elementDecl, less< size_t >, M >::iterator, os_minus_one, pair< T1, T2 >::second, and xml_exception_throw().
Referenced by xml_document::add_element(), xml_document::check_root(), dtd_processor::parseAttrList(), dtd_processor::parseChildren(), dtd_processor::parseElement(), and dtd_processor::parseMixed().
| elementDecl * xml_grammar::find_element_decl |
( |
const char * |
name |
) |
|
tries to find the element declaration by name
- Parameters:
-
| name |
element declaration name |
Definition at line 453 of file sxs.cpp.
References _elementMap, check_readonly(), do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, base_map< size_t, elementDecl, less< size_t >, M >::iterator, os_minus_one, and pair< T1, T2 >::second.
Referenced by xml_document::check_root(), xml_designer_impl::select_xpath(), and xml_document::xml_document().
| const elementDecl * xml_grammar::find_element_decl |
( |
const char * |
name |
) |
const |
tries to find the const element declaration by name
- Parameters:
-
| name |
element declaration name |
Definition at line 439 of file sxs.cpp.
References _elementMap, base_map< size_t, elementDecl, less< size_t >, M >::const_iterator, do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, os_minus_one, and pair< T1, T2 >::second.
| notationDecl & xml_grammar::add_notation_decl |
( |
const char * |
name |
) |
|
adds the notation declaration to the grammar
- Parameters:
-
| name |
notation declaration name |
Definition at line 468 of file sxs.cpp.
References _data_allocator, _notationMap, check_readonly(), do_hash(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, _map< K, T, A, Pr, M >::insert(), base_map< size_t, notationDecl, less< size_t >, M >::iterator, os_minus_one, pair< T1, T2 >::second, and xml_exception_throw().
Referenced by dtd_processor::parseNotation().
| const notationDecl * xml_grammar::find_notation_decl |
( |
const char * |
name |
) |
const |
tries to find the const by name
- Parameters:
-
| name |
notation declaration name |
Definition at line 493 of file sxs.cpp.
References _notationMap, base_map< size_t, notationDecl, less< size_t >, M >::const_iterator, do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, os_minus_one, and pair< T1, T2 >::second.
Referenced by xml_document::assign_attribute_value().
| entityDecl & xml_grammar::add_entity_decl |
( |
const char * |
name, |
|
|
bool & |
wasAdded | |
|
) |
| | |
adds the entity declaration to the grammar
- Parameters:
-
| name |
entity declaration name |
Definition at line 508 of file sxs.cpp.
References _data_allocator, _entityMap, check_readonly(), do_hash(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, _map< K, T, A, Pr, M >::insert(), base_map< size_t, entityDecl, less< size_t >, M >::iterator, os_minus_one, pair< T1, T2 >::second, and xml_exception_throw().
Referenced by xml_document::add_escaped_symbols(), and dtd_processor::parseEntity().
| entityDecl * xml_grammar::find_entity_decl |
( |
const char * |
name |
) |
|
finds the entity declaration by name
- Parameters:
-
| name |
entity declaration name |
Definition at line 549 of file sxs.cpp.
References _entityMap, check_readonly(), do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, base_map< size_t, entityDecl, less< size_t >, M >::iterator, os_minus_one, and pair< T1, T2 >::second.
Referenced by xml_document::assign_attribute_value(), dtd_processor::expandPEReference(), and byte_manager::resolveEntity().
| const entityDecl * xml_grammar::find_entity_decl |
( |
const char * |
name |
) |
const |
finds the const entity declaration by name
- Parameters:
-
| name |
entity declaration name |
Definition at line 534 of file sxs.cpp.
References _entityMap, base_map< size_t, entityDecl, less< size_t >, M >::const_iterator, do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, os_minus_one, and pair< T1, T2 >::second.
| attributeDecl & xml_grammar::add_attribute_decl |
( |
const elementDecl & |
decl, |
|
|
const char * |
name, |
|
|
bool |
mustPresent, |
|
|
bool & |
wasAdded | |
|
) |
| | |
adds/finds the attribute declaration to the grammar
- Parameters:
-
| decl |
parent element declaration |
| name |
attibute name |
| mustPresent |
flag attribute must be found |
| wasAdded |
flag if attribute has been created |
Definition at line 566 of file sxs.cpp.
References elementDecl::_attributes, elementDecl::_content, _data_allocator, namedNode::_name, ATTR_RULE_IMPLIED, ATTR_TYPE_CDATA, check_readonly(), CONTENT_ANY, do_hash(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, _map< K, T, A, Pr, M >::insert(), base_map< size_t, attributeDecl, less< size_t >, M >::iterator, os_minus_one, pair< T1, T2 >::second, vt_string, and xml_exception_throw().
Referenced by xml_document::add_attribute(), and dtd_processor::parseAttDef().
finds the attribute by name and parent element declaration
- Parameters:
-
| decl |
parent element declaration |
| name |
attibute name |
Definition at line 608 of file sxs.cpp.
References elementDecl::_attributes, base_map< size_t, attributeDecl, less< size_t >, M >::const_iterator, do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, os_minus_one, and pair< T1, T2 >::second.
Referenced by xml_document::find_attribute(), xml_document::find_attribute_value(), xml_processor::parseAttributes(), and xml_designer_impl::select_attribute_by_name().
| attributeRefDecl & xml_grammar::add_reference_decl |
( |
const char * |
name, |
|
|
bool |
fromID | |
|
) |
| | |
adds the reference to the declaration
- Parameters:
-
| name |
attribute name |
| fromID |
declared or refrenced |
Definition at line 622 of file sxs.cpp.
References _attributeRefMap, _data_allocator, check_readonly(), do_hash(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, _map< K, T, A, Pr, M >::insert(), base_map< size_t, attributeRefDecl, less< size_t >, M >::iterator, os_minus_one, pair< T1, T2 >::second, and xml_exception_throw().
Referenced by xml_document::assign_attribute_value().
finds the attribute refrence declaration
- Parameters:
-
Definition at line 649 of file sxs.cpp.
References _attributeRefMap, do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, base_map< size_t, attributeRefDecl, less< size_t >, M >::iterator, os_minus_one, and pair< T1, T2 >::second.
Referenced by xml_document::assign_attribute_value().
| void xml_grammar::resolve_references |
( |
|
) |
|
resolves all refrences to the their attribute
Definition at line 704 of file sxs.cpp.
References _attributeRefMap, base_map< K, T, Pr, M >::begin(), base_map< size_t, attributeRefDecl, less< size_t >, M >::const_iterator, base_map< K, T, Pr, M >::end(), and xml_exception_throw().
Referenced by xml_processor::resolve_references().
adds PI declaration
- Parameters:
-
Definition at line 665 of file sxs.cpp.
References _data_allocator, _piMap, check_readonly(), do_hash(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, _map< K, T, A, Pr, M >::insert(), base_map< size_t, namedNodeDecl, less< size_t >, M >::iterator, os_minus_one, PROCESSING_INSTRUCTION_NODE, pair< T1, T2 >::second, and xml_exception_throw().
Referenced by xml_document::add_pi().
| const namedNodeDecl * xml_grammar::find_pi_decl |
( |
const char * |
name |
) |
const |
tries to find the pi declaration by pi name
- Parameters:
-
Definition at line 688 of file sxs.cpp.
References _piMap, base_map< size_t, namedNodeDecl, less< size_t >, M >::const_iterator, do_hash(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::equal_range(), pair< T1, T2 >::first, os_minus_one, and pair< T1, T2 >::second.
| const namedNodeDecl * xml_grammar::get_document_decl |
( |
|
) |
const [inline] |
| const namedNodeDecl * xml_grammar::get_doctype_decl |
( |
|
) |
const [inline] |
| const namedNodeDecl * xml_grammar::get_comment_decl |
( |
|
) |
const [inline] |
| const namedNodeDecl * xml_grammar::get_cdata_decl |
( |
|
) |
const [inline] |
| void xml_grammar::clear |
( |
|
) |
[inline] |
clears resources
Reimplemented in xml_document.
Definition at line 89 of file sxs.hpp.
References _attributeRefMap, _data_allocator, _doc_name, _elementMap, _entityMap, _notationMap, _piMap, _public_id, _system_id, _tmp_allocator, base_map< K, T, Pr, M >::clear(), and byte_allocator::clear_extra().
Referenced by xml_document::clear(), and ~xml_grammar().
| xml_forceinline void xml_grammar::check_readonly |
( |
|
) |
[private] |
Member Data Documentation
data allocator
Definition at line 504 of file sxs.h.
Referenced by xml_document::add_attribute(), add_attribute_decl(), xml_document::add_cdata(), xml_document::add_comment(), xml_document::add_element(), add_element_decl(), xml_document::add_element_desc(), add_entity_decl(), xml_document::add_entity_desc(), add_notation_decl(), xml_document::add_notation_desc(), xml_document::add_pi(), add_pi_decl(), add_reference_decl(), xml_document::add_text(), xml_document::assign_attribute_value(), clear(), xml_document::clear(), copy(), get_data_allocator(), xml_document::get_data_allocator(), and ~xml_grammar().
node declaration we need as a single instance
document node declaration
Definition at line 513 of file sxs.h.
Referenced by get_document_decl().
The documentation for this class was generated from the following files:
|
|