diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-08-03 11:54:04 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-08-03 11:54:04 +0000 |
commit | 3fe1b3d01630d330551a8dd7ae78ad6ff97d9f8d (patch) | |
tree | 8c5bc97bd5f74f8b14cbb8e77a6d7733bcc4d91d | |
parent | 2693ac721ba5965995c4038933cdb75bfbe3814d (diff) | |
download | ATCD-3fe1b3d01630d330551a8dd7ae78ad6ff97d9f8d.tar.gz |
Tue Aug 3 11:52:06 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* apps/svcconf/Svcconf.cpp:
* apps/svcconf/Svcconf_Handler.h:
* apps/svcconf/Svcconf_Handler.cpp:
* common/Attributes_Def_Builder.h:
* common/CharStream.h:
* common/ContentHandler.h:
* common/DTDHandler.h:
* common/DTD_Manager.h:
* common/DefaultHandler.h:
* common/DefaultHandler.cpp:
* common/Element_Def_Builder.h:
* common/EntityResolver.h:
* common/ErrorHandler.h:
* common/Exception.h:
* common/SAXExceptions.inl:
* common/Validator.h:
* common/XMLFilterImpl.h:
* common/XMLFilterImpl.cpp:
* common/XMLReader.h:
* examples/SAXPrint/Print_Handler.h:
* examples/SAXPrint/Print_Handler.cpp:
* examples/SAXPrint/SAXPrint_Handler.h:
* examples/SAXPrint/SAXPrint_Handler.cpp:
* examples/SAXPrint/main.cpp:
* parser/debug_validator/Debug_Attributes_Builder.h:
* parser/debug_validator/Debug_Attributes_Builder.cpp:
* parser/debug_validator/Debug_DTD_Manager.h:
* parser/debug_validator/Debug_DTD_Manager.cpp:
* parser/debug_validator/Debug_Element_Builder.h:
* parser/debug_validator/Debug_Element_Builder.cpp:
* parser/parser/Parser.h:
* parser/parser/Parser.cpp:
* tests/ContentHandler_Test.cpp:
* tests/Transcoder_Test.cpp:
Removed support for emulated exceptions
* common/Env.h:
* common/Env.inl:
* common/Env.cpp:
* common/XML_Macros.h:
Removed these files.
39 files changed, 751 insertions, 1894 deletions
diff --git a/ACE/ACEXML/ChangeLog b/ACE/ACEXML/ChangeLog index 77d579e67b5..c2a021a6e5d 100644 --- a/ACE/ACEXML/ChangeLog +++ b/ACE/ACEXML/ChangeLog @@ -1,3 +1,47 @@ +Tue Aug 3 11:52:06 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl> + + * apps/svcconf/Svcconf.cpp: + * apps/svcconf/Svcconf_Handler.h: + * apps/svcconf/Svcconf_Handler.cpp: + * common/Attributes_Def_Builder.h: + * common/CharStream.h: + * common/ContentHandler.h: + * common/DTDHandler.h: + * common/DTD_Manager.h: + * common/DefaultHandler.h: + * common/DefaultHandler.cpp: + * common/Element_Def_Builder.h: + * common/EntityResolver.h: + * common/ErrorHandler.h: + * common/Exception.h: + * common/SAXExceptions.inl: + * common/Validator.h: + * common/XMLFilterImpl.h: + * common/XMLFilterImpl.cpp: + * common/XMLReader.h: + * examples/SAXPrint/Print_Handler.h: + * examples/SAXPrint/Print_Handler.cpp: + * examples/SAXPrint/SAXPrint_Handler.h: + * examples/SAXPrint/SAXPrint_Handler.cpp: + * examples/SAXPrint/main.cpp: + * parser/debug_validator/Debug_Attributes_Builder.h: + * parser/debug_validator/Debug_Attributes_Builder.cpp: + * parser/debug_validator/Debug_DTD_Manager.h: + * parser/debug_validator/Debug_DTD_Manager.cpp: + * parser/debug_validator/Debug_Element_Builder.h: + * parser/debug_validator/Debug_Element_Builder.cpp: + * parser/parser/Parser.h: + * parser/parser/Parser.cpp: + * tests/ContentHandler_Test.cpp: + * tests/Transcoder_Test.cpp: + Removed support for emulated exceptions + + * common/Env.h: + * common/Env.inl: + * common/Env.cpp: + * common/XML_Macros.h: + Removed these files. + Thu Mar 25 19:41:57 UTC 2010 Douglas C. Schmidt <schmidt@dre.vanderbilt.edu> * parser/parser/Parser.cpp (ACEXML_Parser::parse_encoding_decl): diff --git a/ACE/ACEXML/apps/svcconf/Svcconf.cpp b/ACE/ACEXML/apps/svcconf/Svcconf.cpp index 7fd69046ec3..3ee564a523b 100644 --- a/ACE/ACEXML/apps/svcconf/Svcconf.cpp +++ b/ACE/ACEXML/apps/svcconf/Svcconf.cpp @@ -26,27 +26,21 @@ ACEXML_Svcconf_Parser::ACEXML_Svcconf_Parser () this->parser_.setDTDHandler (&this->svcconf_handler_); this->parser_.setErrorHandler (&this->svcconf_handler_); this->parser_.setEntityResolver (&this->svcconf_handler_); - ACEXML_TRY_NEW_ENV + try { this->parser_.setFeature (ACE_TEXT ("http://xml.org/sax/features/validation"), - 0 - ACEXML_ENV_ARG_PARAMETER); - ACEXML_TRY_CHECK; + 0); } - ACEXML_CATCH (ACEXML_SAXException, ex) + catch (const ACEXML_SAXException& ex) { ex.print (); // Can't do much except printing the error. - return; } - ACEXML_ENDTRY; } ACEXML_Svcconf_Parser::~ACEXML_Svcconf_Parser () { - } - int ACEXML_Svcconf_Parser::parse_file (const ACE_TCHAR file[]) { @@ -66,17 +60,15 @@ ACEXML_Svcconf_Parser::parse_file (const ACE_TCHAR file[]) this->input_stream_.setCharStream (fstm); - ACEXML_TRY_NEW_ENV + try { - this->parser_.parse (&this->input_stream_ ACEXML_ENV_ARG_PARAMETER); - ACEXML_TRY_CHECK; + this->parser_.parse (&this->input_stream_); } - ACEXML_CATCH (ACEXML_SAXException, ex) + catch (const ACEXML_SAXException& ex) { ex.print (); return -1; } - ACEXML_ENDTRY; return 0; } @@ -94,12 +86,12 @@ ACEXML_Svcconf_Parser::parse_string (const ACE_TCHAR str[]) "input stream.\n"), -1); this->input_stream_.setCharStream (stm); - ACEXML_TRY_NEW_ENV + try { - this->parser_.parse (&this->input_stream_ ACEXML_ENV_ARG_PARAMETER); + this->parser_.parse (&this->input_stream_); ACEXML_TRY_CHECK; } - ACEXML_CATCH (ACEXML_SAXException, ex) + catch (const ACEXML_SAXException& ex) { // If there was a problem parsing the stream, set the errno // to EINVAL to indicate to upper levels that the stream was @@ -108,17 +100,7 @@ ACEXML_Svcconf_Parser::parse_string (const ACE_TCHAR str[]) ex.print (); return -1; } - ACEXML_ENDTRY; return 0; } -#else - -# if defined (_AIX) && \ - (defined (__IBMCPP__) && (__IBMCPP__ >= 500) && (__IBMCPP__ < 600)) -// This simply shuts up the AIX linker that complains there are no -// csects or exported symbols when building with Visual Age C++ 5. -extern "C" void ace_shut_up_aix_ld (void) {}; -# endif /* AIX && __IBMCPP__ == 500 */ - #endif /* ACE_USES_CLASSIC_SVC_CONF == 0 */ diff --git a/ACE/ACEXML/apps/svcconf/Svcconf_Handler.cpp b/ACE/ACEXML/apps/svcconf/Svcconf_Handler.cpp index 95f79bc38fe..9d687c486ce 100644 --- a/ACE/ACEXML/apps/svcconf/Svcconf_Handler.cpp +++ b/ACE/ACEXML/apps/svcconf/Svcconf_Handler.cpp @@ -36,13 +36,13 @@ ACEXML_Svcconf_Handler::~ACEXML_Svcconf_Handler (void) void ACEXML_Svcconf_Handler::characters (const ACEXML_Char *, int, - int ACEXML_ENV_ARG_DECL_NOT_USED) + int) { // no-op } void -ACEXML_Svcconf_Handler::endDocument ( ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) +ACEXML_Svcconf_Handler::endDocument (void) { // no-op } @@ -50,7 +50,7 @@ ACEXML_Svcconf_Handler::endDocument ( ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) void ACEXML_Svcconf_Handler::endElement (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + const ACEXML_Char *qName) { if (ACE_OS::strcmp (qName, ACE_TEXT ("dynamic")) == 0) { @@ -268,7 +268,7 @@ ACEXML_Svcconf_Handler::endElement (const ACEXML_Char *, } void -ACEXML_Svcconf_Handler::endPrefixMapping (const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Svcconf_Handler::endPrefixMapping (const ACEXML_Char *) { // no-op } @@ -276,14 +276,14 @@ ACEXML_Svcconf_Handler::endPrefixMapping (const ACEXML_Char * ACEXML_ENV_ARG_DEC void ACEXML_Svcconf_Handler::ignorableWhitespace (const ACEXML_Char *, int, - int ACEXML_ENV_ARG_DECL_NOT_USED) + int) { // no-op } void ACEXML_Svcconf_Handler::processingInstruction (const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // no-op } @@ -295,13 +295,13 @@ ACEXML_Svcconf_Handler::setDocumentLocator (ACEXML_Locator* locator) } void -ACEXML_Svcconf_Handler::skippedEntity (const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Svcconf_Handler::skippedEntity (const ACEXML_Char *) { // no-op } void -ACEXML_Svcconf_Handler::startDocument ( ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) +ACEXML_Svcconf_Handler::startDocument (void) { // no-op } @@ -310,24 +310,24 @@ void ACEXML_Svcconf_Handler::startElement (const ACEXML_Char *, const ACEXML_Char *, const ACEXML_Char *qName, - ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) + ACEXML_Attributes *alist) { if (ACE_OS::strcmp (qName, ACE_TEXT ("dynamic")) == 0) { - this->get_dynamic_attrs (alist ACEXML_ENV_ARG_PARAMETER); + this->get_dynamic_attrs (alist); } else if (ACE_OS::strcmp (qName, ACE_TEXT ("initializer")) == 0) { - this->get_initializer_attrs (alist ACEXML_ENV_ARG_PARAMETER); + this->get_initializer_attrs (alist); } else if (ACE_OS::strcmp (qName, ACE_TEXT ("static")) == 0) { - this->get_static_attrs (alist ACEXML_ENV_ARG_PARAMETER); + this->get_static_attrs (alist); } else if (ACE_OS::strcmp (qName, ACE_TEXT ("stream")) == 0) { - this->get_stream_id (alist ACEXML_ENV_ARG_PARAMETER); + this->get_stream_id (alist); if (ACE_Service_Repository::instance()->find (this->stream_info_.name (), @@ -359,7 +359,7 @@ ACEXML_Svcconf_Handler::startElement (const ACEXML_Char *, } else if (ACE_OS::strcmp (qName, ACE_TEXT ("resume")) == 0) { - this->get_id (alist ACEXML_ENV_ARG_PARAMETER); + this->get_id (alist); if (this->in_module_) { // ACE_DEBUG ((LM_INFO, ACE_TEXT ("Resume %s in stream %s\n"), @@ -400,7 +400,7 @@ ACEXML_Svcconf_Handler::startElement (const ACEXML_Char *, } else if (ACE_OS::strcmp (qName, ACE_TEXT ("suspend")) == 0) { - this->get_id (alist ACEXML_ENV_ARG_PARAMETER); + this->get_id (alist); if (this->in_module_) { // ACE_DEBUG ((LM_INFO, ACE_TEXT ("Suspend %s in stream %s\n"), @@ -441,7 +441,7 @@ ACEXML_Svcconf_Handler::startElement (const ACEXML_Char *, } else if (ACE_OS::strcmp (qName, ACE_TEXT ("remove")) == 0) { - this->get_id (alist ACEXML_ENV_ARG_PARAMETER); + this->get_id (alist); if (this->in_module_) { // ACE_DEBUG ((LM_INFO, ACE_TEXT ("Remove %s in stream %s\n"), @@ -495,7 +495,7 @@ ACEXML_Svcconf_Handler::startElement (const ACEXML_Char *, void ACEXML_Svcconf_Handler::startPrefixMapping (const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -505,7 +505,7 @@ ACEXML_Svcconf_Handler::startPrefixMapping (const ACEXML_Char *, void ACEXML_Svcconf_Handler::notationDecl (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -514,7 +514,7 @@ void ACEXML_Svcconf_Handler::unparsedEntityDecl (const ACEXML_Char *, const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -523,7 +523,7 @@ ACEXML_Svcconf_Handler::unparsedEntityDecl (const ACEXML_Char *, ACEXML_InputSource * ACEXML_Svcconf_Handler::resolveEntity (const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. return 0; @@ -535,7 +535,7 @@ ACEXML_Svcconf_Handler::resolveEntity (const ACEXML_Char *, * Receive notification of a recoverable error. */ void -ACEXML_Svcconf_Handler::error (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Svcconf_Handler::error (ACEXML_SAXParseException& ex) { ACE_DEBUG ((LM_DEBUG, "%s: line :%d col: %d ", this->locator_->getSystemId(), this->locator_->getLineNumber(), @@ -544,7 +544,7 @@ ACEXML_Svcconf_Handler::error (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DECL_ } void -ACEXML_Svcconf_Handler::fatalError (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Svcconf_Handler::fatalError (ACEXML_SAXParseException& ex) { ACE_DEBUG ((LM_DEBUG, "%s: line :%d col: %d ", this->locator_->getSystemId(), this->locator_->getLineNumber(), @@ -553,7 +553,7 @@ ACEXML_Svcconf_Handler::fatalError (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_ } void -ACEXML_Svcconf_Handler::warning (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Svcconf_Handler::warning (ACEXML_SAXParseException& ex) { ACE_DEBUG ((LM_DEBUG, "%s: line :%d col: %d ", this->locator_->getSystemId(), this->locator_->getLineNumber(), @@ -562,7 +562,7 @@ ACEXML_Svcconf_Handler::warning (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DEC } int -ACEXML_Svcconf_Handler::get_stream_id (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) +ACEXML_Svcconf_Handler::get_stream_id (ACEXML_Attributes *alist) { if (alist != 0) for (size_t i = 0; i < alist->getLength (); ++i) @@ -588,7 +588,7 @@ ACEXML_Svcconf_Handler::get_stream_id (ACEXML_Attributes *alist ACEXML_ENV_ARG_D } int -ACEXML_Svcconf_Handler::get_id (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) +ACEXML_Svcconf_Handler::get_id (ACEXML_Attributes *alist) { if (alist != 0) for (size_t i = 0; i < alist->getLength (); ++i) @@ -615,7 +615,7 @@ ACEXML_Svcconf_Handler::get_id (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) } int -ACEXML_Svcconf_Handler::get_dynamic_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) +ACEXML_Svcconf_Handler::get_dynamic_attrs (ACEXML_Attributes *alist) { if (alist != 0) { @@ -696,7 +696,7 @@ ACEXML_Svcconf_Handler::get_dynamic_attrs (ACEXML_Attributes *alist ACEXML_ENV_A } int -ACEXML_Svcconf_Handler::get_initializer_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) +ACEXML_Svcconf_Handler::get_initializer_attrs (ACEXML_Attributes *alist) { if (alist != 0) { @@ -734,7 +734,7 @@ ACEXML_Svcconf_Handler::get_initializer_attrs (ACEXML_Attributes *alist ACEXML_E } int -ACEXML_Svcconf_Handler::get_static_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL) +ACEXML_Svcconf_Handler::get_static_attrs (ACEXML_Attributes *alist) { if (alist != 0) { diff --git a/ACE/ACEXML/apps/svcconf/Svcconf_Handler.h b/ACE/ACEXML/apps/svcconf/Svcconf_Handler.h index b15e20d7426..ebf4af74445 100644 --- a/ACE/ACEXML/apps/svcconf/Svcconf_Handler.h +++ b/ACE/ACEXML/apps/svcconf/Svcconf_Handler.h @@ -102,43 +102,37 @@ public: */ virtual void characters (const ACEXML_Char *ch, int start, - int length ACEXML_ENV_ARG_DECL) - ; + int length); /* * Receive notification of the end of a document. */ - virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL) - ; + virtual void endDocument (void); /* * Receive notification of the end of an element. */ virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *qName); /* * End the scope of a prefix-URI mapping. */ - virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL) - ; + virtual void endPrefixMapping (const ACEXML_Char *prefix); /* * Receive notification of ignorable whitespace in element content. */ virtual void ignorableWhitespace (const ACEXML_Char *ch, int start, - int length ACEXML_ENV_ARG_DECL) - ; + int length); /* * Receive notification of a processing instruction. */ virtual void processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *data); /* * Receive an object for locating the origin of SAX document events. @@ -148,13 +142,12 @@ public: /* * Receive notification of a skipped entity. */ - virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) - ; + virtual void skippedEntity (const ACEXML_Char *name); /* * Receive notification of the beginning of a document. */ - virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL) + virtual void startDocument (void) ; /* @@ -163,15 +156,13 @@ public: virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, - ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) - ; + ACEXML_Attributes *atts); /* * Begin the scope of a prefix-URI Namespace mapping. */ virtual void startPrefixMapping (const ACEXML_Char *prefix, - const ACEXML_Char *uri ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *uri); // *** Methods inherit from ACEXML_DTDHandler. @@ -180,8 +171,7 @@ public: */ virtual void notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *systemId); /* * Receive notification of an unparsed entity declaration event. @@ -189,8 +179,7 @@ public: virtual void unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, - const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *notationName); // Methods inherit from ACEXML_EnitityResolver. @@ -198,54 +187,50 @@ public: * Allow the application to resolve external entities. */ virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *systemId); // Methods inherit from ACEXML_ErrorHandler. /* * Receive notification of a recoverable error. */ - virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void error (ACEXML_SAXParseException &exception); /* * Receive notification of a non-recoverable error. */ - virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void fatalError (ACEXML_SAXParseException &exception); /* * Receive notification of a warning. */ - virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void warning (ACEXML_SAXParseException &exception); protected: /** * Get the only attribute in <stream> or <streamdef>. */ - int get_stream_id (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL); + int get_stream_id (ACEXML_Attributes *alist); /** * Get the only attribute in <resume>, <suspend>, <remove> */ - int get_id (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL); + int get_id (ACEXML_Attributes *alist); /** * Get the dynamic tag attributes. */ - int get_dynamic_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL); + int get_dynamic_attrs (ACEXML_Attributes *alist); /** * Get the initializer tag attributes. */ - int get_initializer_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL); + int get_initializer_attrs (ACEXML_Attributes *alist); /** * Get the static tag attributes. */ - int get_static_attrs (ACEXML_Attributes *alist ACEXML_ENV_ARG_DECL); + int get_static_attrs (ACEXML_Attributes *alist); private: /// We are parsing a stream definition diff --git a/ACE/ACEXML/common/Attributes_Def_Builder.h b/ACE/ACEXML/common/Attributes_Def_Builder.h index c91025cd33d..a9986ff754b 100644 --- a/ACE/ACEXML/common/Attributes_Def_Builder.h +++ b/ACE/ACEXML/common/Attributes_Def_Builder.h @@ -20,7 +20,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ACEXML/common/XML_Types.h" -#include "ACEXML/common/Env.h" #include "ACEXML/common/SAXExceptions.h" #include "ace/Auto_Ptr.h" @@ -75,21 +74,18 @@ public: /** * Set the attribute type. */ - virtual int setAttType (const ATT_TYPE type ACEXML_ENV_ARG_DECL) - = 0; + virtual int setAttType (const ATT_TYPE type) = 0; /** * Insert an element for NOTATION or ENUMERATION type attribute. */ - virtual int insertList (const ACEXML_Char *Name ACEXML_ENV_ARG_DECL) - = 0; + virtual int insertList (const ACEXML_Char *Name) = 0; /** * Set default attribute declaration. */ virtual int setDefault (const DEFAULT_DECL def, - const ACEXML_Char *value ACEXML_ENV_ARG_DECL) - = 0; + const ACEXML_Char *value) = 0; /** * Check validity of the current attribute definition being built. @@ -128,18 +124,17 @@ public: */ virtual int setElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) - = 0; + const ACEXML_Char *qName) = 0; /** * Acquire an Attribute_Builder. */ - virtual ACEXML_Attribute_Def_Builder *getAttribute_Def_Builder () = 0; + virtual ACEXML_Attribute_Def_Builder *getAttribute_Def_Builder (void) = 0; /** * Add a definition for one attribute. */ - virtual int insertAttribute (ACEXML_Attribute_Def_Builder *def ACEXML_ENV_ARG_DECL) = 0; + virtual int insertAttribute (ACEXML_Attribute_Def_Builder *def) = 0; /** diff --git a/ACE/ACEXML/common/CharStream.h b/ACE/ACEXML/common/CharStream.h index e0355d4721a..6c687e91e7c 100644 --- a/ACE/ACEXML/common/CharStream.h +++ b/ACE/ACEXML/common/CharStream.h @@ -35,7 +35,7 @@ public: /** * Virtual destructor, must have. */ - virtual ~ACEXML_CharStream () = 0; + virtual ~ACEXML_CharStream (void) = 0; /** * Returns the available ACEXML_Char in the buffer. -1 diff --git a/ACE/ACEXML/common/ContentHandler.h b/ACE/ACEXML/common/ContentHandler.h index 006eb4ded37..d26cfb22295 100644 --- a/ACE/ACEXML/common/ContentHandler.h +++ b/ACE/ACEXML/common/ContentHandler.h @@ -19,7 +19,6 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ACEXML/common/Env.h" #include "ACEXML/common/SAXExceptions.h" #include "ACEXML/common/Locator.h" #include "ACEXML/common/Attributes.h" @@ -53,44 +52,37 @@ public: */ virtual void characters (const ACEXML_Char *ch, size_t start, - size_t length - ACEXML_ENV_ARG_DECL) - = 0; + size_t length) = 0; /** * Receive notification of the end of a document. */ - virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL) - = 0; + virtual void endDocument (void) = 0; /** * Receive notification of the end of an element. */ virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) - = 0; + const ACEXML_Char *qName) = 0; /** * End the scope of a prefix-URI mapping. */ - virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL) - = 0; + virtual void endPrefixMapping (const ACEXML_Char *prefix) = 0; /** * Receive notification of ignorable whitespace in element content. */ virtual void ignorableWhitespace (const ACEXML_Char *ch, int start, - int length ACEXML_ENV_ARG_DECL) - = 0; + int length) = 0; /** * Receive notification of a processing instruction. */ virtual void processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data ACEXML_ENV_ARG_DECL) - = 0; + const ACEXML_Char *data) = 0; /** * Receive an object for locating the origin of SAX document events. @@ -100,14 +92,12 @@ public: /** * Receive notification of a skipped entity. */ - virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) - = 0; + virtual void skippedEntity (const ACEXML_Char *name) = 0; /** * Receive notification of the beginning of a document. */ - virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL) - = 0; + virtual void startDocument (void) = 0; /** * Receive notification of the beginning of an element. @@ -115,15 +105,13 @@ public: virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, - ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) - = 0; + ACEXML_Attributes *atts) = 0; /** * Begin the scope of a prefix-URI Namespace mapping. */ virtual void startPrefixMapping (const ACEXML_Char *prefix, - const ACEXML_Char *uri ACEXML_ENV_ARG_DECL) - = 0; + const ACEXML_Char *uri) = 0; }; #include /**/ "ace/post.h" diff --git a/ACE/ACEXML/common/DTDHandler.h b/ACE/ACEXML/common/DTDHandler.h index 18800a43a2e..155b8c40f07 100644 --- a/ACE/ACEXML/common/DTDHandler.h +++ b/ACE/ACEXML/common/DTDHandler.h @@ -19,7 +19,6 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ACEXML/common/Env.h" #include "ACEXML/common/SAXExceptions.h" /** @@ -59,7 +58,7 @@ public: */ virtual void notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) + const ACEXML_Char *systemId) = 0; /** @@ -68,8 +67,7 @@ public: virtual void unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, - const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL) - = 0; + const ACEXML_Char *notationName) = 0; }; diff --git a/ACE/ACEXML/common/DTD_Manager.h b/ACE/ACEXML/common/DTD_Manager.h index 51ab3791551..ba99cbf480b 100644 --- a/ACE/ACEXML/common/DTD_Manager.h +++ b/ACE/ACEXML/common/DTD_Manager.h @@ -50,7 +50,7 @@ public: * * @retval 0 if success, -1 if error. */ - virtual int insertElement_Definition (ACEXML_Element_Def_Builder *def ACEXML_ENV_ARG_DECL) = 0; + virtual int insertElement_Definition (ACEXML_Element_Def_Builder *def) = 0; /** * Acquire a pointer to an attributes definition builder. @@ -63,7 +63,7 @@ public: * * @retval 0 if success, -1 otherwise. */ - virtual int insertAttributes_Definition (ACEXML_Attributes_Def_Builder *def ACEXML_ENV_ARG_DECL) = 0; + virtual int insertAttributes_Definition (ACEXML_Attributes_Def_Builder *def) = 0; /** * Acquire an element validator to validate an XML element. diff --git a/ACE/ACEXML/common/DefaultHandler.cpp b/ACE/ACEXML/common/DefaultHandler.cpp index 02e7fd86126..1c4a0a32ab2 100644 --- a/ACE/ACEXML/common/DefaultHandler.cpp +++ b/ACE/ACEXML/common/DefaultHandler.cpp @@ -15,14 +15,13 @@ ACEXML_DefaultHandler::~ACEXML_DefaultHandler (void) void ACEXML_DefaultHandler::characters (const ACEXML_Char *, size_t, - size_t - ACEXML_ENV_ARG_DECL_NOT_USED) + size_t) { // No-op. } void -ACEXML_DefaultHandler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) +ACEXML_DefaultHandler::endDocument (void) { // No-op. } @@ -30,13 +29,13 @@ ACEXML_DefaultHandler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) void ACEXML_DefaultHandler::endElement (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } void -ACEXML_DefaultHandler::endPrefixMapping (const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_DefaultHandler::endPrefixMapping (const ACEXML_Char *) { // No-op. } @@ -44,14 +43,14 @@ ACEXML_DefaultHandler::endPrefixMapping (const ACEXML_Char * ACEXML_ENV_ARG_DECL void ACEXML_DefaultHandler::ignorableWhitespace (const ACEXML_Char *, int, - int ACEXML_ENV_ARG_DECL_NOT_USED) + int) { // No-op. } void ACEXML_DefaultHandler::processingInstruction (const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -63,13 +62,13 @@ ACEXML_DefaultHandler::setDocumentLocator (ACEXML_Locator * ) } void -ACEXML_DefaultHandler::skippedEntity (const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_DefaultHandler::skippedEntity (const ACEXML_Char *) { // No-op. } void -ACEXML_DefaultHandler::startDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) +ACEXML_DefaultHandler::startDocument (void) { // No-op. } @@ -78,14 +77,14 @@ void ACEXML_DefaultHandler::startElement (const ACEXML_Char *, const ACEXML_Char *, const ACEXML_Char *, - ACEXML_Attributes * ACEXML_ENV_ARG_DECL_NOT_USED) + ACEXML_Attributes *) { // No-op. } void ACEXML_DefaultHandler::startPrefixMapping (const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -95,7 +94,7 @@ ACEXML_DefaultHandler::startPrefixMapping (const ACEXML_Char *, void ACEXML_DefaultHandler::notationDecl (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -104,7 +103,7 @@ void ACEXML_DefaultHandler::unparsedEntityDecl (const ACEXML_Char *, const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -113,7 +112,7 @@ ACEXML_DefaultHandler::unparsedEntityDecl (const ACEXML_Char *, ACEXML_InputSource * ACEXML_DefaultHandler::resolveEntity (const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char * ) { // No-op. return 0; @@ -125,19 +124,19 @@ ACEXML_DefaultHandler::resolveEntity (const ACEXML_Char *, * Receive notification of a recoverable error. */ void -ACEXML_DefaultHandler::error (ACEXML_SAXParseException & ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_DefaultHandler::error (ACEXML_SAXParseException &) { // No-op. } void -ACEXML_DefaultHandler::fatalError (ACEXML_SAXParseException & ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_DefaultHandler::fatalError (ACEXML_SAXParseException &) { // No-op. } void -ACEXML_DefaultHandler::warning (ACEXML_SAXParseException & ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_DefaultHandler::warning (ACEXML_SAXParseException &) { // No-op. } diff --git a/ACE/ACEXML/common/DefaultHandler.h b/ACE/ACEXML/common/DefaultHandler.h index a729778201c..7b3d6cc7a92 100644 --- a/ACE/ACEXML/common/DefaultHandler.h +++ b/ACE/ACEXML/common/DefaultHandler.h @@ -66,38 +66,37 @@ public: */ virtual void characters (const ACEXML_Char *ch, size_t start, - size_t length - ACEXML_ENV_ARG_DECL); + size_t length); /* * Receive notification of the end of a document. */ - virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL); + virtual void endDocument (void); /* * Receive notification of the end of an element. */ virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL); + const ACEXML_Char *qName); /* * End the scope of a prefix-URI mapping. */ - virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL); + virtual void endPrefixMapping (const ACEXML_Char *prefix); /* * Receive notification of ignorable whitespace in element content. */ virtual void ignorableWhitespace (const ACEXML_Char *ch, int start, - int length ACEXML_ENV_ARG_DECL); + int length); /* * Receive notification of a processing instruction. */ virtual void processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data ACEXML_ENV_ARG_DECL); + const ACEXML_Char *data); /* * Receive an object for locating the origin of SAX document events. @@ -107,12 +106,12 @@ public: /* * Receive notification of a skipped entity. */ - virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL); + virtual void skippedEntity (const ACEXML_Char *name); /* * Receive notification of the beginning of a document. */ - virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL); + virtual void startDocument (void); /* * Receive notification of the beginning of an element. @@ -120,13 +119,13 @@ public: virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, - ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL); + ACEXML_Attributes *atts); /* * Begin the scope of a prefix-URI Namespace mapping. */ virtual void startPrefixMapping (const ACEXML_Char *prefix, - const ACEXML_Char *uri ACEXML_ENV_ARG_DECL); + const ACEXML_Char *uri); // *** Methods inherit from ACEXML_DTDHandler. @@ -135,7 +134,7 @@ public: */ virtual void notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL); + const ACEXML_Char *systemId); /* * Receive notification of an unparsed entity declaration event. @@ -143,7 +142,7 @@ public: virtual void unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, - const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL); + const ACEXML_Char *notationName); // Methods inherit from ACEXML_EnitityResolver. @@ -151,24 +150,24 @@ public: * Allow the application to resolve external entities. */ virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL); + const ACEXML_Char *systemId); // Methods inherit from ACEXML_ErrorHandler. /* * Receive notification of a recoverable error. */ - virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL); + virtual void error (ACEXML_SAXParseException &exception); /* * Receive notification of a non-recoverable error. */ - virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL); + virtual void fatalError (ACEXML_SAXParseException &exception); /* * Receive notification of a warning. */ - virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL); + virtual void warning (ACEXML_SAXParseException &exception); }; #include /**/ "ace/post.h" diff --git a/ACE/ACEXML/common/Element_Def_Builder.h b/ACE/ACEXML/common/Element_Def_Builder.h index ace842fb17c..fa50437b2b4 100644 --- a/ACE/ACEXML/common/Element_Def_Builder.h +++ b/ACE/ACEXML/common/Element_Def_Builder.h @@ -18,9 +18,9 @@ #if !defined (ACE_LACKS_PRAGMA_ONCE) #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ + #include "ace/Auto_Ptr.h" #include "ACEXML/common/XML_Types.h" -#include "ACEXML/common/Env.h" #include "ACEXML/common/SAXExceptions.h" /** @@ -62,7 +62,7 @@ public: */ virtual int setElementName (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + const ACEXML_Char *qName) = 0; /** @@ -70,7 +70,7 @@ public: * * @retval 0 if valid, -1 otherwise. */ - virtual int setContentType (CONTENT_TYPE type ACEXML_ENV_ARG_DECL) + virtual int setContentType (CONTENT_TYPE type) = 0; /** @@ -78,7 +78,7 @@ public: */ virtual int insertMixedElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + const ACEXML_Char *qName) = 0; /** @@ -91,7 +91,7 @@ public: * * @retval 0 on success. */ - virtual int endChildGroup (CARDINALITY card ACEXML_ENV_ARG_DECL) = 0; + virtual int endChildGroup (CARDINALITY card) = 0; /** * Set the type of current child group to Choice. @@ -118,7 +118,7 @@ public: */ virtual int insertElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + const ACEXML_Char *qName) = 0; /** diff --git a/ACE/ACEXML/common/EntityResolver.h b/ACE/ACEXML/common/EntityResolver.h index c1934724bad..c18708b029a 100644 --- a/ACE/ACEXML/common/EntityResolver.h +++ b/ACE/ACEXML/common/EntityResolver.h @@ -19,7 +19,6 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ACEXML/common/Env.h" #include "ACEXML/common/InputSource.h" #include "ACEXML/common/SAXExceptions.h" @@ -51,8 +50,7 @@ public: * Allow the application to resolve external entities. */ virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - = 0; + const ACEXML_Char *systemId) = 0; }; diff --git a/ACE/ACEXML/common/Env.cpp b/ACE/ACEXML/common/Env.cpp deleted file mode 100644 index e5014a06714..00000000000 --- a/ACE/ACEXML/common/Env.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -*- C++ -*- $Id$ - -#include "ACEXML/common/Env.h" - -#if !defined (__ACEXML_INLINE__) -# include "ACEXML/common/Env.inl" -#endif /* __ACEXML_INLINE__ */ - -ACEXML_Env::ACEXML_Env (void) - : exception_ (0) -{ -} - -ACEXML_Env::ACEXML_Env (const ACEXML_Env &rhs) - : exception_ (0) -{ - if (rhs.exception()) - this->exception_ = rhs.exception_->duplicate(); -} - -ACEXML_Env& -ACEXML_Env::operator= (const ACEXML_Env& rhs) -{ - ACEXML_Env tmp (rhs); - ACEXML_Exception* tmp_ex = this->exception_; - this->exception_ = tmp.exception_; - tmp.exception_ = tmp_ex; - return *this; -} - -ACEXML_Env::~ACEXML_Env (void) -{ - this->clear(); -} diff --git a/ACE/ACEXML/common/Env.h b/ACE/ACEXML/common/Env.h deleted file mode 100644 index ee8aa59768d..00000000000 --- a/ACE/ACEXML/common/Env.h +++ /dev/null @@ -1,72 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Env.h - * - * $Id$ - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - */ -//============================================================================= - -#ifndef _ACEXML_ENV_H_ -#define _ACEXML_ENV_H_ - -#include /**/ "ace/pre.h" -#include "ACEXML/common/ACEXML_Export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ACEXML/common/XML_Macros.h" -#include "ACEXML/common/Exception.h" - -/** - * @class ACEXML_Env Env.h "ACEXML/common/Env.h" - * - * @brief ACEXML_Env - * - * ACEXML_Env is modeled after CORBA_Environment class. It provides a place - * holder for callees to propagate exceptions back to callers. ACEXML does - * not support native exceptions at this moment. - * - * @sa ACEXML_Exception - */ -class ACEXML_Export ACEXML_Env -{ -public: - /// Default constructor. - ACEXML_Env (void); - - /// Copy constructor. - ACEXML_Env (const ACEXML_Env& ACEXML_TRY_ENV); - - /// Assignment - ACEXML_Env& operator= (const ACEXML_Env& ACEXML_TRY_ENV); - - /// Destructor. - ~ACEXML_Env (void); - - /// Return the contained exception. - ACEXML_Exception *exception (void) const; - - /// Set the contained exception to @arg ex - void exception (ACEXML_Exception* ex); - - /// Clear the exception and reset the evnrionment. - void clear (void); - -private: - /// Place holder for exception (if one occurs.) - ACEXML_Exception *exception_; -}; - -#if defined (__ACEXML_INLINE__) -# include "ACEXML/common/Env.inl" -#endif /* __ACEXML_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* _ACEXML_ENV_H_ */ diff --git a/ACE/ACEXML/common/Env.inl b/ACE/ACEXML/common/Env.inl deleted file mode 100644 index 95c3f41c8aa..00000000000 --- a/ACE/ACEXML/common/Env.inl +++ /dev/null @@ -1,25 +0,0 @@ -// -*- C++ -*- $Id$ - -#include "ace/Log_Msg.h" /* to get ACE_ASSERT */ -#include "ACEXML/common/Exception.h" - -ACEXML_INLINE ACEXML_Exception * -ACEXML_Env::exception (void) const -{ - return this->exception_; -} - -ACEXML_INLINE void -ACEXML_Env::exception (ACEXML_Exception *ex) -{ - ACE_ASSERT (ex != this->exception_); - this->clear(); - this->exception_ = ex; -} - -ACEXML_INLINE void -ACEXML_Env::clear (void) -{ - delete this->exception_; - this->exception_ = 0; -} diff --git a/ACE/ACEXML/common/ErrorHandler.h b/ACE/ACEXML/common/ErrorHandler.h index 4d8da5cc4a4..5ba981bbcb4 100644 --- a/ACE/ACEXML/common/ErrorHandler.h +++ b/ACE/ACEXML/common/ErrorHandler.h @@ -19,7 +19,6 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ACEXML/common/Env.h" #include "ACEXML/common/SAXExceptions.h" /** @@ -53,20 +52,17 @@ public: /** * Receive notification of a recoverable error. */ - virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - = 0; + virtual void error (ACEXML_SAXParseException &exception) = 0; /** * Receive notification of a non-recoverable error. */ - virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - = 0; + virtual void fatalError (ACEXML_SAXParseException &exception) = 0; /** * Receive notification of a warning. */ - virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - = 0; + virtual void warning (ACEXML_SAXParseException &exception) = 0; }; diff --git a/ACE/ACEXML/common/Exception.h b/ACE/ACEXML/common/Exception.h index 48572e24c73..56ba88f1566 100644 --- a/ACE/ACEXML/common/Exception.h +++ b/ACE/ACEXML/common/Exception.h @@ -21,14 +21,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ACEXML/common/XML_Types.h" -#include "ACEXML/common/XML_Macros.h" - -#if defined (ACE_USES_NATIVE_EXCEPTIONS) -# define ACEXML_RAISE(EXCEPTION) throw EXCEPTION -#else -# define ACEXML_RAISE(EXCEPTION) -#endif - /** * @class ACEXML_Exception Exception.h "ACEXML/common/Exception.h" diff --git a/ACE/ACEXML/common/SAXExceptions.inl b/ACE/ACEXML/common/SAXExceptions.inl index f184fcf077c..fd2be41cf52 100644 --- a/ACE/ACEXML/common/SAXExceptions.inl +++ b/ACE/ACEXML/common/SAXExceptions.inl @@ -11,25 +11,25 @@ ACEXML_SAXException::message (void) const ACEXML_INLINE void ACEXML_SAXException::_raise (void) { - ACEXML_RAISE (*this); + throw (*this); } ACEXML_INLINE void ACEXML_SAXNotSupportedException::_raise (void) { - ACEXML_RAISE (*this); + throw (*this); } ACEXML_INLINE void ACEXML_SAXNotRecognizedException::_raise (void) { - ACEXML_RAISE (*this); + throw (*this); } ACEXML_INLINE void ACEXML_SAXParseException::_raise (void) { - ACEXML_RAISE (*this); + throw (*this); } ACEXML_INLINE const ACEXML_Char * diff --git a/ACE/ACEXML/common/Validator.h b/ACE/ACEXML/common/Validator.h index fad96bf2f91..79d7ad88356 100644 --- a/ACE/ACEXML/common/Validator.h +++ b/ACE/ACEXML/common/Validator.h @@ -20,7 +20,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ACEXML/common/Attributes.h" -#include "ACEXML/common/Env.h" #include "ACEXML/common/SAXExceptions.h" /** @@ -44,8 +43,7 @@ public: * * @retval 0 if valid, -1 otherwise. */ - virtual int startElement (ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) - = 0; + virtual int startElement (ACEXML_Attributes *atts) = 0; /** * Validate the next child element. @@ -54,8 +52,7 @@ public: */ virtual int nextElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) - = 0; + const ACEXML_Char *qName) = 0; }; diff --git a/ACE/ACEXML/common/XMLFilterImpl.cpp b/ACE/ACEXML/common/XMLFilterImpl.cpp index 6e5be6b7efa..d000c0ea1a9 100644 --- a/ACE/ACEXML/common/XMLFilterImpl.cpp +++ b/ACE/ACEXML/common/XMLFilterImpl.cpp @@ -32,72 +32,68 @@ ACEXML_XMLFilterImpl::~ACEXML_XMLFilterImpl (void) } void -ACEXML_XMLFilterImpl::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::parse (ACEXML_InputSource *input) { if (this->setupParser () < 0) { - ACEXML_THROW (ACEXML_SAXException (ACE_TEXT ("No Parent available"))); + throw ACEXML_SAXException (ACE_TEXT ("No Parent available")); } - this->parent_->parse (input ACEXML_ENV_ARG_PARAMETER); - return; + this->parent_->parse (input); } void -ACEXML_XMLFilterImpl::parse (const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::parse (const ACEXML_Char *systemId) { if (this->setupParser () < 0) { - ACEXML_THROW (ACEXML_SAXException (ACE_TEXT ("No Parent available"))); + throw ACEXML_SAXException (ACE_TEXT ("No Parent available")); } - this->parent_->parse (new ACEXML_InputSource (systemId) ACEXML_ENV_ARG_PARAMETER); - return; + this->parent_->parse (new ACEXML_InputSource (systemId)); } int -ACEXML_XMLFilterImpl::getFeature (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::getFeature (const ACEXML_Char *name) { if (this->parent_ != 0) - return this->parent_->getFeature (name ACEXML_ENV_ARG_PARAMETER); + return this->parent_->getFeature (name); - ACEXML_THROW_RETURN (ACEXML_SAXNotRecognizedException (name), 0); + throw ACEXML_SAXNotRecognizedException (name); } void * -ACEXML_XMLFilterImpl::getProperty (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::getProperty (const ACEXML_Char *name) { if (this->parent_ != 0) - return this->parent_->getProperty (name ACEXML_ENV_ARG_PARAMETER); + return this->parent_->getProperty (name); - ACEXML_THROW_RETURN (ACEXML_SAXNotRecognizedException (name), 0); + throw ACEXML_SAXNotRecognizedException (name); } void -ACEXML_XMLFilterImpl::setFeature (const ACEXML_Char *name, - int boolean_value ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::setFeature (const ACEXML_Char *name, int boolean_value) { if (this->parent_ != 0) { - this->parent_->setFeature (name, - boolean_value ACEXML_ENV_ARG_PARAMETER); - return; + this->parent_->setFeature (name, boolean_value); + } + else + { + throw ACEXML_SAXNotRecognizedException (name); } - - ACEXML_THROW (ACEXML_SAXNotRecognizedException (name)); } void -ACEXML_XMLFilterImpl::setProperty (const ACEXML_Char *name, - void *value ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::setProperty (const ACEXML_Char *name, void *value) { if (this->parent_ != 0) { - this->parent_->setProperty (name, - value ACEXML_ENV_ARG_PARAMETER); - return; + this->parent_->setProperty (name, value); + } + else + { + throw ACEXML_SAXNotRecognizedException (name); } - - ACEXML_THROW (ACEXML_SAXNotRecognizedException (name)); } ACEXML_XMLReader * @@ -115,56 +111,55 @@ ACEXML_XMLFilterImpl::setParent (ACEXML_XMLReader *parent) void ACEXML_XMLFilterImpl::characters (const ACEXML_Char *ch, size_t start, - size_t length - ACEXML_ENV_ARG_DECL) + size_t length) { if (this->contentHandler_ != 0) - this->contentHandler_->characters (ch, start, length ACEXML_ENV_ARG_PARAMETER); + this->contentHandler_->characters (ch, start, length); } void -ACEXML_XMLFilterImpl::endDocument (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_XMLFilterImpl::endDocument (void) { if (this->contentHandler_ != 0) - this->contentHandler_->endDocument (ACEXML_ENV_SINGLE_ARG_PARAMETER); + this->contentHandler_->endDocument (); } void ACEXML_XMLFilterImpl::endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + const ACEXML_Char *qName) { if (this->contentHandler_ != 0) this->contentHandler_->endElement (namespaceURI, localName, - qName ACEXML_ENV_ARG_PARAMETER); + qName); } void -ACEXML_XMLFilterImpl::endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::endPrefixMapping (const ACEXML_Char *prefix) { if (this->contentHandler_ != 0) - this->contentHandler_->endPrefixMapping (prefix ACEXML_ENV_ARG_PARAMETER); + this->contentHandler_->endPrefixMapping (prefix); } void ACEXML_XMLFilterImpl::ignorableWhitespace (const ACEXML_Char *ch, int start, - int length ACEXML_ENV_ARG_DECL) + int length) { if (this->contentHandler_ != 0) this->contentHandler_->ignorableWhitespace (ch, start, - length ACEXML_ENV_ARG_PARAMETER); + length); } void ACEXML_XMLFilterImpl::processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data ACEXML_ENV_ARG_DECL) + const ACEXML_Char *data) { if (this->contentHandler_ != 0) this->contentHandler_->processingInstruction (target, - data ACEXML_ENV_ARG_PARAMETER); + data); } void @@ -175,94 +170,94 @@ ACEXML_XMLFilterImpl::setDocumentLocator (ACEXML_Locator *locator) } void -ACEXML_XMLFilterImpl::skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::skippedEntity (const ACEXML_Char *name) { if (this->contentHandler_ != 0) - this->contentHandler_->skippedEntity (name ACEXML_ENV_ARG_PARAMETER); + this->contentHandler_->skippedEntity (name); } void -ACEXML_XMLFilterImpl::startDocument (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_XMLFilterImpl::startDocument (void) { if (this->contentHandler_ != 0) - this->contentHandler_->startDocument (ACEXML_ENV_SINGLE_ARG_PARAMETER); + this->contentHandler_->startDocument (); } void ACEXML_XMLFilterImpl::startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, - ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) + ACEXML_Attributes *atts) { if (this->contentHandler_ != 0) this->contentHandler_->startElement (namespaceURI, localName, qName, - atts ACEXML_ENV_ARG_PARAMETER); + atts); } void ACEXML_XMLFilterImpl::startPrefixMapping (const ACEXML_Char *prefix, - const ACEXML_Char *uri ACEXML_ENV_ARG_DECL) + const ACEXML_Char *uri) { if (this->contentHandler_ != 0) this->contentHandler_->startPrefixMapping (prefix, - uri ACEXML_ENV_ARG_PARAMETER); + uri); } void ACEXML_XMLFilterImpl::notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) + const ACEXML_Char *systemId) { if (this->dtdHandler_ != 0) this->dtdHandler_->notationDecl (name, publicId, - systemId ACEXML_ENV_ARG_PARAMETER); + systemId); } void ACEXML_XMLFilterImpl::unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, - const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL) + const ACEXML_Char *notationName) { if (this->dtdHandler_ != 0) this->dtdHandler_->unparsedEntityDecl (name, publicId, systemId, - notationName ACEXML_ENV_ARG_PARAMETER); + notationName); } ACEXML_InputSource * ACEXML_XMLFilterImpl::resolveEntity (const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) + const ACEXML_Char *systemId) { if (this->entityResolver_ != 0) return this->entityResolver_->resolveEntity (publicId, - systemId ACEXML_ENV_ARG_PARAMETER); + systemId); return 0; } void -ACEXML_XMLFilterImpl::error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::error (ACEXML_SAXParseException &exception) { if (this->errorHandler_ != 0) - this->errorHandler_->error (exception ACEXML_ENV_ARG_PARAMETER); + this->errorHandler_->error (exception); } void -ACEXML_XMLFilterImpl::fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::fatalError (ACEXML_SAXParseException &exception) { if (this->errorHandler_ != 0) - this->errorHandler_->fatalError (exception ACEXML_ENV_ARG_PARAMETER); + this->errorHandler_->fatalError (exception); } void -ACEXML_XMLFilterImpl::warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) +ACEXML_XMLFilterImpl::warning (ACEXML_SAXParseException &exception) { if (this->errorHandler_ != 0) - this->errorHandler_->warning (exception ACEXML_ENV_ARG_PARAMETER); + this->errorHandler_->warning (exception); } ACEXML_DTDHandler * diff --git a/ACE/ACEXML/common/XMLFilterImpl.h b/ACE/ACEXML/common/XMLFilterImpl.h index fa4913e0910..39e51b00d20 100644 --- a/ACE/ACEXML/common/XMLFilterImpl.h +++ b/ACE/ACEXML/common/XMLFilterImpl.h @@ -58,36 +58,32 @@ public: /* * Look up the value of a feature. */ - virtual int getFeature (const ACEXML_Char *name ACEXML_ENV_ARG_DECL); + virtual int getFeature (const ACEXML_Char *name); /* * Look up the value of a property. */ - virtual void * getProperty (const ACEXML_Char *name ACEXML_ENV_ARG_DECL); + virtual void * getProperty (const ACEXML_Char *name); /* * Parse an XML document. */ - virtual void parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL); + virtual void parse (ACEXML_InputSource *input); /* * Parse an XML document from a system identifier (URI). */ - virtual void parse (const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - // @@ throw IOException??? - ; + virtual void parse (const ACEXML_Char *systemId); /* * Set the state of a feature. */ - virtual void setFeature (const ACEXML_Char *name, - int boolean_value ACEXML_ENV_ARG_DECL); + virtual void setFeature (const ACEXML_Char *name, int boolean_value); /* * Set the value of a property. */ - virtual void setProperty (const ACEXML_Char *name, - void *value ACEXML_ENV_ARG_DECL); + virtual void setProperty (const ACEXML_Char *name, void *value); /* * Get the parent reader. @@ -144,38 +140,37 @@ public: */ virtual void characters (const ACEXML_Char *ch, size_t start, - size_t length - ACEXML_ENV_ARG_DECL); + size_t length); /* * Receive notification of the end of a document. */ - virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL); + virtual void endDocument (void); /* * Receive notification of the end of an element. */ virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL); + const ACEXML_Char *qName); /* * End the scope of a prefix-URI mapping. */ - virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL); + virtual void endPrefixMapping (const ACEXML_Char *prefix); /* * Receive notification of ignorable whitespace in element content. */ virtual void ignorableWhitespace (const ACEXML_Char *ch, int start, - int length ACEXML_ENV_ARG_DECL); + int length); /* * Receive notification of a processing instruction. */ virtual void processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data ACEXML_ENV_ARG_DECL); + const ACEXML_Char *data); /* * Receive an object for locating the origin of SAX document events. @@ -185,12 +180,12 @@ public: /* * Receive notification of a skipped entity. */ - virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL); + virtual void skippedEntity (const ACEXML_Char *name); /* * Receive notification of the beginning of a document. */ - virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL); + virtual void startDocument (void); /* * Receive notification of the beginning of an element. @@ -198,13 +193,13 @@ public: virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, - ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL); + ACEXML_Attributes *atts); /* * Begin the scope of a prefix-URI Namespace mapping. */ virtual void startPrefixMapping (const ACEXML_Char *prefix, - const ACEXML_Char *uri ACEXML_ENV_ARG_DECL); + const ACEXML_Char *uri); // *** Methods inherit from ACEXML_DTDHandler. @@ -213,7 +208,7 @@ public: */ virtual void notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL); + const ACEXML_Char *systemId); /* * Receive notification of an unparsed entity declaration event. @@ -221,7 +216,7 @@ public: virtual void unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, - const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL); + const ACEXML_Char *notationName); // Methods inherit from ACEXML_EnitityResolver. @@ -229,24 +224,24 @@ public: * Allow the application to resolve external entities. */ virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL); + const ACEXML_Char *systemId); // Methods inherit from ACEXML_ErrorHandler. /* * Receive notification of a recoverable error. */ - virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL); + virtual void error (ACEXML_SAXParseException &exception); /* * Receive notification of a non-recoverable error. */ - virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL); + virtual void fatalError (ACEXML_SAXParseException &exception); /* * Receive notification of a warning. */ - virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL); + virtual void warning (ACEXML_SAXParseException &exception); protected: int setupParser (void); // Set up the event handlers of parent parser to this. diff --git a/ACE/ACEXML/common/XMLReader.h b/ACE/ACEXML/common/XMLReader.h index 9cbc6bca7f2..95b03f62142 100644 --- a/ACE/ACEXML/common/XMLReader.h +++ b/ACE/ACEXML/common/XMLReader.h @@ -70,26 +70,22 @@ public: * programmers to check whether a specific feature has been * activated in the parser. */ - virtual int getFeature (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) - = 0; + virtual int getFeature (const ACEXML_Char *name) = 0; /** * Look up the value of a property. */ - virtual void * getProperty (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) - = 0; + virtual void * getProperty (const ACEXML_Char *name) = 0; /** * Parse an XML document. */ - virtual void parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) - = 0; + virtual void parse (ACEXML_InputSource *input) = 0; /** * Parse an XML document from a system identifier (URI). */ - virtual void parse (const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - = 0; + virtual void parse (const ACEXML_Char *systemId) = 0; /** * Allow an application to register a content event handler. @@ -114,16 +110,12 @@ public: /** * Activating or deactivating a feature. */ - virtual void setFeature (const ACEXML_Char *name, - int boolean_value ACEXML_ENV_ARG_DECL) - = 0; + virtual void setFeature (const ACEXML_Char *name, int boolean_value) = 0; /** * Set the value of a property. */ - virtual void setProperty (const ACEXML_Char *name, - void *value ACEXML_ENV_ARG_DECL) - = 0; + virtual void setProperty (const ACEXML_Char *name, void *value) = 0; }; diff --git a/ACE/ACEXML/common/XML_Macros.h b/ACE/ACEXML/common/XML_Macros.h deleted file mode 100644 index 9ee1e90c196..00000000000 --- a/ACE/ACEXML/common/XML_Macros.h +++ /dev/null @@ -1,456 +0,0 @@ -// -*- C++ -*- - -// ============================================================================ -/** - * @file XML_Macros.h - * - * $Id$ - * - * Writing code that is portable between platforms with or without - * native C++ exceptions is hard. The following macros offer some - * help on this task. - * - * @author Nanbor Wang <nanbor@cs.wustl.edu> - * @author Aniruddha Gokhale <gokhale@sahyadri.research.bell-labs.com> - * @author Carlos O'Ryan <coryan@uci.edu> - * @author Krishnakumar B <kitty@cs.wustl.edu>, et al. - */ -// ============================================================================ - -// Macros for handling exceptions. - -#ifndef _ACEXML_MACROS_H -#define _ACEXML_MACROS_H - -#include /**/ "ace/pre.h" - -#include "ace/config-all.h" - -# if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -# endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Exception_Macros.h" - -// The Windows MFC exception mechanism requires that a caught CException -// (including the CMemoryException in use here) be freed using its Delete() -// method. Thus, when MFC is in use and we're catching exceptions as a result -// of new(), the exception's Delete() method has to be called. No other -// platform imposes this sort of restriction/requirement. The Windows -// config stuff (at least for MSVC/MFC) defines a ACE_del_bad_alloc macro -// that works with its ACE_bad_alloc macro to implement this cleanup -// requirement. Since no other platform requires this, define it as -// empty here. -#if !defined (ACE_del_bad_alloc) -# define ACE_del_bad_alloc -#endif - -// The following macros assume that an environment variable is passed -// in/out of each function that can throw an exception. The type of the -// environment variable is defined by ACEXML_ENV_TYPE. - -#if !defined (ACEXML_ENV_TYPE) -# define ACEXML_ENV_TYPE ACEXML_Env -#endif /* ACEXML_ENV_TYPE */ - -// The name of the variable defined by ACEXML_TRY_ENV. Below is the name -// that we use by default. If you wish to change it you can redefine -// ACEXML_TRY_ENV to change the default name. Also ACEXML_ADOPT_ENV allows the -// use of non-standard name within a scope. - -#if !defined (ACEXML_TRY_ENV) -# define ACEXML_TRY_ENV _ACEXML_Env_variable -#endif /* ACEXML_TRY_ENV */ - -// The base type of Exception from which all the other exception types are -// derived. By default, it is set to ACEXML_Exception. - -#if !defined (ACEXML_EXCEPTION_TYPE) -# define ACEXML_EXCEPTION_TYPE ACEXML_Exception -#endif /* ACEXML_EXCEPTION_TYPE */ - -// This is the exception caught by ACEXML_CATCHANY. -#if !defined (ACEXML_ANY_EXCEPTION) -# define ACEXML_ANY_EXCEPTION ex -#endif /* ACEXML_ANY_EXCEPTION */ - -// Declare a new environment variable on the stack. The type of the -// environment variable is determined by ACEXML_ENV_TYPE. -#define ACEXML_DECLARE_NEW_ENV \ - ACEXML_ENV_TYPE ACEXML_TRY_ENV - -#if defined (ACE_USES_NATIVE_EXCEPTIONS) -// ----------------------------------------------------------------- - -#define ACEXML_ADOPT_ENV (ENV) - -// No need to check. Native exceptions handle the control flow -// automatically when an exception occurs. -# define ACEXML_CHECK - -// Used when the function requires a return value. -# define ACEXML_CHECK_RETURN(RETV) - -// ACEXML_THROW_R_INT should not be used by the user. -# define ACEXML_THROW_R_INT(EXCEPTION) \ - throw EXCEPTION - -// Throwing an exception is easy. These two macros should _NOT_ be -// used within try blocks. -# define ACEXML_THROW(EXCEPTION) \ - throw EXCEPTION - -// Throwing an exception when the function reqires a return value. -# if defined (__HP_aCC) -# define ACEXML_THROW_RETURN(EXCEPTION, RETV) \ - do \ - { \ - throw EXCEPTION; \ - return RETV; \ - } while (0) -# else /* WIN32 */ -# define ACEXML_THROW_RETURN(EXCEPTION,RETV) \ - throw EXCEPTION -# endif /* WIN32 */ - -// For compilers with native exceptions, we can simply use try to try. ;-) -// do {} while (0) is required to avoid compilation warnings. -# define ACEXML_TRY \ - do \ - { \ - try \ - { -# define ACEXML_TRY_NEW_ENV \ - do \ - { \ - ACEXML_ENV_TYPE ACEXML_TRY_ENV; \ - try \ - { -# define ACEXML_TRY_EX(LABEL) \ - do \ - { \ - try \ - { - -// No need to check for exceptions within try block for compilers with -// native exceptions. -# define ACEXML_TRY_CHECK -# define ACEXML_TRY_CHECK_EX(LABEL) - -// Likewise, throwing exceptions within try blocks is easy. -# define ACEXML_TRY_THROW(EXCEPTION) throw EXCEPTION -# define ACEXML_TRY_THROW_EX(EXCEPTION,LABEL) throw EXCEPTION - -// Same thing for catch. -# define ACEXML_CATCH(EXCEPTION,VAR) \ - } \ - catch (EXCEPTION & VAR) \ - { \ - ACE_UNUSED_ARG (VAR); - -# define ACEXML_CATCHANY \ - ACEXML_CATCH(ACEXML_EXCEPTION_TYPE, ACEXML_ANY_EXCEPTION) - -# define ACEXML_CATCHALL \ - } \ - catch (...) \ - { - -// Rethrowing the exception from catch blocks. -# define ACEXML_RE_THROW throw -# define ACEXML_RE_THROW_EX(LABEL) throw - -// Close the catch block. -# define ACEXML_ENDTRY \ - } \ - } while (0) - -#else /* ! ACEXML_USES_NATIVE_EXCEPTIONS */ -// ----------------------------------------------------------------- - -// When handling compilers without native exceptions, things get a bit -// hairy. Exceptions are simulated using ACEXML_ENV_TYPE. The trick here is to -// make sure the flow-of-control can simulate the case when native -// exceptions occur... - -# define ACEXML_ADOPT_ENV(ENV) ACEXML_ENV_TYPE &ACEXML_TRY_ENV = ENV - -// Follow every statement that could throw exceptions with ACEXML_CHECK or -// ACEXML_CHECK_RETURN. These two macros should _NOT_ be used within try -// blocks. Use ACEXML_TRY_CHECK or ACEXML_TRY_CHECK_EX instead. -# define ACEXML_CHECK \ - if (ACEXML_TRY_ENV . exception () != 0) \ - return -// When function requires a return value -# define ACEXML_CHECK_RETURN(RETV) \ - if (ACEXML_TRY_ENV . exception () != 0) \ - return RETV - -// ACEXML_THROW_R_INT should not be used by the user. -# define ACEXML_THROW_R_INT(EXCEPTION) ACEXML_TRY_ENV.exception (new EXCEPTION) - -// Throwing exceptions will inevitably cause a return from the current -// function. These two macros should _NOT_ be used within try blocks. Use -// ACEXML_TRY_THROW or ACEXML_TRY_THROW_EX instead. -# define ACEXML_THROW(EXCEPTION) \ - do \ - { \ - ACEXML_TRY_ENV.exception (new EXCEPTION); \ - return; \ - } while (0) - -# define ACEXML_THROW_RETURN(EXCEPTION,RETV) \ - do \ - { \ - ACEXML_TRY_ENV.exception (new EXCEPTION); \ - return RETV; \ - } while (0) - -// ACEXML_TRY sets up flags to control program flow. ACEXML_TRY_FLAG acts -// like a one-shot flip-flop. When an exception occurs (detected using -// ACEXML_TRY_CHECK,) ACEXML_TRY_FLAG will be reset and the control goes -// back into ACEXML_TRY_LABEL. Since ACEXML_TRY_FLAG is reset, the try -// block won't get executed again and the control proceeds to the following -// catch blocks. ACEXML_EXCEPTION_NOT_CAUGHT flag is used to prevent -// catching an exception twice. This macro assumes there's already an -// ACEXML_ENV_TYPE variable ACEXML_TRY_ENV defined (which should be the -// case normally) -# define ACEXML_TRY \ - do { \ - int ACEXML_TRY_FLAG = 1; \ - int ACEXML_EXCEPTION_NOT_CAUGHT = 1; \ - ACEXML_TRY_LABEL: \ - if (ACEXML_TRY_FLAG) \ - do { - -// ACEXML_TRY_NEW_ENV functions like the macro ACEXML_TRY but defines a new -// ACEXML_ENV_TYPE variable ACEXML_TRY_ENV. It is most often used in the outer -// most function where no ACEXML_TRY_ENV is available. -# define ACEXML_TRY_NEW_ENV \ - do { \ - ACEXML_ENV_TYPE ACEXML_TRY_ENV;\ - int ACEXML_TRY_FLAG = 1; \ - int ACEXML_EXCEPTION_NOT_CAUGHT = 1; \ - ACEXML_TRY_LABEL: \ - if (ACEXML_TRY_FLAG) \ - do { - -// ACEXML_TRY_EX works exactly like ACEXML_TRY macro except the label used -// in the try block is customizable to avoid name clashing. It should be -// used when nested try blocks or multiple try blocks are required, in the -// same function. -# define ACEXML_TRY_EX(LABEL) \ - do { \ - int ACEXML_TRY_FLAG = 1; \ - int ACEXML_EXCEPTION_NOT_CAUGHT = 1; \ - ACEXML_TRY_LABEL ## LABEL: \ - if (ACEXML_TRY_FLAG) \ - do { - -// Check for exceptions within try blocks. -# define ACEXML_TRY_CHECK \ - { \ - if (ACEXML_TRY_ENV.exception () != 0) \ - { \ - ACEXML_TRY_FLAG = 0; \ - goto ACEXML_TRY_LABEL; \ - } \ - } - -// Checking exception within EX try blocks. -# define ACEXML_TRY_CHECK_EX(LABEL) \ - { \ - if (ACEXML_TRY_ENV.exception () != 0) \ - { \ - ACEXML_TRY_FLAG = 0; \ - goto ACEXML_TRY_LABEL ## LABEL; \ - } \ - } - -// Throwing exception within TRY blocks. -# define ACEXML_TRY_THROW(EXCEPTION) \ - { \ - ACEXML_TRY_ENV.exception (new EXCEPTION); \ - ACEXML_TRY_FLAG = 0; \ - goto ACEXML_TRY_LABEL; \ - } - -# define ACEXML_TRY_THROW_EX(EXCEPTION,LABEL) \ - { \ - ACEXML_TRY_ENV.exception (new EXCEPTION); \ - ACEXML_TRY_FLAG = 0; \ - goto ACEXML_TRY_LABEL ## LABEL; \ - } - -// When exceptions occur or try block finishes execution without exception, -// control will continue in the catch block. This macro first checks if -// there's any uncaught exception left. If all the conditions are met, we -// have caught an exception. It then resets ACEXML_EXCEPTION_NOT_CAUGHT to -// prevent subsequent catch blocks from catching the same exception again, -// and extracts out the underlying exception in ACEXML_TRY_ENV. We also make a -// copy of ACEXML_TRY_ENV in ACEXML_CAUGHT_ENV, in case we want to rethrow the -// exception. ACEXML_TRY_ENV is cleared out after the exception is caught so -// you should not use ACEXML_TRY_ENV within the catch block(You should use the -// exception directly). -# define ACEXML_CATCH(TYPE,VAR) \ - } while (0); \ - do \ - if (ACEXML_TRY_ENV.exception () != 0 && ACEXML_EXCEPTION_NOT_CAUGHT && \ - TYPE::_downcast(ACEXML_TRY_ENV.exception ()) != 0) \ - { \ - ACEXML_ENV_TYPE ACEXML_CAUGHT_ENV = ACEXML_TRY_ENV;\ - ACEXML_EXCEPTION_NOT_CAUGHT = 0; \ - TYPE &VAR = *TYPE::_downcast (ACEXML_CAUGHT_ENV.exception ()); \ - ACE_UNUSED_ARG (VAR); \ - ACEXML_TRY_ENV.clear (); - -// ACEXML_CATCHANY uses ACEXML_CATCH to catch all exceptions derived from -// ACEXML_EXCEPTION_TYPE -# define ACEXML_CATCHANY ACEXML_CATCH (ACEXML_EXCEPTION_TYPE, ACEXML_ANY_EXCEPTION) - -// Since there's no other exception for compilers without exception -// support, we simply catch all ACEXML_EXCEPTION_TYPE exceptions for -// ACEXML_CATCHALL. -# define ACEXML_CATCHALL ACEXML_CATCHANY - -// Rethrowing exception within catch blocks. Notice that we depend on the -// ACEXML_CHECK/ACEXML_CHECK_RETURN following the ACEXML_ENDTRY, or -// ACEXML_TRY_CHECK/ ACEXML_TRY_CHECK_EX following the ACEXML_ENDTRY when -// the catch block is within another try block, to do the "Right -// Thing[TM]." -# define ACEXML_RE_THROW \ - do {\ - ACEXML_TRY_ENV = ACEXML_CAUGHT_ENV; \ - goto ACEXML_TRY_LABEL; \ - } while (0) -# define ACEXML_RE_THROW_EX(LABEL) \ - do {\ - ACEXML_TRY_ENV = ACEXML_CAUGHT_ENV; \ - goto ACEXML_TRY_LABEL ## LABEL; \ - } while (0) - -// Close the try block. Since exceptions may not get caught, and exceptions -// can also be rethrown from the catch block, it's always a good idea to -// follow ACEXML_ENDTRY with ACEXML_CHECK or ACEXML_TRY_CHECK (depending on -// the context.) -# define ACEXML_ENDTRY \ - } while (0); \ - } while (0) - -#endif /* ! ACE_USES_NATIVE_EXCEPTIONS */ - -// ACE_HAS_EXCEPTIONS is not the same as ACE_NEW_THROWS_EXCEPTIONS. -#if defined(ACE_NEW_THROWS_EXCEPTIONS) - -# define ACEXML_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { ACE_del_bad_alloc errno = ENOMEM; ACEXML_THROW_R_INT (EXCEPTION); } \ - } while (0) - -#else /* ! ACE_NEW_THROWS_EXCEPTIONS */ - -# define ACEXML_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { POINTER = new CONSTRUCTOR; \ - if (POINTER == 0) { errno = ENOMEM; ACEXML_THROW_R_INT (EXCEPTION); } \ - } while (0) - -#endif /* ACE_NEW_THROWS_EXCEPTIONS */ - -# define ACEXML_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) ACEXML_THROW_R_INT (EXCEPTION); - -# define ACEXML_READ_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Read_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) ACEXML_THROW_R_INT (EXCEPTION); - -# define ACEXML_WRITE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ - ACE_Write_Guard< MUTEX > OBJ (LOCK); \ - if (OBJ.locked () == 0) ACEXML_THROW_R_INT (EXCEPTION); - -//@{ -/** - * @name Native C++ exceptions portability macros. - * - * The following macros are used to write code portable between platforms - * with and without native C++ exception support. Their main goal is to - * hide the presence of the ACEXML_ENV_TYPE argument, but they collaborate - * with the ACEXML_TRY_* macros to emulate the try/catch blocks. - */ - -/// Define a macro to emit code only when ACEXML_ENV_TYPE is used -#if !defined (ACE_USES_NATIVE_EXCEPTIONS) || defined (ACEXML_ENV_BKWD_COMPAT) -# define ACEXML_ENV_EMIT_CODE(X) X -#else -# define ACEXML_ENV_EMIT_CODE(X) -#endif /* ACE_USES_NATIVE_EXCEPTIONS && ! ACEXML_ENV_BKWD_COMPAT */ - -/// Another macro to emit code only when ACEXML_ENV_TYPE is used -#if !defined (ACE_USES_NATIVE_EXCEPTIONS) || defined (ACEXML_ENV_BKWD_COMPAT) -# define ACEXML_ENV_EMIT_CODE2(X,Y) X,Y -#else -# define ACEXML_ENV_EMIT_CODE2(X,Y) -#endif /* ACE_USES_NATIVE_EXCEPTIONS && ! ACEXML_ENV_BKWD_COMPAT */ - -/// Helper macro -#define ACEXML_ENV_EMIT_DUMMY - -/// Declare a ACEXML_ENV_TYPE argument as the last argument of a -/// function -/** - * Normally this macro is used as follows: - * - * <CODE>void my_funct (int x, int y ACEXML_ENV_ARG_DECL);</CODE> - * - * Its purpose is to provide developers (and users) with a mechanism to - * write code that is portable to platforms with and without native C++ - * exceptions. - */ -#define ACEXML_ENV_ARG_DECL \ - ACEXML_ENV_EMIT_CODE2(ACEXML_ENV_EMIT_DUMMY, \ - ACEXML_ENV_TYPE &ACEXML_TRY_ENV) - -/// Declare a ACEXML_ENV_TYPE argument that is not used by the -/// function definition. -/** - * Similar to ACEXML_ENV_ARG_DECL, but the formal parameter name is dropped to - * avoid warnings about unused parameters - */ -#define ACEXML_ENV_ARG_DECL_NOT_USED \ - ACEXML_ENV_EMIT_CODE2(ACEXML_ENV_EMIT_DUMMY, \ - ACEXML_ENV_TYPE &) - -/// Declare a ACEXML_ENV_TYPE argument for methods that do not take any other -/// parameters -#define ACEXML_ENV_SINGLE_ARG_DECL \ - ACEXML_ENV_EMIT_CODE(ACEXML_ENV_TYPE &ACEXML_TRY_ENV) - -/// Declare a ACEXML_ENV_TYPE argument for methods which don't use it. -#define ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED \ - ACEXML_ENV_EMIT_CODE(ACEXML_ENV_TYPE &) - -/// Use the ACEXML_ENV_TYPE argument in a nested call -#define ACEXML_ENV_ARG_PARAMETER \ - ACEXML_ENV_EMIT_CODE2(ACEXML_ENV_EMIT_DUMMY, \ - ACEXML_TRY_ENV) - -/// Use the ACEXML_ENV_TYPE argument in a nested call, assuming that the -/// called function takes only the ACEXML_TRY_ENV argument. -#define ACEXML_ENV_SINGLE_ARG_PARAMETER \ - ACEXML_ENV_EMIT_CODE(ACEXML_TRY_ENV) - -/// Eliminate unused argument warnings about ACEXML_TRY_ENV -#define ACEXML_ENV_ARG_NOT_USED \ - ACEXML_ENV_EMIT_CODE(ACE_UNUSED_ARG(ACEXML_TRY_ENV)) -//@} - -#if !defined (ACE_USES_NATIVE_EXCEPTIONS) -// This thing can be moved above when we drop ACEXML_ENV_BKWD_COMPAT. -# define ACEXML_ENV_RAISE(ex) ACEXML_TRY_ENV.exception (ex) -#else -# define ACEXML_ENV_RAISE(ex) (ex)->_raise () -#endif /* ACEXML_CORBA_HAS_EXCEPTIONS */ - -#include /**/ "ace/post.h" - -#endif /* _ACEXML_MACROS_H */ diff --git a/ACE/ACEXML/examples/SAXPrint/Print_Handler.cpp b/ACE/ACEXML/examples/SAXPrint/Print_Handler.cpp index 4bcf19e1b07..846eff84e21 100644 --- a/ACE/ACEXML/examples/SAXPrint/Print_Handler.cpp +++ b/ACE/ACEXML/examples/SAXPrint/Print_Handler.cpp @@ -18,7 +18,7 @@ ACEXML_Print_Handler::~ACEXML_Print_Handler (void) void ACEXML_Print_Handler::characters (const ACEXML_Char *cdata, size_t start, - size_t length ACEXML_ENV_ARG_DECL_NOT_USED) + size_t length) { @@ -28,7 +28,7 @@ ACEXML_Print_Handler::characters (const ACEXML_Char *cdata, } void -ACEXML_Print_Handler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) +ACEXML_Print_Handler::endDocument (void) { @@ -39,8 +39,7 @@ ACEXML_Print_Handler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) void ACEXML_Print_Handler::endElement (const ACEXML_Char *uri, const ACEXML_Char *name, - const ACEXML_Char *qName - ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *qName) { @@ -50,8 +49,7 @@ ACEXML_Print_Handler::endElement (const ACEXML_Char *uri, } void -ACEXML_Print_Handler::endPrefixMapping (const ACEXML_Char *prefix - ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Print_Handler::endPrefixMapping (const ACEXML_Char *prefix) { @@ -63,8 +61,7 @@ ACEXML_Print_Handler::endPrefixMapping (const ACEXML_Char *prefix void ACEXML_Print_Handler::ignorableWhitespace (const ACEXML_Char *, int, - int - ACEXML_ENV_ARG_DECL_NOT_USED) + int) { // ACE_DEBUG ((LM_DEBUG, // ACE_TEXT ("* Event ignorableWhitespace () ***************\n"))); @@ -72,8 +69,7 @@ ACEXML_Print_Handler::ignorableWhitespace (const ACEXML_Char *, void ACEXML_Print_Handler::processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data - ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *data) { @@ -91,8 +87,7 @@ ACEXML_Print_Handler::setDocumentLocator (ACEXML_Locator * locator) } void -ACEXML_Print_Handler::skippedEntity (const ACEXML_Char *name - ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Print_Handler::skippedEntity (const ACEXML_Char *name) { @@ -102,7 +97,7 @@ ACEXML_Print_Handler::skippedEntity (const ACEXML_Char *name } void -ACEXML_Print_Handler::startDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) +ACEXML_Print_Handler::startDocument (void) { @@ -114,8 +109,7 @@ void ACEXML_Print_Handler::startElement (const ACEXML_Char *uri, const ACEXML_Char *name, const ACEXML_Char *qName, - ACEXML_Attributes *alist - ACEXML_ENV_ARG_DECL_NOT_USED) + ACEXML_Attributes *alist) { @@ -134,7 +128,7 @@ ACEXML_Print_Handler::startElement (const ACEXML_Char *uri, void ACEXML_Print_Handler::startPrefixMapping (const ACEXML_Char * prefix, - const ACEXML_Char * uri ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char * uri) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("* Event startPrefixMapping () ***************\n"))); @@ -147,7 +141,7 @@ ACEXML_Print_Handler::startPrefixMapping (const ACEXML_Char * prefix, void ACEXML_Print_Handler::notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicID, - const ACEXML_Char *systemID ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *systemID) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("* Event notationDecl: (%s) "), @@ -171,7 +165,7 @@ void ACEXML_Print_Handler::unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicID, const ACEXML_Char *systemID, - const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *notationName) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("* Unparsed Entity: %s"), @@ -195,7 +189,7 @@ ACEXML_Print_Handler::unparsedEntityDecl (const ACEXML_Char *name, ACEXML_InputSource * ACEXML_Print_Handler::resolveEntity (const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. return 0; @@ -207,7 +201,7 @@ ACEXML_Print_Handler::resolveEntity (const ACEXML_Char *, * Receive notification of a recoverable error. */ void -ACEXML_Print_Handler::error (ACEXML_SAXParseException & ex ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Print_Handler::error (ACEXML_SAXParseException & ex) { ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), @@ -217,7 +211,7 @@ ACEXML_Print_Handler::error (ACEXML_SAXParseException & ex ACEXML_ENV_ARG_DECL_N } void -ACEXML_Print_Handler::fatalError (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Print_Handler::fatalError (ACEXML_SAXParseException& ex) { ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), @@ -228,7 +222,7 @@ ACEXML_Print_Handler::fatalError (ACEXML_SAXParseException& ex ACEXML_ENV_ARG_DE } void -ACEXML_Print_Handler::warning (ACEXML_SAXParseException & ex ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Print_Handler::warning (ACEXML_SAXParseException & ex) { ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), diff --git a/ACE/ACEXML/examples/SAXPrint/Print_Handler.h b/ACE/ACEXML/examples/SAXPrint/Print_Handler.h index c7beebc02b7..1de630c90c6 100644 --- a/ACE/ACEXML/examples/SAXPrint/Print_Handler.h +++ b/ACE/ACEXML/examples/SAXPrint/Print_Handler.h @@ -43,43 +43,37 @@ public: */ virtual void characters (const ACEXML_Char *ch, size_t start, - size_t length ACEXML_ENV_ARG_DECL) - ; + size_t length); /* * Receive notification of the end of a document. */ - virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL) - ; + virtual void endDocument (void); /* * Receive notification of the end of an element. */ virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *qName); /* * End the scope of a prefix-URI mapping. */ - virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL) - ; + virtual void endPrefixMapping (const ACEXML_Char *prefix); /* * Receive notification of ignorable whitespace in element content. */ virtual void ignorableWhitespace (const ACEXML_Char *ch, int start, - int length ACEXML_ENV_ARG_DECL) - ; + int length); /* * Receive notification of a processing instruction. */ virtual void processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *data); /* * Receive an object for locating the origin of SAX document events. @@ -89,14 +83,12 @@ public: /* * Receive notification of a skipped entity. */ - virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) - ; + virtual void skippedEntity (const ACEXML_Char *name); /* * Receive notification of the beginning of a document. */ - virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL) - ; + virtual void startDocument (void); /* * Receive notification of the beginning of an element. @@ -104,15 +96,13 @@ public: virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, - ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) - ; + ACEXML_Attributes *atts); /* * Begin the scope of a prefix-URI Namespace mapping. */ virtual void startPrefixMapping (const ACEXML_Char *prefix, - const ACEXML_Char *uri ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *uri); // *** Methods inherit from ACEXML_DTDHandler. @@ -121,8 +111,7 @@ public: */ virtual void notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *systemId); /* * Receive notification of an unparsed entity declaration event. @@ -130,8 +119,7 @@ public: virtual void unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, - const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *notationName); // Methods inherit from ACEXML_EnitityResolver. @@ -139,28 +127,24 @@ public: * Allow the application to resolve external entities. */ virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *systemId); // Methods inherit from ACEXML_ErrorHandler. /* * Receive notification of a recoverable error. */ - virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void error (ACEXML_SAXParseException &exception); /* * Receive notification of a non-recoverable error. */ - virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void fatalError (ACEXML_SAXParseException &exception); /* * Receive notification of a warning. */ - virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void warning (ACEXML_SAXParseException &exception); private: ACEXML_Char* fileName_; diff --git a/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.cpp b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.cpp index 90182166b17..db9514d527f 100644 --- a/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.cpp +++ b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.cpp @@ -22,8 +22,7 @@ ACEXML_SAXPrint_Handler::~ACEXML_SAXPrint_Handler (void) void ACEXML_SAXPrint_Handler::characters (const ACEXML_Char *cdata, size_t, - size_t - ACEXML_ENV_ARG_DECL_NOT_USED) + size_t) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%s"), @@ -31,7 +30,7 @@ ACEXML_SAXPrint_Handler::characters (const ACEXML_Char *cdata, } void -ACEXML_SAXPrint_Handler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) +ACEXML_SAXPrint_Handler::endDocument (void) { @@ -41,8 +40,7 @@ ACEXML_SAXPrint_Handler::endDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) void ACEXML_SAXPrint_Handler::endElement (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char *qName - ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *qName) { @@ -54,8 +52,7 @@ ACEXML_SAXPrint_Handler::endElement (const ACEXML_Char *, } void -ACEXML_SAXPrint_Handler::endPrefixMapping (const ACEXML_Char * - ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_SAXPrint_Handler::endPrefixMapping (const ACEXML_Char *) { // ACE_DEBUG ((LM_DEBUG, // ACE_TEXT ("* Event endPrefixMapping (%s) ***************\n"), @@ -65,7 +62,7 @@ ACEXML_SAXPrint_Handler::endPrefixMapping (const ACEXML_Char * void ACEXML_SAXPrint_Handler::ignorableWhitespace (const ACEXML_Char * cdata, int, - int ACEXML_ENV_ARG_DECL_NOT_USED) + int) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%s"), @@ -76,8 +73,7 @@ ACEXML_SAXPrint_Handler::ignorableWhitespace (const ACEXML_Char * cdata, void ACEXML_SAXPrint_Handler::processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data - ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *data) { @@ -96,8 +92,7 @@ ACEXML_SAXPrint_Handler::setDocumentLocator (ACEXML_Locator * locator) } void -ACEXML_SAXPrint_Handler::skippedEntity (const ACEXML_Char *name - ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_SAXPrint_Handler::skippedEntity (const ACEXML_Char *name) { @@ -107,7 +102,7 @@ ACEXML_SAXPrint_Handler::skippedEntity (const ACEXML_Char *name } void -ACEXML_SAXPrint_Handler::startDocument (ACEXML_ENV_SINGLE_ARG_DECL_NOT_USED) +ACEXML_SAXPrint_Handler::startDocument (void) { @@ -119,8 +114,7 @@ void ACEXML_SAXPrint_Handler::startElement (const ACEXML_Char *, const ACEXML_Char *, const ACEXML_Char *qName, - ACEXML_Attributes *alist - ACEXML_ENV_ARG_DECL_NOT_USED) + ACEXML_Attributes *alist) { @@ -141,7 +135,7 @@ ACEXML_SAXPrint_Handler::startElement (const ACEXML_Char *, void ACEXML_SAXPrint_Handler::startPrefixMapping (const ACEXML_Char * , - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // ACE_DEBUG ((LM_DEBUG, // ACE_TEXT ("* Event startPrefixMapping () ***************\n"))); @@ -155,7 +149,7 @@ ACEXML_SAXPrint_Handler::startPrefixMapping (const ACEXML_Char * , void ACEXML_SAXPrint_Handler::notationDecl (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -164,7 +158,7 @@ void ACEXML_SAXPrint_Handler::unparsedEntityDecl (const ACEXML_Char *, const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. } @@ -173,7 +167,7 @@ ACEXML_SAXPrint_Handler::unparsedEntityDecl (const ACEXML_Char *, ACEXML_InputSource * ACEXML_SAXPrint_Handler::resolveEntity (const ACEXML_Char *, - const ACEXML_Char * ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *) { // No-op. return 0; @@ -185,8 +179,7 @@ ACEXML_SAXPrint_Handler::resolveEntity (const ACEXML_Char *, * Receive notification of a recoverable error. */ void -ACEXML_SAXPrint_Handler::error (ACEXML_SAXParseException & ex - ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_SAXPrint_Handler::error (ACEXML_SAXParseException & ex) { ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), @@ -196,8 +189,7 @@ ACEXML_SAXPrint_Handler::error (ACEXML_SAXParseException & ex } void -ACEXML_SAXPrint_Handler::fatalError (ACEXML_SAXParseException & ex - ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_SAXPrint_Handler::fatalError (ACEXML_SAXParseException & ex) { ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), @@ -207,8 +199,7 @@ ACEXML_SAXPrint_Handler::fatalError (ACEXML_SAXParseException & ex } void -ACEXML_SAXPrint_Handler::warning (ACEXML_SAXParseException & ex - ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_SAXPrint_Handler::warning (ACEXML_SAXParseException & ex) { ACE_DEBUG ((LM_DEBUG, "%s: line: %d col: %d ", (this->locator_->getSystemId() == 0 ? this->fileName_ : this->locator_->getSystemId()), diff --git a/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.h b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.h index 1f7ba8381b4..88e7b8b1c1b 100644 --- a/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.h +++ b/ACE/ACEXML/examples/SAXPrint/SAXPrint_Handler.h @@ -43,14 +43,13 @@ public: */ virtual void characters (const ACEXML_Char *ch, size_t start, - size_t length - ACEXML_ENV_ARG_DECL) + size_t length) ; /* * Receive notification of the end of a document. */ - virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL) + virtual void endDocument (void) ; /* @@ -58,46 +57,40 @@ public: */ virtual void endElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *qName); /* * End the scope of a prefix-URI mapping. */ - virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL) - ; + virtual void endPrefixMapping (const ACEXML_Char *prefix); /* * Receive notification of ignorable whitespace in element content. */ virtual void ignorableWhitespace (const ACEXML_Char *ch, int start, - int length ACEXML_ENV_ARG_DECL) - ; + int length); /* * Receive notification of a processing instruction. */ virtual void processingInstruction (const ACEXML_Char *target, - const ACEXML_Char *data ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *data); /* * Receive an object for locating the origin of SAX document events. */ - virtual void setDocumentLocator (ACEXML_Locator *locator) ; + virtual void setDocumentLocator (ACEXML_Locator *locator); /* * Receive notification of a skipped entity. */ - virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) - ; + virtual void skippedEntity (const ACEXML_Char *name); /* * Receive notification of the beginning of a document. */ - virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL) - ; + virtual void startDocument (void); /* * Receive notification of the beginning of an element. @@ -105,15 +98,13 @@ public: virtual void startElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, - ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) - ; + ACEXML_Attributes *atts); /* * Begin the scope of a prefix-URI Namespace mapping. */ virtual void startPrefixMapping (const ACEXML_Char *prefix, - const ACEXML_Char *uri ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *uri); // *** Methods inherit from ACEXML_DTDHandler. @@ -122,8 +113,7 @@ public: */ virtual void notationDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *systemId); /* * Receive notification of an unparsed entity declaration event. @@ -131,8 +121,7 @@ public: virtual void unparsedEntityDecl (const ACEXML_Char *name, const ACEXML_Char *publicId, const ACEXML_Char *systemId, - const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *notationName); // Methods inherit from ACEXML_EnitityResolver. @@ -140,28 +129,24 @@ public: * Allow the application to resolve external entities. */ virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId, - const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *systemId); // Methods inherit from ACEXML_ErrorHandler. /* * Receive notification of a recoverable error. */ - virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void error (ACEXML_SAXParseException &exception); /* * Receive notification of a non-recoverable error. */ - virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void fatalError (ACEXML_SAXParseException &exception); /* * Receive notification of a warning. */ - virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) - ; + virtual void warning (ACEXML_SAXParseException &exception); void inc_indent (); void dec_indent (); diff --git a/ACE/ACEXML/examples/SAXPrint/main.cpp b/ACE/ACEXML/examples/SAXPrint/main.cpp index b43b1247c63..edd92ecea93 100644 --- a/ACE/ACEXML/examples/SAXPrint/main.cpp +++ b/ACE/ACEXML/examples/SAXPrint/main.cpp @@ -153,31 +153,26 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) parser.setDTDHandler (handler); parser.setErrorHandler (handler); parser.setEntityResolver (handler); - ACEXML_DECLARE_NEW_ENV; - ACEXML_TRY_EX (FIRST) + try { - parser.parse (&input ACEXML_ENV_ARG_PARAMETER); - ACEXML_TRY_CHECK_EX (FIRST); + parser.parse (&input); } - ACEXML_CATCH (ACEXML_Exception, ex) + catch (const ACEXML_Exception& ex) { ex.print(); ACE_DEBUG ((LM_ERROR, ACE_TEXT ("Exception occurred. Exiting...\n"))); } - ACEXML_ENDTRY; - ACEXML_TRY_EX (SECOND) + try { - parser.parse (&input ACEXML_ENV_ARG_PARAMETER); - ACEXML_TRY_CHECK_EX (SECOND); + parser.parse (&input); } - ACEXML_CATCH (ACEXML_SAXException, ex) + catch (const ACEXML_SAXException& ex) { ex.print(); ACE_DEBUG ((LM_ERROR, ACE_TEXT ("Exception occurred. Exiting...\n"))); return 1; } - ACEXML_ENDTRY; // ACEXML_TRY_EX (THIRD) // { // parser.parse (&input ACEXML_ENV_ARG_PARAMETER); diff --git a/ACE/ACEXML/parser/debug_validator/Debug_Attributes_Builder.cpp b/ACE/ACEXML/parser/debug_validator/Debug_Attributes_Builder.cpp index ccebd4b9098..2401a18f79c 100644 --- a/ACE/ACEXML/parser/debug_validator/Debug_Attributes_Builder.cpp +++ b/ACE/ACEXML/parser/debug_validator/Debug_Attributes_Builder.cpp @@ -36,8 +36,7 @@ ACEXML_Debug_Attribute_Builder::getName (void) } int -ACEXML_Debug_Attribute_Builder::setAttType (const ATT_TYPE type - ACEXML_ENV_ARG_DECL) +ACEXML_Debug_Attribute_Builder::setAttType (const ATT_TYPE type) { if (this->type_ == ERROR_TYPE) { @@ -49,8 +48,7 @@ ACEXML_Debug_Attribute_Builder::setAttType (const ATT_TYPE type } int -ACEXML_Debug_Attribute_Builder::insertList (const ACEXML_Char *n - ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Debug_Attribute_Builder::insertList (const ACEXML_Char *n) { ACEXML_String str (n, 0, 0); @@ -60,8 +58,7 @@ ACEXML_Debug_Attribute_Builder::insertList (const ACEXML_Char *n int ACEXML_Debug_Attribute_Builder::setDefault (const DEFAULT_DECL def, - const ACEXML_Char *value - ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *value) { this->default_decl_ = def; this->default_value_.set (value, 0); @@ -159,7 +156,7 @@ ACEXML_Debug_Attributes_Builder::~ACEXML_Debug_Attributes_Builder () int ACEXML_Debug_Attributes_Builder::setElement (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *qName) { this->element_name_.set (qName, 0); return 0; @@ -177,7 +174,8 @@ ACEXML_Debug_Attributes_Builder::getAttribute_Def_Builder () } int -ACEXML_Debug_Attributes_Builder::insertAttribute (ACEXML_Attribute_Def_Builder *def ACEXML_ENV_ARG_DECL) +ACEXML_Debug_Attributes_Builder::insertAttribute ( + ACEXML_Attribute_Def_Builder *def) { ACEXML_Attribute_Def_Builder::VAR ptr (def); diff --git a/ACE/ACEXML/parser/debug_validator/Debug_Attributes_Builder.h b/ACE/ACEXML/parser/debug_validator/Debug_Attributes_Builder.h index e22b6ef936a..c7ddf073eb1 100644 --- a/ACE/ACEXML/parser/debug_validator/Debug_Attributes_Builder.h +++ b/ACE/ACEXML/parser/debug_validator/Debug_Attributes_Builder.h @@ -50,19 +50,17 @@ public: /** * Set the attribute type. */ - virtual int setAttType (const ATT_TYPE type ACEXML_ENV_ARG_DECL); + virtual int setAttType (const ATT_TYPE type); /** * Insert an element for NOTATION or ENUMERATION type attribute. */ - virtual int insertList (const ACEXML_Char *Name ACEXML_ENV_ARG_DECL); + virtual int insertList (const ACEXML_Char *Name); /** * Set default attribute declaration. */ - virtual int setDefault (const DEFAULT_DECL def, - const ACEXML_Char *value ACEXML_ENV_ARG_DECL) - ; + virtual int setDefault (const DEFAULT_DECL def, const ACEXML_Char *value); /** * Check validity of the current attribute definition being built. diff --git a/ACE/ACEXML/parser/debug_validator/Debug_DTD_Manager.cpp b/ACE/ACEXML/parser/debug_validator/Debug_DTD_Manager.cpp index d0745d13bfc..22794dd6112 100644 --- a/ACE/ACEXML/parser/debug_validator/Debug_DTD_Manager.cpp +++ b/ACE/ACEXML/parser/debug_validator/Debug_DTD_Manager.cpp @@ -22,7 +22,7 @@ ACEXML_Debug_DTD_Manager::getElement_Def_Builder () } int -ACEXML_Debug_DTD_Manager::insertElement_Definition (ACEXML_Element_Def_Builder *def ACEXML_ENV_ARG_DECL) +ACEXML_Debug_DTD_Manager::insertElement_Definition (ACEXML_Element_Def_Builder *def) { ACEXML_Element_Def_Builder::VAR ptr (def); @@ -46,7 +46,7 @@ ACEXML_Debug_DTD_Manager::getAttribute_Def_Builder () } int -ACEXML_Debug_DTD_Manager::insertAttributes_Definition (ACEXML_Attributes_Def_Builder *def ACEXML_ENV_ARG_DECL) +ACEXML_Debug_DTD_Manager::insertAttributes_Definition (ACEXML_Attributes_Def_Builder *def) { ACEXML_Attributes_Def_Builder::VAR ptr (def); if (def != 0) @@ -59,13 +59,9 @@ ACEXML_Debug_DTD_Manager::insertAttributes_Definition (ACEXML_Attributes_Def_Bui } ACEXML_Validator * -ACEXML_Debug_DTD_Manager::getValidator (const ACEXML_Char *namespaceURI, - const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) +ACEXML_Debug_DTD_Manager::getValidator (const ACEXML_Char *, + const ACEXML_Char *, + const ACEXML_Char *) { - ACE_UNUSED_ARG (namespaceURI); - ACE_UNUSED_ARG (localName); - ACE_UNUSED_ARG (qName); - ACEXML_THROW_RETURN (ACEXML_SAXNotSupportedException (ACE_TEXT ("getValidator()")), 0); } diff --git a/ACE/ACEXML/parser/debug_validator/Debug_DTD_Manager.h b/ACE/ACEXML/parser/debug_validator/Debug_DTD_Manager.h index 0849d95ecb2..dbcbb1d0c5c 100644 --- a/ACE/ACEXML/parser/debug_validator/Debug_DTD_Manager.h +++ b/ACE/ACEXML/parser/debug_validator/Debug_DTD_Manager.h @@ -44,7 +44,7 @@ public: * * @retval 0 if success, -1 if error. */ - virtual int insertElement_Definition (ACEXML_Element_Def_Builder *def ACEXML_ENV_ARG_DECL); + virtual int insertElement_Definition (ACEXML_Element_Def_Builder *def); /** * Acquire a pointer to an attributes definition builder. @@ -57,7 +57,7 @@ public: * * @retval 0 if success, -1 otherwise. */ - virtual int insertAttributes_Definition (ACEXML_Attributes_Def_Builder *def ACEXML_ENV_ARG_DECL); + virtual int insertAttributes_Definition (ACEXML_Attributes_Def_Builder *def); /** * Acquire an element validator to validate an XML element. @@ -67,7 +67,7 @@ public: */ virtual ACEXML_Validator *getValidator (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL); + const ACEXML_Char *qName); }; #include /**/ "ace/post.h" diff --git a/ACE/ACEXML/parser/debug_validator/Debug_Element_Builder.cpp b/ACE/ACEXML/parser/debug_validator/Debug_Element_Builder.cpp index da422a3429f..6890a9626c2 100644 --- a/ACE/ACEXML/parser/debug_validator/Debug_Element_Builder.cpp +++ b/ACE/ACEXML/parser/debug_validator/Debug_Element_Builder.cpp @@ -17,14 +17,14 @@ ACEXML_Debug_Element_Builder::~ACEXML_Debug_Element_Builder () int ACEXML_Debug_Element_Builder::setElementName (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *qName) { this->element_.set (qName, 0); return 0; } int -ACEXML_Debug_Element_Builder::setContentType (CONTENT_TYPE type ACEXML_ENV_ARG_DECL) +ACEXML_Debug_Element_Builder::setContentType (CONTENT_TYPE type) { if (this->type_ == UNDEFINED) { @@ -38,9 +38,9 @@ ACEXML_Debug_Element_Builder::setContentType (CONTENT_TYPE type ACEXML_ENV_ARG_D int ACEXML_Debug_Element_Builder::insertMixedElement (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *qName) { - ACEXML_Element_Tree_Name_Node *node; + ACEXML_Element_Tree_Name_Node *node = 0; // @@ We should "throw" an exception here instead of returning -1. ACE_NEW_RETURN (node, @@ -60,7 +60,7 @@ ACEXML_Debug_Element_Builder::insertMixedElement (const ACEXML_Char *, int ACEXML_Debug_Element_Builder::startChildGroup () { - ACEXML_Element_Tree_List_Node *lnode; + ACEXML_Element_Tree_List_Node *lnode = 0; ACE_NEW_RETURN (lnode, ACEXML_Element_Tree_List_Node (), @@ -81,7 +81,7 @@ ACEXML_Debug_Element_Builder::startChildGroup () } int -ACEXML_Debug_Element_Builder::endChildGroup (CARDINALITY ACEXML_ENV_ARG_DECL_NOT_USED) +ACEXML_Debug_Element_Builder::endChildGroup (CARDINALITY ) { this->active_list_.pop (); return 0; @@ -104,9 +104,9 @@ ACEXML_Debug_Element_Builder::setSequence () int ACEXML_Debug_Element_Builder::insertElement (const ACEXML_Char *, const ACEXML_Char *, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL_NOT_USED) + const ACEXML_Char *qName) { - ACEXML_Element_Tree_Name_Node *node; + ACEXML_Element_Tree_Name_Node *node = 0; // @@ We should "throw" an exception here instead of returning -1. ACE_NEW_RETURN (node, diff --git a/ACE/ACEXML/parser/debug_validator/Debug_Element_Builder.h b/ACE/ACEXML/parser/debug_validator/Debug_Element_Builder.h index dc1f7765441..d892408fe4f 100644 --- a/ACE/ACEXML/parser/debug_validator/Debug_Element_Builder.h +++ b/ACE/ACEXML/parser/debug_validator/Debug_Element_Builder.h @@ -44,24 +44,21 @@ public: */ virtual int setElementName (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *qName); /** * Define the content type of the element. * * @retval 0 if valid, -1 otherwise. */ - virtual int setContentType (CONTENT_TYPE type ACEXML_ENV_ARG_DECL) - ; + virtual int setContentType (CONTENT_TYPE type); /** * Insert one more element into Mixed definition. */ virtual int insertMixedElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) - ; + const ACEXML_Char *qName); /** * Start a new group of children. @@ -73,7 +70,7 @@ public: * * @retval 0 on success. */ - virtual int endChildGroup (CARDINALITY card ACEXML_ENV_ARG_DECL); + virtual int endChildGroup (CARDINALITY card); /** * Set the type of current child group to Choice. @@ -100,7 +97,7 @@ public: */ virtual int insertElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, - const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) + const ACEXML_Char *qName) ; /** diff --git a/ACE/ACEXML/parser/parser/Parser.cpp b/ACE/ACEXML/parser/parser/Parser.cpp index bd22df23716..e86d2bde39f 100644 --- a/ACE/ACEXML/parser/parser/Parser.cpp +++ b/ACE/ACEXML/parser/parser/Parser.cpp @@ -84,42 +84,33 @@ ACEXML_Parser::initialize(ACEXML_InputSource* input) } void -ACEXML_Parser::parse (const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) +ACEXML_Parser::parse (const ACEXML_Char *systemId) { ACEXML_InputSource* input = 0; ACE_NEW (input, ACEXML_InputSource (systemId)); - this->parse (input ACEXML_ENV_ARG_PARAMETER); + this->parse (input); } void -ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) +ACEXML_Parser::parse (ACEXML_InputSource *input) { if (input == 0) { - this->fatal_error(ACE_TEXT ("Invalid input source") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error(ACE_TEXT ("Invalid input source")); } if (this->content_handler_ == 0) { - this->fatal_error (ACE_TEXT ("No content handlers defined. Exiting..") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error (ACE_TEXT ("No content handlers defined. Exiting..")); } if (this->validate_ && this->dtd_handler_ == 0) { - this->fatal_error (ACE_TEXT ("No DTD handlers defined. Exiting..") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error (ACE_TEXT ("No DTD handlers defined. Exiting..")); } - if (this->initialize(input) == -1) { - this->fatal_error (ACE_TEXT ("Failed to initialize parser state") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error (ACE_TEXT ("Failed to initialize parser state")); } // Set up Locator. this->content_handler_->setDocumentLocator (this->current_->getLocator()); @@ -132,8 +123,7 @@ ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) fwd = this->peek(); if (fwd == 'x' && !xmldecl_defined) { - this->parse_xml_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK; + this->parse_xml_decl (); xmldecl_defined = 1; } } @@ -141,12 +131,9 @@ ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) if (this->validate_ && !xmldecl_defined) { this->fatal_error (ACE_TEXT ("Expecting an XMLDecl at the beginning of") - ACE_TEXT (" a valid document") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + ACE_TEXT (" a valid document")); } - this->content_handler_->startDocument (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK; + this->content_handler_->startDocument (); int doctype_defined = 0; for (int prolog_done = 0; prolog_done == 0; ) @@ -158,9 +145,7 @@ ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) if (this->skip_whitespace () != '<') { this->fatal_error (ACE_TEXT ("Expecting '<' at the beginning of ") - ACE_TEXT ("Misc section") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + ACE_TEXT ("Misc section")); } fwd = this->peek(); } @@ -168,8 +153,7 @@ ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) { case '?': this->get(); - this->parse_processing_instruction (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK; + this->parse_processing_instruction (); xmldecl_defined = 1; break; case '!': @@ -178,8 +162,7 @@ ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) if (fwd == 'D' && !doctype_defined) // DOCTYPE { // This will also take care of the trailing MISC block if any. - this->parse_doctypedecl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK; + this->parse_doctypedecl (); doctype_defined = 1; // Now that we have a DOCTYPE Decl defined, we shouldn't // accept XML Decl any longer @@ -187,25 +170,19 @@ ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) } else if (fwd == 'D') { - this->fatal_error (ACE_TEXT ("Duplicate DOCTYPE declaration") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error (ACE_TEXT ("Duplicate DOCTYPE declaration")); } else if (fwd == '-') // COMMENT { if (this->parse_comment () < 0) { - this->fatal_error(ACE_TEXT ("Invalid comment in document") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error(ACE_TEXT ("Invalid comment in document")); } xmldecl_defined = 1; } break; case 0: - this->fatal_error (ACE_TEXT ("Unexpected end-of-file") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error (ACE_TEXT ("Unexpected end-of-file")); default: // Root element begins prolog_done = 1; break; @@ -214,17 +191,13 @@ ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) if (this->validate_ && !doctype_defined) { - this->warning (ACE_TEXT ("No doctypeDecl in valid document") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->warning (ACE_TEXT ("No doctypeDecl in valid document")); } // Now parse root element. - this->parse_element (1 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->parse_element (1); - this->content_handler_->endDocument (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK; + this->content_handler_->endDocument (); // Reset the parser state this->reset(); @@ -232,29 +205,24 @@ ACEXML_Parser::parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL) } int -ACEXML_Parser::parse_doctypedecl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_doctypedecl (void) { if (this->parse_token (ACE_TEXT ("DOCTYPE")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword DOCTYPE in a doctypedecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword DOCTYPE in a doctypedecl")); } ACEXML_Char nextch = 0; if (this->skip_whitespace_count (&nextch) == 0) { this->fatal_error(ACE_TEXT ("Expecting a space between DOCTYPE keyword ") - ACE_TEXT ("and name") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("and name")); } this->doctype_ = this->parse_name (); if (this->doctype_ == 0) { - this->fatal_error(ACE_TEXT ("Invalid DOCTYPE name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid DOCTYPE name")); } int count = this->skip_whitespace_count (&nextch); @@ -263,13 +231,10 @@ ACEXML_Parser::parse_doctypedecl (ACEXML_ENV_SINGLE_ARG_DECL) if (count == 0) { this->fatal_error(ACE_TEXT ("Expecting a space between DOCTYPE") - ACE_TEXT ("keyword and name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("keyword and name")); } this->external_dtd_ = 1; - this->parse_external_dtd (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_external_dtd (); } nextch = this->skip_whitespace (); @@ -277,37 +242,30 @@ ACEXML_Parser::parse_doctypedecl (ACEXML_ENV_SINGLE_ARG_DECL) { case '[': this->internal_dtd_ = 1; // Internal DTD definition - this->parse_internal_dtd (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_internal_dtd (); break; case '>': // End of DTD definition // This is an XML document without a doctypedecl. if (this->validate_ && !this->external_dtd_) { - this->fatal_error (ACE_TEXT ("No DTD defined") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("No DTD defined")); } return 0; case '0': - this->fatal_error (ACE_TEXT ("Unexpected end-of-file") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Unexpected end-of-file")); default: break; } if (this->skip_whitespace() != '>') { - this->fatal_error(ACE_TEXT ("Expecting '>' at end of doctypedecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting '>' at end of doctypedecl")); } return 0; } int -ACEXML_Parser::parse_internal_dtd (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_internal_dtd (void) { this->ref_state_ = ACEXML_ParserInt::IN_INT_DTD; ACEXML_Char nextch = this->skip_whitespace (); @@ -319,40 +277,30 @@ ACEXML_Parser::parse_internal_dtd (ACEXML_ENV_SINGLE_ARG_DECL) switch (nextch) { case '!': - this->parse_markup_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_markup_decl (); break; case '?': - this->parse_processing_instruction (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_processing_instruction (); break; default: - this->fatal_error (ACE_TEXT ("Invalid internal subset") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid internal subset")); break; } break; case '%': this->has_pe_refs_ = 1; - this->parse_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_PE_reference (); break; case ']': // End of internal definitions. return 0; case '&': - this->fatal_error (ACE_TEXT ("Invalid Reference in internal DTD") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid Reference in internal DTD")); break; case 0: - this->pop_context (0 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->pop_context (0); break; default: - this->fatal_error (ACE_TEXT ("Invalid content in internal subset") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid content in internal subset")); }; nextch = this->skip_whitespace (); } while (1); @@ -361,17 +309,14 @@ ACEXML_Parser::parse_internal_dtd (ACEXML_ENV_SINGLE_ARG_DECL) } int -ACEXML_Parser::parse_external_dtd (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_external_dtd (void) { this->ref_state_ = ACEXML_ParserInt::IN_EXT_DTD; ACEXML_Char* publicId = 0; ACEXML_Char* systemId = 0; - if (this->parse_external_id (publicId, systemId - ACEXML_ENV_ARG_PARAMETER) != 0) + if (this->parse_external_id (publicId, systemId) != 0) { - this->fatal_error (ACE_TEXT ("Error in parsing ExternalID") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Error in parsing ExternalID")); } if (this->validate_) { @@ -381,9 +326,7 @@ ACEXML_Parser::parse_external_dtd (ACEXML_ENV_SINGLE_ARG_DECL) if (this->entity_resolver_) { ip = this->entity_resolver_->resolveEntity (publicId, - (uri ? uri : systemId) - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + (uri ? uri : systemId)); } if (ip) { @@ -396,22 +339,19 @@ ACEXML_Parser::parse_external_dtd (ACEXML_ENV_SINGLE_ARG_DECL) ACEXML_CharStream* cstream = factory.create_stream (uri ? uri: systemId); if (!cstream) { - this->fatal_error (ACE_TEXT ("Invalid input source") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid input source")); } if (this->switch_input (cstream, systemId, publicId) != 0) return -1; } - this->parse_external_subset (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_external_subset (); } return 0; } int -ACEXML_Parser::parse_external_subset (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_external_subset (void) { this->ref_state_ = ACEXML_ParserInt::IN_EXT_DTD; this->external_subset_ = 1; @@ -427,60 +367,49 @@ ACEXML_Parser::parse_external_subset (ACEXML_ENV_SINGLE_ARG_DECL) case '!': nextch = this->peek(); if (nextch == '[') - this->parse_conditional_section (ACEXML_ENV_SINGLE_ARG_PARAMETER); + this->parse_conditional_section (); else - this->parse_markup_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_markup_decl (); break; case '?': nextch = this->peek(); if (nextch == 'x') - this->parse_text_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); + this->parse_text_decl (); else - this->parse_processing_instruction (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_processing_instruction (); break; default: - this->fatal_error (ACE_TEXT ("Invalid content in external DTD") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid content in external DTD")); } break; case '%': - this->parse_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_PE_reference (); break; case 0: - nrelems = this->pop_context (0 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + nrelems = this->pop_context (0); if (nrelems == 1) return 0; break; default: - this->fatal_error (ACE_TEXT ("Invalid content in external DTD") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid content in external DTD")); } nextch = this->skip_whitespace(); } while (1); } int -ACEXML_Parser::parse_conditional_section (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_conditional_section (void) { ACEXML_Char ch = this->get (); int include = 0; if (ch != '[') { - this->fatal_error(ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Internal Parser Error")); } ch = this->skip_whitespace(); if (ch == '%') { - this->parse_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_PE_reference (); ch = this->skip_whitespace(); } if (ch == 'I') @@ -492,9 +421,7 @@ ACEXML_Parser::parse_conditional_section (ACEXML_ENV_SINGLE_ARG_DECL) if (this->parse_token (ACE_TEXT ("CLUDE")) < 0) { this->fatal_error (ACE_TEXT ("Expecting keyword INCLUDE in ") - ACE_TEXT ("conditionalSect") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("conditionalSect")); } include = 1; break; @@ -502,48 +429,38 @@ ACEXML_Parser::parse_conditional_section (ACEXML_ENV_SINGLE_ARG_DECL) if (this->parse_token (ACE_TEXT ("GNORE")) < 0) { this->fatal_error (ACE_TEXT ("Expecting keyword IGNORE in ") - ACE_TEXT ("conditionalSect") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("conditionalSect")); } include = 0; break; default: - this->fatal_error (ACE_TEXT ("Invalid conditionalSect") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid conditionalSect")); } ACEXML_Char fwd = '\xFF'; this->skip_whitespace_count (&fwd); if (fwd == 0) { this->get(); // Consume the 0 - this->pop_context (0 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->pop_context (0); } } else { - this->fatal_error (ACE_TEXT ("Invalid conditionalSect") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid conditionalSect")); } if (this->skip_whitespace() != '[') { - this->fatal_error (ACE_TEXT ("Expecting '[' in conditionalSect") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Expecting '[' in conditionalSect")); } if (include) - this->parse_includesect (ACEXML_ENV_SINGLE_ARG_PARAMETER); + this->parse_includesect (); else - this->parse_ignoresect (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_ignoresect (); return 0; } int -ACEXML_Parser::parse_ignoresect (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_ignoresect (void) { ACEXML_Char nextch = this->skip_whitespace(); int count = 0; @@ -558,7 +475,7 @@ ACEXML_Parser::parse_ignoresect (ACEXML_ENV_SINGLE_ARG_DECL) if (this->peek() == '[') { this->get(); - count++; + ++count; } } break; @@ -582,9 +499,7 @@ ACEXML_Parser::parse_ignoresect (ACEXML_ENV_SINGLE_ARG_DECL) if (count != 0) { this->fatal_error (ACE_TEXT ("Invalid Conditional Section/PE ") - ACE_TEXT ("Nesting ") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("Nesting ")); } default: break; @@ -598,7 +513,7 @@ ACEXML_Parser::parse_ignoresect (ACEXML_ENV_SINGLE_ARG_DECL) } int -ACEXML_Parser::parse_includesect (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_includesect (void) { ACEXML_Char nextch = this->skip_whitespace(); do { @@ -611,31 +526,24 @@ ACEXML_Parser::parse_includesect (ACEXML_ENV_SINGLE_ARG_DECL) case '!': nextch = this->peek(); if (nextch == '[') - this->parse_conditional_section (ACEXML_ENV_SINGLE_ARG_PARAMETER); + this->parse_conditional_section (); else - this->parse_markup_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_markup_decl (); break; case '?': nextch = this->peek(); - this->parse_processing_instruction (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_processing_instruction (); break; default: - this->fatal_error (ACE_TEXT ("Invalid includeSect") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid includeSect")); } break; case '%': - this->parse_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_PE_reference (); break; case 0: // [VC: Proper Conditional Section/PE Nesting] this->fatal_error (ACE_TEXT ("Invalid Conditional Section/PE ") - ACE_TEXT ("Nesting ") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("Nesting ")); case ']': if (this->peek() == ']') { @@ -647,16 +555,14 @@ ACEXML_Parser::parse_includesect (ACEXML_ENV_SINGLE_ARG_DECL) } } default: - this->fatal_error (ACE_TEXT ("Invalid includeSect") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid includeSect")); } nextch = this->skip_whitespace(); } while (1); } int -ACEXML_Parser::parse_markup_decl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_markup_decl (void) { ACEXML_Char nextch = this->peek (); switch (nextch) @@ -667,54 +573,41 @@ ACEXML_Parser::parse_markup_decl (ACEXML_ENV_SINGLE_ARG_DECL) switch (nextch) { case 'L': - this->parse_element_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_element_decl (); break; case 'N': - this->parse_entity_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_entity_decl (); break; default: - this->fatal_error(ACE_TEXT ("Expecting keyword ELEMENT/ENTITY") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword ELEMENT/ENTITY")); } break; case 'A': // An ATTLIST decl - this->parse_attlist_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_attlist_decl (); break; case 'N': // A NOTATION decl - this->parse_notation_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_notation_decl (); break; case '-': // a comment. if (this->parse_comment () < 0) { - this->fatal_error(ACE_TEXT ("Invalid comment") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid comment")); } break; case 0: // [VC: Proper Declaration/PE Nesting] - this->fatal_error (ACE_TEXT ("Unexpected end-of-file") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Unexpected end-of-file")); default: - this->fatal_error (ACE_TEXT ("Invalid markupDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid markupDecl")); } return 0; } int ACEXML_Parser::parse_external_id (ACEXML_Char *&publicId, - ACEXML_Char *&systemId - ACEXML_ENV_ARG_DECL) + ACEXML_Char *&systemId) { publicId = systemId = 0; ACEXML_Char nextch = this->get (); @@ -725,53 +618,39 @@ ACEXML_Parser::parse_external_id (ACEXML_Char *&publicId, if (this->parse_token (ACE_TEXT ("YSTEM")) < 0 || this->skip_whitespace_count () < 1) { - this->fatal_error(ACE_TEXT ("Expecting keyword SYSTEM") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword SYSTEM")); } if (this->parse_system_literal (systemId) != 0) { - this->fatal_error(ACE_TEXT ("Invalid systemLiteral") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid systemLiteral")); } break; case 'P': // External PUBLIC id or previously defined PUBLIC id. if (this->parse_token (ACE_TEXT ("UBLIC")) < 0 || this->skip_whitespace_count () < 1) { - this->fatal_error(ACE_TEXT ("Expecing keyword PUBLIC") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword PUBLIC")); } if (this->parse_pubid_literal (publicId) != 0) { - this->fatal_error(ACE_TEXT ("Invalid PubidLiteral") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid PubidLiteral")); } this->skip_whitespace_count(&fwd); if (fwd == '\'' || fwd == '"') { if (this->parse_system_literal (systemId) != 0) { - this->fatal_error(ACE_TEXT ("Invalid systemLiteral") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid systemLiteral")); } } else if (this->ref_state_ != ACEXML_ParserInt::IN_NOTATION) { this->fatal_error(ACE_TEXT ("Expecting systemLiteral after a ") - ACE_TEXT ("PUBLIC keyword") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("PUBLIC keyword")); } break; default: - this->fatal_error(ACE_TEXT ("Invalid system/public Literal") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid system/public Literal")); } return 0; } @@ -820,21 +699,19 @@ ACEXML_Parser::normalize_systemid (const ACEXML_Char* systemId) } void -ACEXML_Parser::parse_element (int is_root ACEXML_ENV_ARG_DECL) +ACEXML_Parser::parse_element (int is_root) { // Parse STag. const ACEXML_Char *startname = this->parse_name (); if (startname == 0) { - this->fatal_error (ACE_TEXT ("Unexpected end-of-file") - ACEXML_ENV_ARG_PARAMETER); + this->fatal_error (ACE_TEXT ("Unexpected end-of-file")); return; } if (is_root && this->doctype_ != 0 && ACE_OS::strcmp (startname, this->doctype_) != 0) { - this->fatal_error (ACE_TEXT ("Root element different from DOCTYPE") - ACEXML_ENV_ARG_PARAMETER); + this->fatal_error (ACE_TEXT ("Root element different from DOCTYPE")); return ; } ACEXML_AttributesImpl attributes; @@ -851,34 +728,24 @@ ACEXML_Parser::parse_element (int is_root ACEXML_ENV_ARG_DECL) switch (ch) { case 0: - this->fatal_error(ACE_TEXT ("Internal Parser error") - ACEXML_ENV_ARG_PARAMETER); + this->fatal_error(ACE_TEXT ("Internal Parser error")); return; case '/': if (this->get () != '>') { this->fatal_error(ACE_TEXT ("Expecting '>' at end of element ") - ACE_TEXT ("definition") - ACEXML_ENV_ARG_PARAMETER); + ACE_TEXT ("definition")); return; } this->xml_namespace_.processName(startname, ns_uri, ns_lname, 0); this->prefix_mapping (this->xml_namespace_.getPrefix(ns_uri), - ns_uri, 1 - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + ns_uri, 1); this->content_handler_->startElement(ns_uri, ns_lname, - startname, &attributes - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; - this->content_handler_->endElement (ns_uri, ns_lname, startname - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + startname, &attributes); + this->content_handler_->endElement (ns_uri, ns_lname, startname); this->prefix_mapping (this->xml_namespace_.getPrefix(ns_uri), - ns_uri, 0 - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + ns_uri, 0); if (ns_flag) { this->xml_namespace_.popContext (); @@ -889,13 +756,9 @@ ACEXML_Parser::parse_element (int is_root ACEXML_ENV_ARG_DECL) this->xml_namespace_.processName (startname, ns_uri, ns_lname, 0); this->prefix_mapping (this->xml_namespace_.getPrefix(ns_uri), - ns_uri, 1 - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + ns_uri, 1); this->content_handler_->startElement(ns_uri, ns_lname, startname, - &attributes - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + &attributes); start_element_done = 1; break; default: @@ -904,10 +767,9 @@ ACEXML_Parser::parse_element (int is_root ACEXML_ENV_ARG_DECL) if (attname == 0 || this->skip_equal () != 0 || - this->parse_attvalue (attvalue ACEXML_ENV_ARG_PARAMETER) != 0) + this->parse_attvalue (attvalue) != 0) { - this->fatal_error(ACE_TEXT ("Error reading attribute value") - ACEXML_ENV_ARG_PARAMETER); + this->fatal_error(ACE_TEXT ("Error reading attribute value")); return; } @@ -931,8 +793,7 @@ ACEXML_Parser::parse_element (int is_root ACEXML_ENV_ARG_DECL) attvalue) == -1) { this->fatal_error(ACE_TEXT ("Duplicate definition of ") - ACE_TEXT ("prefix") - ACEXML_ENV_ARG_PARAMETER); + ACE_TEXT ("prefix")); return; } } @@ -948,8 +809,7 @@ ACEXML_Parser::parse_element (int is_root ACEXML_ENV_ARG_DECL) this->fatal_error(ACE_TEXT ("Duplicate attribute ") ACE_TEXT ("definition. Hint: Try ") ACE_TEXT ("setting namespace_prefix") - ACE_TEXT ("es feature to 0") - ACEXML_ENV_ARG_PARAMETER); + ACE_TEXT ("es feature to 0")); return; } } @@ -957,8 +817,7 @@ ACEXML_Parser::parse_element (int is_root ACEXML_ENV_ARG_DECL) { this->fatal_error(ACE_TEXT ("One of namespaces or ") ACE_TEXT ("namespace_prefixes should be") - ACE_TEXT (" declared") - ACEXML_ENV_ARG_PARAMETER); + ACE_TEXT (" declared")); return; } } @@ -971,23 +830,21 @@ ACEXML_Parser::parse_element (int is_root ACEXML_ENV_ARG_DECL) attvalue) == -1) { this->fatal_error(ACE_TEXT ("Duplicate attribute ") - ACE_TEXT ("definition") - ACEXML_ENV_ARG_PARAMETER); + ACE_TEXT ("definition")); return; } } break; } } - if (this->parse_content (startname, ns_uri, ns_lname, ns_flag - ACEXML_ENV_ARG_PARAMETER) != 0) + if (this->parse_content (startname, ns_uri, ns_lname, ns_flag) != 0) return; } int ACEXML_Parser::parse_content (const ACEXML_Char* startname, const ACEXML_Char*& ns_uri, - const ACEXML_Char*& ns_lname, int ns_flag ACEXML_ENV_ARG_DECL) + const ACEXML_Char*& ns_lname, int ns_flag) { ACEXML_Char *cdata; size_t cdata_length = 0; @@ -999,17 +856,14 @@ ACEXML_Parser::parse_content (const ACEXML_Char* startname, switch (ch) { case 0: - this->pop_context (1 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->pop_context (1); break; case '<': // Push out old 'characters' event. if (cdata_length != 0) { cdata = this->obstack_.freeze (); - this->content_handler_->characters (cdata, 0, cdata_length - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->content_handler_->characters (cdata, 0, cdata_length); this->obstack_.unwind (cdata); cdata_length = 0; } @@ -1024,29 +878,22 @@ ACEXML_Parser::parse_content (const ACEXML_Char* startname, if (this->parse_comment () < 0) { this->fatal_error(ACE_TEXT ("Invalid comment in ") - ACE_TEXT ("document") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("document")); } } else if (ch == '[') // a CDATA section. { - this->parse_cdata (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_cdata (); } else { this->fatal_error(ACE_TEXT ("Expecting a CDATA section ") - ACE_TEXT ("or a comment section") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("or a comment section")); } break; case '?': // a PI. this->get(); // consume the '?' - this->parse_processing_instruction - (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_processing_instruction (); break; case '/': // an ETag. { @@ -1056,38 +903,30 @@ ACEXML_Parser::parse_content (const ACEXML_Char* startname, ACE_OS::strcmp (startname, endname) != 0) { this->fatal_error(ACE_TEXT ("Name in ETag doesn't ") - ACE_TEXT ("match name in STag") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("match name in STag")); } if (this->skip_whitespace () != '>') { this->fatal_error(ACE_TEXT ("Expecting '>' at end ") - ACE_TEXT ("of element") - ACEXML_ENV_ARG_PARAMETER); + ACE_TEXT ("of element")); return -1; } this->content_handler_->endElement (ns_uri, ns_lname, - endname - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + endname); this->prefix_mapping (this->xml_namespace_.getPrefix(ns_uri), - ns_uri, 0 - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ns_uri, 0); if (this->namespaces_ && ns_flag) { - if (this->nested_namespace_ >= 1) - { - this->xml_namespace_.popContext (); - this->nested_namespace_--; - } + if (this->nested_namespace_ >= 1) + { + this->xml_namespace_.popContext (); + this->nested_namespace_--; + } } return 0; } default: // a new nested element? - this->parse_element (0 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_element (0); break; } break; @@ -1102,9 +941,7 @@ ACEXML_Parser::parse_content (const ACEXML_Char* startname, if (this->parse_char_reference (buf, len) != 0) { // [WFC: Legal Character] - this->fatal_error (ACE_TEXT ("Invalid CharRef") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid CharRef")); } } while (buf[0] == '&' && this->peek() == '#'); for (size_t j = 0; j < len; ++j) @@ -1114,10 +951,9 @@ ACEXML_Parser::parse_content (const ACEXML_Char* startname, else { this->ref_state_ = ACEXML_ParserInt::IN_CONTENT; - int length = this->parse_entity_reference(ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + int const length = this->parse_entity_reference(); if (length == 1) - cdata_length++; + ++cdata_length; } break; case '\x20': case '\x0D': case '\x0A': case '\x09': @@ -1167,14 +1003,12 @@ ACEXML_Parser::parse_content (const ACEXML_Char* startname, int -ACEXML_Parser::parse_cdata (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_cdata (void) { if (this->parse_token (ACE_TEXT ("[CDATA[")) < 0) { this->fatal_error(ACE_TEXT ("Expecting '[CDATA[' at beginning of CDATA ") - ACE_TEXT ("section") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("section")); } ACEXML_Char ch; @@ -1192,9 +1026,7 @@ ACEXML_Parser::parse_cdata (ACEXML_ENV_SINGLE_ARG_DECL) { ch = this->get(); cdata = this->obstack_.freeze (); - this->content_handler_->characters (cdata, 0, datalen - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->content_handler_->characters (cdata, 0, datalen); this->obstack_.unwind(cdata); return 0; } @@ -1209,7 +1041,7 @@ ACEXML_Parser::parse_cdata (ACEXML_ENV_SINGLE_ARG_DECL) int -ACEXML_Parser::parse_entity_decl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_entity_decl (void) { ACEXML_Char nextch = 0; @@ -1217,8 +1049,7 @@ ACEXML_Parser::parse_entity_decl (ACEXML_ENV_SINGLE_ARG_DECL) this->skip_whitespace_count (&nextch) == 0) { this->fatal_error (ACE_TEXT ("Expecting keyword ENTITY followed by a ") - ACE_TEXT ("space") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("space")); } int is_GEDecl = 1; @@ -1229,37 +1060,28 @@ ACEXML_Parser::parse_entity_decl (ACEXML_ENV_SINGLE_ARG_DECL) if (this->skip_whitespace_count (&nextch) == 0) { this->fatal_error (ACE_TEXT ("Expecting space between % and ") - ACE_TEXT ("entity name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("entity name")); } } ACEXML_Char *entity_name = this->parse_name (); if (entity_name == 0) { - this->fatal_error (ACE_TEXT ("Invalid entity name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid entity name")); } if (this->skip_whitespace_count (&nextch) == 0) { this->fatal_error (ACE_TEXT ("Expecting space between entity name and ") - ACE_TEXT ("entityDef") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("entityDef")); } int retval = 0; if (nextch == '\'' || nextch == '"') { ACEXML_Char *entity_value = 0; - if (this->parse_entity_value (entity_value - ACEXML_ENV_ARG_PARAMETER) != 0) + if (this->parse_entity_value (entity_value) != 0) { - this->fatal_error(ACE_TEXT ("Invalid EntityValue") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid EntityValue")); } if (is_GEDecl) retval = this->internal_GE_.add_entity (entity_name, @@ -1270,46 +1092,35 @@ ACEXML_Parser::parse_entity_decl (ACEXML_ENV_SINGLE_ARG_DECL) if (retval < 0) { this->fatal_error (ACE_TEXT ("Internal Parser Error in adding") - ACE_TEXT ("Entity to map") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("Entity to map")); } else if (retval == 1) { - this->warning (ACE_TEXT ("Duplicate entity found") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->warning (ACE_TEXT ("Duplicate entity found")); } } else { - ACEXML_Char *systemid, *publicid; + ACEXML_Char *systemid = 0, *publicid = 0; - this->parse_external_id (publicid, systemid - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_external_id (publicid, systemid); if (systemid == 0) { - this->fatal_error(ACE_TEXT ("Invalid SystemLiteral") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid SystemLiteral")); } this->skip_whitespace_count (&nextch); if (nextch == 'N') // NDATA section followed { if (is_GEDecl == 0) { - this->fatal_error(ACE_TEXT ("Invalid NDataDecl in PEDef") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid NDataDecl in PEDef")); } if ((this->parse_token (ACE_TEXT ("NDATA")) < 0) || this->skip_whitespace_count (&nextch) == 0) { this->fatal_error(ACE_TEXT ("Expecting keyword NDATA followed ") - ACE_TEXT ("by a space") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("by a space")); } ACEXML_Char *ndata = this->parse_name (); @@ -1317,141 +1128,106 @@ ACEXML_Parser::parse_entity_decl (ACEXML_ENV_SINGLE_ARG_DECL) { if (!this->notations_.resolve_entity (ndata)) { - this->fatal_error (ACE_TEXT ("Undeclared Notation name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Undeclared Notation name")); } this->dtd_handler_->unparsedEntityDecl(entity_name, publicid, - systemid, ndata - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + systemid, ndata); } } else { if (is_GEDecl) - retval = this->external_GE_.add_entity (entity_name, - systemid); + retval = this->external_GE_.add_entity (entity_name, systemid); else - retval = this->external_PE_.add_entity (entity_name, - systemid); + retval = this->external_PE_.add_entity (entity_name, systemid); if (retval < 0) { - this->fatal_error(ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Internal Parser Error")); } else if (retval == 1) - this->warning(ACE_TEXT ("Duplicate external entity") - ACEXML_ENV_ARG_PARAMETER); + this->warning(ACE_TEXT ("Duplicate external entity")); if (is_GEDecl) - retval = this->external_GE_.add_entity (entity_name, - publicid); + retval = this->external_GE_.add_entity (entity_name, publicid); else - retval = this->external_PE_.add_entity (entity_name, - publicid); + retval = this->external_PE_.add_entity (entity_name, publicid); if (retval < 0) { - this->fatal_error(ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Internal Parser Error")); } else if (retval == 1) - this->warning (ACE_TEXT ("Duplicate entity definition") - ACEXML_ENV_ARG_PARAMETER); + this->warning (ACE_TEXT ("Duplicate entity definition")); } } // End of ENTITY definition if (this->skip_whitespace() != '>') { - this->fatal_error(ACE_TEXT ("Expecting '>' at end of entityDef") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting '>' at end of entityDef")); } return 0; } int -ACEXML_Parser::parse_attlist_decl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_attlist_decl (void) { if (this->parse_token (ACE_TEXT ("ATTLIST")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword 'ATTLIST'") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword 'ATTLIST'")); } - int count = check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + int count = check_for_PE_reference (); if (!count) { this->fatal_error(ACE_TEXT ("Expecting space between ATTLIST and ") - ACE_TEXT ("element name") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("element name")); } ACEXML_Char *element_name = this->parse_name (); if (element_name == 0) { - this->fatal_error(ACE_TEXT ("Invalid element Name in attlistDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid element Name in attlistDecl")); } ACEXML_Char fwd = 0; count = this->skip_whitespace_count (&fwd); // Parse AttDef* while (fwd != '>') { - if (!this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER) + if (!this->check_for_PE_reference () && !count) this->fatal_error(ACE_TEXT ("Expecting space between element ") - ACE_TEXT ("name and AttDef") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("name and AttDef")); this->skip_whitespace_count (&fwd); if (fwd == '>') break; - count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + count = this->check_for_PE_reference (); - this->parse_attname (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_attname (); - count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + count = this->check_for_PE_reference (); if (!count) { this->fatal_error(ACE_TEXT ("Expecting space between AttName and ") - ACE_TEXT ("AttType") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("AttType")); } - this->parse_atttype (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_atttype (); - count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + count = this->check_for_PE_reference (); if (!count) { this->fatal_error(ACE_TEXT ("Expecting space between AttType and") - ACE_TEXT (" DefaultDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT (" DefaultDecl")); } - this->parse_defaultdecl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_defaultdecl (); - count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + count = this->check_for_PE_reference (); this->skip_whitespace_count(&fwd); } this->get (); // consume closing '>' return 0; } - int -ACEXML_Parser::check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::check_for_PE_reference (void) { ACEXML_Char fwd = '\xFF'; // Skip any leading whitespaces and store the number of such chars skipped @@ -1459,8 +1235,7 @@ ACEXML_Parser::check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) if (fwd == 0) { this->get(); // Consume the 0 - this->pop_context (0 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->pop_context (0); fwd = this->peek(); } if (fwd == '%') @@ -1468,14 +1243,11 @@ ACEXML_Parser::check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) this->get(); // Consume the % if (this->external_subset_) { - this->parse_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_PE_reference (); } else { - this->fatal_error(ACE_TEXT ("Illegal PERef within markupDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Illegal PERef within markupDecl")); } } if (count) @@ -1489,21 +1261,19 @@ ACEXML_Parser::check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) } ACEXML_Char* -ACEXML_Parser::parse_attname (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_attname (void) { // Parse attribute name ACEXML_Char *att_name = this->parse_name (); if (att_name == 0) { - this->fatal_error(ACE_TEXT ("Invalid AttName") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (0); + this->fatal_error(ACE_TEXT ("Invalid AttName")); } return att_name; } int -ACEXML_Parser::parse_defaultdecl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_defaultdecl (void) { // DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) ACEXML_Char nextch = this->peek (); @@ -1517,9 +1287,7 @@ ACEXML_Parser::parse_defaultdecl (ACEXML_ENV_SINGLE_ARG_DECL) case 'R': if (this->parse_token (ACE_TEXT ("EQUIRED")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword REQUIRED") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword REQUIRED")); } // We now know this attribute is required // @@ Set up the validator as such. @@ -1527,9 +1295,7 @@ ACEXML_Parser::parse_defaultdecl (ACEXML_ENV_SINGLE_ARG_DECL) case 'I': if (this->parse_token (ACE_TEXT ("MPLIED")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword IMPLIED") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword IMPLIED")); } // We now know this attribute is implied. // @@ Set up the validator as such. @@ -1538,47 +1304,36 @@ ACEXML_Parser::parse_defaultdecl (ACEXML_ENV_SINGLE_ARG_DECL) if (this->parse_token (ACE_TEXT ("IXED")) < 0 || this->skip_whitespace_count () == 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword FIXED") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword FIXED")); } // We now know this attribute is fixed. - if (this->parse_attvalue (fixed_attr - ACEXML_ENV_ARG_PARAMETER) != 0) + if (this->parse_attvalue (fixed_attr) != 0) { - this->fatal_error(ACE_TEXT ("Invalid Default AttValue") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid Default AttValue")); } // @@ set up validator break; default: - this->fatal_error (ACE_TEXT ("Invalid DefaultDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid DefaultDecl")); } break; case '\'': case '"': - if (this->parse_attvalue (fixed_attr ACEXML_ENV_ARG_PARAMETER) != 0) + if (this->parse_attvalue (fixed_attr) != 0) { - this->fatal_error(ACE_TEXT ("Invalid AttValue") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid AttValue")); } // @@ set up validator break; default: - this->fatal_error (ACE_TEXT ("Invalid DefaultDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid DefaultDecl")); break; } return 0; } int -ACEXML_Parser::parse_tokenized_type (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_tokenized_type (void) { ACEXML_Char ch = this->get(); switch (ch) @@ -1615,8 +1370,7 @@ ACEXML_Parser::parse_tokenized_type (ACEXML_ENV_SINGLE_ARG_DECL) } // Admittedly, this error message is not precise enough this->fatal_error(ACE_TEXT ("Expecting keyword `ID', `IDREF', or") - ACE_TEXT ("`IDREFS'") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("`IDREFS'")); case 'E': // ENTITY or ENTITIES if (this->parse_token (ACE_TEXT ("NTIT")) == 0) { @@ -1641,8 +1395,7 @@ ACEXML_Parser::parse_tokenized_type (ACEXML_ENV_SINGLE_ARG_DECL) } // Admittedly, this error message is not precise enough this->fatal_error(ACE_TEXT ("Expecting keyword `ENTITY', or") - ACE_TEXT ("`ENTITIES'") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("`ENTITIES'")); case 'M': if (this->parse_token (ACE_TEXT ("TOKEN")) == 0) { @@ -1664,13 +1417,10 @@ ACEXML_Parser::parse_tokenized_type (ACEXML_ENV_SINGLE_ARG_DECL) } } this->fatal_error(ACE_TEXT ("Expecting keyword `NMTOKEN' or `NMTO") - ACE_TEXT ("KENS'") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("KENS'")); break; default: - this->fatal_error (ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Internal Parser Error")); break; } return 0; @@ -1699,7 +1449,7 @@ ACEXML_Parser::parse_tokenized_type (ACEXML_ENV_SINGLE_ARG_DECL) * [VC: Enumeration] */ int -ACEXML_Parser::parse_atttype (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_atttype (void) { ACEXML_Char nextch = this->peek(); switch (nextch) @@ -1707,17 +1457,14 @@ ACEXML_Parser::parse_atttype (ACEXML_ENV_SINGLE_ARG_DECL) case 'C': // CDATA if (this->parse_token (ACE_TEXT ("CDATA")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword 'CDATA'") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword 'CDATA'")); } // Else, we have successfully identified the type of the // attribute as CDATA // @@ Set up validator appropriately here. break; case 'I': case 'E': // ID, IDREF, IDREFS, ENTITY or ENTITIES - this->parse_tokenized_type (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_tokenized_type (); break; case 'N': // NMTOKEN, NMTOKENS, or NOTATION this->get(); @@ -1725,95 +1472,71 @@ ACEXML_Parser::parse_atttype (ACEXML_ENV_SINGLE_ARG_DECL) if (nextch != 'M' && nextch != 'O') { this->fatal_error (ACE_TEXT ("Expecting keyword 'NMTOKEN', ") - ACE_TEXT ("'NMTOKENS' or 'NOTATION'") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("'NMTOKENS' or 'NOTATION'")); } if (nextch == 'M') { - this->parse_tokenized_type (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_tokenized_type (); break; } else // NOTATION { if (this->parse_token (ACE_TEXT ("OTATION")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword `NOTATION'") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword `NOTATION'")); } - int count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + int count = this->check_for_PE_reference (); if (!count) { this->fatal_error (ACE_TEXT ("Expecting space between keyword ") - ACE_TEXT ("NOTATION and '('") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("NOTATION and '('")); } if (this->get () != '(') { - this->fatal_error(ACE_TEXT ("Expecting '(' in NotationType") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting '(' in NotationType")); } - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); do { this->skip_whitespace_count(); ACEXML_Char *notation_name = this->parse_name (); if (notation_name == 0) { - this->fatal_error(ACE_TEXT ("Invalid notation name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid notation name")); } // @@ get another notation name, set up validator as such - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); nextch = this->get(); } while (nextch == '|'); if (nextch != ')') { this->fatal_error (ACE_TEXT ("Expecting a ')' after a ") - ACE_TEXT ("NotationType declaration") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("NotationType declaration")); } } break; case '(': // EnumeratedType - Enumeration this->get(); - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); do { this->skip_whitespace_count(); ACEXML_Char *token_name = this->parse_nmtoken (); if (token_name == 0) { - this->fatal_error(ACE_TEXT ("Invalid enumeration name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid enumeration name")); } // @@ get another nmtoken, set up validator as such - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); nextch = this->get(); } while (nextch == '|'); if (nextch != ')') { this->fatal_error (ACE_TEXT ("Expecting a ')' after a ") - ACE_TEXT ("Enumeration declaration") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("Enumeration declaration")); } break; default: { - this->fatal_error(ACE_TEXT ("Invalid AttType") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid AttType")); } ACE_NOTREACHED (break); } @@ -1821,38 +1544,28 @@ ACEXML_Parser::parse_atttype (ACEXML_ENV_SINGLE_ARG_DECL) } int -ACEXML_Parser::parse_notation_decl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_notation_decl (void) { if (this->parse_token (ACE_TEXT ("NOTATION")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting Keyword 'NOTATION'") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting Keyword 'NOTATION'")); } - int count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + int count = this->check_for_PE_reference (); if (!count) { this->fatal_error (ACE_TEXT ("Expecting a space between keyword NOTATION") - ACE_TEXT (" and notation name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT (" and notation name")); } ACEXML_Char *notation = this->parse_name (); if (notation == 0) { - this->fatal_error(ACE_TEXT ("Invalid Notation name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid Notation name")); } - count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + count = this->check_for_PE_reference (); if (!count) { this->fatal_error (ACE_TEXT ("Expecting a space between notation name ") - ACE_TEXT ("and ExternalID/PublicID") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("and ExternalID/PublicID")); } ACEXML_Char *systemid, *publicid; @@ -1863,9 +1576,7 @@ ACEXML_Parser::parse_notation_decl (ACEXML_ENV_SINGLE_ARG_DECL) ACEXML_ParserInt::ReferenceState temp = this->ref_state_; this->ref_state_ = ACEXML_ParserInt::IN_NOTATION; - this->parse_external_id (publicid, systemid - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_external_id (publicid, systemid); // Restore the original value. this->ref_state_ = temp; @@ -1873,71 +1584,52 @@ ACEXML_Parser::parse_notation_decl (ACEXML_ENV_SINGLE_ARG_DECL) if (systemid && this->notations_.add_entity (notation, systemid) != 0 && this->validate_) { - this->fatal_error(ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Internal Parser Error")); } if (publicid) { int retval = this->notations_.add_entity (notation, publicid); if (retval != 0 && !systemid && this->validate_) { - this->fatal_error(ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Internal Parser Error")); } } if (this->skip_whitespace() != '>') { - this->fatal_error(ACE_TEXT ("Expecting '>' at end of NotationDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting '>' at end of NotationDecl")); } if (this->validate_ && this->dtd_handler_) { - this->dtd_handler_->notationDecl (notation, - publicid, - systemid ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->dtd_handler_->notationDecl (notation, publicid, systemid); } return 0; } int -ACEXML_Parser::parse_element_decl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_element_decl (void) { if (this->parse_token (ACE_TEXT ("LEMENT")) < 0) { - this->fatal_error (ACE_TEXT ("Expecting keyword ELEMENT") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Expecting keyword ELEMENT")); } - int count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + int count = this->check_for_PE_reference (); if (!count) { this->fatal_error (ACE_TEXT ("Expecting a space between keyword ELEMENT") - ACE_TEXT (" and element name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT (" and element name")); } ACEXML_Char *element_name = this->parse_name (); if (element_name == 0) { - this->fatal_error (ACE_TEXT ("Invalid element name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid element name")); } - count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + count = this->check_for_PE_reference (); if (!count) { this->fatal_error (ACE_TEXT ("Expecting a space between element name ") - ACE_TEXT ("and element definition") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("and element definition")); } ACEXML_Char nextch = this->peek(); switch (nextch) @@ -1945,46 +1637,35 @@ ACEXML_Parser::parse_element_decl (ACEXML_ENV_SINGLE_ARG_DECL) case 'E': // EMPTY if (this->parse_token (ACE_TEXT ("EMPTY")) < 0) { - this->fatal_error (ACE_TEXT ("Expecting keyword EMPTY") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Expecting keyword EMPTY")); } break; case 'A': // ANY if (this->parse_token (ACE_TEXT ("ANY")) < 0) { - this->fatal_error (ACE_TEXT ("Expecting keyword ANY") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Expecting keyword ANY")); } break; case '(': // children - this->parse_children_definition (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_children_definition (); break; default: // error - this->fatal_error (ACE_TEXT ("Invalid element definition") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid element definition")); } - count = this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + count = this->check_for_PE_reference (); if (this->skip_whitespace () != '>') { - this->fatal_error (ACE_TEXT ("Expecting '>' after element defintion") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Expecting '>' after element defintion")); } return 0; } int -ACEXML_Parser::parse_children_definition (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_children_definition (void) { this->get (); // consume the '(' - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); int subelement_number = 0; ACEXML_Char nextch = this->peek(); switch (nextch) @@ -1992,38 +1673,31 @@ ACEXML_Parser::parse_children_definition (ACEXML_ENV_SINGLE_ARG_DECL) case '#': // Mixed element, if (this->parse_token (ACE_TEXT ("#PCDATA")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword '#PCDATA'") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword '#PCDATA'")); } - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); nextch = this->get(); while (nextch == '|') { - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); ACEXML_Char *name = this->parse_name (); // @@ name will be used in the Validator later. ACE_UNUSED_ARG (name); ++subelement_number; // @@ Install Mixed element name into the validator. - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); nextch = this->skip_whitespace(); } if (nextch != ')' || (subelement_number && this->get () != '*')) { this->fatal_error(ACE_TEXT ("Expecing ')' or ')*' at end of Mixed") - ACE_TEXT (" element") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT (" element")); } // @@ close the element definition in the validator. break; default: - int status = this->parse_child (1 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + int status = this->parse_child (1); if (status != 0) return -1; } @@ -2052,41 +1726,33 @@ ACEXML_Parser::parse_children_definition (ACEXML_ENV_SINGLE_ARG_DECL) } int -ACEXML_Parser::parse_child (int skip_open_paren ACEXML_ENV_ARG_DECL) +ACEXML_Parser::parse_child (int skip_open_paren) { // Conditionally consume the open paren. if (skip_open_paren == 0 && this->get () != '(') { - this->fatal_error(ACE_TEXT ("Expecting '(' at beginning of children") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting '(' at beginning of children")); } ACEXML_Char node_type = 0; ACEXML_Char nextch; do { - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); this->skip_whitespace_count (&nextch); switch (nextch) { case '(': - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); - this->parse_child (0 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); + this->parse_child (0); break; default: - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); // must be an element name here. ACEXML_Char *subelement = this->parse_name (); if (subelement == 0) { - this->fatal_error(ACE_TEXT ("Invalid subelement name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Invalid subelement name")); } // Check for trailing '?', '*', '+' nextch = this->peek (); @@ -2111,8 +1777,7 @@ ACEXML_Parser::parse_child (int skip_open_paren ACEXML_ENV_ARG_DECL) // @@ Inform validator of the new element here. break; } - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); this->skip_whitespace_count (&nextch); switch (nextch) { @@ -2127,9 +1792,7 @@ ACEXML_Parser::parse_child (int skip_open_paren ACEXML_ENV_ARG_DECL) break; default: this->fatal_error (ACE_TEXT ("Expecting `,', `|', or `)' ") - ACE_TEXT ("while defining an element") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("while defining an element")); } break; case ',': @@ -2143,24 +1806,19 @@ ACEXML_Parser::parse_child (int skip_open_paren ACEXML_ENV_ARG_DECL) break; default: this->fatal_error (ACE_TEXT ("Expecting `,', `|', or `)' ") - ACE_TEXT ("while defining an element") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("while defining an element")); } break; case ')': break; default: this->fatal_error (ACE_TEXT ("Expecting `,', `|', or `)' ") - ACE_TEXT ("while defining an element") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("while defining an element")); } nextch = this->get(); // Consume the `,' or `|' or `)' if (nextch == ')') break; - this->check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->check_for_PE_reference (); this->skip_whitespace_count (&nextch); } while (nextch != ')'); @@ -2260,7 +1918,7 @@ ACEXML_Parser::parse_reference_name (void) } int -ACEXML_Parser::parse_attvalue (ACEXML_Char *&str ACEXML_ENV_ARG_DECL) +ACEXML_Parser::parse_attvalue (ACEXML_Char *&str) { ACEXML_Char quote = this->get (); if (quote != '\'' && quote != '"') // Not a quoted string. @@ -2306,9 +1964,7 @@ ACEXML_Parser::parse_attvalue (ACEXML_Char *&str ACEXML_ENV_ARG_DECL) if (this->parse_char_reference (buf, len) != 0) { // [WFC: Legal Character] - this->fatal_error (ACE_TEXT ("Invalid CharacterRef") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid CharacterRef")); } for (size_t j = 0; j < len; ++j) this->obstack_.grow (buf[j]); @@ -2316,21 +1972,17 @@ ACEXML_Parser::parse_attvalue (ACEXML_Char *&str ACEXML_ENV_ARG_DECL) else { this->ref_state_ = ACEXML_ParserInt::IN_ATT_VALUE; - this->parse_entity_reference (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_entity_reference (); } break; case '\x20': case '\x0D': case '\x0A': case '\x09': this->obstack_.grow ('\x20'); break; case '<': // [WFC: No < in Attribute Values] - this->fatal_error (ACE_TEXT ("Illegal '<' in AttValue") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Illegal '<' in AttValue")); break; case 0: - this->pop_context (1 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->pop_context (1); break; default: this->obstack_.grow (ch); @@ -2340,24 +1992,18 @@ ACEXML_Parser::parse_attvalue (ACEXML_Char *&str ACEXML_ENV_ARG_DECL) } } - - int -ACEXML_Parser::parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_entity_reference (void) { ACEXML_Char* replace = this->parse_reference_name (); if (replace == 0) { - this->fatal_error (ACE_TEXT ("Invalid Reference name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid Reference name")); } // [WFC: Parsed Entity] if (this->unparsed_entities_.resolve_entity (replace)) { - this->fatal_error (ACE_TEXT ("EntityRef refers to unparsed entity") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("EntityRef refers to unparsed entity")); } // Look in the internal general entities set first. const ACEXML_Char* entity = this->internal_GE_.resolve_entity(replace); @@ -2379,15 +2025,11 @@ ACEXML_Parser::parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL) if (this->standalone_) { // [WFC: Entity Declared] - this->fatal_error (ACE_TEXT ("Undeclared Entity reference") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Undeclared Entity reference")); } else { - this->content_handler_->skippedEntity (replace - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->content_handler_->skippedEntity (replace); return 0; } } @@ -2403,9 +2045,7 @@ ACEXML_Parser::parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL) || this->standalone_)) { // [WFC: Entity Declared] - this->fatal_error (ACE_TEXT ("Undeclared Entity reference") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Undeclared Entity reference")); } ACEXML_Char* systemId = 0; @@ -2414,15 +2054,11 @@ ACEXML_Parser::parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL) { if (this->external_GE_.resolve_entity (replace, systemId, publicId) < 0) { - this->fatal_error (ACE_TEXT ("Undeclared Entity reference") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Undeclared Entity reference")); } if (this->ref_state_ == ACEXML_ParserInt::IN_ATT_VALUE) { - this->fatal_error (ACE_TEXT ("External EntityRef in Attribute Value") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("External EntityRef in Attribute Value")); } this->external_entity_++; } @@ -2435,9 +2071,7 @@ ACEXML_Parser::parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL) { while (this->GE_reference_.pop(ref_name) != -1) ; - this->fatal_error (ACE_TEXT ("Recursion in resolving entity") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Recursion in resolving entity")); } if (!this->external_entity_) @@ -2448,9 +2082,7 @@ ACEXML_Parser::parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL) || this->switch_input (str, replace) != 0) { this->fatal_error (ACE_TEXT ("Unable to create internal input ") - ACE_TEXT ("stream") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + ACE_TEXT ("stream")); } return 0; } @@ -2462,17 +2094,13 @@ ACEXML_Parser::parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL) if (this->entity_resolver_) { ip = this->entity_resolver_->resolveEntity (publicId, - (uri ? uri : systemId) - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + (uri ? uri : systemId)); if (ip) { if (this->switch_input (ip, (uri ? uri : systemId), publicId) != 0) { - this->fatal_error (ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Internal Parser Error")); } return 0; } @@ -2480,29 +2108,23 @@ ACEXML_Parser::parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL) ACEXML_StreamFactory factory; ACEXML_CharStream* cstream = factory.create_stream (uri ? uri: systemId); if (!cstream) { - this->fatal_error (ACE_TEXT ("Invalid input source") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid input source")); } if (this->switch_input (cstream, systemId, publicId) != 0) { - this->fatal_error (ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Internal Parser Error")); } } return 0; } int -ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_PE_reference (void) { ACEXML_Char* replace = this->parse_reference_name (); if (replace == 0) { - this->fatal_error (ACE_TEXT ("Invalid PEReference name") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid PEReference name")); } // Look in the internal general entities set first. @@ -2513,9 +2135,7 @@ ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) this->standalone_)) // or Standalone { // [VC: Entity Declared] - this->fatal_error (ACE_TEXT ("Undefined Internal PEReference") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Undefined Internal PEReference")); } ACEXML_Char* systemId = 0; @@ -2524,9 +2144,7 @@ ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) { if (this->external_PE_.resolve_entity (replace, systemId, publicId) < 0) { - this->fatal_error (ACE_TEXT ("Undefined PEReference") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Undefined PEReference")); } this->external_entity_++; } @@ -2538,9 +2156,7 @@ ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) { while (this->PE_reference_.pop(ref_name) != -1) ; - this->fatal_error (ACE_TEXT ("Recursion in resolving entity") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Recursion in resolving entity")); } if (entity && !this->external_entity_) @@ -2559,9 +2175,7 @@ ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) if (sstream->open (str.c_str(), replace) < 0 || this->switch_input (sstream, replace) != 0) { - this->fatal_error (ACE_TEXT ("Error in switching InputSource") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Error in switching InputSource")); } return 0; } @@ -2573,17 +2187,13 @@ ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) if (this->entity_resolver_) { ip = this->entity_resolver_->resolveEntity (publicId, - (uri ? uri : systemId) - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + (uri ? uri : systemId)); } if (ip) { if (this->switch_input (ip, (uri ? uri : systemId), publicId) != 0) { - this->fatal_error (ACE_TEXT ("Error in switching InputSource") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Error in switching InputSource")); } return 0; } @@ -2592,15 +2202,11 @@ ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) ACEXML_StreamFactory factory; ACEXML_CharStream* cstream = factory.create_stream (uri ? uri: systemId); if (!cstream) { - this->fatal_error (ACE_TEXT ("Invalid input source") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid input source")); } if (this->switch_input (cstream, systemId, publicId) != 0) { - this->fatal_error (ACE_TEXT ("Error in switching InputSource") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Error in switching InputSource")); } if (this->ref_state_ == ACEXML_ParserInt::IN_ENTITY_VALUE) { @@ -2613,8 +2219,7 @@ ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) mark = this->get(); if (this->peek() == 'x') { - this->parse_text_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_text_decl (); } else { @@ -2628,15 +2233,12 @@ ACEXML_Parser::parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL) return 0; } } - this->fatal_error (ACE_TEXT ("Undefined PEReference") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Undefined PEReference")); return -1; } int -ACEXML_Parser::parse_entity_value (ACEXML_Char *&str - ACEXML_ENV_ARG_DECL) +ACEXML_Parser::parse_entity_value (ACEXML_Char *&str) { ACEXML_ParserInt::ReferenceState temp = this->ref_state_; ACEXML_Char quote = this->get (); @@ -2664,8 +2266,7 @@ ACEXML_Parser::parse_entity_value (ACEXML_Char *&str { // [WFC: Legal Character] this->fatal_error (ACE_TEXT ("Invalid character ") - ACE_TEXT ("reference") - ACEXML_ENV_ARG_PARAMETER); + ACE_TEXT ("reference")); return -1; } for (size_t j = 0; j < len; ++j) @@ -2679,15 +2280,13 @@ ACEXML_Parser::parse_entity_value (ACEXML_Char *&str if (!this->external_entity_) { this->ref_state_ = ACEXML_ParserInt::IN_ENTITY_VALUE; - this->parse_PE_reference(ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_PE_reference(); break; } this->obstack_.grow (ch); break; case 0: - this->pop_context (0 ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->pop_context (0); break; default: this->obstack_.grow (ch); @@ -2884,21 +2483,17 @@ ACEXML_Parser::parse_sddecl (ACEXML_Char*& str) void ACEXML_Parser::prefix_mapping (const ACEXML_Char* prefix, const ACEXML_Char* uri, - int start ACEXML_ENV_ARG_DECL) + int start) { if (this->namespaces_) { const ACEXML_Char* temp = (prefix == 0) ? empty_string : prefix; if (start) { - this->content_handler_->startPrefixMapping (temp, uri - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->content_handler_->startPrefixMapping (temp, uri); } else { - this->content_handler_->endPrefixMapping(temp - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->content_handler_->endPrefixMapping(temp); } } } @@ -2947,48 +2542,38 @@ ACEXML_Parser::push_context (ACEXML_Parser_Context* context) } size_t -ACEXML_Parser::pop_context (int GE_ref ACEXML_ENV_ARG_DECL) +ACEXML_Parser::pop_context (int GE_ref) { size_t nrelems = this->ctx_stack_.size(); if (nrelems <= 1) { - this->fatal_error(ACE_TEXT ("Unexpected end-of-file") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Unexpected end-of-file")); } ACEXML_Parser_Context* temp = 0; int retval = this->ctx_stack_.pop (temp); if (retval != 0) { - this->fatal_error (ACE_TEXT ("Unable to pop element of the input stack") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Unable to pop element of the input stack")); } delete temp; if (this->ctx_stack_.top (this->current_) != 0) { - this->fatal_error (ACE_TEXT ("Unable to read top element of input stack") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Unable to read top element of input stack")); } ACEXML_Char* reference = 0; if (GE_ref == 1 && this->GE_reference_.size() > 0) { if (this->GE_reference_.pop (reference) < 0) { - this->fatal_error (ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Internal Parser Error")); } } else if (GE_ref == 0 && this->PE_reference_.size() > 0) { if (this->PE_reference_.pop (reference) < 0) { - this->fatal_error (ACE_TEXT ("Internal Parser Error") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Internal Parser Error")); } } nrelems = this->ctx_stack_.size(); @@ -3002,7 +2587,7 @@ ACEXML_Parser::pop_context (int GE_ref ACEXML_ENV_ARG_DECL) } int -ACEXML_Parser::getFeature (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) +ACEXML_Parser::getFeature (const ACEXML_Char *name) { if (ACE_OS::strcmp (name, ACEXML_Parser::simple_parsing_feature_) == 0) { @@ -3021,14 +2606,13 @@ ACEXML_Parser::getFeature (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) { return this->validate_; } - ACEXML_THROW_RETURN (ACEXML_SAXNotRecognizedException (name), -1); + throw ACEXML_SAXNotRecognizedException (name); } void -ACEXML_Parser::setFeature (const ACEXML_Char *name, - int boolean_value ACEXML_ENV_ARG_DECL) +ACEXML_Parser::setFeature (const ACEXML_Char *name, int boolean_value) { if (ACE_OS::strcmp (name, ACEXML_Parser::simple_parsing_feature_) == 0) { @@ -3052,90 +2636,84 @@ ACEXML_Parser::setFeature (const ACEXML_Char *name, return; } - ACEXML_THROW (ACEXML_SAXNotRecognizedException (name)); + throw ACEXML_SAXNotRecognizedException (name); } void * -ACEXML_Parser::getProperty (const ACEXML_Char *name ACEXML_ENV_ARG_DECL) +ACEXML_Parser::getProperty (const ACEXML_Char *name) { - ACEXML_THROW_RETURN (ACEXML_SAXNotSupportedException (name), 0); + throw ACEXML_SAXNotSupportedException (name); } void ACEXML_Parser::setProperty (const ACEXML_Char *name, - void *value ACEXML_ENV_ARG_DECL) + void *) { - ACE_UNUSED_ARG (value); - - ACEXML_THROW (ACEXML_SAXNotSupportedException (name)); + throw ACEXML_SAXNotSupportedException (name); } void -ACEXML_Parser::error (const ACEXML_Char* msg ACEXML_ENV_ARG_DECL) +ACEXML_Parser::error (const ACEXML_Char* msg) { ACEXML_SAXParseException* exception = 0; ACE_NEW_NORETURN (exception, ACEXML_SAXParseException (msg)); if (this->error_handler_) - this->error_handler_->error (*exception ACEXML_ENV_ARG_PARAMETER); + this->error_handler_->error (*exception); else - ACEXML_ENV_RAISE (exception); + throw exception; return; } void -ACEXML_Parser::warning (const ACEXML_Char* msg ACEXML_ENV_ARG_DECL) +ACEXML_Parser::warning (const ACEXML_Char* msg) { ACEXML_SAXParseException* exception = 0; ACE_NEW_NORETURN (exception, ACEXML_SAXParseException (msg)); if (this->error_handler_) - this->error_handler_->warning (*exception ACEXML_ENV_ARG_PARAMETER); + this->error_handler_->warning (*exception); delete exception; return; } void -ACEXML_Parser::fatal_error (const ACEXML_Char* msg ACEXML_ENV_ARG_DECL) +ACEXML_Parser::fatal_error (const ACEXML_Char* msg) { ACEXML_SAXParseException* exception = 0; ACE_NEW_NORETURN (exception, ACEXML_SAXParseException (msg)); if (this->error_handler_) - this->error_handler_->fatalError (*exception ACEXML_ENV_ARG_PARAMETER); + this->error_handler_->fatalError (*exception); this->reset(); - ACEXML_ENV_RAISE (exception); + throw exception; return; } void -ACEXML_Parser::parse_version_info (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_version_info (void) { ACEXML_Char* astring; if (this->parse_token (ACE_TEXT("ersion")) < 0 || this->skip_equal () != 0 || this->parse_version_num (astring) != 0) { - this->fatal_error (ACE_TEXT ("Invalid VersionInfo specification") - ACEXML_ENV_ARG_PARAMETER); + this->fatal_error (ACE_TEXT ("Invalid VersionInfo specification")); return; } if (ACE_OS::strcmp (astring, ACE_TEXT ("1.0")) != 0) { this->fatal_error (ACE_TEXT ("ACEXML Parser supports XML version 1.0 ") - ACE_TEXT ("documents only") ACEXML_ENV_ARG_PARAMETER); - return; + ACE_TEXT ("documents only")); } } void -ACEXML_Parser::parse_encoding_decl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_encoding_decl (void) { ACEXML_Char* astring = 0; if ((this->parse_token (ACE_TEXT("ncoding")) < 0) || this->skip_equal () != 0 || this->parse_encname (astring) != 0) { - this->fatal_error (ACE_TEXT ("Invalid EncodingDecl specification") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error (ACE_TEXT ("Invalid EncodingDecl specification")); } const ACEXML_Char* encoding = this->current_->getInputSource()->getEncoding(); if (encoding != 0 && ACE_OS::strcasecmp (astring, encoding) != 0) @@ -3144,60 +2722,51 @@ ACEXML_Parser::parse_encoding_decl (ACEXML_ENV_SINGLE_ARG_DECL) ACE_TEXT (": Declared Encoding is %s\n"), encoding, astring)); this->warning (ACE_TEXT ("Declared encoding differs from detected ") - ACE_TEXT ("encoding") ACEXML_ENV_ARG_PARAMETER); + ACE_TEXT ("encoding")); } } int -ACEXML_Parser::parse_text_decl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_text_decl (void) { // Read xml if (this->parse_token (ACE_TEXT("xml")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword 'xml' in TextDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("Expecting keyword 'xml' in TextDecl")); } ACEXML_Char fwd = this->skip_whitespace(); // Read version if (fwd == 'v') { - this->parse_version_info (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_version_info (); fwd = this->skip_whitespace(); } if (fwd == 'e') { - this->parse_encoding_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->parse_encoding_decl (); fwd = this->skip_whitespace(); } else { - this->fatal_error (ACE_TEXT ("Missing encodingDecl in TextDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Missing encodingDecl in TextDecl")); } if (fwd == '?' && this->get() == '>') return 0; // All the rules fail. So return an error. - this->fatal_error (ACE_TEXT ("Invalid TextDecl") ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error (ACE_TEXT ("Invalid TextDecl")); return -1; } void -ACEXML_Parser::parse_xml_decl (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_xml_decl (void) { // Read <?xml if (this->parse_token (ACE_TEXT("xml")) < 0) { - this->fatal_error(ACE_TEXT ("Expecting keyword xml in XMLDecl") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error(ACE_TEXT ("Expecting keyword xml in XMLDecl")); } ACEXML_Char fwd = this->skip_whitespace(); @@ -3205,21 +2774,17 @@ ACEXML_Parser::parse_xml_decl (ACEXML_ENV_SINGLE_ARG_DECL) // Read version if (fwd != 'v') { - this->fatal_error (ACE_TEXT ("Expecting VersionInfo declaration") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error (ACE_TEXT ("Expecting VersionInfo declaration")); } - this->parse_version_info (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK; + this->parse_version_info (); fwd = this->skip_whitespace(); if (fwd != '?') { if (fwd == 'e') { - this->parse_encoding_decl (ACEXML_ENV_SINGLE_ARG_PARAMETER); - ACEXML_CHECK; + this->parse_encoding_decl (); fwd = this->skip_whitespace(); } if (fwd == 's') @@ -3238,9 +2803,7 @@ ACEXML_Parser::parse_xml_decl (ACEXML_ENV_SINGLE_ARG_DECL) if (fwd == '?' && this->get() == '>') return; // All the rules fail. So return an error. - this->fatal_error (ACE_TEXT ("Invalid XMLDecl declaration") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK; + this->fatal_error (ACE_TEXT ("Invalid XMLDecl declaration")); } int @@ -3269,7 +2832,7 @@ ACEXML_Parser::parse_comment (void) } int -ACEXML_Parser::parse_processing_instruction (ACEXML_ENV_SINGLE_ARG_DECL) +ACEXML_Parser::parse_processing_instruction (void) { const ACEXML_Char *pitarget = this->parse_name (); ACEXML_Char *instruction = 0; @@ -3277,9 +2840,7 @@ ACEXML_Parser::parse_processing_instruction (ACEXML_ENV_SINGLE_ARG_DECL) if (!ACE_OS::strcasecmp (ACE_TEXT ("xml"), pitarget)) { // Invalid PITarget name. - this->fatal_error(ACE_TEXT ("PI can't have 'xml' in PITarget") - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + this->fatal_error(ACE_TEXT ("PI can't have 'xml' in PITarget")); } int state = 0; @@ -3298,9 +2859,7 @@ ACEXML_Parser::parse_processing_instruction (ACEXML_ENV_SINGLE_ARG_DECL) { instruction = this->obstack_.freeze (); this->content_handler_->processingInstruction (pitarget, - instruction - ACEXML_ENV_ARG_PARAMETER); - ACEXML_CHECK_RETURN (-1); + instruction); this->obstack_.unwind (const_cast<ACEXML_Char*> (pitarget)); return 0; } diff --git a/ACE/ACEXML/parser/parser/Parser.h b/ACE/ACEXML/parser/parser/Parser.h index 3b0725ec214..1f99a456b94 100644 --- a/ACE/ACEXML/parser/parser/Parser.h +++ b/ACE/ACEXML/parser/parser/Parser.h @@ -83,34 +83,34 @@ public: * programmers to check whether a specific feature has been * activated in the parser. */ - virtual int getFeature (const ACEXML_Char *name ACEXML_ENV_ARG_DECL); + virtual int getFeature (const ACEXML_Char *name); /** * Activating or deactivating a feature. */ virtual void setFeature (const ACEXML_Char *name, - int boolean_value ACEXML_ENV_ARG_DECL); + int boolean_value); /* * Look up the value of a property. */ - virtual void * getProperty (const ACEXML_Char *name ACEXML_ENV_ARG_DECL); + virtual void * getProperty (const ACEXML_Char *name); /* * Set the value of a property. */ virtual void setProperty (const ACEXML_Char *name, - void *value ACEXML_ENV_ARG_DECL); + void *value); /* * Parse an XML document. */ - virtual void parse (ACEXML_InputSource *input ACEXML_ENV_ARG_DECL); + virtual void parse (ACEXML_InputSource *input); /* * Parse an XML document from a system identifier (URI). */ - virtual void parse (const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL) + virtual void parse (const ACEXML_Char *systemId) ; /* @@ -139,30 +139,30 @@ protected: /** * Parse XML Prolog. */ - void parse_xml_prolog (ACEXML_ENV_SINGLE_ARG_DECL); + void parse_xml_prolog (void); /** * Parse VersionInfo declaration. * */ - void parse_version_info (ACEXML_ENV_SINGLE_ARG_DECL); + void parse_version_info (void); /** * Parse a EncodingDecl declaration. * */ - void parse_encoding_decl (ACEXML_ENV_SINGLE_ARG_DECL); + void parse_encoding_decl (void); /** * Parse a XMLDecl declaration. * */ - void parse_xml_decl (ACEXML_ENV_SINGLE_ARG_DECL); + void parse_xml_decl (void); /** * Parse a TextDecl declaration. */ - int parse_text_decl (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_text_decl (void); /** * Parse a PI statement. The first character encountered @@ -170,13 +170,13 @@ protected: * * @retval 0 on success, -1 otherwise. */ - int parse_processing_instruction (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_processing_instruction (void); /** * Parse the DOCTYPE declaration. The first character encountered * should always be 'D' in doctype prefix: "@<@!DOCTYPE". */ - int parse_doctypedecl (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_doctypedecl (void); /** * Parse an XML element. The first character encountered should @@ -191,15 +191,14 @@ protected: * of validator or allow the function to return the element name so it * can be used in a validator. */ - void parse_element (int is_root ACEXML_ENV_ARG_DECL); + void parse_element (int is_root); /** * Parse a content declaration. * */ int parse_content (const ACEXML_Char* startname, const ACEXML_Char*& ns_uri, - const ACEXML_Char*& ns_lname, int ns_flag - ACEXML_ENV_ARG_DECL); + const ACEXML_Char*& ns_lname, int ns_flag); /** * Parse a character reference, i.e., " " or "". The first @@ -231,13 +230,13 @@ protected: * @retval 0 on success. * @retval -1 if fail. */ - int parse_cdata (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_cdata (void); /** * Parse a "markupdecl" section, this includes both "markupdecl" and * "DeclSep" sections in XML specification */ - int parse_internal_dtd (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_internal_dtd (void); /** * Skip over a comment. The first character encountered should always be @@ -252,7 +251,7 @@ protected: * * @retval 0 on success, -1 otherwise. */ - int parse_element_decl (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_element_decl (void); /** * Parse an "ENTITY" decl. The first character this method expects @@ -260,7 +259,7 @@ protected: * * @retval 0 on success, -1 otherwise. */ - int parse_entity_decl (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_entity_decl (void); /** * Parse an "ATTLIST" decl. Thse first character this method @@ -269,13 +268,13 @@ protected: * * @retval 0 on success, -1 otherwise. */ - int parse_attlist_decl (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_attlist_decl (void); /** * Parse a AttType declaration. * */ - int parse_atttype (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_atttype (void); /** *Parse a "NOTATION" decl. The first character this method @@ -284,7 +283,7 @@ protected: * * @retval 0 on success, -1 otherwise. */ - int parse_notation_decl (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_notation_decl (void); /** * Parse an ExternalID or a reference to PUBLIC ExternalID. @@ -306,69 +305,68 @@ protected: * * @retval 0 on success, -1 otherwise. */ - int parse_external_id (ACEXML_Char *&publicId, ACEXML_Char *&systemId - ACEXML_ENV_ARG_DECL); + int parse_external_id (ACEXML_Char *&publicId, ACEXML_Char *&systemId); /** * Parse an external DTD. * */ - int parse_external_dtd (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_external_dtd (void); /** * Parse an external subset. This does the actual parsing of an external * subset and is called by @sa parse_external_dtd. * */ - int parse_external_subset (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_external_subset (void); /** * Parse a markupDecl section. * */ - int parse_markup_decl (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_markup_decl (void); /** * Parse a conditionalSect declaration. * */ - int parse_conditional_section (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_conditional_section (void); /** * Parse a includeSect declaration. * */ - int parse_includesect (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_includesect (void); /** * * Parse a ignoreSect declaration. */ - int parse_ignoresect (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_ignoresect (void); /** * Parse a PEReference. * */ - int parse_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_PE_reference (void); /** * Parse a Reference. * */ - int parse_entity_reference (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_entity_reference (void); /** * Parse an entityValue. * */ - int parse_entity_value (ACEXML_Char *&str ACEXML_ENV_ARG_DECL); + int parse_entity_value (ACEXML_Char *&str); /** * Parse a DefaultDecl specification. * */ - int parse_defaultdecl (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_defaultdecl (void); /** @@ -379,7 +377,7 @@ protected: * * @retval 0 on success, -1 otherwise. */ - int parse_children_definition (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_children_definition (void); /** * Parse a @c cp non-terminal. @c cp can either be a @c seq or a @c choice. @@ -391,7 +389,7 @@ protected: * * @retval 0 on success, -1 otherwise. */ - int parse_child (int skip_open_paren ACEXML_ENV_ARG_DECL); + int parse_child (int skip_open_paren); /** * Parse a name from the input CharStream. If @a ch @!= 0, then we have @@ -448,7 +446,7 @@ protected: * if successful. * @retval 0 otherwise. */ - ACEXML_Char* parse_attname (ACEXML_ENV_SINGLE_ARG_DECL); + ACEXML_Char* parse_attname (void); /** * Parse an attribute value. @@ -456,14 +454,14 @@ protected: * @param str String containing the value of the attribute if successful. * @return 0 if attribute value was read successfully, -1 otherwise. */ - int parse_attvalue (ACEXML_Char*& str ACEXML_ENV_ARG_DECL); + int parse_attvalue (ACEXML_Char*& str); /** * Parse a tokenized type attribute. * * @return 0 if attribute type was read successfully, -1 otherwise. */ - int parse_tokenized_type (ACEXML_ENV_SINGLE_ARG_DECL); + int parse_tokenized_type (void); /** * Parse a SystemLiteral. @@ -624,19 +622,19 @@ private: * Dispatch errors to ErrorHandler. * */ - void error (const ACEXML_Char* msg ACEXML_ENV_ARG_DECL); + void error (const ACEXML_Char* msg); /** * Dispatch warnings to ErrorHandler. * */ - void warning (const ACEXML_Char* msg ACEXML_ENV_ARG_DECL); + void warning (const ACEXML_Char* msg); /** * Dispatch fatal errors to ErrorHandler. * */ - void fatal_error (const ACEXML_Char* msg ACEXML_ENV_ARG_DECL); + void fatal_error (const ACEXML_Char* msg); /** * Dispatch prefix mapping calls to the ContentHandler. @@ -648,7 +646,7 @@ private: */ void prefix_mapping (const ACEXML_Char* prefix, const ACEXML_Char* uri, - int start ACEXML_ENV_ARG_DECL); + int start); /** * Parse a keyword. */ @@ -663,7 +661,7 @@ private: /** * Pop the top element in the stack and replace current context with that. */ - size_t pop_context (int GE_ref ACEXML_ENV_ARG_DECL); + size_t pop_context (int GE_ref); /** * Create a new ACEXML_CharStream from @a systemId and @a publicId and @@ -688,7 +686,7 @@ private: * * @retval Number of whitespace characters skipped. */ - int check_for_PE_reference (ACEXML_ENV_SINGLE_ARG_DECL); + int check_for_PE_reference (void); /** * Reset the parser state. diff --git a/ACE/ACEXML/tests/ContentHandler_Test.cpp b/ACE/ACEXML/tests/ContentHandler_Test.cpp index 7c7e2c5594b..28835b25eaf 100644 --- a/ACE/ACEXML/tests/ContentHandler_Test.cpp +++ b/ACE/ACEXML/tests/ContentHandler_Test.cpp @@ -23,7 +23,7 @@ public: */ virtual void characters (const ACEXML_Char *ch, size_t start, - size_t length ACEXML_ENV_ARG_DECL); + size_t length); const ACEXML_Char *get_test_string (void) { return Basic_Content_Tester::test_string_; } @@ -40,20 +40,20 @@ const ACEXML_Char * Basic_Content_Tester::test_string_ = void Basic_Content_Tester::characters (const ACEXML_Char *ch, size_t start, - size_t length ACEXML_ENV_ARG_DECL) + size_t length) { - static int already_called = 0; + static bool already_called = false; static const ACEXML_Char *expect = ACE_TEXT ("Example\nd'internationalisation"); if (already_called) { - ACEXML_THROW (ACEXML_SAXException - (ACE_TEXT ("characters() called too much\n"))); + throw ACEXML_SAXException + (ACE_TEXT ("characters() called too much\n")); } - already_called = 1; + already_called = true; - size_t expected_len = ACE_OS::strlen (expect); + size_t const expected_len = ACE_OS::strlen (expect); if (length != expected_len) { ACE_ERROR ((LM_ERROR, @@ -61,9 +61,8 @@ Basic_Content_Tester::characters (const ACEXML_Char *ch, ACE_TEXT ("got %u (%*s)\n"), expected_len, expected_len, ch + start, length, length, ch + start)); - ACEXML_THROW (ACEXML_SAXException (ACE_TEXT ("Functionality failure"))); + throw ACEXML_SAXException (ACE_TEXT ("Functionality failure")); } - return; } int @@ -82,20 +81,16 @@ ACE_TMAIN (int, ACE_TCHAR *[]) ACEXML_InputSource input (test_stream); ACEXML_Parser parser; parser.setContentHandler (&tester); - ACEXML_TRY_NEW_ENV + try { parser.setFeature (ACE_TEXT ("http://xml.org/sax/features/validation"), - 0 - ACEXML_ENV_ARG_PARAMETER); - ACEXML_TRY_CHECK; - parser.parse (&input ACEXML_ENV_ARG_PARAMETER); - ACEXML_TRY_CHECK; + 0); + parser.parse (&input); } - ACEXML_CATCH (ACEXML_SAXException, ex) + catch (const ACEXML_SAXException& ex) { ex.print(); status = 1; } - ACEXML_ENDTRY; return status; } diff --git a/ACE/ACEXML/tests/Transcoder_Test.cpp b/ACE/ACEXML/tests/Transcoder_Test.cpp index f5dc289e5e0..83fab779702 100644 --- a/ACE/ACEXML/tests/Transcoder_Test.cpp +++ b/ACE/ACEXML/tests/Transcoder_Test.cpp @@ -5,8 +5,7 @@ #include "ace/OS_NS_string.h" #include "ace/OS_main.h" -void dump_utf16 (const ACEXML_UTF16 *data, - size_t len) +void dump_utf16 (const ACEXML_UTF16 *data, size_t len) { size_t ptr = 0; |