diff options
Diffstat (limited to 'TAO/CIAO/CCF')
18 files changed, 245 insertions, 59 deletions
diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLine.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLine.hpp index 4b4ac287224..69d5716eeb8 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLine.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLine.hpp @@ -9,8 +9,6 @@ #include <vector> #include <string> -using namespace std; - //@@ this stuff needs proper reimplementation class CommandLine diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineDescriptor.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineDescriptor.hpp index 42cfcb5051f..1944d8b4f59 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineDescriptor.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/CommandLineDescriptor.hpp @@ -154,6 +154,8 @@ namespace CL inline void print_text (std::ostream& os, Description const& d) { + using std::endl; + os << d.command (); Description::OptionIterator ob = d.begin_option (); @@ -183,7 +185,7 @@ namespace CL << (ob->optional () ? "]" : "") << endl; - os << "\t\t" << ob->description () << endl; + os << "\t\t" << ob->description () << endl << endl; } } @@ -192,6 +194,8 @@ namespace CL inline void print_html (std::ostream& os, Description const& d) { + using std::endl; + os << "<html>" << endl << "<body>" << endl << "<div align=\"center\">" << endl diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp index 75af953c318..713f917e834 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationBuffer.hpp @@ -11,6 +11,7 @@ namespace Indentation { + template <typename C> class Buffer { public: @@ -30,15 +31,15 @@ namespace Indentation public: typedef - std::char_traits<char> + std::char_traits<C> traits_type; typedef - traits_type::char_type + typename traits_type::char_type char_type; typedef - traits_type::char_type + typename traits_type::int_type int_type; public: diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp index 2772e9ecd2a..daede420625 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationCxx.hpp @@ -11,10 +11,28 @@ namespace Indentation { - class Cxx : public Buffer + template <typename C> + class Cxx : public Buffer<C> { public: - Cxx (Buffer& out) + typedef + typename Buffer<C>::traits_type + traits_type; + + typedef + typename Buffer<C>::char_type + char_type; + + typedef + typename Buffer<C>::int_type + int_type; + + typedef + typename Buffer<C>::EndOfStream + EndOfStream; + + public: + Cxx (Buffer<C>& out) : out_ (out), indentation_ (0), spaces_ (2), @@ -57,19 +75,25 @@ namespace Indentation // Reduce multiple newlines to one. while (hold_.size () > 1) { - Hold::reverse_iterator i = hold_.rbegin (); + typename Hold::reverse_iterator i = hold_.rbegin (); if (*i == '\n' && *(i + 1) == '\n') hold_.pop_back (); else break; } ensure_new_line (); output_indentation (); - + hold_.push_back (c); - + // result = write (c); - ensure_new_line (); + //ensure_new_line (); + + // Add double newline after '}'. + // + hold_.push_back ('\n'); + hold_.push_back ('\n'); + break; } @@ -77,16 +101,19 @@ namespace Indentation { // Handling '};' case. // + + bool brace (false); + if (hold_.size () > 1 && hold_.back () == '\n') { bool pop_nl (false); - for (Hold::reverse_iterator + for (typename Hold::reverse_iterator i (hold_.rbegin ()), e (hold_.rend ()); i != e; ++i) { if (*i != '\n') { - if (*i == '}') pop_nl = true; + if (*i == '}') brace = pop_nl = true; break; } } @@ -94,10 +121,15 @@ namespace Indentation if (pop_nl) while (hold_.back () == '\n') hold_.pop_back (); } - output_indentation (); result = write (c); + if (brace) + { + hold_.push_back ('\n'); + hold_.push_back ('\n'); + } + if (construct_ != STRING_LITERAL && construct_ != CHAR_LITERAL) { ensure_new_line (); @@ -219,7 +251,7 @@ namespace Indentation private: - Buffer& out_; + Buffer<C>& out_; unsigned long indentation_; unsigned long spaces_; diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationIDL.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationIDL.hpp index 3f428462745..1c620338206 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationIDL.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationIDL.hpp @@ -11,10 +11,28 @@ namespace Indentation { - class IDL : public Buffer + template <typename C> + class IDL : public Buffer<C> { public: - IDL (Buffer& out) + typedef + typename Buffer<C>::traits_type + traits_type; + + typedef + typename Buffer<C>::char_type + char_type; + + typedef + typename Buffer<C>::int_type + int_type; + + typedef + typename Buffer<C>::EndOfStream + EndOfStream; + + public: + IDL (Buffer<C>& out) : out_ (out), indentation_ (0), spaces_ (2), @@ -57,7 +75,7 @@ namespace Indentation // Reduce multiple newlines to one. while (hold_.size () > 1) { - Hold::reverse_iterator i = hold_.rbegin (); + typename Hold::reverse_iterator i = hold_.rbegin (); if (*i == '\n' && *(i + 1) == '\n') hold_.pop_back (); else break; } @@ -193,7 +211,7 @@ namespace Indentation private: - Buffer& out_; + Buffer<C>& out_; unsigned long indentation_; unsigned long spaces_; diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationImplanter.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationImplanter.hpp index 8dfc4093bdb..63303cdcb17 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationImplanter.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationImplanter.hpp @@ -11,10 +11,24 @@ namespace Indentation { - class ToStreamBufAdapter : public std::streambuf + template <typename C> + class ToStreamBufAdapter : public std::basic_streambuf<C> { public: - ToStreamBufAdapter (Buffer& buffer) + typedef + typename std::basic_streambuf<C>::traits_type + traits_type; + + typedef + typename std::basic_streambuf<C>::char_type + char_type; + + typedef + typename std::basic_streambuf<C>::int_type + int_type; + + public: + ToStreamBufAdapter (Buffer<C>& buffer) : buffer_ (buffer) { } @@ -22,7 +36,7 @@ namespace Indentation virtual int_type overflow (int_type c) { - return buffer_.put (Buffer::traits_type::to_char_type (c)); + return buffer_.put (traits_type::to_char_type (c)); } virtual int @@ -32,13 +46,31 @@ namespace Indentation } private: - Buffer& buffer_; + Buffer<C>& buffer_; }; - class FromStreamBufAdapter : public Buffer + template <typename C> + class FromStreamBufAdapter : public Buffer<C> { public: - FromStreamBufAdapter (std::streambuf& buffer) + typedef + typename Buffer<C>::traits_type + traits_type; + + typedef + typename Buffer<C>::char_type + char_type; + + typedef + typename Buffer<C>::int_type + int_type; + + typedef + typename Buffer<C>::Exception + Exception; + + public: + FromStreamBufAdapter (std::basic_streambuf<C>& buffer) : buffer_ (buffer) { } @@ -64,14 +96,14 @@ namespace Indentation } private: - std::streambuf& buffer_; + std::basic_streambuf<C>& buffer_; }; - template <typename Buffer> + template <template <typename> class Buffer, typename C = char> class Implanter { public: - Implanter (std::ostream& os) + Implanter (std::basic_ostream<C>& os) : os_ (os), prev_ (os_.rdbuf ()), from_adapter_ (*prev_), @@ -82,7 +114,7 @@ namespace Indentation } template <typename Arg0> - Implanter (std::ostream& os, Arg0 a0) + Implanter (std::basic_ostream<C>& os, Arg0 a0) : os_ (os), prev_ (os_.rdbuf ()), from_adapter_ (*prev_), @@ -107,14 +139,14 @@ namespace Indentation } private: - std::ostream& os_; - std::streambuf* prev_; + std::basic_ostream<C>& os_; + std::basic_streambuf<C>* prev_; - FromStreamBufAdapter from_adapter_; + FromStreamBufAdapter<C> from_adapter_; - Buffer buffer_; + Buffer<C> buffer_; - ToStreamBufAdapter to_adapter_; + ToStreamBufAdapter<C> to_adapter_; }; } diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationXML.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationXML.hpp index fd45f9b11bd..774a70e501f 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationXML.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/IndentationXML.hpp @@ -1,5 +1,6 @@ // file : CCF/CodeGenerationKit/IndentationXML.hpp // author : Diego Sevilla Ruiz <dsevilla@ditec.um.es> +// author : Boris Kolpackov <boris@dre.vanderbilt.edu> // cvs-id : $Id$ #ifndef CCF_CODE_GENERATION_KIT_INDENTATION_XML_HPP @@ -11,10 +12,28 @@ namespace Indentation { - class XML : public Buffer + template <typename C> + class XML : public Buffer<C> { public: - XML (Buffer& out) + typedef + typename Buffer<C>::traits_type + traits_type; + + typedef + typename Buffer<C>::char_type + char_type; + + typedef + typename Buffer<C>::int_type + int_type; + + typedef + typename Buffer<C>::EndOfStream + EndOfStream; + + public: + XML (Buffer<C>& out) : out_ (out), indentation_ (0), base_indent_ (indentation_), @@ -186,7 +205,7 @@ namespace Indentation private: - Buffer& out_; + Buffer<C>& out_; long indentation_; unsigned long base_indent_; unsigned long spaces_; @@ -203,17 +222,12 @@ namespace Indentation Construct construct_; - typedef std::deque<int_type> Hold; + typedef + std::deque<int_type> + Hold; Hold hold_; }; } #endif // CCF_CODE_GENERATION_KIT_INDENTATION_XML_HPP - -/* - * Local Variables: - * mode: C++ - * c-basic-offset: 2 - * End: - */ diff --git a/TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp b/TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp index 17f0cd09baa..8b5a14cbf22 100644 --- a/TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp +++ b/TAO/CIAO/CCF/CCF/CodeGenerationKit/Regex.hpp @@ -14,8 +14,12 @@ namespace regex using boost::regex_merge; inline std::string - perl_s (std::string src, std::string e, char delimiter = '/') + perl_s (std::string src, std::string e) { + if (e.empty ()) return src; + + char delimiter (e[0]); + std::string::size_type first = e.find (delimiter); std::string::size_type middle = e.find (delimiter, first + 1); std::string::size_type last = e.find (delimiter, middle + 1); @@ -33,6 +37,33 @@ namespace regex format, boost::match_default | boost::format_all ); } + + using boost::wregex; + + inline std::wstring + perl_s (std::wstring src, std::wstring e) + { + if (e.empty ()) return src; + + wchar_t delimiter (e[0]); + + std::wstring::size_type first = e.find (delimiter); + std::wstring::size_type middle = e.find (delimiter, first + 1); + std::wstring::size_type last = e.find (delimiter, middle + 1); + + std::wstring pattern (e, first + 1, middle - first - 1); + std::wstring format (e, middle + 1, last - middle - 1); + + //std::cout << pattern << " " << format << std::endl; + + wregex expr (pattern); + + return regex_merge ( + src, + expr, + format, + boost::match_default | boost::format_all ); + } } #endif // CCF_RUNTIME_REGEX_HPP diff --git a/TAO/CIAO/CCF/CCF/CompilerElements/Context.hpp b/TAO/CIAO/CCF/CCF/CompilerElements/Context.hpp index 02a2145c429..fe799e32b48 100644 --- a/TAO/CIAO/CCF/CCF/CompilerElements/Context.hpp +++ b/TAO/CIAO/CCF/CCF/CompilerElements/Context.hpp @@ -31,7 +31,7 @@ namespace CCF Map::size_type count (char const* key) const throw () { - return map_.count (key) != 0; + return map_.count (key); } template <typename T> @@ -88,6 +88,16 @@ namespace CCF } } + void + remove (char const* key) throw (NotFound) + { + Map::iterator i (map_.find (key)); + + if (i == map_.end ()) throw NotFound (); + + map_.erase (i); + } + private: Map map_; diff --git a/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp b/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp index 43b94414db1..665a86270a3 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp @@ -16,6 +16,16 @@ #include "CCF/IDL2/Parsing/Action.hpp" #include "CCF/IDL2/Parsing/Recovery.hpp" +// #$%^ing MS +// +#ifdef CONST +#undef CONST +#undef FACTORY +#undef IN +#undef OUT +#endif + + namespace CCF { namespace IDL2 diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Name.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Name.cpp index 19cd6fc1f9f..c7a48fc8494 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Name.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Name.cpp @@ -196,7 +196,7 @@ namespace CCF ScopedName ScopedName:: scope_name () const throw (FileScope) { - Iterator end (end () - 1); + Iterator end (this->end () - 1); if (begin () == end) throw FileScope (); diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Elements.hpp index 0e89696406a..745e017f9f9 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Elements.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Elements.hpp @@ -393,6 +393,10 @@ namespace CCF struct ScopeTemplate : Node<T> { public: + /* GCC#13590/DR#39 + using Node<T>::edge_traverser; + */ + virtual void traverse (T& s) { @@ -403,7 +407,7 @@ namespace CCF names (T& s) { names_pre (s); - names (s, edge_traverser ()); + names (s, this->edge_traverser ()); names_post (s); } diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Interface.hpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Interface.hpp index 64bce204efc..c7d9ba574ee 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Interface.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Interface.hpp @@ -27,6 +27,10 @@ namespace CCF template <typename T> struct InterfaceTemplate : ScopeTemplate<T> { + /* GCC#13590/DR#39 + using ScopeTemplate<T>::edge_traverser; + */ + virtual void traverse (T&); diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Interface.tpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Interface.tpp index 7c22c0794f4..23d2bfd922d 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Interface.tpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Interface.tpp @@ -52,7 +52,7 @@ namespace CCF inherits_pre (i); iterate_and_traverse (b, e, - edge_traverser (), + this->edge_traverser (), *this, &InterfaceTemplate::comma, i); diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.hpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.hpp index 92dbb390dab..04a426301f0 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.hpp @@ -57,6 +57,10 @@ namespace CCF template<typename T> struct ParameterTemplate : Node<T> { + /* GCC#13590/DR#39 + using Node<T>::edge_traverser; + */ + virtual void traverse (T&); @@ -98,6 +102,10 @@ namespace CCF template <typename T> struct OperationTemplate : Node<T> { + /* GCC#13590/DR#39 + using Node<T>::edge_traverser; + */ + virtual void traverse (T&); diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.tpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.tpp index 3c46aae76c3..bcb3760ec3b 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.tpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.tpp @@ -38,7 +38,7 @@ namespace CCF void ParameterTemplate<T>:: belongs (T& p) { - belongs (p, edge_traverser ()); + belongs (p, this->edge_traverser ()); } template<typename T> @@ -86,7 +86,7 @@ namespace CCF void OperationTemplate<T>:: returns (T& o) { - returns (o, edge_traverser ()); + returns (o, this->edge_traverser ()); } template<typename T> @@ -113,7 +113,7 @@ namespace CCF { receives_pre (o); iterate_and_traverse ( - b, e, edge_traverser (), *this, &OperationTemplate<T>::comma, o); + b, e, this->edge_traverser (), *this, &OperationTemplate<T>::comma, o); receives_post (o); } else @@ -158,7 +158,7 @@ namespace CCF { raises_pre (o); iterate_and_traverse ( - b, e, edge_traverser (), *this, &OperationTemplate<T>::comma, o); + b, e, this->edge_traverser (), *this, &OperationTemplate<T>::comma, o); raises_post (o); } else diff --git a/TAO/CIAO/CCF/CCF/IDL3/Traversal/Component.hpp b/TAO/CIAO/CCF/CCF/IDL3/Traversal/Component.hpp index 9aac498931f..ebc0f79c704 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/Traversal/Component.hpp +++ b/TAO/CIAO/CCF/CCF/IDL3/Traversal/Component.hpp @@ -17,6 +17,10 @@ namespace CCF template <typename T> struct PortTemplate : Node<T> { + /* GCC#13590/DR#39 + using Node<T>::edge_traverser; + */ + virtual void traverse (T&); }; @@ -24,6 +28,10 @@ namespace CCF template <typename T> struct PortAccessorTemplate : Node<T> { + /* GCC#13590/DR#39 + using Node<T>::edge_traverser; + */ + virtual void traverse (T&); @@ -70,6 +78,10 @@ namespace CCF template <typename T> struct PortGetTemplate : PortAccessorTemplate<T> { + /* GCC#13590/DR#39 + using Node<T>::edge_traverser; + */ + virtual void returns (T&); }; @@ -77,6 +89,10 @@ namespace CCF template <typename T> struct PortSetTemplate : PortAccessorTemplate<T> { + /* GCC#13590/DR#39 + using Node<T>::edge_traverser; + */ + virtual void receives (T&); }; @@ -84,6 +100,10 @@ namespace CCF template <typename T> struct PortDataTemplate : Node<T> { + /* GCC#13590/DR#39 + using Node<T>::edge_traverser; + */ + virtual void traverse (T&); diff --git a/TAO/CIAO/CCF/CCF/IDL3/Traversal/Component.tpp b/TAO/CIAO/CCF/CCF/IDL3/Traversal/Component.tpp index b6d96da7d0a..fc74e4c717b 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/Traversal/Component.tpp +++ b/TAO/CIAO/CCF/CCF/IDL3/Traversal/Component.tpp @@ -15,7 +15,7 @@ namespace CCF void PortTemplate<T>:: traverse (T& p) { - edge_traverser ().traverse (p.belongs ()); + this->edge_traverser ().traverse (p.belongs ()); } @@ -129,7 +129,7 @@ namespace CCF void PortGetTemplate<T>:: returns (T& p) { - PortAccessorTemplate<T>::returns (p, edge_traverser ()); + PortAccessorTemplate<T>::returns (p, this->edge_traverser ()); } @@ -141,7 +141,7 @@ namespace CCF receives (T& p) { receives_pre (p); - PortAccessorTemplate<T>::receives (p, edge_traverser ()); + PortAccessorTemplate<T>::receives (p, this->edge_traverser ()); receives_post (p); } @@ -176,7 +176,7 @@ namespace CCF void PortDataTemplate<T>:: belongs (T& p) { - belongs (p, edge_traverser ()); + belongs (p, this->edge_traverser ()); } template <typename T> |