#include "ACEXML/parser/parser/Parser.h"
Inheritance diagram for ACEXML_Parser:
Public Methods | |
ACEXML_Parser (void) | |
Default constructor. More... | |
virtual | ~ACEXML_Parser (void) |
Destructor. More... | |
virtual ACEXML_ContentHandler * | getContentHandler (void) const |
Return the current content handler. More... | |
virtual ACEXML_DTDHandler * | getDTDHandler (void) const |
Return the current DTD handler. More... | |
virtual ACEXML_EntityResolver * | getEntityResolver (void) const |
Return the current entity resolver. More... | |
virtual ACEXML_ErrorHandler * | getErrorHandler (void) const |
Return the current error handler. More... | |
virtual int | getFeature (const ACEXML_Char *name, ACEXML_Env &xmlenv) |
Look up the value of a feature. More... | |
virtual void | setFeature (const ACEXML_Char *name, int boolean_value, ACEXML_Env &xmlenv) |
Activating or deactivating a feature. More... | |
virtual void * | getProperty (const ACEXML_Char *name, ACEXML_Env &xmlenv) |
Look up the value of a property. More... | |
virtual void | setProperty (const ACEXML_Char *name, void *value, ACEXML_Env &xmlenv) |
Set the value of a property. More... | |
virtual void | parse (ACEXML_InputSource *input, ACEXML_Env &xmlenv) |
Parse an XML document. More... | |
virtual void | parse (const ACEXML_Char *systemId, ACEXML_Env &xmlenv) |
Parse an XML document from a system identifier (URI). More... | |
virtual void | setContentHandler (ACEXML_ContentHandler *handler) |
Allow an application to register a content event handler. More... | |
virtual void | setDTDHandler (ACEXML_DTDHandler *handler) |
Allow an application to register a DTD event handler. More... | |
virtual void | setEntityResolver (ACEXML_EntityResolver *resolver) |
Allow an application to register an entity resolver. More... | |
virtual void | setErrorHandler (ACEXML_ErrorHandler *handler) |
Allow an application to register an error event handler. More... | |
ACEXML_Char | skip_whitespace (ACEXML_Char **whitespace) |
Skip any whitespaces encountered until the first non-whitespace character is encountered and consumed from the current input CharStream. More... | |
int | skip_whitespace_count (ACEXML_Char *peek=0) |
Skip any whitespaces encountered until the first non-whitespace character. More... | |
int | is_whitespace (ACEXML_Char c) |
Check if a character c is a whitespace. More... | |
int | is_whitespace_or_equal (ACEXML_Char c) |
Check if a character c is a whitespace or '='. More... | |
int | is_nonname (ACEXML_Char c) |
Check if a character c is a valid character for nonterminal NAME. More... | |
int | skip_equal (void) |
Skip an equal sign. More... | |
int | get_quoted_string (ACEXML_Char *&str) |
Get a quoted string. More... | |
int | parse_processing_instruction (ACEXML_Env &xmlenv) |
Parse a PI statement. More... | |
int | grok_comment () |
Skip over a comment. More... | |
ACEXML_Char * | read_name (ACEXML_Char ch=0) |
Read a name from the input CharStream (until white space). More... | |
int | parse_doctypedecl (ACEXML_Env &xmlenv) |
Parse the DOCTYPE declaration. More... | |
void | parse_element (int is_root, ACEXML_Env &xmlenv) |
Parse an XML element. More... | |
void | parse_xml_prolog (ACEXML_Env &xmlenv) |
Parse XML Prolog. More... | |
int | parse_char_reference (ACEXML_Char *buf, size_t len) |
Parse a character reference, i.e., "&x20;" or "". More... | |
const ACEXML_String * | parse_reference (void) |
Parse an entity reference, i.e., "&". More... | |
int | parse_cdata (ACEXML_Env &xmlenv) |
Parse a CDATA section. More... | |
int | parse_internal_dtd (ACEXML_Env &xmlenv) |
Parse a "markupdecl" section, this includes both "markupdecl" and "DeclSep" sections in XML specification. More... | |
int | parse_element_decl (ACEXML_Env &xmlenv) |
Parse an "ELEMENT" decl. More... | |
int | parse_entity_decl (ACEXML_Env &xmlenv) |
Parse an "ENTITY" decl. More... | |
int | parse_attlist_decl (ACEXML_Env &xmlenv) |
Parse an "ATTLIST" decl. More... | |
int | parse_notation_decl (ACEXML_Env &xmlenv) |
Parse a "NOTATION" decl. More... | |
int | parse_external_id_and_ref (ACEXML_Char *&publicId, ACEXML_Char *&systemId, ACEXML_Env &xmlenv) |
Parse an ExternalID or a reference to PUBLIC ExternalID. More... | |
int | parse_children_definition (ACEXML_Env &xmlenv) |
Parse the "children" and "Mixed" non-terminals in contentspec. More... | |
int | parse_child (int skip_open_paren, ACEXML_Env &xmlenv) |
Parse a cp non-terminal. More... | |
Protected Methods | |
ACEXML_Char | get (void) |
Get a character. More... | |
ACEXML_Char | peek (void) |
Peek a character. More... | |
int | try_grow_cdata (size_t size, size_t &len, ACEXML_Env &xmlenv) |
Check if more data can be added to a character buffer in obstack. More... | |
Static Protected Attributes | |
const ACEXML_Char | simple_parsing_feature_ [] = { 'S', 'i', 'm', 'p', 'l', 'e', 0 } |
This constant string defines the name of "simple XML parsing" feature. More... | |
const ACEXML_Char | namespaces_feature_ [] = {'h', 't', 't', 'p', ':', '/', '/', 'x', 'm', 'l', '.', 'o', 'r', 'g', '/', 's', 'a', 'x', '/', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '/', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', 's', 0 } |
This constant string defines the SAX XML Namespace feature. More... | |
const ACEXML_Char | namespace_prefixes_feature_ [] = {'h', 't', 't', 'p', ':', '/', '/', 'x', 'm', 'l', '.', 'o', 'r', 'g', '/', 's', 'a', 'x', '/', 'f', 'e', 'a', 't', 'u', 'r', 'e', 's', '/', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '-', 'p', 'r', 'e', 'f', 'i', 'x', 'e', 's', 0 } |
This constant string defines the SAX XML Namespace prefixes feature. More... | |
Private Methods | |
void | report_error (const ACEXML_Char *message, ACEXML_Env &xmlenv) |
Dispatch errors to ErrorHandler. More... | |
void | report_warning (const ACEXML_Char *message, ACEXML_Env &xmlenv) |
Dispatch warnings to ErrorHandler. More... | |
void | report_fatal_error (const ACEXML_Char *message, ACEXML_Env &xmlenv) |
Dispatch fatal errors to ErrorHandler. More... | |
void | report_prefix_mapping (const ACEXML_Char *prefix, const ACEXML_Char *uri, const ACEXML_Char *name, int start, ACEXML_Env &xmlenv) |
Dispatch prefix mapping calls to the ContentHandler. More... | |
int | parse_token (const ACEXML_Char *keyword) |
Parse a keyword. More... | |
Private Attributes | |
ACEXML_DTDHandler * | dtd_handler_ |
Keeping track of the handlers. We do not manage the memory for handlers. More... | |
ACEXML_EntityResolver * | entity_resolver_ |
ACEXML_ContentHandler * | content_handler_ |
ACEXML_ErrorHandler * | error_handler_ |
ACEXML_CharStream * | instream_ |
Feature and properties management structure here. Current input char stream. More... | |
ACEXML_Char * | doctype_ |
My doctype, if any. More... | |
ACEXML_Char * | dtd_system_ |
External DTD System Literal, if any. More... | |
ACEXML_Char * | dtd_public_ |
External DTD Public Literal, if any. More... | |
ACE_Obstack_T< ACEXML_Char > | obstack_ |
ACEXML_NamespaceSupport | xml_namespace_ |
ACEXML_Entity_Manager | entities_ |
ACEXML_LocatorImpl | locator_ |
int | simple_parsing_ |
int | namespaces_ |
int | namespace_prefixes_ |
|
Default constructor.
|
|
Destructor.
|
|
Get a character.
|
|
Get a quoted string. Quoted strings are used to specify attribute values and this routine will replace character and entity references on-the-fly. Parameter entities are not allowed (or replaced) in this function. (But regular entities are.)
|
|
Return the current content handler.
Reimplemented from ACEXML_XMLReader. |
|
Return the current DTD handler.
Reimplemented from ACEXML_XMLReader. |
|
Return the current entity resolver.
Reimplemented from ACEXML_XMLReader. |
|
Return the current error handler.
Reimplemented from ACEXML_XMLReader. |
|
Look up the value of a feature. This method allows programmers to check whether a specific feature has been activated in the parser. Reimplemented from ACEXML_XMLReader. |
|
Look up the value of a property.
Reimplemented from ACEXML_XMLReader. |
|
Skip over a comment. The first character encountered should always be the first '-' in the comment prefix "<@!--". |
|
Check if a character c is a valid character for nonterminal NAME.
|
|
Check if a character c is a whitespace.
|
|
Check if a character c is a whitespace or '='.
|
|
Parse an XML document from a system identifier (URI).
Reimplemented from ACEXML_XMLReader. |
|
Parse an XML document.
Reimplemented from ACEXML_XMLReader. |
|
Parse an "ATTLIST" decl. Thse first character this method expects is always the 'A' (the first char) in the word "ATTLIST".
|
|
Parse a CDATA section. The first character should always be the first '[' in CDATA definition.
|
|
Parse a character reference, i.e., "&x20;" or "". The first character encountered should be the '#' char.
|
|
Parse a
|
|
Parse the "children" and "Mixed" non-terminals in contentspec. The first character this function sees must be the first open paren '(' in children.
|
|
Parse the DOCTYPE declaration. The first character encountered should always be 'D' in doctype prefix: "<@!DOCTYPE". |
|
Parse an XML element. The first character encountered should be the first character of the element "Name".
|
|
Parse an "ELEMENT" decl. The first character this method expects is always the 'L' (the second char) in the word "ELEMENT".
|
|
Parse an "ENTITY" decl. The first character this method expects is always the 'N' (the second char) in the word "ENTITY".
|
|
Parse an ExternalID or a reference to PUBLIC ExternalID.
Possible cases are in the forms of:
SYSTEM 'quoted string representing system resource' PUBLIC 'quoted name of public ID' 'quoted resource' PUBLIC 'quoted name we are referring to' The first character this function sees must be either 'S' or 'P'. When the function finishes parsing, the input stream points at the first non-whitespace character.
|
|
Parse a "markupdecl" section, this includes both "markupdecl" and "DeclSep" sections in XML specification.
|
|
Parse a "NOTATION" decl. The first character this method expects is always the 'N' (the first char) in the word "NOTATION".
|
|
Parse a PI statement. The first character encountered should always be '?' in the PI prefix "<?".
|
|
Parse an entity reference, i.e., "&". The first character encountered should be the character following '&'.
|
|
Parse a keyword.
|
|
Parse XML Prolog.
|
|
Peek a character.
|
|
Read a name from the input CharStream (until white space). If ch @!= 0, then we have already consumed the first name character from the input CharStream, otherwise, read_name will use this->get() to acquire the initial character.
|
|
Dispatch errors to ErrorHandler.
|
|
Dispatch fatal errors to ErrorHandler.
|
|
Dispatch prefix mapping calls to the ContentHandler.
|
|
Dispatch warnings to ErrorHandler.
|
|
Allow an application to register a content event handler.
Reimplemented from ACEXML_XMLReader. |
|
Allow an application to register a DTD event handler.
Reimplemented from ACEXML_XMLReader. |
|
Allow an application to register an entity resolver.
Reimplemented from ACEXML_XMLReader. |
|
Allow an application to register an error event handler.
Reimplemented from ACEXML_XMLReader. |
|
Activating or deactivating a feature.
Reimplemented from ACEXML_XMLReader. |
|
Set the value of a property.
Reimplemented from ACEXML_XMLReader. |
|
Skip an equal sign.
|
|
Skip any whitespaces encountered until the first non-whitespace character is encountered and consumed from the current input CharStream.
|
|
Skip any whitespaces encountered until the first non-whitespace character. The first non-whitespace character is not consumed. This method does peek into the input CharStream and therefore is more expensive than skip_whitespace.
|
|
Check if more data can be added to a character buffer in obstack. If not, the existing data in the buffer will be cleared out by freezing the segment and pass it out thru a content_handler_->characters () call. counter records the length of the existing data in obstack. |
|
|
|
My doctype, if any.
|
|
Keeping track of the handlers. We do not manage the memory for handlers.
|
|
External DTD Public Literal, if any.
|
|
External DTD System Literal, if any.
|
|
|
|
|
|
|
|
Feature and properties management structure here. Current input char stream. @ |
|
|
|
|
|
|
|
|
|
|
|
|