diff options
author | boris <boris@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-11-05 20:11:50 +0000 |
---|---|---|
committer | boris <boris@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-11-05 20:11:50 +0000 |
commit | 53b452ed10e956b47c353cc7c0ba4d89a2517416 (patch) | |
tree | 65210d360892dac75349d45d570c975a0311f12e /TAO/CIAO | |
parent | 59f98fc80fe0b5f5bdac9105a36992f63a899f4a (diff) | |
download | ATCD-53b452ed10e956b47c353cc7c0ba4d89a2517416.tar.gz |
ChangeLogTag: Wed Nov 5 14:07:06 2003 Boris Kolpackov <boris@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/CIAO')
-rw-r--r-- | TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineGrammar.hpp | 4 | ||||
-rw-r--r-- | TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineParser.cpp | 2 | ||||
-rw-r--r-- | TAO/CIAO/CCF/CCF/IDL2/Parser.hpp | 51 | ||||
-rw-r--r-- | TAO/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp | 92 | ||||
-rw-r--r-- | TAO/CIAO/CCF/CCF/IDL2/SyntaxTree/Elements.hpp | 2 | ||||
-rw-r--r-- | TAO/CIAO/ChangeLog | 21 |
6 files changed, 100 insertions, 72 deletions
diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineGrammar.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineGrammar.hpp index af9f38b4763..7240186c07c 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineGrammar.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineGrammar.hpp @@ -46,8 +46,6 @@ struct string_directive : public unary<S, parser<string_directive<S> > > Iterator save = scan.first; - int len = 0; - if (!scan.at_end()) { // Now go one level deeper @@ -61,7 +59,7 @@ struct string_directive : public unary<S, parser<string_directive<S> > > match<nil_t> hit = this->subject ().parse(sl_scan); - if (hit.length() == v.length ()) + if (static_cast<std::size_t> (hit.length()) == v.length ()) { ++scan; diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineParser.cpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineParser.cpp index 03d35a2d6a3..49e241fc475 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineParser.cpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineParser.cpp @@ -34,7 +34,7 @@ bool parse (int argc, char* argv[], CommandLine& cl) throw () match<nil_t> hit = g.parse(scan); - bool result = hit.length() == v.size (); + bool result = static_cast<std::size_t>(hit.length()) == v.size (); // some semantic analisys if (!cl.separator) diff --git a/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp b/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp index 390f8fb3184..482d8cdc63b 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp @@ -98,11 +98,11 @@ namespace CCF } RecoveryStatus - operator() (Parsing::Scanner const& s, Parsing::Error& e) const + operator() (Parsing::Scanner const& s, Parsing::Error e) const { Iterator i = e.where; - switch (e.descriptor.diagnostic_) + switch (e.descriptor->diagnostic_) { case Parsing::DiagnosticType::BEFORE: { @@ -111,7 +111,7 @@ namespace CCF (*i)->line ()); rec << "before \'" << (*i)->lexeme () << "\': " - << e.descriptor.description_; + << e.descriptor->description_; dout_ << rec; break; @@ -125,7 +125,7 @@ namespace CCF (*i)->line ()); rec << "after \'" << (*i)->lexeme () << "\': " - << e.descriptor.description_; + << e.descriptor->description_; dout_ << rec; break; @@ -135,13 +135,13 @@ namespace CCF } } - if (e.descriptor.action_one_.get ()) - e.descriptor.action_one_->execute (); + if (e.descriptor->action_one_.get ()) + e.descriptor->action_one_->execute (); - if (e.descriptor.action_two_.get ()) - e.descriptor.action_two_->execute (); + if (e.descriptor->action_two_.get ()) + e.descriptor->action_two_->execute (); - switch (e.descriptor.recovery_) + switch (e.descriptor->recovery_) { case Parsing::RecoveryMethod::STANDARD: { @@ -175,7 +175,7 @@ namespace CCF } } - switch (e.descriptor.diagnostic_) + switch (e.descriptor->diagnostic_) { case Parsing::DiagnosticType::BEFORE: { @@ -205,13 +205,14 @@ namespace CCF } } - e.descriptor.recovery_ = Parsing::RecoveryMethod::BAIL_OUT; - e.descriptor.diagnostic_ = Parsing::DiagnosticType::NONE; + e.descriptor->recovery_ = Parsing::RecoveryMethod::BAIL_OUT; + e.descriptor->diagnostic_ = Parsing::DiagnosticType::NONE; - e.descriptor.action_one_.reset (); - e.descriptor.action_two_.reset (); + e.descriptor->action_one_.reset (); + e.descriptor->action_two_.reset (); - return RecoveryStatus (RecoveryStatus::rethrow); + // return RecoveryStatus (RecoveryStatus::rethrow); + throw e; } case Parsing::RecoveryMethod::NONE: default: @@ -222,13 +223,14 @@ namespace CCF } case Parsing::RecoveryMethod::BAIL_OUT: { - e.descriptor.recovery_ = Parsing::RecoveryMethod::BAIL_OUT; - e.descriptor.diagnostic_ = Parsing::DiagnosticType::NONE; + e.descriptor->recovery_ = Parsing::RecoveryMethod::BAIL_OUT; + e.descriptor->diagnostic_ = Parsing::DiagnosticType::NONE; - e.descriptor.action_one_.reset (); - e.descriptor.action_two_.reset (); + e.descriptor->action_one_.reset (); + e.descriptor->action_two_.reset (); - return RecoveryStatus (RecoveryStatus::rethrow); + // return RecoveryStatus (RecoveryStatus::rethrow); + throw e; } } } @@ -272,17 +274,18 @@ namespace CCF } RecoveryStatus - operator() (Parsing::Scanner const& s, Parsing::Error& e) const + operator() (Parsing::Scanner const& s, Parsing::Error e) const { assert ( - e.descriptor.diagnostic_ == Parsing::DiagnosticType::NONE && - e.descriptor.recovery_ == Parsing::RecoveryMethod::BAIL_OUT + e.descriptor->diagnostic_ == Parsing::DiagnosticType::NONE && + e.descriptor->recovery_ == Parsing::RecoveryMethod::BAIL_OUT ); if (action_one_.get ()) action_one_->execute (); if (action_two_.get ()) action_two_->execute (); - return RecoveryStatus (RecoveryStatus::rethrow); + // return RecoveryStatus (RecoveryStatus::rethrow); + throw e; } std::auto_ptr<Parsing::Thunk> action_one_; diff --git a/TAO/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp b/TAO/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp index 021d28a034e..82ae9be30c5 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Parsing/Recovery.hpp @@ -7,6 +7,7 @@ #include <memory> +#include "CCF/CompilerElements/ReferenceCounting.hpp" #include "CCF/IDL2/Parsing/Elements.hpp" namespace CCF @@ -107,8 +108,11 @@ namespace CCF // // // - struct RecoveryDescriptor + struct RecoveryDescriptor : + public virtual ReferenceCounting::DefaultImpl <> { + virtual ~RecoveryDescriptor () throw () {} + RecoveryDescriptor (std::string d, RecoveryMethod::Value recovery, DiagnosticType::Value diagnostic) @@ -166,13 +170,19 @@ namespace CCF DiagnosticType::Value diagnostic_; }; + typedef + ReferenceCounting::StrictPtr<RecoveryDescriptor> + RecoveryDescriptorPtr; + // I have to use a pointer to RecoveryDescriptor instead of + // just RecoveryDescriptor to subvert constness of descriptor + // member in spirit::parser_error. // // - // + typedef - parser_error<RecoveryDescriptor, Iterator> + parser_error<RecoveryDescriptorPtr, Iterator> Error; @@ -181,54 +191,56 @@ namespace CCF // struct Assertion { - assertion<RecoveryDescriptor> + typedef + assertion<RecoveryDescriptorPtr> + AssertionImpl; + + AssertionImpl operator () (RecoveryMethod::Value recovery = RecoveryMethod::NONE) { - return assertion<RecoveryDescriptor> ( - RecoveryDescriptor ("", recovery, DiagnosticType::NONE)); + return AssertionImpl ( + RecoveryDescriptorPtr ( + new RecoveryDescriptor ("", recovery, DiagnosticType::NONE))); } - assertion<RecoveryDescriptor> + AssertionImpl operator () (std::string d, RecoveryMethod::Value recovery = RecoveryMethod::STANDARD, DiagnosticType::Value diagnostic = DiagnosticType::AFTER) { - return assertion<RecoveryDescriptor> ( - RecoveryDescriptor (d, recovery, diagnostic)); + return AssertionImpl ( + RecoveryDescriptorPtr ( + new RecoveryDescriptor (d, recovery, diagnostic))); } template<typename Object> - assertion<RecoveryDescriptor> + AssertionImpl operator () (std::string d, Object& obj, void (Object::*action_one)(), RecoveryMethod::Value recovery = RecoveryMethod::STANDARD, DiagnosticType::Value diagnostic = DiagnosticType::AFTER) { - return assertion<RecoveryDescriptor> ( - RecoveryDescriptor (d, - recovery, - diagnostic, - obj, - action_one)); + return AssertionImpl ( + RecoveryDescriptorPtr ( + new RecoveryDescriptor ( + d, recovery, diagnostic, obj, action_one))); } template<typename Object> - assertion<RecoveryDescriptor> + AssertionImpl operator () (Object& obj, void (Object::*action_one)(), RecoveryMethod::Value recovery = RecoveryMethod::BAIL_OUT) { - return assertion<RecoveryDescriptor> ( - RecoveryDescriptor ("", - recovery, - DiagnosticType::NONE, - obj, - action_one)); + return AssertionImpl ( + RecoveryDescriptorPtr ( + new RecoveryDescriptor ( + "", recovery, DiagnosticType::NONE, obj, action_one))); } template<typename Object> - assertion<RecoveryDescriptor> + AssertionImpl operator () (std::string d, Object& obj, void (Object::*action_one)(), @@ -236,32 +248,30 @@ namespace CCF RecoveryMethod::Value recovery = RecoveryMethod::STANDARD, DiagnosticType::Value diagnostic = DiagnosticType::AFTER) { - return assertion<RecoveryDescriptor> ( - RecoveryDescriptor (d, - recovery, - diagnostic, - obj, - action_one, - action_two)); + return AssertionImpl ( + RecoveryDescriptorPtr ( + new RecoveryDescriptor ( + d, recovery, diagnostic, obj, action_one, action_two))); } template<typename Object> - assertion<RecoveryDescriptor> + AssertionImpl operator () (Object& obj, void (Object::*action_one)(), void (Object::*action_two)(), RecoveryMethod::Value recovery = RecoveryMethod::BAIL_OUT) { - return assertion<RecoveryDescriptor> ( - RecoveryDescriptor ("", - recovery, - DiagnosticType::NONE, - obj, - action_one, - action_two)); + return AssertionImpl ( + RecoveryDescriptorPtr ( + new RecoveryDescriptor ("", + recovery, + DiagnosticType::NONE, + obj, + action_one, + action_two))); } - + }; typedef @@ -269,7 +279,7 @@ namespace CCF RecoveryStatus; typedef - guard<RecoveryDescriptor> + guard<RecoveryDescriptorPtr> Guard; } } diff --git a/TAO/CIAO/CCF/CCF/IDL2/SyntaxTree/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL2/SyntaxTree/Elements.hpp index 5f9e0918de3..2c3973eed5c 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SyntaxTree/Elements.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SyntaxTree/Elements.hpp @@ -537,7 +537,7 @@ namespace CCF { context_holder_ = ContextHolderPtr (new ContextHolder); } - + return context_holder_; } diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index dee2fe4d23c..55c220b5cd9 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,11 +1,28 @@ +Wed Nov 5 14:07:06 2003 Boris Kolpackov <boris@dre.vanderbilt.edu> + + * CCF/CCF/CodeGenerationKit/CommandLineGrammar.hpp: + * CCF/CCF/CodeGenerationKit/CommandLineParser.cpp: + + Got rid of some warnings. + + * CCF/CCF/IDL2/Parser.hpp: + * CCF/CCF/IDL2/Parsing/Recovery.hpp: + * CCF/CCF/IDL2/SyntaxTree/Elements.hpp: + + Added a work-around to subvert constness of descriptor + member in spirit::parser_error. Joel de Guzman acknowledged + that this is an architectural error but unfortunately it + doesn't seem he is going to fix it any time soon (even though + patch is available). + Tue Nov 4 21:21:06 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> * ciao/ComponentsC.h: * ciao/ComponentsS.h; Regenerated these files. Not sure why this is maintained in the - repo. - + repo. + * examples/handcrafted/Hello/hello_executors.h: #include "tao/LocalObject.h" |