From 973221821ac8e20da4eadbf4ad552f686b1ace48 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jun 2012 15:07:35 +0200 Subject: Get rid of dependency on libcult --- xsde/cxx/hybrid/aggregate-elements.hxx | 8 +- xsde/cxx/hybrid/aggregate-include.hxx | 24 +- xsde/cxx/hybrid/default-value.cxx | 126 ++++---- xsde/cxx/hybrid/default-value.hxx | 84 ++--- xsde/cxx/hybrid/elements.cxx | 32 +- xsde/cxx/hybrid/elements.hxx | 397 ++++++++++++------------ xsde/cxx/hybrid/extraction-header.cxx | 24 +- xsde/cxx/hybrid/extraction-header.hxx | 2 +- xsde/cxx/hybrid/extraction-source.cxx | 62 ++-- xsde/cxx/hybrid/extraction-source.hxx | 2 +- xsde/cxx/hybrid/generator.cxx | 98 +++--- xsde/cxx/hybrid/generator.hxx | 29 +- xsde/cxx/hybrid/insertion-header.cxx | 24 +- xsde/cxx/hybrid/insertion-header.hxx | 2 +- xsde/cxx/hybrid/insertion-source.cxx | 40 +-- xsde/cxx/hybrid/insertion-source.hxx | 2 +- xsde/cxx/hybrid/options.cli | 68 ++-- xsde/cxx/hybrid/parser-aggregate-header.cxx | 128 ++++---- xsde/cxx/hybrid/parser-aggregate-header.hxx | 2 +- xsde/cxx/hybrid/parser-aggregate-source.cxx | 75 +++-- xsde/cxx/hybrid/parser-aggregate-source.hxx | 2 +- xsde/cxx/hybrid/parser-header.cxx | 44 +-- xsde/cxx/hybrid/parser-header.hxx | 2 +- xsde/cxx/hybrid/parser-name-processor.cxx | 82 +++-- xsde/cxx/hybrid/parser-name-processor.hxx | 9 +- xsde/cxx/hybrid/parser-source.cxx | 62 ++-- xsde/cxx/hybrid/parser-source.hxx | 2 +- xsde/cxx/hybrid/serializer-aggregate-header.cxx | 129 ++++---- xsde/cxx/hybrid/serializer-aggregate-header.hxx | 2 +- xsde/cxx/hybrid/serializer-aggregate-source.cxx | 76 +++-- xsde/cxx/hybrid/serializer-aggregate-source.hxx | 2 +- xsde/cxx/hybrid/serializer-header.cxx | 46 +-- xsde/cxx/hybrid/serializer-header.hxx | 2 +- xsde/cxx/hybrid/serializer-name-processor.cxx | 77 +++-- xsde/cxx/hybrid/serializer-name-processor.hxx | 9 +- xsde/cxx/hybrid/serializer-source.cxx | 72 ++--- xsde/cxx/hybrid/serializer-source.hxx | 2 +- xsde/cxx/hybrid/tree-forward.cxx | 110 +++---- xsde/cxx/hybrid/tree-forward.hxx | 4 +- xsde/cxx/hybrid/tree-header.cxx | 208 ++++++------- xsde/cxx/hybrid/tree-header.hxx | 2 +- xsde/cxx/hybrid/tree-inline.cxx | 66 ++-- xsde/cxx/hybrid/tree-inline.hxx | 2 +- xsde/cxx/hybrid/tree-name-processor.cxx | 299 +++++++++--------- xsde/cxx/hybrid/tree-name-processor.hxx | 9 +- xsde/cxx/hybrid/tree-size-processor.cxx | 248 ++++++++------- xsde/cxx/hybrid/tree-size-processor.hxx | 11 +- xsde/cxx/hybrid/tree-source.cxx | 134 ++++---- xsde/cxx/hybrid/tree-source.hxx | 2 +- xsde/cxx/hybrid/tree-type-map.cxx | 23 +- xsde/cxx/hybrid/tree-type-map.hxx | 8 +- xsde/cxx/hybrid/validator.cxx | 78 ++--- xsde/cxx/hybrid/validator.hxx | 11 +- 53 files changed, 1509 insertions(+), 1555 deletions(-) (limited to 'xsde/cxx/hybrid') diff --git a/xsde/cxx/hybrid/aggregate-elements.hxx b/xsde/cxx/hybrid/aggregate-elements.hxx index a7ac9c7..c73696e 100644 --- a/xsde/cxx/hybrid/aggregate-elements.hxx +++ b/xsde/cxx/hybrid/aggregate-elements.hxx @@ -6,7 +6,7 @@ #ifndef CXX_HYBRID_AGGREGATE_ELEMENTS_HXX #define CXX_HYBRID_AGGREGATE_ELEMENTS_HXX -#include +#include #include @@ -14,9 +14,7 @@ namespace CXX { namespace Hybrid { - typedef - Cult::Containers::Map - TypeInstanceMap; + typedef std::map TypeInstanceMap; struct InstanceInfo { @@ -24,7 +22,7 @@ namespace CXX String name; }; - typedef Cult::Containers::Map TypeIdInstanceMap; + typedef std::map TypeIdInstanceMap; } } diff --git a/xsde/cxx/hybrid/aggregate-include.hxx b/xsde/cxx/hybrid/aggregate-include.hxx index 03a5198..01ec3c9 100644 --- a/xsde/cxx/hybrid/aggregate-include.hxx +++ b/xsde/cxx/hybrid/aggregate-include.hxx @@ -6,7 +6,7 @@ #ifndef CXX_HYBRID_AGGREGATE_INCLUDE_HXX #define CXX_HYBRID_AGGREGATE_INCLUDE_HXX -#include +#include #include #include @@ -31,7 +31,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c); @@ -71,7 +71,7 @@ namespace CXX belongs_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { if (types_.find (&t) != types_.end ()) @@ -83,7 +83,7 @@ namespace CXX collect (t); } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (types_.find (&c) != types_.end ()) @@ -104,7 +104,7 @@ namespace CXX } private: - virtual Void + virtual void collect (SemanticGraph::Type& t) { using SemanticGraph::Type; @@ -120,7 +120,7 @@ namespace CXX } } - virtual Void + virtual void emit (SemanticGraph::Type& t) { using SemanticGraph::Schema; @@ -173,8 +173,8 @@ namespace CXX } private: - Cult::Containers::Set types_; - Cult::Containers::Set schemas_; + std::set types_; + std::set schemas_; BaseInclude base_; Traversal::Inherits inherits_; @@ -194,19 +194,19 @@ namespace CXX Traversal::Element, Context { - AggregateInclude (Context& c, Char const* key) + AggregateInclude (Context& c, char const* key) : Context (c), key_ (key), type_include_ (c) { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { if (t.context ().count (key_)) type_include_.dispatch (t); } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.context ().count (key_)) @@ -214,7 +214,7 @@ namespace CXX } private: - Char const* key_; + char const* key_; TypeInclude type_include_; }; } diff --git a/xsde/cxx/hybrid/default-value.cxx b/xsde/cxx/hybrid/default-value.cxx index d6287a8..f45ff4b 100644 --- a/xsde/cxx/hybrid/default-value.cxx +++ b/xsde/cxx/hybrid/default-value.cxx @@ -24,18 +24,18 @@ namespace CXX { } - Void InitValue:: + void InitValue:: dispatch (SemanticGraph::Node& type, String const& value) { value_ = value; Traversal::NodeBase::dispatch (type); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::List& l) { SemanticGraph::Type& t (l.argumented ().type ()); - Boolean fl (fixed_length (t)); + bool fl (fixed_length (t)); LiteralValue::collapse (value_); @@ -45,9 +45,9 @@ namespace CXX String ov (value_); String om (member_); - Size b (0); + size_t b (0); - for (Size e (ov.find (' ')); ; e = ov.find (' ', b)) + for (size_t e (ov.find (' ')); ; e = ov.find (' ', b)) { String v (ov, b, e != String::npos ? e - b : e); @@ -146,7 +146,7 @@ namespace CXX value_ = ov; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Union& u) { String const& value (u.context ().get ("value")); @@ -178,13 +178,13 @@ namespace CXX } } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Complex& c) { Traversal::NodeBase::dispatch (ultimate_base (c)); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Enumeration& e) { using SemanticGraph::Enumerator; @@ -215,7 +215,7 @@ namespace CXX // String const& vt (e.context ().get ("value-type")); - Size n (0); + size_t n (0); { Enumeration const& tmp (x); for (Enumeration::NamesConstIterator i (tmp.names_begin ()); @@ -233,7 +233,7 @@ namespace CXX os << ");"; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Type& t) { // This is a fall-back case where we handle all other (literal) @@ -245,7 +245,7 @@ namespace CXX // anySimpleType. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::AnySimpleType& t) { string_type (t); @@ -253,49 +253,49 @@ namespace CXX // Strings. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::String& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::NormalizedString& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Token& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::NameToken& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::NameTokens&) { string_sequence_type (); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Name& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::NCName& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Language& t) { string_type (t); @@ -303,13 +303,13 @@ namespace CXX // Qualified name. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::QName&) { // Newer version of the XSD frontend provide resolved values // in the form #. // - Size p (value_.rfind ('#')); + size_t p (value_.rfind ('#')); if (p != String::npos) value_ = String (value_, p + 1, value_.size () - p - 1); @@ -348,19 +348,19 @@ namespace CXX // ID/IDREF. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Id& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::IdRef& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::IdRefs&) { string_sequence_type (); @@ -368,7 +368,7 @@ namespace CXX // URI. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::AnyURI& t) { string_type (t); @@ -376,7 +376,7 @@ namespace CXX // Binary. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Base64Binary&) { LiteralValue::collapse (value_); @@ -386,7 +386,7 @@ namespace CXX << endl; } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::HexBinary&) { LiteralValue::collapse (value_); @@ -399,15 +399,15 @@ namespace CXX // Date/time. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Date&) { // date := [-]CCYY[N]*-MM-DD[Z|(+|-)HH:MM] // LiteralValue::collapse (value_); - Size b (0); - Size e (value_.find ('-', value_[0] == '-' ? 5 : 4)); + size_t b (0); + size_t e (value_.find ('-', value_[0] == '-' ? 5 : 4)); String year (value_, 0, e); b = e + 1; @@ -427,15 +427,15 @@ namespace CXX time_zone (b + 2); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::DateTime&) { // date_time := [-]CCYY[N]*-MM-DDTHH:MM:SS[.S+][Z|(+|-)HH:MM] // LiteralValue::collapse (value_); - Size b (0); - Size e (value_.find ('-', value_[0] == '-' ? 5 : 4)); + size_t b (0); + size_t e (value_.find ('-', value_[0] == '-' ? 5 : 4)); String year (value_, 0, e); b = e + 1; @@ -454,7 +454,7 @@ namespace CXX e = b + 2; for (; e < value_.size (); ++e) { - WideChar c (value_[e]); + wchar_t c (value_[e]); if (c == 'Z' || c == '+' || c == '-') break; @@ -482,12 +482,12 @@ namespace CXX namespace { - Size - find_delim (String const& s, Size pos) + size_t + find_delim (String const& s, size_t pos) { for (; pos < s.size (); ++pos) { - WideChar c (s[pos]); + wchar_t c (s[pos]); if (c == 'Y' || c == 'D' || c == 'M' || c == 'H' || c == 'M' || c == 'S' || c == 'T') @@ -498,14 +498,14 @@ namespace CXX } } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Duration&) { // duration := [-]P[nY][nM][nD][TnHnMn[.n+]S] // LiteralValue::collapse (value_); - Size b (1), e, n (value_.size ()); + size_t b (1), e, n (value_.size ()); if (value_[0] == '-') { @@ -583,7 +583,7 @@ namespace CXX } } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Day&) { // gday := ---DD[Z|(+|-)HH:MM] @@ -598,7 +598,7 @@ namespace CXX time_zone (5); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Month&) { // gmonth := --MM[Z|(+|-)HH:MM] @@ -613,7 +613,7 @@ namespace CXX time_zone (4); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::MonthDay&) { // gmonth_day := --MM-DD[Z|(+|-)HH:MM] @@ -632,17 +632,17 @@ namespace CXX time_zone (7); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Year&) { // gyear := [-]CCYY[N]*[Z|(+|-)HH:MM] // LiteralValue::collapse (value_); - Size pos (value_[0] == '-' ? 5 : 4); + size_t pos (value_[0] == '-' ? 5 : 4); for (; pos < value_.size (); ++pos) { - WideChar c (value_[pos]); + wchar_t c (value_[pos]); if (c == 'Z' || c == '+' || c == '-') break; @@ -656,14 +656,14 @@ namespace CXX time_zone (pos); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::YearMonth&) { // gyear_month := [-]CCYY[N]*-MM[Z|(+|-)HH:MM] // LiteralValue::collapse (value_); - Size pos (value_.find ('-', value_[0] == '-' ? 5 : 4)); + size_t pos (value_.find ('-', value_[0] == '-' ? 5 : 4)); String year (value_, 0, pos); String month (value_, pos + 1, 2); @@ -677,7 +677,7 @@ namespace CXX time_zone (pos + 3); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Time&) { // time := HH:MM:SS[.S+][Z|(+|-)HH:MM] @@ -687,10 +687,10 @@ namespace CXX String hours (value_, 0, 2); String minutes (value_, 3, 2); - Size e (8); + size_t e (8); for (; e < value_.size (); ++e) { - WideChar c (value_[e]); + wchar_t c (value_[e]); if (c == 'Z' || c == '+' || c == '-') break; @@ -710,8 +710,8 @@ namespace CXX time_zone (e); } - Void InitValue:: - time_zone (Size pos) + void InitValue:: + time_zone (size_t pos) { // time_zone := Z|(+|-)HH:MM // @@ -746,19 +746,19 @@ namespace CXX // Entity. // - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Entity& t) { string_type (t); } - Void InitValue:: + void InitValue:: traverse (SemanticGraph::Fundamental::Entities&) { string_sequence_type (); } - Void InitValue:: + void InitValue:: string_type (SemanticGraph::Type& t) { // In case STL is disabled, strings are returned as literals @@ -795,7 +795,7 @@ namespace CXX } } - Void InitValue:: + void InitValue:: string_sequence_type () { LiteralValue::collapse (value_); @@ -803,9 +803,9 @@ namespace CXX if (!value_) return; - Size b (0); + size_t b (0); - for (Size e (value_.find (' ')); ; e = value_.find (' ', b)) + for (size_t e (value_.find (' ')); ; e = value_.find (' ', b)) { String v (value_, b, e != String::npos ? e - b : e); @@ -856,7 +856,7 @@ namespace CXX { } - Void CompareValue:: + void CompareValue:: dispatch (SemanticGraph::Node& type, String const& lhs, String const& rhs) { lhs_ = &lhs; @@ -864,7 +864,7 @@ namespace CXX Traversal::NodeBase::dispatch (type); } - Void CompareValue:: + void CompareValue:: traverse (SemanticGraph::Union& u) { String const& value (u.context ().get ("value")); @@ -873,13 +873,13 @@ namespace CXX " ()"; } - Void CompareValue:: + void CompareValue:: traverse (SemanticGraph::Complex& c) { Traversal::NodeBase::dispatch (ultimate_base (c)); } - Void CompareValue:: + void CompareValue:: traverse (SemanticGraph::Enumeration& e) { // First see if we should delegate this one to the Complex @@ -894,7 +894,7 @@ namespace CXX os << *lhs_ << " == " << *rhs_; } - Void CompareValue:: + void CompareValue:: traverse (SemanticGraph::Type&) { // This is a fall-back case where we handle all other types. diff --git a/xsde/cxx/hybrid/default-value.hxx b/xsde/cxx/hybrid/default-value.hxx index 2a806bd..562279b 100644 --- a/xsde/cxx/hybrid/default-value.hxx +++ b/xsde/cxx/hybrid/default-value.hxx @@ -60,130 +60,130 @@ namespace CXX { InitValue (Context&); - Void + void dispatch (SemanticGraph::Node& type, String const& value); - virtual Void + virtual void traverse (SemanticGraph::List&); - virtual Void + virtual void traverse (SemanticGraph::Union&); - virtual Void + virtual void traverse (SemanticGraph::Complex&); - virtual Void + virtual void traverse (SemanticGraph::Enumeration&); - virtual Void + virtual void traverse (SemanticGraph::Type& t); // anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType&); // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language&); // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName&); // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs&); // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI&); // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary&); // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time&); // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity&); - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities&); private: - Void + void string_type (SemanticGraph::Type&); - Void + void string_sequence_type (); - Void - time_zone (Size pos); + void + time_zone (size_t pos); private: String member_; @@ -202,21 +202,21 @@ namespace CXX { CompareValue (Context&); - Void + void dispatch (SemanticGraph::Node& type, String const& lhs, String const& rhs); - virtual Void + virtual void traverse (SemanticGraph::Union&); - virtual Void + virtual void traverse (SemanticGraph::Complex&); - virtual Void + virtual void traverse (SemanticGraph::Enumeration&); - virtual Void + virtual void traverse (SemanticGraph::Type& t); private: diff --git a/xsde/cxx/hybrid/elements.cxx b/xsde/cxx/hybrid/elements.cxx index 9356b66..fe1e533 100644 --- a/xsde/cxx/hybrid/elements.cxx +++ b/xsde/cxx/hybrid/elements.cxx @@ -350,7 +350,7 @@ namespace CXX // // String Context:: - scope (SemanticGraph::Compositor& c, Boolean fq) const + scope (SemanticGraph::Compositor& c, bool fq) const { using namespace SemanticGraph; @@ -403,7 +403,7 @@ namespace CXX } String Context:: - scope (SemanticGraph::Element& e, Boolean fq) const + scope (SemanticGraph::Element& e, bool fq) const { SemanticGraph::Compositor& c (e.contained_particle ().compositor ()); @@ -414,7 +414,7 @@ namespace CXX } String Context:: - scope (SemanticGraph::Attribute& a, Boolean fq) const + scope (SemanticGraph::Attribute& a, bool fq) const { using SemanticGraph::Complex; @@ -425,7 +425,7 @@ namespace CXX : ename_custom (t); } - Boolean Context:: + bool Context:: recursive_base (SemanticGraph::Complex& c) { using namespace SemanticGraph; @@ -443,17 +443,17 @@ namespace CXX return false; } - Void Context:: + void Context:: close_ns () { - for (Size i (0), n (ns_stack.size () - 1); i < n; ++i) + for (size_t i (0), n (ns_stack.size () - 1); i < n; ++i) os << "}"; } - Void Context:: + void Context:: open_ns () { - for (NamespaceStack::Iterator i (ns_stack.begin () + 1); + for (NamespaceStack::iterator i (ns_stack.begin () + 1); i != ns_stack.end (); ++i) { @@ -484,11 +484,11 @@ namespace CXX return os; } - Boolean Context:: + bool Context:: enum_mapping (SemanticGraph::Enumeration& e, SemanticGraph::Enumeration** base) { - Boolean gen (false); + bool gen (false); StringBasedType t (gen); t.dispatch (e); @@ -515,18 +515,18 @@ namespace CXX // Namespace // Namespace:: - Namespace (Context& c, Boolean track_scope) + Namespace (Context& c, bool track_scope) : CXX::Namespace (c, track_scope ? this : 0), ctx_ (c) { } - Void Namespace:: + void Namespace:: enter (String const& name) { ctx_.ns_stack.push_back (name); } - Void Namespace:: + void Namespace:: leave () { ctx_.ns_stack.pop_back (); @@ -534,7 +534,7 @@ namespace CXX // Includes // - Void TypeForward:: + void TypeForward:: traverse (SemanticGraph::Type& t) { SemanticGraph::Context& ctx (t.context ()); @@ -558,7 +558,7 @@ namespace CXX os << "class " << ename (t) << ";"; } - Void Includes:: + void Includes:: traverse_ (SemanticGraph::Uses& u) { // Support for weak (forward) inclusion used in the file-per-type @@ -566,7 +566,7 @@ namespace CXX // Type t (type_); SemanticGraph::Schema& s (u.schema ()); - Boolean weak (u.context ().count ("weak")); + bool weak (u.context ().count ("weak")); if (weak && (t == header || t == impl_header)) { diff --git a/xsde/cxx/hybrid/elements.hxx b/xsde/cxx/hybrid/elements.hxx index f4b00e8..a1fb22e 100644 --- a/xsde/cxx/hybrid/elements.hxx +++ b/xsde/cxx/hybrid/elements.hxx @@ -6,12 +6,11 @@ #ifndef CXX_HYBRID_ELEMENTS_HXX #define CXX_HYBRID_ELEMENTS_HXX +#include #include #include -#include - #include #include @@ -253,10 +252,10 @@ namespace CXX return c.context ().get ("arm-tag"); } - static UnsignedLong const& + static size_t const& arm_tag_count (SemanticGraph::Choice& c) { - return c.context ().get ("arm-tag-count"); + return c.context ().get ("arm-tag-count"); } static String const& @@ -515,16 +514,16 @@ namespace CXX private: String - scope (SemanticGraph::Compositor&, Boolean fq) const; + scope (SemanticGraph::Compositor&, bool fq) const; String - scope (SemanticGraph::Element&, Boolean fq) const; + scope (SemanticGraph::Element&, bool fq) const; String - scope (SemanticGraph::Attribute&, Boolean fq) const; + scope (SemanticGraph::Attribute&, bool fq) const; public: - Boolean + bool restriction_p (SemanticGraph::Complex& c) const { if (c.inherits_p () && @@ -539,31 +538,31 @@ namespace CXX } public: - static Boolean + static bool fixed_length (SemanticGraph::Type& t) { - return t.context ().get ("fixed"); + return t.context ().get ("fixed"); } - static Boolean + static bool fixed_length (SemanticGraph::Compositor& c) { - return c.context ().get ("fixed"); + return c.context ().get ("fixed"); } - static Boolean + static bool recursive (SemanticGraph::Type& t) { return t.context ().count ("recursive"); } - static Boolean + static bool polymorphic (SemanticGraph::Type& t) { return t.context ().count ("polymorphic"); } - static Boolean + static bool recursive_base (SemanticGraph::Complex& c); public: @@ -574,38 +573,36 @@ namespace CXX ostream (NarrowString const& os) const; public: - Void + void close_ns (); - Void + void open_ns (); public: // Determine whether we are generating the enum mapping for this // enumeration. Also optionally return the base enum. // - static Boolean + static bool enum_mapping (SemanticGraph::Enumeration& e, SemanticGraph::Enumeration** base = 0); public: - typedef - Cult::Containers::Deque - NamespaceStack; + typedef std::deque NamespaceStack; public: options_type const& options; - Boolean exceptions; - Boolean stl; - Boolean poly_code; - Boolean poly_runtime; - Boolean reset; - Boolean clone; - Boolean detach; - Boolean typeinfo; - Boolean mixin; - Boolean tiein; - Boolean enum_; + bool exceptions; + bool stl; + bool poly_code; + bool poly_runtime; + bool reset; + bool clone; + bool detach; + bool typeinfo; + bool mixin; + bool tiein; + bool enum_; Regex const* fwd_expr; Regex const* hxx_expr; @@ -646,13 +643,13 @@ namespace CXX // struct Namespace: CXX::Namespace, CXX::Namespace::ScopeTracker { - Namespace (Context&, Boolean track_scope = false); + Namespace (Context&, bool track_scope = false); protected: - virtual Void + virtual void enter (String const& name); - virtual Void + virtual void leave (); protected: @@ -682,86 +679,86 @@ namespace CXX Traversal::Fundamental::Decimal { - FundamentalType (Boolean& result) + FundamentalType (bool& result) : r_ (result) { } // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger&) { r_ = true; @@ -769,7 +766,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean&) { r_ = true; @@ -777,26 +774,26 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal&) { r_ = true; } private: - Boolean& r_; + bool& r_; }; // @@ -815,85 +812,85 @@ namespace CXX Traversal::Fundamental::AnyURI, Traversal::Fundamental::Entity { - StringType (Boolean& result) + StringType (bool& result) : r_ (result) { } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity&) { r_ = true; } private: - Boolean& r_; + bool& r_; }; // Check whether this is a string-based type (excluding ID, IDFER, @@ -908,13 +905,13 @@ namespace CXX Traversal::Fundamental::NCName, Traversal::Fundamental::Language { - StringBasedType (Boolean& r) + StringBasedType (bool& r) : r_ (r) { *this >> inherits_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -922,50 +919,50 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName&) { r_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language&) { r_ = true; } private: - Boolean& r_; + bool& r_; Traversal::Inherits inherits_; }; @@ -984,7 +981,7 @@ namespace CXX inherits_ >> enum_; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -999,7 +996,7 @@ namespace CXX *this >> inherits_ >> *this; } - virtual Void + virtual void traverse (Type& e) { e_ = &e; @@ -1097,7 +1094,7 @@ namespace CXX xs_ns_ = xs_ns_name (); } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { type (t); @@ -1105,13 +1102,13 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType&) { if (stl || use_ != base) @@ -1122,7 +1119,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean&) { if (use_ != base) @@ -1133,7 +1130,7 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte&) { if (use_ != base) @@ -1142,7 +1139,7 @@ namespace CXX os << xs_ns_ << "::byte_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte&) { if (use_ != base) @@ -1151,7 +1148,7 @@ namespace CXX os << xs_ns_ << "::unsigned_byte_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short&) { if (use_ != base) @@ -1160,7 +1157,7 @@ namespace CXX os << xs_ns_ << "::short_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort&) { if (use_ != base) @@ -1169,7 +1166,7 @@ namespace CXX os << xs_ns_ << "::unsigned_short_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int&) { if (use_ != base) @@ -1178,7 +1175,7 @@ namespace CXX os << xs_ns_ << "::int_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt&) { if (use_ != base) @@ -1187,7 +1184,7 @@ namespace CXX os << xs_ns_ << "::unsigned_int_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long&) { if (use_ != base) @@ -1201,7 +1198,7 @@ namespace CXX os << xs_ns_ << "::long_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong&) { if (use_ != base) @@ -1215,7 +1212,7 @@ namespace CXX os << xs_ns_ << "::unsigned_long_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer&) { if (use_ != base) @@ -1224,7 +1221,7 @@ namespace CXX os << xs_ns_ << "::integer_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger&) { if (use_ != base) @@ -1233,7 +1230,7 @@ namespace CXX os << xs_ns_ << "::non_positive_integer_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger&) { if (use_ != base) @@ -1242,7 +1239,7 @@ namespace CXX os << xs_ns_ << "::non_negative_integer_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger&) { if (use_ != base) @@ -1251,7 +1248,7 @@ namespace CXX os << xs_ns_ << "::positive_integer_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger&) { if (use_ != base) @@ -1262,7 +1259,7 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float&) { if (use_ != base) @@ -1271,7 +1268,7 @@ namespace CXX os << xs_ns_ << "::float_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double&) { if (use_ != base) @@ -1280,7 +1277,7 @@ namespace CXX os << xs_ns_ << "::double_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal&) { if (use_ != base) @@ -1291,7 +1288,7 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&) { if (stl || use_ != base) @@ -1300,7 +1297,7 @@ namespace CXX os << xs_ns_ << "::string_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&) { if (stl || use_ != base) @@ -1309,7 +1306,7 @@ namespace CXX os << xs_ns_ << "::normalized_string_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&) { if (stl || use_ != base) @@ -1318,7 +1315,7 @@ namespace CXX os << xs_ns_ << "::token_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken&) { if (stl || use_ != base) @@ -1327,13 +1324,13 @@ namespace CXX os << xs_ns_ << "::nmtoken_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name&) { if (stl || use_ != base) @@ -1342,7 +1339,7 @@ namespace CXX os << xs_ns_ << "::name_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName&) { if (stl || use_ != base) @@ -1351,7 +1348,7 @@ namespace CXX os << xs_ns_ << "::ncname_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language&) { if (stl || use_ != base) @@ -1363,7 +1360,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { type (t); @@ -1372,7 +1369,7 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id&) { if (stl || use_ != base) @@ -1381,7 +1378,7 @@ namespace CXX os << xs_ns_ << "::id_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef&) { if (stl || use_ != base) @@ -1390,7 +1387,7 @@ namespace CXX os << xs_ns_ << "::idref_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { type (t); @@ -1398,7 +1395,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI&) { if (stl || use_ != base) @@ -1409,13 +1406,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { type (t); @@ -1424,55 +1421,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { type (t); @@ -1480,7 +1477,7 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity&) { if (stl || use_ != base) @@ -1489,14 +1486,14 @@ namespace CXX os << xs_ns_ << "::entity_base"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { type (t); } private: - Void + void type (SemanticGraph::Type& t) { String fq (fq_name (t)); @@ -1550,8 +1547,8 @@ namespace CXX } } - Void - fund_type (Char const* name) + void + fund_type (char const* name) { switch (use_) { @@ -1573,7 +1570,7 @@ namespace CXX } } - Void + void string_type () { switch (use_) @@ -1688,7 +1685,7 @@ namespace CXX Traversal::Fundamental::Entity, Traversal::Fundamental::Entities { - virtual Void + virtual void traverse (SemanticGraph::Type& t) { type (t); @@ -1696,13 +1693,13 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { string_type (t); @@ -1710,7 +1707,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { fund_type (t); @@ -1718,79 +1715,79 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { fund_type (t); @@ -1798,19 +1795,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { fund_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { fund_type (t); @@ -1818,49 +1815,49 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { string_type (t); @@ -1868,7 +1865,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { type (t); @@ -1876,19 +1873,19 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { type (t); @@ -1896,7 +1893,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { string_type (t); @@ -1904,13 +1901,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { type (t); @@ -1918,55 +1915,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { type (t); @@ -1974,26 +1971,26 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { string_type (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { type (t); } protected: - virtual Void + virtual void type (SemanticGraph::Type&) = 0; - virtual Void + virtual void fund_type (SemanticGraph::Type&) = 0; - virtual Void + virtual void string_type (SemanticGraph::Type&) = 0; }; @@ -2005,19 +2002,19 @@ namespace CXX } protected: - virtual Void + virtual void type (SemanticGraph::Type& t) { if (!fixed_length (t)) os << "*"; } - virtual Void + virtual void fund_type (SemanticGraph::Type&) { } - virtual Void + virtual void string_type (SemanticGraph::Type&) { } @@ -2030,7 +2027,7 @@ namespace CXX { } - Void + void dispatch (SemanticGraph::Node& type, String const& var) { var_ = var; @@ -2038,7 +2035,7 @@ namespace CXX } protected: - virtual Void + virtual void type (SemanticGraph::Type& t) { if (!custom_alloc) @@ -2054,13 +2051,13 @@ namespace CXX } } - virtual Void + virtual void fund_type (SemanticGraph::Type& t) { type (t); } - virtual Void + virtual void string_type (SemanticGraph::Type& t) { if (stl) @@ -2089,7 +2086,7 @@ namespace CXX // Copy member from 'this' to 'c'. // - Void + void dispatch (SemanticGraph::Node& type, SemanticGraph::Member& member) { member_ = &member; @@ -2097,7 +2094,7 @@ namespace CXX } protected: - virtual Void + virtual void type (SemanticGraph::Type& t) { String const& name (ename (*member_)); @@ -2115,13 +2112,13 @@ namespace CXX << "}"; } - virtual Void + virtual void fund_type (SemanticGraph::Type& t) { type (t); } - virtual Void + virtual void string_type (SemanticGraph::Type&) { // We can only get here if STL is disabled. @@ -2154,7 +2151,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t); }; @@ -2181,26 +2178,26 @@ namespace CXX schema_ >> schema_names_ >> namespace_ >> names_ >> type_forward_; } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { traverse_ (i); } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { traverse_ (i); } private: - Void + void traverse_ (SemanticGraph::Uses&); private: Context& ctx_; Type type_; - Boolean forward_; + bool forward_; Regex const* regex_; Traversal::Schema schema_; @@ -2214,19 +2211,19 @@ namespace CXX // struct AggregateTest: Traversal::Type, Traversal::Element { - AggregateTest (Boolean& generate, Char const* key) + AggregateTest (bool& generate, char const* key) : gen_ (generate), key_ (key) { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { if (!gen_ && t.context ().count (key_)) gen_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (!gen_ && e.context ().count (key_)) @@ -2234,8 +2231,8 @@ namespace CXX } private: - Boolean& gen_; - Char const* key_; + bool& gen_; + char const* key_; }; } } diff --git a/xsde/cxx/hybrid/extraction-header.cxx b/xsde/cxx/hybrid/extraction-header.cxx index 25b4b43..3ec42d1 100644 --- a/xsde/cxx/hybrid/extraction-header.cxx +++ b/xsde/cxx/hybrid/extraction-header.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -62,7 +62,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename_custom (l)); @@ -91,7 +91,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename_custom (u)); @@ -124,7 +124,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -149,12 +149,12 @@ namespace CXX struct Choice: Traversal::Choice, Context { - Choice (Context& c, Boolean in_choice) + Choice (Context& c, bool in_choice) : Context (c), in_choice_ (in_choice) { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // When choice is in choice we generate nested class even @@ -179,18 +179,18 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; }; struct Sequence: Traversal::Sequence, Context { - Sequence (Context& c, Boolean in_choice) + Sequence (Context& c, bool in_choice) : Context (c), in_choice_ (in_choice) { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we generate nested class even @@ -215,7 +215,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; }; struct Complex : Traversal::Complex, Context @@ -245,7 +245,7 @@ namespace CXX contains_compositor_ >> sequence_in_sequence_; } - virtual Void + virtual void traverse (Type& c) { String const& name (ename_custom (c)); @@ -285,7 +285,7 @@ namespace CXX }; } - Void + void generate_extraction_header (Context& ctx) { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/extraction-header.hxx b/xsde/cxx/hybrid/extraction-header.hxx index d6e1af3..1670f64 100644 --- a/xsde/cxx/hybrid/extraction-header.hxx +++ b/xsde/cxx/hybrid/extraction-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_extraction_header (Context&); } } diff --git a/xsde/cxx/hybrid/extraction-source.cxx b/xsde/cxx/hybrid/extraction-source.cxx index 413ffdc..cfdaf56 100644 --- a/xsde/cxx/hybrid/extraction-source.cxx +++ b/xsde/cxx/hybrid/extraction-source.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -75,7 +75,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename_custom (l)); @@ -113,7 +113,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename_custom (u)); @@ -159,7 +159,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { // Nothing is serialized for fixed attributes. @@ -169,8 +169,8 @@ namespace CXX SemanticGraph::Type& t (a.type ()); - Boolean fl (fixed_length (t)); - Boolean st (false); + bool fl (fixed_length (t)); + bool st (false); String const& name (ename (a)); @@ -309,7 +309,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { // See also ChoiceParticleData. @@ -328,8 +328,8 @@ namespace CXX { SemanticGraph::Type& t (e.type ()); - Boolean fl (fixed_length (t)); - Boolean st (false); + bool fl (fixed_length (t)); + bool st (false); if (!fl) { @@ -434,7 +434,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -442,7 +442,7 @@ namespace CXX // if (a.min () == 0) { - Boolean fl (fixed_length (a)); + bool fl (fixed_length (a)); String const& name (ename (a)); String const& present (epresent (a)); @@ -524,7 +524,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { os << "case " << scope (e) << "::" << etag (e) << ":" @@ -546,8 +546,8 @@ namespace CXX { SemanticGraph::Type& t (e.type ()); - Boolean fl (fixed_length (t)); - Boolean st (false); + bool fl (fixed_length (t)); + bool st (false); if (!fl) { @@ -643,7 +643,7 @@ namespace CXX << "}"; } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { os << "case " << scope (c) << "::" << etag (c) << ":" @@ -665,7 +665,7 @@ namespace CXX } else { - Boolean fl (fixed_length (c)); + bool fl (fixed_length (c)); if (c.min () == 0) { @@ -747,7 +747,7 @@ namespace CXX contains_data_ >> particle_data_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.max () != 1) @@ -762,7 +762,7 @@ namespace CXX } else if (c.min () == 0) { - Boolean fl (fixed_length (c)); + bool fl (fixed_length (c)); String const& name (ename (c)); String const& present (epresent (c)); @@ -870,7 +870,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1) @@ -885,7 +885,7 @@ namespace CXX } else if (s.min () == 0) { - Boolean fl (fixed_length (s)); + bool fl (fixed_length (s)); String const& name (ename (s)); String const& present (epresent (s)); @@ -969,7 +969,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -1005,13 +1005,13 @@ namespace CXX struct Choice: Traversal::Choice, Context { - Choice (Context& c, Boolean in_choice) + Choice (Context& c, bool in_choice) : Context (c), in_choice_ (in_choice), particle_data_ (c) { contains_data_ >> particle_data_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // When choice is in choice we generate nested class even @@ -1060,7 +1060,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; ChoiceParticleData particle_data_; Traversal::ContainsParticle contains_data_; @@ -1070,7 +1070,7 @@ namespace CXX struct Sequence: Traversal::Sequence, Context { Sequence (Context& c, - Boolean in_choice, + bool in_choice, Traversal::ContainsParticle& contains_data) : Context (c), in_choice_ (in_choice), @@ -1078,7 +1078,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we generate nested class even @@ -1111,7 +1111,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; Traversal::ContainsParticle& contains_data_; }; @@ -1175,7 +1175,7 @@ namespace CXX contains_compositor_ >> sequence_in_sequence_; } - virtual Void + virtual void traverse (Type& c) { String const& name (ename_custom (c)); @@ -1186,7 +1186,7 @@ namespace CXX if (!name) return; - Boolean restriction (restriction_p (c)); + bool restriction (restriction_p (c)); for (NarrowStrings::const_iterator i (istreams.begin ()); i != istreams.end (); ++i) @@ -1203,7 +1203,7 @@ namespace CXX { SemanticGraph::Type& b (c.inherits ().base ()); - Boolean c_str (false); + bool c_str (false); if (!stl) { @@ -1291,7 +1291,7 @@ namespace CXX }; } - Void + void generate_extraction_source (Context& ctx) { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/extraction-source.hxx b/xsde/cxx/hybrid/extraction-source.hxx index 363f5c1..0d28daa 100644 --- a/xsde/cxx/hybrid/extraction-source.hxx +++ b/xsde/cxx/hybrid/extraction-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_extraction_source (Context&); } } diff --git a/xsde/cxx/hybrid/generator.cxx b/xsde/cxx/hybrid/generator.cxx index c2289ae..eac7cf0 100644 --- a/xsde/cxx/hybrid/generator.cxx +++ b/xsde/cxx/hybrid/generator.cxx @@ -10,9 +10,6 @@ #include -#include -#include - #include #include #include @@ -75,7 +72,7 @@ namespace CXX { namespace { - Char const copyright_gpl[] = + char const copyright_gpl[] = "// Copyright (c) 2005-2011 Code Synthesis Tools CC\n" "//\n" "// This program was generated by CodeSynthesis XSD/e, an XML Schema\n" @@ -96,7 +93,7 @@ namespace CXX "//\n" "//\n\n"; - Char const copyright_proprietary[] = + char const copyright_proprietary[] = "// Copyright (c) 2005-2011 Code Synthesis Tools CC\n" "//\n" "// This program was generated by CodeSynthesis XSD/e, an XML Schema to\n" @@ -107,7 +104,7 @@ namespace CXX "//\n\n"; } - Void Hybrid::Generator:: + void Hybrid::Generator:: usage () { CXX::Hybrid::options::print_usage (wcout); @@ -125,12 +122,12 @@ namespace CXX sloc_filter; NarrowString - find_value (NarrowStrings const& v, Char const* key) + find_value (NarrowStrings const& v, char const* key) { for (NarrowStrings::const_iterator i (v.begin ()), e (v.end ()); i != e; ++i) { - Size p (i->find ('=')); + size_t p (i->find ('=')); if (p == NarrowString::npos) { @@ -161,15 +158,15 @@ namespace CXX return NarrowString (); } - Void - copy_values (NarrowStrings& dst, NarrowStrings const& src, Char const* key) + void + copy_values (NarrowStrings& dst, NarrowStrings const& src, char const* key) { dst.clear (); for (NarrowStrings::const_iterator i (src.begin ()), e (src.end ()); i != e; ++i) { - Size p (i->find ('=')); + size_t p (i->find ('=')); if (p == NarrowString::npos) { @@ -201,7 +198,7 @@ namespace CXX struct FundNamespace: Namespace, Hybrid::Context { - FundNamespace (Hybrid::Context& c, Char type) + FundNamespace (Hybrid::Context& c, char type) : Namespace (c), Hybrid::Context (c), type_ (type) { } @@ -214,7 +211,7 @@ namespace CXX os << "using ::xsde::cxx::hybrid::any_type;" << endl; - Boolean us, ui; + bool us, ui; String skel, impl; if (type_ == 'p') @@ -250,7 +247,7 @@ namespace CXX } private: - Char type_; + char type_; }; } @@ -271,7 +268,7 @@ namespace CXX r->skel_type_suffix (h.pskel_type_suffix ()); r->impl_type_suffix (h.pimpl_type_suffix ()); - Char const* k = "pskel"; + char const* k = "pskel"; r->hxx_regex (find_value (h.hxx_regex (), k)); r->ixx_regex (find_value (h.ixx_regex (), k)); @@ -337,7 +334,7 @@ namespace CXX r->skel_type_suffix (h.sskel_type_suffix ()); r->impl_type_suffix (h.simpl_type_suffix ()); - Char const* k = "pskel"; + char const* k = "pskel"; r->hxx_regex (find_value (h.hxx_regex (), k)); r->ixx_regex (find_value (h.ixx_regex (), k)); @@ -386,7 +383,7 @@ namespace CXX return r; } - Void Hybrid::Generator:: + void Hybrid::Generator:: calculate_size (options const& ops, XSDFrontend::SemanticGraph::Schema& schema, XSDFrontend::SemanticGraph::Path const& file, @@ -400,7 +397,7 @@ namespace CXX throw Failed (); } - Void Hybrid::Generator:: + void Hybrid::Generator:: process_tree_names (options const& ops, XSDFrontend::SemanticGraph::Schema& schema, XSDFrontend::SemanticGraph::Path const& file) @@ -409,7 +406,7 @@ namespace CXX proc.process (ops, schema, file, false); } - Void Hybrid::Generator:: + void Hybrid::Generator:: process_parser_names (options const& ops, XSDFrontend::SemanticGraph::Schema& schema, XSDFrontend::SemanticGraph::Path const& file) @@ -419,7 +416,7 @@ namespace CXX throw Failed (); } - Void Hybrid::Generator:: + void Hybrid::Generator:: process_serializer_names (options const& ops, XSDFrontend::SemanticGraph::Schema& schema, XSDFrontend::SemanticGraph::Path const& file) @@ -432,7 +429,7 @@ namespace CXX namespace { template - Void + void open (S& ifs, NarrowString const& path) { try @@ -457,7 +454,7 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowString const& path, WideInputFileStream& default_is) @@ -477,19 +474,19 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowStrings const& primary, NarrowStrings const& def, - Char const* primary_key, - Char const* def_key) + char const* primary_key, + char const* def_key) { for (NarrowStrings const* v = &primary; v != 0; v = (v == &def ? 0 : &def)) { - Boolean found (false); - Char const* key (v == &primary ? primary_key : def_key); + bool found (false); + char const* key (v == &primary ? primary_key : def_key); for (NarrowStrings::const_iterator i (v->begin ()), e (v->end ()); i != e; ++i) @@ -498,7 +495,7 @@ namespace CXX os << i->c_str () << endl; else { - Size p (i->find ('=')); + size_t p (i->find ('=')); if (p == NarrowString::npos) { @@ -535,22 +532,21 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowStrings const& primary, NarrowStrings const& def, - Char const* key) + char const* key) { append (os, primary, def, key, key); } } - - UnsignedLong Hybrid::Generator:: + size_t Hybrid::Generator:: generate_tree (Hybrid::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, const WarningSet& disabled_warnings, TypeMap::Namespaces& parser_type_map, TypeMap::Namespaces& serializer_type_map, @@ -562,7 +558,7 @@ namespace CXX try { - Boolean generate_xml_schema (ops.generate_xml_schema ()); + bool generate_xml_schema (ops.generate_xml_schema ()); // We could be compiling several schemas at once in which case // handling of the --generate-xml-schema option gets tricky: we @@ -595,9 +591,9 @@ namespace CXX // Generate code. // - Boolean inline_ (ops.generate_inline () && !generate_xml_schema); - Boolean forward (ops.generate_forward () && !generate_xml_schema); - Boolean source (!generate_xml_schema); + bool inline_ (ops.generate_inline () && !generate_xml_schema); + bool forward (ops.generate_forward () && !generate_xml_schema); + bool source (!generate_xml_schema); NarrowString name (file_path.leaf ()); @@ -769,7 +765,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); if (forward) @@ -806,7 +802,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); // // @@ -1288,11 +1284,11 @@ namespace CXX } } - UnsignedLong Hybrid::Generator:: + size_t Hybrid::Generator:: generate_parser (Hybrid::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, const WarningSet&, FileList& file_list, AutoUnlinks& unlinks) @@ -1303,7 +1299,7 @@ namespace CXX try { { - Boolean gen_xml_schema (ops.generate_xml_schema ()); + bool gen_xml_schema (ops.generate_xml_schema ()); // We could be compiling several schemas at once in which case // handling of the --generate-xml-schema option gets tricky: we @@ -1450,7 +1446,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); hxx << copyright; @@ -1479,7 +1475,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); // // @@ -1493,7 +1489,7 @@ namespace CXX if (guard_prefix) guard_prefix += '_'; - Boolean aggr (ops.generate_aggregate ()); + bool aggr (ops.generate_aggregate ()); // HXX // @@ -1674,11 +1670,11 @@ namespace CXX } } - UnsignedLong Hybrid::Generator:: + size_t Hybrid::Generator:: generate_serializer (Hybrid::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, const WarningSet&, FileList& file_list, AutoUnlinks& unlinks) @@ -1689,7 +1685,7 @@ namespace CXX try { { - Boolean gen_xml_schema (ops.generate_xml_schema ()); + bool gen_xml_schema (ops.generate_xml_schema ()); // We could be compiling several schemas at once in which case // handling of the --generate-xml-schema option gets tricky: we @@ -1836,7 +1832,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); hxx << copyright; @@ -1865,7 +1861,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); // // @@ -1879,7 +1875,7 @@ namespace CXX if (guard_prefix) guard_prefix += '_'; - Boolean aggr (ops.generate_aggregate ()); + bool aggr (ops.generate_aggregate ()); // HXX // diff --git a/xsde/cxx/hybrid/generator.hxx b/xsde/cxx/hybrid/generator.hxx index cbef109..131c241 100644 --- a/xsde/cxx/hybrid/generator.hxx +++ b/xsde/cxx/hybrid/generator.hxx @@ -8,14 +8,11 @@ #include // std::auto_ptr -#include - -#include - #include // Path #include #include +#include #include #include @@ -26,14 +23,12 @@ namespace CXX { namespace Hybrid { - using namespace Cult::Types; - class Generator { public: struct Failed {}; - static Void + static void usage (); static std::auto_ptr @@ -48,7 +43,7 @@ namespace CXX // Calculate type sizes. // - static Void + static void calculate_size ( options const&, XSDFrontend::SemanticGraph::Schema&, @@ -57,19 +52,19 @@ namespace CXX // Assign names to global declarations. // - static Void + static void process_tree_names ( options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const&); - static Void + static void process_parser_names ( options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const&); - static Void + static void process_serializer_names ( options const&, XSDFrontend::SemanticGraph::Schema&, @@ -77,34 +72,34 @@ namespace CXX // Generate code. // - static UnsignedLong + static size_t generate_tree ( options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const&, - Boolean file_per_type, + bool file_per_type, WarningSet const& disabled_warnings, TypeMap::Namespaces& parser_type_map, TypeMap::Namespaces& serializer_type_map, FileList&, AutoUnlinks&); - static UnsignedLong + static size_t generate_parser ( options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const&, - Boolean file_per_type, + bool file_per_type, WarningSet const& disabled_warnings, FileList&, AutoUnlinks&); - static UnsignedLong + static size_t generate_serializer ( options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const&, - Boolean file_per_type, + bool file_per_type, WarningSet const& disabled_warnings, FileList&, AutoUnlinks&); diff --git a/xsde/cxx/hybrid/insertion-header.cxx b/xsde/cxx/hybrid/insertion-header.cxx index a054d9e..8c11707 100644 --- a/xsde/cxx/hybrid/insertion-header.cxx +++ b/xsde/cxx/hybrid/insertion-header.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -62,7 +62,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename_custom (l)); @@ -91,7 +91,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename_custom (u)); @@ -124,7 +124,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -149,12 +149,12 @@ namespace CXX struct Choice: Traversal::Choice, Context { - Choice (Context& c, Boolean in_choice) + Choice (Context& c, bool in_choice) : Context (c), in_choice_ (in_choice) { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // When choice is in choice we generate nested class even @@ -179,18 +179,18 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; }; struct Sequence: Traversal::Sequence, Context { - Sequence (Context& c, Boolean in_choice) + Sequence (Context& c, bool in_choice) : Context (c), in_choice_ (in_choice) { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we generate nested class even @@ -215,7 +215,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; }; struct Complex : Traversal::Complex, Context @@ -245,7 +245,7 @@ namespace CXX contains_compositor_ >> sequence_in_sequence_; } - virtual Void + virtual void traverse (Type& c) { String const& name (ename_custom (c)); @@ -285,7 +285,7 @@ namespace CXX }; } - Void + void generate_insertion_header (Context& ctx) { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/insertion-header.hxx b/xsde/cxx/hybrid/insertion-header.hxx index b3ecc83..487de93 100644 --- a/xsde/cxx/hybrid/insertion-header.hxx +++ b/xsde/cxx/hybrid/insertion-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_insertion_header (Context&); } } diff --git a/xsde/cxx/hybrid/insertion-source.cxx b/xsde/cxx/hybrid/insertion-source.cxx index d579964..4002384 100644 --- a/xsde/cxx/hybrid/insertion-source.cxx +++ b/xsde/cxx/hybrid/insertion-source.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -66,7 +66,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename_custom (l)); @@ -105,7 +105,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename_custom (u)); @@ -142,7 +142,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { // Don't waste space on fixed attributes. @@ -203,7 +203,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () == 1 && e.min () == 0) @@ -241,7 +241,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -283,7 +283,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { os << "case " << scope (e) << "::" << etag (e) << ":" @@ -295,7 +295,7 @@ namespace CXX << "}"; } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { os << "case " << scope (c) << "::" << etag (c) << ":" @@ -342,7 +342,7 @@ namespace CXX contains_data_ >> particle_data_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.max () != 1) @@ -412,7 +412,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1) @@ -464,7 +464,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -500,13 +500,13 @@ namespace CXX struct Choice: Traversal::Choice, Context { - Choice (Context& c, Boolean in_choice) + Choice (Context& c, bool in_choice) : Context (c), in_choice_ (in_choice), particle_data_ (c) { contains_data_ >> particle_data_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // When choice is in choice we generate nested class even @@ -552,7 +552,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; ChoiceParticleData particle_data_; Traversal::ContainsParticle contains_data_; @@ -562,7 +562,7 @@ namespace CXX struct Sequence: Traversal::Sequence, Context { Sequence (Context& c, - Boolean in_choice, + bool in_choice, Traversal::ContainsParticle& contains_data) : Context (c), in_choice_ (in_choice), @@ -570,7 +570,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we generate nested class even @@ -603,7 +603,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; Traversal::ContainsParticle& contains_data_; }; @@ -667,7 +667,7 @@ namespace CXX contains_compositor_ >> sequence_in_sequence_; } - virtual Void + virtual void traverse (Type& c) { String const& name (ename_custom (c)); @@ -678,7 +678,7 @@ namespace CXX if (!name) return; - Boolean restriction (restriction_p (c)); + bool restriction (restriction_p (c)); for (NarrowStrings::const_iterator i (ostreams.begin ()); i != ostreams.end (); ++i) @@ -754,7 +754,7 @@ namespace CXX }; } - Void + void generate_insertion_source (Context& ctx) { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/insertion-source.hxx b/xsde/cxx/hybrid/insertion-source.hxx index 166bfee..d5da94a 100644 --- a/xsde/cxx/hybrid/insertion-source.hxx +++ b/xsde/cxx/hybrid/insertion-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_insertion_source (Context&); } } diff --git a/xsde/cxx/hybrid/options.cli b/xsde/cxx/hybrid/options.cli index 33b05b0..64ae2fd 100644 --- a/xsde/cxx/hybrid/options.cli +++ b/xsde/cxx/hybrid/options.cli @@ -3,11 +3,9 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -include ; -include ; include ; // std::size_t -include ; // NarrowString +include ; // NarrowString, NarrowStrings include ; @@ -77,7 +75,7 @@ namespace CXX same tree or between different trees." }; - std::vector --generate-insertion + NarrowStrings --generate-insertion { "", "Generate data representation stream insertion operators for the @@ -89,7 +87,7 @@ namespace CXX \cb{--hxx-prologue*} options to include the necessary declarations." }; - std::vector --generate-extraction + NarrowStrings --generate-extraction { "", "Generate data representation stream extraction operators for the @@ -121,7 +119,7 @@ namespace CXX configured with polymorphism support." }; - std::vector --polymorphic-type + NarrowStrings --polymorphic-type { "", "Indicate that is a root of a polymorphic type hierarchy. The @@ -140,7 +138,7 @@ namespace CXX standard C++ RTTI mechanism to determine object's type at runtime." }; - std::vector --polymorphic-schema + NarrowStrings --polymorphic-schema { "", "Indicate that contains derivations of polymorphic types that @@ -164,7 +162,7 @@ namespace CXX // Custom data/type. // - std::vector --custom-data + NarrowStrings --custom-data { "", "Add the ability to store custom data to the C++ class generated for @@ -173,7 +171,7 @@ namespace CXX containing the compositor, for example, \cb{foo::sequence::choise1}." }; - std::vector --custom-type + NarrowStrings --custom-type { "", "Use a custom type implementation instead of the generated version. @@ -194,7 +192,7 @@ namespace CXX \ci{base} is specified) or instead of the generated version." }; - std::vector --custom-parser + NarrowStrings --custom-parser { "", "Use a custom parser implementation instead of the generated version. @@ -209,7 +207,7 @@ namespace CXX generated version." }; - std::vector --custom-serializer + NarrowStrings --custom-serializer { "", "Use a custom serializer implementation instead of the generated @@ -260,7 +258,7 @@ namespace CXX also the \cb{--generate-aggregate} option." }; - std::vector --root-element + NarrowStrings --root-element { "", "Treat only as a document root. This determines for which @@ -269,7 +267,7 @@ namespace CXX \cb{--generate-aggregate} option." }; - std::vector --root-type + NarrowStrings --root-type { "", "Generate parser/serializer aggregate for . Repeat this option @@ -279,70 +277,70 @@ namespace CXX // Suffixes. // - Cult::Types::NarrowString --pskel-type-suffix = "_pskel" + NarrowString --pskel-type-suffix = "_pskel" { "", "Use instead of the default \cb{_pskel} to construct the names of generated parser skeletons." }; - Cult::Types::NarrowString --sskel-type-suffix = "_sskel" + NarrowString --sskel-type-suffix = "_sskel" { "", "Use instead of the default \cb{_sskel} to construct the names of generated serializer skeletons." }; - Cult::Types::NarrowString --pskel-file-suffix = "-pskel" + NarrowString --pskel-file-suffix = "-pskel" { "", "Use instead of the default \cb{-pskel} to construct the names of generated parser skeleton files." }; - Cult::Types::NarrowString --sskel-file-suffix = "-sskel" + NarrowString --sskel-file-suffix = "-sskel" { "", "Use instead of the default \cb{-sskel} to construct the names of generated serializer skeleton files." }; - Cult::Types::NarrowString --pimpl-type-suffix = "_pimpl" + NarrowString --pimpl-type-suffix = "_pimpl" { "", "Use instead of the default \cb{_pimpl} to construct the names of generated parser implementations." }; - Cult::Types::NarrowString --simpl-type-suffix = "_simpl" + NarrowString --simpl-type-suffix = "_simpl" { "", "Use instead of the default \cb{_simpl} to construct the names of generated serializer implementations." }; - Cult::Types::NarrowString --pimpl-file-suffix = "-pimpl" + NarrowString --pimpl-file-suffix = "-pimpl" { "", "Use instead of the default \cb{-pimpl} to construct the names of generated parser implementation files." }; - Cult::Types::NarrowString --simpl-file-suffix = "-simpl" + NarrowString --simpl-file-suffix = "-simpl" { "", "Use instead of the default \cb{-simpl} to construct the names of generated serializer implementation files." }; - Cult::Types::NarrowString --paggr-type-suffix = "_paggr" + NarrowString --paggr-type-suffix = "_paggr" { "", "Use instead of the default \cb{_paggr} to construct the names of generated parser aggregates." }; - Cult::Types::NarrowString --saggr-type-suffix = "_saggr" + NarrowString --saggr-type-suffix = "_saggr" { "", "Use instead of the default \cb{_saggr} to construct the @@ -354,18 +352,18 @@ namespace CXX // "override" them here. Note that the documentation is still // specified in the common version. // - std::vector --hxx-regex; - std::vector --ixx-regex; - std::vector --cxx-regex; - - std::vector --hxx-prologue-file; - std::vector --ixx-prologue-file; - std::vector --cxx-prologue-file; - std::vector --prologue-file; - std::vector --hxx-epilogue-file; - std::vector --ixx-epilogue-file; - std::vector --cxx-epilogue-file; - std::vector --epilogue-file; + NarrowStrings --hxx-regex; + NarrowStrings --ixx-regex; + NarrowStrings --cxx-regex; + + NarrowStrings --hxx-prologue-file; + NarrowStrings --ixx-prologue-file; + NarrowStrings --cxx-prologue-file; + NarrowStrings --prologue-file; + NarrowStrings --hxx-epilogue-file; + NarrowStrings --ixx-epilogue-file; + NarrowStrings --cxx-epilogue-file; + NarrowStrings --epilogue-file; }; } } diff --git a/xsde/cxx/hybrid/parser-aggregate-header.cxx b/xsde/cxx/hybrid/parser-aggregate-header.cxx index 967f1db..c75e0eb 100644 --- a/xsde/cxx/hybrid/parser-aggregate-header.cxx +++ b/xsde/cxx/hybrid/parser-aggregate-header.cxx @@ -3,6 +3,8 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include + #include #include #include @@ -10,7 +12,7 @@ #include #include -#include +using namespace std; namespace CXX { @@ -18,7 +20,7 @@ namespace CXX { namespace { - typedef Cult::Containers::Set InstanceSet; + typedef set InstanceSet; // For base types we only want member's types, but not the // base itself. @@ -32,7 +34,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c); @@ -44,7 +46,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::List& l) { def_.dispatch (l.argumented ().type ()); @@ -146,7 +148,7 @@ namespace CXX belongs_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { if (map_.find (&t) == map_.end ()) @@ -158,7 +160,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (map_.find (&l) == map_.end ()) @@ -172,7 +174,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (map_.find (&c) == map_.end ()) @@ -196,7 +198,7 @@ namespace CXX } } - virtual Void + virtual void collect (SemanticGraph::Type& t) { using SemanticGraph::Type; @@ -227,7 +229,7 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { if (fund_type (t, "any_type")) @@ -237,7 +239,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { fund_type (t, "any_simple_type"); @@ -245,7 +247,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { fund_type (t, "boolean"); @@ -253,79 +255,79 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { fund_type (t, "byte"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { fund_type (t, "unsigned_byte"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { fund_type (t, "short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { fund_type (t, "unsigned_short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { fund_type (t, "int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { fund_type (t, "unsigned_int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { fund_type (t, "long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { fund_type (t, "unsigned_long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { fund_type (t, "integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { fund_type (t, "non_positive_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { fund_type (t, "non_negative_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { fund_type (t, "positive_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { fund_type (t, "negative_integer"); @@ -333,19 +335,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { fund_type (t, "float"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { fund_type (t, "double"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { fund_type (t, "decimal"); @@ -353,49 +355,49 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { fund_type (t, "string"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { fund_type (t, "normalized_string"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { fund_type (t, "token"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { fund_type (t, "nmtoken"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { fund_type (t, "nmtokens"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { fund_type (t, "name"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { fund_type (t, "ncname"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { fund_type (t, "language"); @@ -404,7 +406,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { fund_type (t, "qname"); @@ -413,19 +415,19 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { fund_type (t, "id"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { fund_type (t, "idref"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { fund_type (t, "idrefs"); @@ -433,7 +435,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { fund_type (t, "uri"); @@ -441,13 +443,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { fund_type (t, "base64_binary"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { fund_type (t, "hex_binary"); @@ -456,55 +458,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { fund_type (t, "date"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { fund_type (t, "date_time"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { fund_type (t, "duration"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { fund_type (t, "day"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { fund_type (t, "month"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { fund_type (t, "month_day"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { fund_type (t, "year"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { fund_type (t, "year_month"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { fund_type (t, "time"); @@ -512,20 +514,20 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { fund_type (t, "entity"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { fund_type (t, "entities"); } private: - virtual Boolean + virtual bool fund_type (SemanticGraph::Type& t, String const& name) { if (map_.find (&t) == map_.end ()) @@ -542,7 +544,7 @@ namespace CXX { String name (escape (raw_name + L"_p_")); - for (UnsignedLong i (1); set_.find (name) != set_.end (); ++i) + for (size_t i (1); set_.find (name) != set_.end (); ++i) { std::wostringstream os; os << i; @@ -584,7 +586,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& tc (t.context ()); @@ -592,7 +594,7 @@ namespace CXX if (!tc.count ("paggr")) return; - Boolean poly (polymorphic (t)); + bool poly (polymorphic (t)); String const& name (tc.get ("paggr")); String pre (unclash (name, "pre")); @@ -752,7 +754,7 @@ namespace CXX os << "public:" << endl; - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) os << fq_name (*i->first, "p:impl") << " " << i->second << ";"; @@ -774,7 +776,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { SemanticGraph::Context& ec (e.context ()); @@ -783,7 +785,7 @@ namespace CXX return; SemanticGraph::Type& t (e.type ()); - Boolean poly (polymorphic (t)); + bool poly (polymorphic (t)); String const& name (ec.get ("paggr")); String pre (unclash (name, "pre")); @@ -960,7 +962,7 @@ namespace CXX os << "public:" << endl; - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) os << fq_name (*i->first, "p:impl") << " " << i->second << ";"; @@ -977,10 +979,10 @@ namespace CXX }; } - Void + void generate_parser_aggregate_header (Context& ctx) { - Boolean gen (false); + bool gen (false); { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/parser-aggregate-header.hxx b/xsde/cxx/hybrid/parser-aggregate-header.hxx index 0e75792..5e5cad9 100644 --- a/xsde/cxx/hybrid/parser-aggregate-header.hxx +++ b/xsde/cxx/hybrid/parser-aggregate-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_parser_aggregate_header (Context&); } } diff --git a/xsde/cxx/hybrid/parser-aggregate-source.cxx b/xsde/cxx/hybrid/parser-aggregate-source.cxx index a1d9bf3..5c81eaa 100644 --- a/xsde/cxx/hybrid/parser-aggregate-source.cxx +++ b/xsde/cxx/hybrid/parser-aggregate-source.cxx @@ -9,7 +9,6 @@ #include #include -#include namespace CXX { @@ -23,8 +22,8 @@ namespace CXX { ParticleArg (Context& c, TypeInstanceMap& map, - Boolean& first, - Boolean poly, + bool& first, + bool poly, String const& arg) : Context (c), poly_ (poly), @@ -35,7 +34,7 @@ namespace CXX { } - ParticleArg (Context& c, Boolean& result, Boolean poly) + ParticleArg (Context& c, bool& result, bool poly) : Context (c), poly_ (poly), map_ (0), @@ -44,7 +43,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (poly_ && anonymous (e.type ())) @@ -68,26 +67,26 @@ namespace CXX } private: - Boolean poly_; + bool poly_; TypeInstanceMap* map_; - Boolean* first_; - Boolean* result_; + bool* first_; + bool* result_; String arg_; }; struct AttributeArg: Traversal::Attribute, Context { - AttributeArg (Context& c, TypeInstanceMap& map, Boolean& first) + AttributeArg (Context& c, TypeInstanceMap& map, bool& first) : Context (c), map_ (&map), first_ (&first), result_ (0) { } - AttributeArg (Context& c, Boolean& result) + AttributeArg (Context& c, bool& result) : Context (c), map_ (0), first_ (0), result_ (&result) { } - virtual Void + virtual void traverse (Type& a) { if (result_ != 0) @@ -106,8 +105,8 @@ namespace CXX private: TypeInstanceMap* map_; - Boolean* first_; - Boolean* result_; + bool* first_; + bool* result_; }; struct ArgList : Traversal::Complex, @@ -116,7 +115,7 @@ namespace CXX { ArgList (Context& c, TypeInstanceMap& map, - Boolean poly, + bool poly, String const& arg) : Context (c), poly_ (poly), @@ -137,7 +136,7 @@ namespace CXX names_ >> attribute_; } - ArgList (Context& c, Boolean& result, Boolean poly) + ArgList (Context& c, bool& result, bool poly) : Context (c), poly_ (poly), map_ (0), @@ -156,7 +155,7 @@ namespace CXX names_ >> attribute_; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -168,7 +167,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (poly_) @@ -189,7 +188,7 @@ namespace CXX } private: - Boolean poly_; + bool poly_; TypeInstanceMap* map_; Traversal::Inherits inherits_; @@ -202,8 +201,8 @@ namespace CXX Traversal::Names names_; AttributeArg attribute_; - Boolean first_; - Boolean* result_; + bool first_; + bool* result_; }; struct ParserConnect: Traversal::List, @@ -212,13 +211,13 @@ namespace CXX { ParserConnect (Context& c, TypeInstanceMap& map, - Boolean poly, + bool poly, String const& map_inst = String ()) : Context (c), poly_ (poly), map_ (map), map_inst_ (map_inst) { } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (poly_) @@ -229,7 +228,7 @@ namespace CXX << endl; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (has_members (c)) @@ -246,17 +245,17 @@ namespace CXX } private: - Boolean + bool has_members (SemanticGraph::Complex& c) { - Boolean r (false); + bool r (false); ArgList test (*this, r, poly_); test.traverse (c); return r; } private: - Boolean poly_; + bool poly_; TypeInstanceMap& map_; String map_inst_; }; @@ -271,7 +270,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& tc (t.context ()); @@ -312,9 +311,9 @@ namespace CXX { String const& entry (tc.get ("paggr-parser-map-entries")); - Size n (0); + size_t n (0); - for (TypeIdInstanceMap::Iterator i (tid_map->begin ()); + for (TypeIdInstanceMap::iterator i (tid_map->begin ()); i != tid_map->end (); ++i, ++n) { @@ -330,7 +329,7 @@ namespace CXX // ParserConnect connect (*this, map, false); - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) connect.dispatch (*i->first); @@ -341,7 +340,7 @@ namespace CXX ParserConnect connect ( *this, map, true, tc.get ("paggr-parser-map")); - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) connect.dispatch (*i->first); } @@ -357,7 +356,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { SemanticGraph::Context& ec (e.context ()); @@ -398,9 +397,9 @@ namespace CXX { String const& entry (ec.get ("paggr-parser-map-entries")); - Size n (0); + size_t n (0); - for (TypeIdInstanceMap::Iterator i (tid_map->begin ()); + for (TypeIdInstanceMap::iterator i (tid_map->begin ()); i != tid_map->end (); ++i, ++n) { @@ -416,7 +415,7 @@ namespace CXX // ParserConnect connect (*this, map, false); - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) connect.dispatch (*i->first); @@ -427,7 +426,7 @@ namespace CXX ParserConnect connect ( *this, map, true, ec.get ("paggr-parser-map")); - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) connect.dispatch (*i->first); } @@ -457,10 +456,10 @@ namespace CXX }; } - Void + void generate_parser_aggregate_source (Context& ctx) { - Boolean gen (false); + bool gen (false); { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/parser-aggregate-source.hxx b/xsde/cxx/hybrid/parser-aggregate-source.hxx index bac9fed..e4237fe 100644 --- a/xsde/cxx/hybrid/parser-aggregate-source.hxx +++ b/xsde/cxx/hybrid/parser-aggregate-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_parser_aggregate_source (Context&); } } diff --git a/xsde/cxx/hybrid/parser-header.cxx b/xsde/cxx/hybrid/parser-header.cxx index 64a7f55..4a1ec35 100644 --- a/xsde/cxx/hybrid/parser-header.cxx +++ b/xsde/cxx/hybrid/parser-header.cxx @@ -23,7 +23,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (c.inherits_p ()) @@ -52,7 +52,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -73,8 +73,8 @@ namespace CXX // if (name) { - Boolean fl (fixed_length (e)); - Boolean val (!options.suppress_validation () && + bool fl (fixed_length (e)); + bool val (!options.suppress_validation () && !options.suppress_parser_val ()); SemanticGraph::Type& b (e.inherits ().base ()); @@ -232,7 +232,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (epimpl_custom (l)); @@ -323,7 +323,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (epimpl_custom (u)); @@ -333,7 +333,7 @@ namespace CXX // if (name) { - Boolean fl (fixed_length (u)); + bool fl (fixed_length (u)); os << "class " << name << ": public " << (mixin ? "virtual " : "") << epskel (u) @@ -437,7 +437,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { if (c.max () != 1) @@ -467,7 +467,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1}. @@ -482,7 +482,7 @@ namespace CXX Traversal::All::traverse (a); } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { os << "virtual void" << endl @@ -492,7 +492,7 @@ namespace CXX Traversal::Choice::traverse (c); } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1) @@ -519,7 +519,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& arg (parg_type (e.type ())); @@ -542,7 +542,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (a.fixed_p ()) @@ -595,7 +595,7 @@ namespace CXX names_attribute_callback_ >> attribute_callback_; } - virtual Void + virtual void traverse (Type& c) { String const& name (epimpl_custom (c)); @@ -605,14 +605,14 @@ namespace CXX // if (name) { - Boolean hb (c.inherits_p ()); - Boolean he (has (c)); - Boolean ha (has (c)); - Boolean hae (has_particle (c)); + bool hb (c.inherits_p ()); + bool he (has (c)); + bool ha (has (c)); + bool hae (has_particle (c)); - Boolean restriction (restriction_p (c)); - Boolean fixed (fixed_length (c)); - Boolean rec (recursive (c)); + bool restriction (restriction_p (c)); + bool fixed (fixed_length (c)); + bool rec (recursive (c)); String const& ret (pret_type (c)); @@ -784,7 +784,7 @@ namespace CXX }; } - Void + void generate_parser_header (Context& ctx) { ctx.os << "#include " << endl diff --git a/xsde/cxx/hybrid/parser-header.hxx b/xsde/cxx/hybrid/parser-header.hxx index 230ba49..62a1b06 100644 --- a/xsde/cxx/hybrid/parser-header.hxx +++ b/xsde/cxx/hybrid/parser-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_parser_header (Context&); } } diff --git a/xsde/cxx/hybrid/parser-name-processor.cxx b/xsde/cxx/hybrid/parser-name-processor.cxx index d5f7edd..9c0f9fd 100644 --- a/xsde/cxx/hybrid/parser-name-processor.cxx +++ b/xsde/cxx/hybrid/parser-name-processor.cxx @@ -3,6 +3,11 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include +#include +#include +#include + #include #include #include @@ -10,11 +15,7 @@ #include #include -#include -#include - -#include -#include +using namespace std; namespace CXX { @@ -22,10 +23,7 @@ namespace CXX { namespace { - // - // - typedef Cult::Containers::Set NameSet; - + typedef set NameSet; struct Failed {}; class Context: public CXX::Context @@ -61,7 +59,7 @@ namespace CXX // Split the string in two parts at the last '='. // - Size pos (s.rfind ('=')); + size_t pos (s.rfind ('=')); // If no delimiter found then both base and include are empty. // @@ -107,13 +105,13 @@ namespace CXX } public: - Boolean + bool fixed_length (SemanticGraph::Type& t) { - return t.context ().get ("fixed"); + return t.context ().get ("fixed"); } - Boolean + bool recursive (SemanticGraph::Type& t) { return t.context ().count ("recursive"); @@ -125,7 +123,7 @@ namespace CXX { String name (escape (n + suffix)); - for (UnsignedLong i (1); set.find (name) != set.end (); ++i) + for (size_t i (1); set.find (name) != set.end (); ++i) { std::wostringstream os; os << i; @@ -212,25 +210,23 @@ namespace CXX String include; }; - typedef - Cult::Containers::Map - CustomParserMap; + typedef map CustomParserMap; private: String const impl_suffix_; String const aggr_suffix_; CustomParserMap custom_parser_map_; - Cult::Containers::Map global_type_names_; + map global_type_names_; public: options_type const& options; - Boolean aggregate; + bool aggregate; String const& impl_suffix; String const& aggr_suffix; CustomParserMap const& custom_parser_map; - Cult::Containers::Map& global_type_names; + map& global_type_names; }; // @@ -242,7 +238,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -268,7 +264,7 @@ namespace CXX if (!name) return; - Boolean fl (fixed_length (e)); + bool fl (fixed_length (e)); NameSet set; set.insert (name); @@ -297,7 +293,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { SemanticGraph::Context& lc (l.context ()); @@ -331,7 +327,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { SemanticGraph::Context& uc (u.context ()); @@ -368,7 +364,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { if (c.max () != 1) @@ -393,7 +389,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { SemanticGraph::Context& cc (c.context ()); @@ -409,7 +405,7 @@ namespace CXX // // - Boolean restriction (false); + bool restriction (false); if (c.inherits_p ()) restriction = c.inherits ().is_a () && @@ -472,7 +468,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& tc (t.context ()); @@ -482,8 +478,8 @@ namespace CXX // See if this parser is being customized. // - Boolean custom (false); - CustomParserMap::ConstIterator i (custom_parser_map.find (name)); + bool custom (false); + CustomParserMap::const_iterator i (custom_parser_map.find (name)); if (i != custom_parser_map.end ()) { @@ -550,10 +546,10 @@ namespace CXX process (*last_); } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { - Boolean p (false); + bool p (false); if (last_ == 0 && options.root_element_first ()) p = true; @@ -595,7 +591,7 @@ namespace CXX } private: - Void + void process (SemanticGraph::Element& e) { SemanticGraph::Context& ec (e.context ()); @@ -618,7 +614,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& ns) { SemanticGraph::Context& nsc (ns.context ()); @@ -669,7 +665,7 @@ namespace CXX Traversal::Includes, Traversal::Imports { - virtual Void + virtual void traverse (SemanticGraph::Sources& sr) { SemanticGraph::Schema& s (sr.schema ()); @@ -681,7 +677,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { SemanticGraph::Schema& s (i.schema ()); @@ -693,7 +689,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { SemanticGraph::Schema& s (i.schema ()); @@ -705,16 +701,16 @@ namespace CXX } } - static Char const* seen_key; + static char const* seen_key; }; - Char const* Uses::seen_key = "cxx-hybrid-parser-name-processor-seen"; + char const* Uses::seen_key = "cxx-hybrid-parser-name-processor-seen"; - Void + void process_impl (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, - Boolean deep) + bool deep) { Context ctx (ops, tu, file); @@ -776,11 +772,11 @@ namespace CXX } } - Boolean ParserNameProcessor:: + bool ParserNameProcessor:: process (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, - Boolean deep) + bool deep) { try { diff --git a/xsde/cxx/hybrid/parser-name-processor.hxx b/xsde/cxx/hybrid/parser-name-processor.hxx index 20721ee..d5fd390 100644 --- a/xsde/cxx/hybrid/parser-name-processor.hxx +++ b/xsde/cxx/hybrid/parser-name-processor.hxx @@ -6,26 +6,23 @@ #ifndef CXX_HYBRID_PARSER_NAME_PROCESSOR_HXX #define CXX_HYBRID_PARSER_NAME_PROCESSOR_HXX -#include - #include +#include #include namespace CXX { namespace Hybrid { - using namespace Cult::Types; - class ParserNameProcessor { public: - Boolean + bool process (options const& options, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, - Boolean deep); + bool deep); }; } } diff --git a/xsde/cxx/hybrid/parser-source.cxx b/xsde/cxx/hybrid/parser-source.cxx index 3b6ed31..a5df5bc 100644 --- a/xsde/cxx/hybrid/parser-source.cxx +++ b/xsde/cxx/hybrid/parser-source.cxx @@ -23,10 +23,10 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { - Boolean clear (false); + bool clear (false); if (scope_ == 0) { @@ -70,7 +70,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { using SemanticGraph::Enumeration; @@ -96,7 +96,7 @@ namespace CXX names_ >> enumerator_; } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -119,9 +119,9 @@ namespace CXX << "//" << endl << endl; - Boolean fl (fixed_length (e)); + bool fl (fixed_length (e)); - Boolean val (!options.suppress_validation () && + bool val (!options.suppress_validation () && !options.suppress_parser_val ()); SemanticGraph::Context& ec (e.context ()); @@ -430,7 +430,7 @@ namespace CXX os << type << "* r = this->" << state << ".x_;" << "this->" << state << ".x_ = 0;"; - Boolean flb (fixed_length (b)); + bool flb (fixed_length (b)); // Copy the value if our base is fixed-length. // @@ -486,7 +486,7 @@ namespace CXX << "}"; } - virtual Void + virtual void comma (Type&) { os << "else "; @@ -509,7 +509,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (epimpl_custom (l)); @@ -662,7 +662,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (epimpl_custom (u)); @@ -863,13 +863,13 @@ namespace CXX // for the current element in the container is returned. // String - access_seq (SemanticGraph::Particle& p, Boolean element = true) + access_seq (SemanticGraph::Particle& p, bool element = true) { using namespace SemanticGraph; String r; - Boolean seq (false); + bool seq (false); Compositor* c; @@ -957,7 +957,7 @@ namespace CXX if (!seq) { - Boolean fixed (fixed_length (t)); + bool fixed (fixed_length (t)); String const& s (epstate_member (t)); if (!r) @@ -1036,24 +1036,24 @@ namespace CXX struct CompositorTest: Traversal::Compositor { - CompositorTest (Boolean& p) + CompositorTest (bool& p) : p_ (p) { } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { // We are only interested in var-length required compositors. // if (c.max () == 1 && c.min () == 1 && - !c.context ().get ("fixed")) + !c.context ().get ("fixed")) p_ = true; } private: - Boolean& p_; + bool& p_; }; // @@ -1070,7 +1070,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1}. @@ -1129,7 +1129,7 @@ namespace CXX Traversal::All::traverse (a); } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { String const& s (epimpl_custom (scope (c))); @@ -1350,7 +1350,7 @@ namespace CXX Traversal::Choice::traverse (c); } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1) @@ -1487,7 +1487,7 @@ namespace CXX } private: - Boolean init_; + bool init_; CompositorTest compositor_test_; }; @@ -1498,7 +1498,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { using SemanticGraph::Complex; @@ -1547,7 +1547,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { using SemanticGraph::Complex; @@ -1598,7 +1598,7 @@ namespace CXX names_attribute_callback_ >> attribute_callback_; } - virtual Void + virtual void traverse (Type& c) { String const& name (epimpl_custom (c)); @@ -1606,15 +1606,15 @@ namespace CXX if (!name) return; - Boolean hb (c.inherits_p ()); - Boolean restriction (restriction_p (c)); - Boolean fixed (fixed_length (c)); - Boolean rec (recursive (c)); + bool hb (c.inherits_p ()); + bool restriction (restriction_p (c)); + bool fixed (fixed_length (c)); + bool rec (recursive (c)); - Boolean validation (!options.suppress_validation () && + bool validation (!options.suppress_validation () && !options.suppress_parser_val ()); - Boolean c_string_base (false); + bool c_string_base (false); if (!stl && hb) { StringType test (c_string_base); @@ -2086,7 +2086,7 @@ namespace CXX }; } - Void + void generate_parser_source (Context& ctx, Regex const& hxx_obj_expr) { if (ctx.enum_) diff --git a/xsde/cxx/hybrid/parser-source.hxx b/xsde/cxx/hybrid/parser-source.hxx index b664041..5a02361 100644 --- a/xsde/cxx/hybrid/parser-source.hxx +++ b/xsde/cxx/hybrid/parser-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_parser_source (Context&, Regex const& hxx_obj_expr); } } diff --git a/xsde/cxx/hybrid/serializer-aggregate-header.cxx b/xsde/cxx/hybrid/serializer-aggregate-header.cxx index cfcb203..e8316b7 100644 --- a/xsde/cxx/hybrid/serializer-aggregate-header.cxx +++ b/xsde/cxx/hybrid/serializer-aggregate-header.cxx @@ -3,6 +3,8 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include + #include #include #include @@ -10,8 +12,7 @@ #include #include -#include -#include +using namespace std; namespace CXX { @@ -19,7 +20,7 @@ namespace CXX { namespace { - typedef Cult::Containers::Set InstanceSet; + typedef set InstanceSet; // For base types we only want member's types, but not the // base itself. @@ -33,7 +34,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c); @@ -45,7 +46,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::List& l) { def_.dispatch (l.argumented ().type ()); @@ -147,7 +148,7 @@ namespace CXX belongs_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { if (map_.find (&t) == map_.end ()) @@ -159,7 +160,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (map_.find (&l) == map_.end ()) @@ -172,7 +173,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (map_.find (&c) == map_.end ()) @@ -196,7 +197,7 @@ namespace CXX } } - virtual Void + virtual void collect (SemanticGraph::Type& t) { using SemanticGraph::Type; @@ -227,7 +228,7 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { if (fund_type (t, "any_type")) @@ -237,7 +238,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { fund_type (t, "any_simple_type"); @@ -245,7 +246,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { fund_type (t, "boolean"); @@ -253,79 +254,79 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { fund_type (t, "byte"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { fund_type (t, "unsigned_byte"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { fund_type (t, "short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { fund_type (t, "unsigned_short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { fund_type (t, "int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { fund_type (t, "unsigned_int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { fund_type (t, "long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { fund_type (t, "unsigned_long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { fund_type (t, "integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { fund_type (t, "non_positive_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { fund_type (t, "non_negative_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { fund_type (t, "positive_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { fund_type (t, "negative_integer"); @@ -333,19 +334,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { fund_type (t, "float"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { fund_type (t, "double"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { fund_type (t, "decimal"); @@ -353,49 +354,49 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { fund_type (t, "string"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { fund_type (t, "normalized_string"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { fund_type (t, "token"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { fund_type (t, "nmtoken"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { fund_type (t, "nmtokens"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { fund_type (t, "name"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { fund_type (t, "ncname"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { fund_type (t, "language"); @@ -404,7 +405,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { fund_type (t, "qname"); @@ -413,19 +414,19 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { fund_type (t, "id"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { fund_type (t, "idref"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { fund_type (t, "idrefs"); @@ -433,7 +434,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { fund_type (t, "uri"); @@ -441,13 +442,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { fund_type (t, "base64_binary"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { fund_type (t, "hex_binary"); @@ -456,55 +457,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { fund_type (t, "date"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { fund_type (t, "date_time"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { fund_type (t, "duration"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { fund_type (t, "day"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { fund_type (t, "month"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { fund_type (t, "month_day"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { fund_type (t, "year"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { fund_type (t, "year_month"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { fund_type (t, "time"); @@ -512,20 +513,20 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { fund_type (t, "entity"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { fund_type (t, "entities"); } private: - virtual Boolean + virtual bool fund_type (SemanticGraph::Type& t, String const& name) { if (map_.find (&t) == map_.end ()) @@ -542,7 +543,7 @@ namespace CXX { String name (escape (raw_name + L"_s_")); - for (UnsignedLong i (1); set_.find (name) != set_.end (); ++i) + for (size_t i (1); set_.find (name) != set_.end (); ++i) { std::wostringstream os; os << i; @@ -584,7 +585,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& tc (t.context ()); @@ -592,7 +593,7 @@ namespace CXX if (!tc.count ("saggr")) return; - Boolean poly (polymorphic (t)); + bool poly (polymorphic (t)); String const& name (tc.get ("saggr")); String pre (unclash (name, "pre")); @@ -757,7 +758,7 @@ namespace CXX os << "public:" << endl; - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) os << fq_name (*i->first, "s:impl") << " " << i->second << ";"; @@ -781,7 +782,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { SemanticGraph::Context& ec (e.context ()); @@ -790,7 +791,7 @@ namespace CXX return; SemanticGraph::Type& t (e.type ()); - Boolean poly (polymorphic (t)); + bool poly (polymorphic (t)); String const& name (ec.get ("saggr")); String pre (unclash (name, "pre")); @@ -972,7 +973,7 @@ namespace CXX os << "public:" << endl; - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) os << fq_name (*i->first, "s:impl") << " " << i->second << ";"; @@ -990,10 +991,10 @@ namespace CXX }; } - Void + void generate_serializer_aggregate_header (Context& ctx) { - Boolean gen (false); + bool gen (false); { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/serializer-aggregate-header.hxx b/xsde/cxx/hybrid/serializer-aggregate-header.hxx index 7c0d73a..8836261 100644 --- a/xsde/cxx/hybrid/serializer-aggregate-header.hxx +++ b/xsde/cxx/hybrid/serializer-aggregate-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_serializer_aggregate_header (Context&); } } diff --git a/xsde/cxx/hybrid/serializer-aggregate-source.cxx b/xsde/cxx/hybrid/serializer-aggregate-source.cxx index e9edeea..ef7ff76 100644 --- a/xsde/cxx/hybrid/serializer-aggregate-source.cxx +++ b/xsde/cxx/hybrid/serializer-aggregate-source.cxx @@ -9,8 +9,6 @@ #include #include -#include - namespace CXX { namespace Hybrid @@ -21,8 +19,8 @@ namespace CXX { ParticleArg (Context& c, TypeInstanceMap& map, - Boolean& first, - Boolean poly, + bool& first, + bool poly, String const& arg) : Context (c), poly_ (poly), @@ -33,7 +31,7 @@ namespace CXX { } - ParticleArg (Context& c, Boolean& result, Boolean poly) + ParticleArg (Context& c, bool& result, bool poly) : Context (c), poly_ (poly), map_ (0), @@ -42,7 +40,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (poly_ && anonymous (e.type ())) @@ -66,26 +64,26 @@ namespace CXX } private: - Boolean poly_; + bool poly_; TypeInstanceMap* map_; - Boolean* first_; - Boolean* result_; + bool* first_; + bool* result_; String arg_; }; struct AttributeArg: Traversal::Attribute, Context { - AttributeArg (Context& c, TypeInstanceMap& map, Boolean& first) + AttributeArg (Context& c, TypeInstanceMap& map, bool& first) : Context (c), map_ (&map), first_ (&first), result_ (0) { } - AttributeArg (Context& c, Boolean& result) + AttributeArg (Context& c, bool& result) : Context (c), map_ (0), first_ (0), result_ (&result) { } - virtual Void + virtual void traverse (Type& a) { if (result_ != 0) @@ -104,8 +102,8 @@ namespace CXX private: TypeInstanceMap* map_; - Boolean* first_; - Boolean* result_; + bool* first_; + bool* result_; }; struct ArgList : Traversal::Complex, @@ -114,7 +112,7 @@ namespace CXX { ArgList (Context& c, TypeInstanceMap& map, - Boolean poly, + bool poly, String const& arg) : Context (c), poly_ (poly), @@ -135,7 +133,7 @@ namespace CXX names_ >> attribute_; } - ArgList (Context& c, Boolean& result, Boolean poly) + ArgList (Context& c, bool& result, bool poly) : Context (c), poly_ (poly), map_ (0), @@ -154,7 +152,7 @@ namespace CXX names_ >> attribute_; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -166,7 +164,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (poly_) @@ -187,7 +185,7 @@ namespace CXX } private: - Boolean poly_; + bool poly_; TypeInstanceMap* map_; Traversal::Inherits inherits_; @@ -200,8 +198,8 @@ namespace CXX Traversal::Names names_; AttributeArg attribute_; - Boolean first_; - Boolean* result_; + bool first_; + bool* result_; }; struct SerializerConnect: Traversal::List, @@ -210,13 +208,13 @@ namespace CXX { SerializerConnect (Context& c, TypeInstanceMap& map, - Boolean poly, + bool poly, String const& map_inst = String ()) : Context (c), poly_ (poly), map_ (map), map_inst_ (map_inst) { } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (poly_) @@ -227,7 +225,7 @@ namespace CXX << endl; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (has_members (c)) @@ -244,17 +242,17 @@ namespace CXX } private: - Boolean + bool has_members (SemanticGraph::Complex& c) { - Boolean r (false); + bool r (false); ArgList test (*this, r, poly_); test.traverse (c); return r; } private: - Boolean poly_; + bool poly_; TypeInstanceMap& map_; String map_inst_; }; @@ -268,7 +266,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& tc (t.context ()); @@ -310,9 +308,9 @@ namespace CXX String const& entry ( tc.get ("saggr-serializer-map-entries")); - Size n (0); + size_t n (0); - for (TypeIdInstanceMap::Iterator i (tid_map->begin ()); + for (TypeIdInstanceMap::iterator i (tid_map->begin ()); i != tid_map->end (); ++i, ++n) { @@ -328,7 +326,7 @@ namespace CXX // SerializerConnect connect (*this, map, false); - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) connect.dispatch (*i->first); @@ -339,7 +337,7 @@ namespace CXX SerializerConnect connect ( *this, map, true, tc.get ("saggr-serializer-map")); - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) connect.dispatch (*i->first); } @@ -355,7 +353,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { SemanticGraph::Context& ec (e.context ()); @@ -397,9 +395,9 @@ namespace CXX String const& entry ( ec.get ("saggr-serializer-map-entries")); - Size n (0); + size_t n (0); - for (TypeIdInstanceMap::Iterator i (tid_map->begin ()); + for (TypeIdInstanceMap::iterator i (tid_map->begin ()); i != tid_map->end (); ++i, ++n) { @@ -415,7 +413,7 @@ namespace CXX // SerializerConnect connect (*this, map, false); - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) connect.dispatch (*i->first); @@ -426,7 +424,7 @@ namespace CXX SerializerConnect connect ( *this, map, true, ec.get ("saggr-serializer-map")); - for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ()); + for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ()); i != end; ++i) connect.dispatch (*i->first); } @@ -456,10 +454,10 @@ namespace CXX }; } - Void + void generate_serializer_aggregate_source (Context& ctx) { - Boolean gen (false); + bool gen (false); { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/serializer-aggregate-source.hxx b/xsde/cxx/hybrid/serializer-aggregate-source.hxx index ba2357d..11bfd97 100644 --- a/xsde/cxx/hybrid/serializer-aggregate-source.hxx +++ b/xsde/cxx/hybrid/serializer-aggregate-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_serializer_aggregate_source (Context&); } } diff --git a/xsde/cxx/hybrid/serializer-header.cxx b/xsde/cxx/hybrid/serializer-header.cxx index 2297474..7a4117f 100644 --- a/xsde/cxx/hybrid/serializer-header.cxx +++ b/xsde/cxx/hybrid/serializer-header.cxx @@ -23,7 +23,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (c.inherits_p ()) @@ -52,7 +52,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -156,7 +156,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (esimpl_custom (l)); @@ -236,7 +236,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (esimpl_custom (u)); @@ -298,7 +298,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { if (c.max () != 1) @@ -323,7 +323,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () != 1) @@ -353,7 +353,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1}. @@ -368,12 +368,12 @@ namespace CXX Traversal::All::traverse (a); } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.contains_begin () != c.contains_end ()) { - UnsignedLong min (c.min ()), max (c.max ()); + size_t min (c.min ()), max (c.max ()); if (min == 0 && max == 1) { @@ -396,10 +396,10 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { - UnsignedLong min (s.min ()), max (s.max ()); + size_t min (s.min ()), max (s.max ()); if (min == 0 && max == 1) { @@ -425,10 +425,10 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { - UnsignedLong min (e.min ()), max (e.max ()); + size_t min (e.min ()), max (e.max ()); if (min == 0 && max == 1) { @@ -458,7 +458,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (a.optional_p ()) @@ -513,7 +513,7 @@ namespace CXX names_attribute_callback_ >> attribute_callback_; } - virtual Void + virtual void traverse (Type& c) { String const& name (esimpl_custom (c)); @@ -527,16 +527,16 @@ namespace CXX // generate serializer callbacks, etc. since they are the same // as in the base. We only need the serialization/validation code. // - Boolean restriction (restriction_p (c)); + bool restriction (restriction_p (c)); - Boolean hb (c.inherits_p ()); - Boolean he (has (c)); - Boolean ha (has (c)); + bool hb (c.inherits_p ()); + bool he (has (c)); + bool ha (has (c)); - Boolean hae (has_particle (c)); - Boolean haa (has (c)); + bool hae (has_particle (c)); + bool haa (has (c)); - Boolean rec (recursive (c)); + bool rec (recursive (c)); String const& arg (sarg_type (c)); @@ -689,7 +689,7 @@ namespace CXX }; } - Void + void generate_serializer_header (Context& ctx) { ctx.os << "#include " << endl diff --git a/xsde/cxx/hybrid/serializer-header.hxx b/xsde/cxx/hybrid/serializer-header.hxx index ddf3ded..9e6f8d6 100644 --- a/xsde/cxx/hybrid/serializer-header.hxx +++ b/xsde/cxx/hybrid/serializer-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_serializer_header (Context&); } } diff --git a/xsde/cxx/hybrid/serializer-name-processor.cxx b/xsde/cxx/hybrid/serializer-name-processor.cxx index 4071ecb..b29b509 100644 --- a/xsde/cxx/hybrid/serializer-name-processor.cxx +++ b/xsde/cxx/hybrid/serializer-name-processor.cxx @@ -3,6 +3,11 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include +#include +#include +#include + #include #include #include @@ -10,10 +15,7 @@ #include #include -#include - -#include -#include +using namespace std; namespace CXX { @@ -21,10 +23,7 @@ namespace CXX { namespace { - // - // - typedef Cult::Containers::Set NameSet; - + typedef set NameSet; struct Failed {}; class Context: public CXX::Context @@ -60,7 +59,7 @@ namespace CXX // Split the string in two parts at the last '='. // - Size pos (s.rfind ('=')); + size_t pos (s.rfind ('=')); // If no delimiter found then both base and include are empty. // @@ -111,7 +110,7 @@ namespace CXX { String name (escape (n + suffix)); - for (UnsignedLong i (1); set.find (name) != set.end (); ++i) + for (size_t i (1); set.find (name) != set.end (); ++i) { std::wostringstream os; os << i; @@ -129,7 +128,7 @@ namespace CXX } public: - Boolean + bool recursive (SemanticGraph::Type& t) { return t.context ().count ("recursive"); @@ -205,25 +204,23 @@ namespace CXX String include; }; - typedef - Cult::Containers::Map - CustomSerializerMap; + typedef map CustomSerializerMap; private: String const impl_suffix_; String const aggr_suffix_; CustomSerializerMap custom_serializer_map_; - Cult::Containers::Map global_type_names_; + map global_type_names_; public: options_type const& options; - Boolean aggregate; + bool aggregate; String const& impl_suffix; String const& aggr_suffix; CustomSerializerMap const& custom_serializer_map; - Cult::Containers::Map& global_type_names; + map& global_type_names; }; // @@ -235,7 +232,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -283,7 +280,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { SemanticGraph::Context& lc (l.context ()); @@ -319,7 +316,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { SemanticGraph::Context& uc (u.context ()); @@ -350,7 +347,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { if (c.max () != 1) @@ -375,7 +372,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () != 1) @@ -400,7 +397,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { SemanticGraph::Context& cc (c.context ()); @@ -416,7 +413,7 @@ namespace CXX // // - Boolean restriction (false); + bool restriction (false); if (c.inherits_p ()) restriction = c.inherits ().is_a () && @@ -479,7 +476,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& tc (t.context ()); @@ -489,8 +486,8 @@ namespace CXX // See if this serializer is being customized. // - Boolean custom (false); - CustomSerializerMap::ConstIterator i ( + bool custom (false); + CustomSerializerMap::const_iterator i ( custom_serializer_map.find (name)); if (i != custom_serializer_map.end ()) @@ -558,10 +555,10 @@ namespace CXX process (*last_); } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { - Boolean p (false); + bool p (false); if (last_ == 0 && options.root_element_first ()) p = true; @@ -602,7 +599,7 @@ namespace CXX } private: - Void + void process (SemanticGraph::Element& e) { SemanticGraph::Context& ec (e.context ()); @@ -625,7 +622,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& ns) { SemanticGraph::Context& nsc (ns.context ()); @@ -676,7 +673,7 @@ namespace CXX Traversal::Includes, Traversal::Imports { - virtual Void + virtual void traverse (SemanticGraph::Sources& sr) { SemanticGraph::Schema& s (sr.schema ()); @@ -688,7 +685,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { SemanticGraph::Schema& s (i.schema ()); @@ -700,7 +697,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { SemanticGraph::Schema& s (i.schema ()); @@ -712,16 +709,16 @@ namespace CXX } } - static Char const* seen_key; + static char const* seen_key; }; - Char const* Uses::seen_key = "cxx-hybrid-serializer-name-processor-seen"; + char const* Uses::seen_key = "cxx-hybrid-serializer-name-processor-seen"; - Void + void process_impl (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, - Boolean deep) + bool deep) { Context ctx (ops, tu, file); @@ -783,11 +780,11 @@ namespace CXX } } - Boolean SerializerNameProcessor:: + bool SerializerNameProcessor:: process (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, - Boolean deep) + bool deep) { try { diff --git a/xsde/cxx/hybrid/serializer-name-processor.hxx b/xsde/cxx/hybrid/serializer-name-processor.hxx index 0840f52..f7e3ea4 100644 --- a/xsde/cxx/hybrid/serializer-name-processor.hxx +++ b/xsde/cxx/hybrid/serializer-name-processor.hxx @@ -6,26 +6,23 @@ #ifndef CXX_HYBRID_SERIALIZER_NAME_PROCESSOR_HXX #define CXX_HYBRID_SERIALIZER_NAME_PROCESSOR_HXX -#include - #include +#include #include namespace CXX { namespace Hybrid { - using namespace Cult::Types; - class SerializerNameProcessor { public: - Boolean + bool process (options const& options, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, - Boolean deep); + bool deep); }; } } diff --git a/xsde/cxx/hybrid/serializer-source.cxx b/xsde/cxx/hybrid/serializer-source.cxx index d99d167..d93ffa4 100644 --- a/xsde/cxx/hybrid/serializer-source.cxx +++ b/xsde/cxx/hybrid/serializer-source.cxx @@ -30,38 +30,38 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens&) { os << "&"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName&) { if (!stl) os << "&"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs&) { os << "&"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary&) { os << "&"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary&) { os << "&"; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities&) { os << "&"; @@ -77,10 +77,10 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { - Boolean clear (false); + bool clear (false); if (scope_ == 0) { @@ -127,7 +127,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -239,7 +239,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (esimpl_custom (l)); @@ -306,7 +306,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (esimpl_custom (u)); @@ -367,13 +367,13 @@ namespace CXX // for the current element in the container is returned. // String - access_seq (SemanticGraph::Particle& p, Boolean element = true) + access_seq (SemanticGraph::Particle& p, bool element = true) { using namespace SemanticGraph; String r; - Boolean seq (false); + bool seq (false); Compositor* c; @@ -538,19 +538,19 @@ namespace CXX struct CompositorTest: Traversal::Choice, Traversal::Sequence { - CompositorTest (Boolean& seq) + CompositorTest (bool& seq) : seq_ (seq) { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.max () != 1) seq_ = true; } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1) @@ -564,17 +564,17 @@ namespace CXX } private: - Boolean& seq_; + bool& seq_; }; struct ParticleTest: Traversal::Element { - ParticleTest (Boolean& seq) + ParticleTest (bool& seq) : seq_ (seq) { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () != 1) @@ -582,7 +582,7 @@ namespace CXX } private: - Boolean& seq_; + bool& seq_; }; // @@ -598,7 +598,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.max () != 1) @@ -617,7 +617,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1) @@ -650,7 +650,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () != 1) @@ -691,7 +691,7 @@ namespace CXX contains_particle_test_ >> particle_test_; } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1}. @@ -710,7 +710,7 @@ namespace CXX All::traverse (a); } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { SemanticGraph::Complex& t (scope (c)); @@ -831,7 +831,7 @@ namespace CXX Choice::traverse (c); } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { String const& sc (esimpl_custom (scope (s))); @@ -906,7 +906,7 @@ namespace CXX private: Traversal::ContainsParticle& init_; - Boolean seq_; + bool seq_; CompositorTest compositor_test_; ParticleTest particle_test_; Traversal::ContainsParticle contains_particle_test_; @@ -919,7 +919,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& s ( @@ -1039,7 +1039,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { String const& s ( @@ -1056,7 +1056,7 @@ namespace CXX if (a.default_p ()) { - Boolean omit (options.omit_default_attributes ()); + bool omit (options.omit_default_attributes ()); if (a.fixed_p ()) os << "return " << (omit ? "false" : "true") << ";"; @@ -1132,7 +1132,7 @@ namespace CXX names_attribute_callback_ >> attribute_callback_; } - virtual Void + virtual void traverse (Type& c) { String const& name (esimpl_custom (c)); @@ -1140,11 +1140,11 @@ namespace CXX if (!name) return; - Boolean hb (c.inherits_p ()); - Boolean rec (recursive (c)); - Boolean restriction (restriction_p (c)); + bool hb (c.inherits_p ()); + bool rec (recursive (c)); + bool restriction (restriction_p (c)); - Boolean validation (!options.suppress_validation () && + bool validation (!options.suppress_validation () && !options.suppress_serializer_val ()); String state; @@ -1392,7 +1392,7 @@ namespace CXX }; } - Void + void generate_serializer_source (Context& ctx, Regex const& hxx_obj_expr) { if (ctx.poly_code && !ctx.stl) diff --git a/xsde/cxx/hybrid/serializer-source.hxx b/xsde/cxx/hybrid/serializer-source.hxx index 17caaee..76a7ab4 100644 --- a/xsde/cxx/hybrid/serializer-source.hxx +++ b/xsde/cxx/hybrid/serializer-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_serializer_source (Context&, Regex const& hxx_obj_expr); } } diff --git a/xsde/cxx/hybrid/tree-forward.cxx b/xsde/cxx/hybrid/tree-forward.cxx index 6fbd424..bd2fdeb 100644 --- a/xsde/cxx/hybrid/tree-forward.cxx +++ b/xsde/cxx/hybrid/tree-forward.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -65,7 +65,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { SemanticGraph::Context& ctx (l.context ()); @@ -97,7 +97,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { SemanticGraph::Context& ctx (u.context ()); @@ -129,7 +129,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { SemanticGraph::Context& ctx (c.context ()); @@ -234,13 +234,13 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType&) { gen_using ("::xsde::cxx::hybrid::any_type"); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType&) { gen_typedef ("any_simple_type", string_type_); @@ -253,7 +253,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean&) { gen_typedef ("boolean", "bool"); @@ -263,7 +263,7 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte&) { gen_typedef ("byte", "signed char"); @@ -271,7 +271,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte&) { gen_typedef ("unsigned_byte", "unsigned char"); @@ -279,7 +279,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short&) { gen_typedef ("short", "short"); @@ -287,7 +287,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort&) { gen_typedef ("unsigned_short", "unsigned short"); @@ -295,7 +295,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int&) { gen_typedef ("int", "int"); @@ -303,7 +303,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt&) { gen_typedef ("unsigned_int", "unsigned int"); @@ -311,7 +311,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long&) { gen_typedef ("long", long_type_); @@ -319,7 +319,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong&) { gen_typedef ("unsigned_long", unsigned_long_type_); @@ -327,7 +327,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer&) { gen_typedef ("integer", "long"); @@ -335,7 +335,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger&) { gen_typedef ("negative_integer", "long"); @@ -343,7 +343,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger&) { gen_typedef ("non_positive_integer", "long"); @@ -351,7 +351,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger&) { gen_typedef ("positive_integer", "unsigned long"); @@ -359,7 +359,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger&) { gen_typedef ("non_negative_integer", "unsigned long"); @@ -369,7 +369,7 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float&) { gen_typedef ("float", "float"); @@ -377,7 +377,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double&) { gen_typedef ("double", "double"); @@ -385,7 +385,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal&) { gen_typedef ("decimal", "double"); @@ -395,7 +395,7 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&) { gen_typedef ("string", string_type_); @@ -406,7 +406,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&) { gen_typedef ("normalized_string", string_type_); @@ -417,7 +417,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&) { gen_typedef ("token", string_type_); @@ -426,7 +426,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken&) { gen_typedef ("nmtoken", string_type_); @@ -435,14 +435,14 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens&) { gen_typedef ("nmtokens", "::xsde::cxx::string_sequence"); os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name&) { gen_typedef ("name", string_type_); @@ -451,7 +451,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName&) { gen_typedef ("ncname", string_type_); @@ -460,7 +460,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language&) { gen_typedef ("language", string_type_); @@ -471,7 +471,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName&) { gen_using ("::xsde::cxx::qname"); @@ -480,7 +480,7 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id&) { gen_typedef ("id", string_type_); @@ -489,7 +489,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef&) { gen_typedef ("idref", string_type_); @@ -498,7 +498,7 @@ namespace CXX os << endl; } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs&) { gen_typedef ("idrefs", "::xsde::cxx::string_sequence"); @@ -507,7 +507,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI&) { gen_typedef ("uri", string_type_); @@ -518,14 +518,14 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary&) { gen_using ("::xsde::cxx::buffer"); gen_typedef ("base64_binary", "::xsde::cxx::buffer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary&) { gen_typedef ("hex_binary", "::xsde::cxx::buffer"); @@ -535,56 +535,56 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date&) { gen_using ("::xsde::cxx::time_zone"); gen_using ("::xsde::cxx::date"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime&) { gen_using ("::xsde::cxx::date_time"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration&) { gen_using ("::xsde::cxx::duration"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day&) { gen_using ("::xsde::cxx::gday"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month&) { gen_using ("::xsde::cxx::gmonth"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay&) { gen_using ("::xsde::cxx::gmonth_day"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year&) { gen_using ("::xsde::cxx::gyear"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth&) { gen_using ("::xsde::cxx::gyear_month"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time&) { gen_using ("::xsde::cxx::time"); @@ -592,24 +592,24 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity&) { } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities&) { } private: - Void + void gen_typedef (String const& name, String const& type) { os << "typedef " << type << " " << escape (name) << ";"; } - Void + void gen_using (String const& name) { os << "using " << name << ";"; @@ -667,8 +667,8 @@ namespace CXX // Data representation stream types. // - Boolean icdr (false), ocdr (false); - Boolean ixdr (false), oxdr (false); + bool icdr (false), ocdr (false); + bool ixdr (false), oxdr (false); for (NarrowStrings::const_iterator i (istreams.begin ()); i != istreams.end (); ++i) @@ -721,8 +721,8 @@ namespace CXX }; } - Void - generate_tree_forward (Context& ctx, Boolean generate_xml_schema) + void + generate_tree_forward (Context& ctx, bool generate_xml_schema) { NarrowString xml_schema (ctx.options.extern_xml_schema ()); diff --git a/xsde/cxx/hybrid/tree-forward.hxx b/xsde/cxx/hybrid/tree-forward.hxx index 5b5fa84..84cf830 100644 --- a/xsde/cxx/hybrid/tree-forward.hxx +++ b/xsde/cxx/hybrid/tree-forward.hxx @@ -12,8 +12,8 @@ namespace CXX { namespace Hybrid { - Void - generate_tree_forward (Context&, Boolean generate_xml_schema); + void + generate_tree_forward (Context&, bool generate_xml_schema); } } diff --git a/xsde/cxx/hybrid/tree-header.cxx b/xsde/cxx/hybrid/tree-header.cxx index ae24feb..0cbbaf4 100644 --- a/xsde/cxx/hybrid/tree-header.cxx +++ b/xsde/cxx/hybrid/tree-header.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { os << ename (e); @@ -39,7 +39,7 @@ namespace CXX names_ >> enumerator_; } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -61,9 +61,9 @@ namespace CXX // if (name) { - Boolean fl (fixed_length (e)); - Boolean cd (ec.count ("cd-name")); - Boolean poly (polymorphic (e)); + bool fl (fixed_length (e)); + bool cd (ec.count ("cd-name")); + bool poly (polymorphic (e)); String const& vt (ec.get ("value-type")); os << "// " << comment (e.name ()) << " (" << @@ -237,7 +237,7 @@ namespace CXX } } - virtual Void + virtual void comma (Type&) { os << "," << endl; @@ -258,7 +258,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { SemanticGraph::Context& lc (l.context ()); @@ -269,8 +269,8 @@ namespace CXX // if (name) { - Boolean cd (lc.count ("cd-name")); - Boolean poly (polymorphic (l)); + bool cd (lc.count ("cd-name")); + bool poly (polymorphic (l)); os << "// " << comment (l.name ()) << " (variable-length)" << endl << "//" << endl; @@ -397,7 +397,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { SemanticGraph::Context& uc (u.context ()); @@ -408,9 +408,9 @@ namespace CXX // if (name) { - Boolean fl (fixed_length (u)); - Boolean poly (polymorphic (u)); - Boolean cd (uc.count ("cd-name")); + bool fl (fixed_length (u)); + bool poly (polymorphic (u)); + bool cd (uc.count ("cd-name")); os << "// " << comment (u.name ()) << " (" << (fl ? "fixed-length" : "variable-length") << ")" << endl @@ -694,7 +694,7 @@ namespace CXX // length types. // - Void + void dispatch (SemanticGraph::Node& n) { rank_ = 1; @@ -705,19 +705,19 @@ namespace CXX os << type_; } - virtual Void + virtual void traverse (SemanticGraph::List&) { align_type ("size_t", 5); } - virtual Void + virtual void traverse (SemanticGraph::Union&) { align_type ("size_t", 5); // std::string } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { Complex::inherits (c, inherits_); @@ -730,7 +730,7 @@ namespace CXX // anySimpleType // - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType&) { align_type ("size_t", 5); // std::string @@ -738,7 +738,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean&) { // In worst case scenario bool is 4 bytes. Assume that. @@ -748,43 +748,43 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte&) { align_type ("signed char", 1); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte&) { align_type ("unsigned char", 1); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short&) { align_type ("short", 2); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort&) { align_type ("unsigned short", 2); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int&) { align_type ("int", 4); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt&) { align_type ("unsigned int", 4); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long&) { if (options.no_long_long ()) @@ -793,7 +793,7 @@ namespace CXX align_type ("long long", 8); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong&) { if (options.no_long_long ()) @@ -802,31 +802,31 @@ namespace CXX align_type ("unsigned long long", 8); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer&) { align_type ("long", 5); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger&) { align_type ("long", 5); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger&) { align_type ("unsigned long", 5); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger&) { align_type ("unsigned long", 5); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger&) { align_type ("long", 5); @@ -834,19 +834,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float&) { align_type ("float", 4); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double&) { align_type ("double", 7); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal&) { align_type ("double", 7); @@ -854,43 +854,43 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String&) { align_type ("size_t", 5); // std::string } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString&) { align_type ("size_t", 5); // std::string } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token&) { align_type ("size_t", 5); // std::string } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken&) { align_type ("size_t", 5); // std::string } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name&) { align_type ("size_t", 5); // std::string } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName&) { align_type ("size_t", 5); // std::string } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language&) { align_type ("size_t", 5); // std::string @@ -898,7 +898,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName&) { align_type ("size_t", 5); // std::string @@ -906,13 +906,13 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id&) { align_type ("size_t", 5); // std::string } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef&) { align_type ("size_t", 5); // std::string @@ -920,7 +920,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI&) { align_type ("size_t", 5); // std::string @@ -928,55 +928,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date&) { align_type ("int", 4); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime&) { align_type ("double", 7); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration&) { align_type ("double", 7); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day&) { align_type ("short", 2); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month&) { align_type ("short", 2); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay&) { align_type ("short", 2); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year&) { align_type ("int", 4); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth&) { align_type ("int", 4); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time&) { align_type ("double", 7); @@ -984,15 +984,15 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity&) { align_type ("size_t", 5); // std::string } private: - Void - align_type (Char const* type, unsigned short rank) + void + align_type (char const* type, unsigned short rank) { if (rank > rank_) { @@ -1010,7 +1010,7 @@ namespace CXX struct Attribute: Traversal::Attribute { - virtual Void + virtual void traverse (Type& a) { if (!a.fixed_p ()) @@ -1035,7 +1035,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (!a.fixed_p ()) @@ -1062,7 +1062,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () != 1) @@ -1092,7 +1092,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () != 1) @@ -1147,7 +1147,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -1178,7 +1178,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.max () != 1) @@ -1216,7 +1216,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // For choice in choice we always have a nested class. @@ -1263,7 +1263,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1) @@ -1293,7 +1293,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // For sequence in choice we always have a nested class. @@ -1347,18 +1347,18 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { os << "// " << comment (a.name ()) << endl << "//" << endl; - Boolean def (a.default_p ()); - Boolean fix (a.fixed_p ()); + bool def (a.default_p ()); + bool fix (a.fixed_p ()); String const& name (ename (a)); SemanticGraph::Type& t (a.type ()); - Boolean fl (fixed_length (t)); + bool fl (fixed_length (t)); if (a.optional_p () && !fix) @@ -1447,7 +1447,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { os << "// " << comment (e.name ()) << endl @@ -1455,7 +1455,7 @@ namespace CXX String const& name (ename (e)); SemanticGraph::Type& t (e.type ()); - Boolean fl (fixed_length (t)); + bool fl (fixed_length (t)); if (e.max () != 1) { @@ -1558,7 +1558,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -1566,8 +1566,8 @@ namespace CXX // if (a.min () == 0) { - Boolean fl (fixed_length (a)); - Boolean cd (a.context ().count ("cd-name")); + bool fl (fixed_length (a)); + bool cd (a.context ().count ("cd-name")); String const& name (ename (a)); String const& type (etype (a)); @@ -1733,31 +1733,31 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { emit_tag (etag (e)); } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { emit_tag (etag (a)); } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { emit_tag (etag (c)); } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { emit_tag (etag (s)); } - virtual Void + virtual void emit_tag (String const& tag) { if (first_) @@ -1769,7 +1769,7 @@ namespace CXX } private: - Boolean first_; + bool first_; }; struct ChoiceInSequence: Traversal::Choice, Context @@ -1780,14 +1780,14 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { - UnsignedLong min (c.min ()), max (c.max ()); + size_t min (c.min ()), max (c.max ()); String const& name (ename (c)); - Boolean fl; + bool fl; String type; if (max != 1 || min == 0) @@ -1871,7 +1871,7 @@ namespace CXX if (max != 1 || min == 0) { - Boolean cd (c.context ().count ("cd-name")); + bool cd (c.context ().count ("cd-name")); // Custom data. // @@ -2029,16 +2029,16 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // When shoice is in choice we generate nested class even // for min == max == 1. // - UnsignedLong min (c.min ()), max (c.max ()); + size_t min (c.min ()), max (c.max ()); - Boolean fl (fixed_length (c)); - Boolean cd (c.context ().count ("cd-name")); + bool fl (fixed_length (c)); + bool cd (c.context ().count ("cd-name")); String const& name (ename (c)); String const& type (etype (c)); @@ -2268,10 +2268,10 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { - UnsignedLong min (s.min ()), max (s.max ()); + size_t min (s.min ()), max (s.max ()); if (max == 1 && min == 1) { @@ -2279,8 +2279,8 @@ namespace CXX return; } - Boolean fl (fixed_length (s)); - Boolean cd (s.context ().count ("cd-name")); + bool fl (fixed_length (s)); + bool cd (s.context ().count ("cd-name")); String const& name (ename (s)); String const& type (etype (s)); @@ -2474,14 +2474,14 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we generate nested class even // for min == max == 1. // - Boolean fl (fixed_length (s)); - Boolean cd (s.context ().count ("cd-name")); + bool fl (fixed_length (s)); + bool cd (s.context ().count ("cd-name")); String const& name (ename (s)); String const& type (etype (s)); @@ -2740,7 +2740,7 @@ namespace CXX contains_compositor_ >> sequence_in_sequence_; } - virtual Void + virtual void traverse (Type& c) { SemanticGraph::Context& cc (c.context ()); @@ -2751,10 +2751,10 @@ namespace CXX // if (name) { - Boolean fl (fixed_length (c)); - Boolean poly (polymorphic (c)); - Boolean restriction (restriction_p (c)); - Boolean cd (cc.count ("cd-name")); + bool fl (fixed_length (c)); + bool poly (polymorphic (c)); + bool restriction (restriction_p (c)); + bool cd (cc.count ("cd-name")); os << "// " << comment (c.name ()) << " (" << (fl ? "fixed-length" : "variable-length") << ")" << endl @@ -2943,10 +2943,10 @@ namespace CXX }; } - Void + void generate_tree_header (Context& ctx) { - Boolean inline_ (ctx.options.generate_inline ()); + bool inline_ (ctx.options.generate_inline ()); // Emit header includes. // diff --git a/xsde/cxx/hybrid/tree-header.hxx b/xsde/cxx/hybrid/tree-header.hxx index 0259349..2ca8914 100644 --- a/xsde/cxx/hybrid/tree-header.hxx +++ b/xsde/cxx/hybrid/tree-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_tree_header (Context&); } } diff --git a/xsde/cxx/hybrid/tree-inline.cxx b/xsde/cxx/hybrid/tree-inline.cxx index 2f6815e..2d845f4 100644 --- a/xsde/cxx/hybrid/tree-inline.cxx +++ b/xsde/cxx/hybrid/tree-inline.cxx @@ -24,7 +24,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -131,7 +131,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename_custom (l)); @@ -195,7 +195,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename_custom (u)); @@ -361,11 +361,11 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { - Boolean def (a.default_p ()); - Boolean fix (a.fixed_p ()); + bool def (a.default_p ()); + bool fix (a.fixed_p ()); String const& name (ename (a)); String member; @@ -374,7 +374,7 @@ namespace CXX member = emember (a); SemanticGraph::Type& t (a.type ()); - Boolean fl (fixed_length (t)); + bool fl (fixed_length (t)); String scope (Context::scope (a)); if (a.optional_p () && !fix) @@ -566,14 +566,14 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& name (ename (e)); String const& member (emember (e)); SemanticGraph::Type& t (e.type ()); - Boolean fl (fixed_length (t)); + bool fl (fixed_length (t)); String scope (Context::scope (e)); if (e.max () != 1) @@ -720,7 +720,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& name (ename (e)); @@ -764,10 +764,10 @@ namespace CXX } else { - UnsignedLong min (e.min ()); + size_t min (e.min ()); SemanticGraph::Type& t (e.type ()); - Boolean fl (fixed_length (t)); + bool fl (fixed_length (t)); String const& tag (etag (e)); String const& arm_member (earm_member (c)); @@ -936,7 +936,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -949,7 +949,7 @@ namespace CXX String const& present (epresent (a)); String const& member (emember (a)); - Boolean fl (fixed_length (a)); + bool fl (fixed_length (a)); String scope (Context::scope (a)); @@ -1077,10 +1077,10 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { - UnsignedLong min (c.min ()), max (c.max ()); + size_t min (c.min ()), max (c.max ()); if (max == 1 && min == 1) { @@ -1131,7 +1131,7 @@ namespace CXX } else if (min == 0) { - Boolean fl (fixed_length (c)); + bool fl (fixed_length (c)); String const& type (etype (c)); String const& present (epresent (c)); @@ -1258,10 +1258,10 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { - UnsignedLong min (s.min ()), max (s.max ()); + size_t min (s.min ()), max (s.max ()); if (max == 1 && min == 1) { @@ -1300,7 +1300,7 @@ namespace CXX } else if (min == 0) { - Boolean fl (fixed_length (s)); + bool fl (fixed_length (s)); String const& type (etype (s)); String const& present (epresent (s)); @@ -1427,7 +1427,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { // When compositor is in choice we generate nested class even @@ -1474,9 +1474,9 @@ namespace CXX } else { - UnsignedLong min (c.min ()); + size_t min (c.min ()); - Boolean fl (fixed_length (c)); + bool fl (fixed_length (c)); String const& type (etype (c)); String const& tag (etag (c)); @@ -1632,7 +1632,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { CompositorInChoiceFunc::traverse (c); @@ -1646,7 +1646,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { CompositorInChoiceFunc::traverse (s); @@ -1664,7 +1664,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -1717,7 +1717,7 @@ namespace CXX struct Choice: Traversal::Choice, Context { Choice (Context& c, - Boolean in_choice, + bool in_choice, Traversal::ContainsParticle& contains_func) : Context (c), in_choice_ (in_choice), @@ -1725,7 +1725,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // When choice is in choice we generate nested class even @@ -1785,7 +1785,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; Traversal::ContainsParticle& contains_func_; }; @@ -1798,7 +1798,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1 || s.min () == 0) @@ -1855,7 +1855,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we generate nested class even @@ -1969,7 +1969,7 @@ namespace CXX contains_compositor_ >> sequence_in_sequence_; } - virtual Void + virtual void traverse (Type& c) { String const& scope (ename_custom (c)); @@ -2062,7 +2062,7 @@ namespace CXX }; } - Void + void generate_tree_inline (Context& ctx) { // Generate includes. diff --git a/xsde/cxx/hybrid/tree-inline.hxx b/xsde/cxx/hybrid/tree-inline.hxx index 56f466c..214bfc7 100644 --- a/xsde/cxx/hybrid/tree-inline.hxx +++ b/xsde/cxx/hybrid/tree-inline.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_tree_inline (Context&); } } diff --git a/xsde/cxx/hybrid/tree-name-processor.cxx b/xsde/cxx/hybrid/tree-name-processor.cxx index 0558907..148033e 100644 --- a/xsde/cxx/hybrid/tree-name-processor.cxx +++ b/xsde/cxx/hybrid/tree-name-processor.cxx @@ -3,6 +3,13 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include +#include +#include +#include + +#include + #include #include @@ -11,11 +18,8 @@ #include #include -#include -#include - -#include -#include +using namespace std; +using cutl::shared_ptr; namespace CXX { @@ -23,10 +27,8 @@ namespace CXX { namespace { - // - // - typedef Cult::Containers::Set NameSet; - Char const* member_set_key = "cxx-hybrid-name-processor-member-set"; + typedef set NameSet; + char const* member_set_key = "cxx-hybrid-name-processor-member-set"; class Context: public CXX::Context { @@ -62,10 +64,10 @@ namespace CXX e = name.find (L"::", b); String entry (name, b, e == String::npos ? e : e - b); - Shptr& p ((*map)[entry]); + shared_ptr& p ((*map)[entry]); if (p == 0) - p = Shptr (new CustomDataMap); + p = shared_ptr (new (shared) CustomDataMap); b = e; @@ -73,7 +75,7 @@ namespace CXX { // Last name. Add an empty string to indicate this. // - (*p)[L""] = Shptr (0); + (*p)[L""] = shared_ptr (); break; } @@ -99,7 +101,7 @@ namespace CXX // Split the string in two parts at the last '='. // - Size pos (s.rfind ('=')); + size_t pos (s.rfind ('=')); // If no delimiter found type, base, and include are empty. // @@ -173,19 +175,19 @@ namespace CXX } public: - Boolean + bool fixed_length (SemanticGraph::Type& t) { - return t.context ().get ("fixed"); + return t.context ().get ("fixed"); } - Boolean + bool fixed_length (SemanticGraph::Compositor& c) { - return c.context ().get ("fixed"); + return c.context ().get ("fixed"); } - Void + void mark_variable (SemanticGraph::Compositor& c) { SemanticGraph::Compositor* p (&c); @@ -199,7 +201,7 @@ namespace CXX p = &p->contained_particle ().compositor (); - if (!p->context ().get ("fixed")) + if (!p->context ().get ("fixed")) break; } } @@ -210,7 +212,7 @@ namespace CXX { String name (escape (n + suffix)); - for (UnsignedLong i (1); set.find (name) != set.end (); ++i) + for (size_t i (1); set.find (name) != set.end (); ++i) { std::wostringstream os; os << i; @@ -228,10 +230,7 @@ namespace CXX } public: - struct CustomDataMap: - Cult::Containers::Map > - { - }; + struct CustomDataMap: map > {}; public: struct CustomType @@ -248,25 +247,23 @@ namespace CXX String include; }; - typedef - Cult::Containers::Map - CustomTypeMap; + typedef map CustomTypeMap; private: CustomDataMap custom_data_map_; CustomTypeMap custom_type_map_; - Cult::Containers::Map global_type_names_; + map global_type_names_; public: - Boolean stl; - Boolean detach; - Boolean enum_; + bool stl; + bool detach; + bool enum_; CustomDataMap& custom_data_map; CustomTypeMap& custom_type_map; - Cult::Containers::Map& global_type_names; + map& global_type_names; }; // @@ -280,7 +277,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { a.context ().set ("name", find_name (a.name (), set_)); @@ -297,7 +294,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { e.context ().set ("name", find_name (e.name (), set_)); @@ -314,7 +311,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -332,12 +329,12 @@ namespace CXX struct PrimaryChoice: Traversal::Choice, Context { - PrimaryChoice (Context& c, NameSet& set, Boolean in_choice) + PrimaryChoice (Context& c, NameSet& set, bool in_choice) : Context (c), set_ (set), in_choice_ (in_choice) { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // In case of choice assign primary name even if there is @@ -352,17 +349,17 @@ namespace CXX private: NameSet& set_; - Boolean in_choice_; + bool in_choice_; }; struct PrimarySequence: Traversal::Sequence, Context { - PrimarySequence (Context& c, NameSet& set, Boolean in_choice) + PrimarySequence (Context& c, NameSet& set, bool in_choice) : Context (c), set_ (set), in_choice_ (in_choice) { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we have nested class even @@ -376,7 +373,7 @@ namespace CXX private: NameSet& set_; - Boolean in_choice_; + bool in_choice_; }; // @@ -385,18 +382,18 @@ namespace CXX struct SecondaryAttribute: Traversal::Attribute, Context { - SecondaryAttribute (Context& c, NameSet& set, Boolean data_members) + SecondaryAttribute (Context& c, NameSet& set, bool data_members) : Context (c), set_ (set), data_members_ (data_members) { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { SemanticGraph::Context& ac (a.context ()); - Boolean def (a.default_p ()); - Boolean fix (a.fixed_p ()); + bool def (a.default_p ()); + bool fix (a.fixed_p ()); String const& base (ac.get ("name")); @@ -438,17 +435,17 @@ namespace CXX private: NameSet& set_; - Boolean data_members_; + bool data_members_; }; struct SecondaryElement: Traversal::Element, Context { - SecondaryElement (Context& c, NameSet& set, Boolean data_members) + SecondaryElement (Context& c, NameSet& set, bool data_members) : Context (c), set_ (set), data_members_ (data_members) { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { SemanticGraph::Context& ec (e.context ()); @@ -495,7 +492,7 @@ namespace CXX private: NameSet& set_; - Boolean data_members_; + bool data_members_; }; struct SecondaryAll: Traversal::All, Context @@ -503,7 +500,7 @@ namespace CXX SecondaryAll (Context& c, NameSet& set, CustomDataMap* map, - Boolean data_members) + bool data_members) : Context (c), set_ (set), map_ (map), @@ -511,7 +508,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -530,7 +527,7 @@ namespace CXX if (map_) { - CustomDataMap::Iterator i (map_->find (base)); + CustomDataMap::iterator i (map_->find (base)); if (i != map_->end ()) map = i->second.get (); } @@ -621,7 +618,7 @@ namespace CXX private: NameSet& set_; CustomDataMap* map_; - Boolean data_members_; + bool data_members_; }; struct ParticleTag: Traversal::Element, @@ -635,27 +632,27 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& base (e.context ().get ("name")); e.context ().set ("tag", find_name (base, L"_tag", set_)); } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { a.context ().set ("tag", find_name (L"any", L"_tag", set_)); } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { String const& base (c.context ().get ("name")); c.context ().set ("tag", find_name (base, L"_tag", set_)); } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { String const& base (s.context ().get ("name")); @@ -671,8 +668,8 @@ namespace CXX SecondaryChoice (Context& c, NameSet& set, CustomDataMap* map, - Boolean in_choice, - Boolean data_members) + bool in_choice, + bool data_members) : Context (c), set_ (set), map_ (map), @@ -681,17 +678,17 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice&); - Void + void traverse_nested (SemanticGraph::Choice&, NameSet&, CustomDataMap*); private: NameSet& set_; CustomDataMap* map_; - Boolean in_choice_; - Boolean data_members_; + bool in_choice_; + bool data_members_; }; struct SecondarySequence: Traversal::Sequence, Context @@ -699,8 +696,8 @@ namespace CXX SecondarySequence (Context& c, NameSet& set, CustomDataMap* map, - Boolean in_choice, - Boolean data_members) + bool in_choice, + bool data_members) : Context (c), set_ (set), map_ (map), @@ -709,21 +706,21 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence&); - Void + void traverse_nested (SemanticGraph::Sequence&, NameSet&, CustomDataMap*); private: NameSet& set_; CustomDataMap* map_; - Boolean in_choice_; - Boolean data_members_; + bool in_choice_; + bool data_members_; }; - Void SecondaryChoice:: + void SecondaryChoice:: traverse (SemanticGraph::Choice& c) { SemanticGraph::Context& cc (c.context ()); @@ -743,7 +740,7 @@ namespace CXX if (map_) { - CustomDataMap::Iterator i (map_->find (base)); + CustomDataMap::iterator i (map_->find (base)); if (i != map_->end ()) map = i->second.get (); } @@ -774,7 +771,7 @@ namespace CXX cc.set ("arm-tag", find_name (arm + L"_tag", name_set)); { - UnsignedLong count (name_set.size ()); + size_t count (name_set.size ()); ParticleTag particle (*this, name_set); Traversal::ContainsParticle contains (particle); @@ -869,7 +866,7 @@ namespace CXX cc.set ("arm-tag", find_name (arm + L"_tag", set_)); { - UnsignedLong count (set_.size ()); + size_t count (set_.size ()); ParticleTag particle (*this, set_); Traversal::ContainsParticle contains (particle); @@ -889,7 +886,7 @@ namespace CXX } } - Void SecondaryChoice:: + void SecondaryChoice:: traverse_nested (SemanticGraph::Choice& c, NameSet& name_set, CustomDataMap* map) @@ -948,7 +945,7 @@ namespace CXX Choice::contains (c, choice_contains_particle); } - Void SecondarySequence:: + void SecondarySequence:: traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we have nested class even @@ -968,7 +965,7 @@ namespace CXX if (map_) { - CustomDataMap::Iterator i (map_->find (base)); + CustomDataMap::iterator i (map_->find (base)); if (i != map_->end ()) map = i->second.get (); } @@ -1062,7 +1059,7 @@ namespace CXX Sequence::contains (s); } - Void SecondarySequence:: + void SecondarySequence:: traverse_nested (SemanticGraph::Sequence& s, NameSet& name_set, CustomDataMap* map) @@ -1130,7 +1127,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String const& n (e.name ()); @@ -1149,12 +1146,12 @@ namespace CXX Traversal::Enumeration, Context { - GlobalTypeMembers (Context& c, Boolean data_members) + GlobalTypeMembers (Context& c, bool data_members) : Context (c), data_members_ (data_members) { } - virtual Void + virtual void traverse (SemanticGraph::Enumeration& e) { // First see if we should delegate this one to Complex. @@ -1201,7 +1198,7 @@ namespace CXX // Check if this type has custom data. // - CustomDataMap::Iterator i (custom_data_map.find (e.name ())); + CustomDataMap::iterator i (custom_data_map.find (e.name ())); if (i != custom_data_map.end () && i->second->find (L"") != i->second->end ()) @@ -1232,7 +1229,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::List& l) { SemanticGraph::Context& lc (l.context ()); @@ -1250,7 +1247,7 @@ namespace CXX { // Check if this type has custom data. // - CustomDataMap::Iterator i (custom_data_map.find (l.name ())); + CustomDataMap::iterator i (custom_data_map.find (l.name ())); if (i != custom_data_map.end () && i->second->find (L"") != i->second->end ()) @@ -1283,7 +1280,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Union& u) { SemanticGraph::Context& uc (u.context ()); @@ -1311,7 +1308,7 @@ namespace CXX // Check if this type has custom data. // - CustomDataMap::Iterator i (custom_data_map.find (u.name ())); + CustomDataMap::iterator i (custom_data_map.find (u.name ())); if (i != custom_data_map.end () && i->second->find (L"") != i->second->end ()) @@ -1340,7 +1337,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (data_members_) @@ -1349,7 +1346,7 @@ namespace CXX assign_names (c); } - virtual Void + virtual void assign_names (SemanticGraph::Complex& c) { SemanticGraph::Context& cc (c.context ()); @@ -1368,7 +1365,7 @@ namespace CXX // CustomDataMap* map (0); { - CustomDataMap::Iterator i (custom_data_map.find (c.name ())); + CustomDataMap::iterator i (custom_data_map.find (c.name ())); if (i != custom_data_map.end ()) map = i->second.get (); } @@ -1380,7 +1377,7 @@ namespace CXX // Add our base's members to the initial list. // - Boolean restriction (false); + bool restriction (false); if (c.inherits_p ()) { @@ -1519,7 +1516,7 @@ namespace CXX } } - virtual Void + virtual void assign_data (SemanticGraph::Complex& c) { SemanticGraph::Context& cc (c.context ()); @@ -1535,7 +1532,7 @@ namespace CXX // // - Boolean restriction (false); + bool restriction (false); if (c.inherits_p ()) restriction = c.inherits ().is_a () && @@ -1606,7 +1603,7 @@ namespace CXX } private: - Boolean data_members_; + bool data_members_; }; // @@ -1621,7 +1618,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { String const& name (t.name ()); @@ -1631,7 +1628,7 @@ namespace CXX // See if this parser is being customized. // - CustomTypeMap::ConstIterator i (custom_type_map.find (name)); + CustomTypeMap::const_iterator i (custom_type_map.find (name)); if (i != custom_type_map.end ()) { @@ -1650,7 +1647,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Union& u) { traverse (static_cast (u)); @@ -1674,7 +1671,7 @@ namespace CXX uc.set ("value", find_name ("value", set)); } - virtual Void + virtual void traverse (SemanticGraph::Enumeration& e) { traverse (static_cast (e)); @@ -1720,7 +1717,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& ns) { SemanticGraph::Context& nsc (ns.context ()); @@ -1816,13 +1813,13 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { set_name (t, "any_type"); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { set_name (t, "any_simple_type"); @@ -1830,7 +1827,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { set_name (t, "boolean"); @@ -1838,79 +1835,79 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { set_name (t, "byte"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { set_name (t, "unsigned_byte"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { set_name (t, "short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { set_name (t, "unsigned_short"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { set_name (t, "int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { set_name (t, "unsigned_int"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { set_name (t, "long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { set_name (t, "unsigned_long"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { set_name (t, "integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { set_name (t, "non_positive_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { set_name (t, "non_negative_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { set_name (t, "positive_integer"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { set_name (t, "negative_integer"); @@ -1918,19 +1915,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { set_name (t, "float"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { set_name (t, "double"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { set_name (t, "decimal"); @@ -1938,49 +1935,49 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { set_name (t, "string"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { set_name (t, "normalized_string"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { set_name (t, "token"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { set_name (t, "nmtoken"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { set_name (t, "nmtokens"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { set_name (t, "name"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { set_name (t, "ncname"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { set_name (t, "language"); @@ -1989,7 +1986,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { set_name (t, "qname"); @@ -1998,19 +1995,19 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { set_name (t, "id"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { set_name (t, "idref"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { set_name (t, "idrefs"); @@ -2018,7 +2015,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { set_name (t, "uri"); @@ -2026,13 +2023,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { set_name (t, "base64_binary"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { set_name (t, "hex_binary"); @@ -2041,55 +2038,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { set_name (t, "date"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { set_name (t, "date_time"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { set_name (t, "duration"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { set_name (t, "gday"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { set_name (t, "gmonth"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { set_name (t, "gmonth_day"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { set_name (t, "gyear"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { set_name (t, "gyear_month"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { set_name (t, "time"); @@ -2097,20 +2094,20 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { set_name (t, "entity"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { set_name (t, "entities"); } private: - Void + void set_name (SemanticGraph::Type& t, String const& name) { SemanticGraph::Context& c (t.context ()); @@ -2125,7 +2122,7 @@ namespace CXX Traversal::Includes, Traversal::Imports { - virtual Void + virtual void traverse (SemanticGraph::Sources& sr) { SemanticGraph::Schema& s (sr.schema ()); @@ -2137,7 +2134,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { SemanticGraph::Schema& s (i.schema ()); @@ -2149,7 +2146,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { SemanticGraph::Schema& s (i.schema ()); @@ -2167,7 +2164,7 @@ namespace CXX // struct Implies: Traversal::Implies { - virtual Void + virtual void traverse (SemanticGraph::Implies& i) { SemanticGraph::Schema& s (i.schema ()); @@ -2180,11 +2177,11 @@ namespace CXX } }; - Void + void process_impl (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, - Boolean deep) + bool deep) { Context ctx (ops, tu, file); @@ -2294,11 +2291,11 @@ namespace CXX } } - Void TreeNameProcessor:: + void TreeNameProcessor:: process (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, - Boolean deep) + bool deep) { process_impl (ops, tu, file, deep); } diff --git a/xsde/cxx/hybrid/tree-name-processor.hxx b/xsde/cxx/hybrid/tree-name-processor.hxx index fff1fb8..5b488fa 100644 --- a/xsde/cxx/hybrid/tree-name-processor.hxx +++ b/xsde/cxx/hybrid/tree-name-processor.hxx @@ -6,26 +6,23 @@ #ifndef CXX_HYBRID_TREE_NAME_PROCESSOR_HXX #define CXX_HYBRID_TREE_NAME_PROCESSOR_HXX -#include - #include +#include #include namespace CXX { namespace Hybrid { - using namespace Cult::Types; - class TreeNameProcessor { public: - Void + void process (options const& options, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, - Boolean deep); + bool deep); }; } } diff --git a/xsde/cxx/hybrid/tree-size-processor.cxx b/xsde/cxx/hybrid/tree-size-processor.cxx index 0d734ca..2872bf6 100644 --- a/xsde/cxx/hybrid/tree-size-processor.cxx +++ b/xsde/cxx/hybrid/tree-size-processor.cxx @@ -3,19 +3,18 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include +#include +#include +#include + #include #include #include #include -#include -#include -#include - -#include - -using std::wcerr; +using namespace std; namespace CXX { @@ -23,53 +22,52 @@ namespace CXX { namespace { - typedef Cult::Containers::Set TypeSet; - + typedef set TypeSet; struct CustomType { - Boolean fixed; + bool fixed; String base; }; - typedef Cult::Containers::Map CustomTypeMap; + typedef map CustomTypeMap; - Boolean + bool test (SemanticGraph::Type& t) { return t.context ().count ("fixed") != 0; } - Void - set (SemanticGraph::Type& t, Boolean v) + void + set (SemanticGraph::Type& t, bool v) { t.context ().set ("fixed", v); } - Void - set (SemanticGraph::Compositor& c, Boolean v) + void + set (SemanticGraph::Compositor& c, bool v) { c.context ().set ("fixed", v); } - Boolean + bool get (SemanticGraph::Type& t) { - return t.context ().get ("fixed"); + return t.context ().get ("fixed"); } // // struct Particle: Traversal::Element { - Particle (Boolean& fixed, - Boolean& poly, + Particle (bool& fixed, + bool& poly, Traversal::NodeBase& type_traverser) : fixed_ (fixed), poly_ (poly), type_traverser_ (type_traverser) { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { // Check the type. We need to do it even if fixed_ is @@ -91,7 +89,7 @@ namespace CXX } /* - virtual Void + virtual void traverse (SemanticGraph::Any&) { // Types with wildcards are always variable length. @@ -102,8 +100,8 @@ namespace CXX */ private: - Boolean& fixed_; - Boolean& poly_; + bool& fixed_; + bool& poly_; Traversal::NodeBase& type_traverser_; }; @@ -111,14 +109,14 @@ namespace CXX Traversal::Choice, Traversal::Sequence { - Compositor (Boolean& fixed, - Boolean& poly, + Compositor (bool& fixed, + bool& poly, Traversal::NodeBase& type_traverser) : fixed_ (fixed), poly_ (poly), type_traverser_ (type_traverser) { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -127,7 +125,7 @@ namespace CXX // if (a.min () == 0) { - Boolean fixed = true; + bool fixed = true; { Particle particle (fixed, poly_, type_traverser_); @@ -147,13 +145,13 @@ namespace CXX All::contains (a); } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // Here we need to assign the size for the nested class in // all three cases because this choice might be in choice. // - Boolean fixed = true; + bool fixed = true; { Particle particle (fixed, poly_, type_traverser_); @@ -172,13 +170,13 @@ namespace CXX fixed_ = false; } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // Here we need to assign the size for the nested class in // all three cases because this sequence might be in choice. // - Boolean fixed = true; + bool fixed = true; { Particle particle (fixed, poly_, type_traverser_); @@ -198,19 +196,19 @@ namespace CXX } private: - Boolean& fixed_; - Boolean& poly_; + bool& fixed_; + bool& poly_; Traversal::NodeBase& type_traverser_; }; struct Attribute: Traversal::Attribute { - Attribute (Boolean& fixed, Traversal::NodeBase& type_traverser) + Attribute (bool& fixed, Traversal::NodeBase& type_traverser) : fixed_ (fixed), type_traverser_ (type_traverser) { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { // Simple types cannot be recursive. @@ -227,7 +225,7 @@ namespace CXX } /* - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute&) { // Types with wildcards are always variable length. @@ -238,7 +236,7 @@ namespace CXX */ private: - Boolean& fixed_; + bool& fixed_; Traversal::NodeBase& type_traverser_; }; @@ -249,13 +247,13 @@ namespace CXX Traversal::Complex, Traversal::Enumeration { - Type (Boolean& valid, + Type (bool& valid, TypeSet& custom_data, CustomTypeMap& custom_type_map, TypeSet& poly_types, - Boolean stl_, - Boolean poly_, - Boolean enum_mapping) + bool stl_, + bool poly_, + bool enum_mapping) : valid_ (valid), custom_data_ (custom_data), custom_type_map_ (custom_type_map), @@ -266,19 +264,19 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (!test (l)) set (l, false); } - virtual Void + virtual void traverse (SemanticGraph::Union& u) { if (!test (u)) { - Boolean fixed (stl); + bool fixed (stl); // Check for custom data. // @@ -292,7 +290,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Enumeration& e) { if (!test (e)) @@ -313,7 +311,7 @@ namespace CXX return; } - Boolean fixed (true); + bool fixed (true); if (base_enum && !get (b)) fixed = false; @@ -330,7 +328,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { SemanticGraph::Context& ctx (c.context ()); @@ -344,7 +342,7 @@ namespace CXX // Mark all the types involved in the cycle as recursive. // - for (Path::ReverseIterator i (path_.rbegin ()); *i != &c; ++i) + for (Path::reverse_iterator i (path_.rbegin ()); *i != &c; ++i) { (*i)->context ().set ("recursive", true); } @@ -354,7 +352,7 @@ namespace CXX ctx.set ("recurse", true); path_.push_back (&c); - Boolean fixed = true; + bool fixed = true; // First check our base. // @@ -373,7 +371,7 @@ namespace CXX // if (c.contains_compositor_p ()) { - Boolean poly (false); + bool poly (false); Particle particle (fixed, poly, *this); Compositor compositor (fixed, poly, *this); @@ -424,8 +422,8 @@ namespace CXX } private: - Void - set (SemanticGraph::Type& t, Boolean v) + void + set (SemanticGraph::Type& t, bool v) { using SemanticGraph::Complex; @@ -441,7 +439,7 @@ namespace CXX { // If our base is polymorphic then we are as well. // - Boolean pb (false); + bool pb (false); if (Complex* c = dynamic_cast (&t)) { pb = c->inherits_p () && @@ -460,7 +458,7 @@ namespace CXX // Check if this is a custom type. // - CustomTypeMap::Iterator i = custom_type_map_.find (name); + CustomTypeMap::iterator i = custom_type_map_.find (name); if (i != custom_type_map_.end ()) { @@ -481,15 +479,15 @@ namespace CXX } private: - Boolean& valid_; + bool& valid_; TypeSet& custom_data_; CustomTypeMap& custom_type_map_; TypeSet& poly_types_; - Boolean stl; - Boolean poly; - Boolean enum_; + bool stl; + bool poly; + bool enum_; - typedef Containers::Vector Path; + typedef vector Path; Path path_; }; @@ -550,14 +548,14 @@ namespace CXX Traversal::Fundamental::Entities { - FundType (Boolean stl_, TypeSet& poly_types) + FundType (bool stl_, TypeSet& poly_types) : stl (stl_), poly_types_ (poly_types) { } // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { set (t, false); @@ -568,7 +566,7 @@ namespace CXX t.context ().set ("polymorphic", true); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { set (t, stl); @@ -576,7 +574,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { set (t, true); @@ -584,79 +582,79 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { set (t, true); @@ -664,19 +662,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { set (t, true); @@ -684,49 +682,49 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { set (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { set (t, stl); @@ -735,7 +733,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { set (t, stl); @@ -744,19 +742,19 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { set (t, false); @@ -764,7 +762,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { set (t, stl); @@ -772,13 +770,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { set (t, false); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { set (t, false); @@ -787,55 +785,55 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { set (t, true); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { set (t, true); @@ -843,27 +841,27 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { set (t, stl); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { set (t, false); } private: - Boolean stl; + bool stl; TypeSet& poly_types_; }; struct GlobalElement: Traversal::Element { GlobalElement (TypeSet& poly_types, - Boolean& valid, + bool& valid, const WarningSet& disabled_warnings) : poly_types_ (poly_types), valid_ (valid), warning_ (true) { @@ -872,7 +870,7 @@ namespace CXX warning_ = false; } - virtual Void + virtual void traverse (Type& e) { using SemanticGraph::Schema; @@ -945,7 +943,7 @@ namespace CXX private: // Return true if root sources s. // - Boolean + bool sources_p (SemanticGraph::Schema& root, SemanticGraph::Schema& s) { using SemanticGraph::Schema; @@ -966,8 +964,8 @@ namespace CXX private: TypeSet& poly_types_; - Boolean& valid_; - Boolean warning_; + bool& valid_; + bool warning_; }; // Go into sourced/included/imported schemas while making sure @@ -977,12 +975,12 @@ namespace CXX Traversal::Includes, Traversal::Imports { - Uses (Char const* seen_key) + Uses (char const* seen_key) : seen_key_ (seen_key) { } - virtual Void + virtual void traverse (SemanticGraph::Sources& sr) { SemanticGraph::Schema& s (sr.schema ()); @@ -994,7 +992,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { SemanticGraph::Schema& s (i.schema ()); @@ -1006,7 +1004,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { SemanticGraph::Schema& s (i.schema ()); @@ -1019,21 +1017,21 @@ namespace CXX } private: - Char const* seen_key_; + char const* seen_key_; }; - Char const* pass_one_key = "cxx-hybrid-size-processor-seen-one"; - Char const* pass_two_key = "cxx-hybrid-size-processor-seen-two"; + char const* pass_one_key = "cxx-hybrid-size-processor-seen-one"; + char const* pass_two_key = "cxx-hybrid-size-processor-seen-two"; - Boolean + bool process_impl (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const&, const WarningSet& disabled_warnings) { - Boolean valid (true); - Boolean stl (!ops.no_stl ()); - Boolean poly (ops.generate_polymorphic ()); + bool valid (true); + bool stl (!ops.no_stl ()); + bool poly (ops.generate_polymorphic ()); // Prepare a set of polymorphic types. // @@ -1127,7 +1125,7 @@ namespace CXX // Split the string in two parts at the last '='. // - Size pos (s.rfind ('=')); + size_t pos (s.rfind ('=')); if (pos == String::npos) continue; @@ -1238,7 +1236,7 @@ namespace CXX } } - Boolean TreeSizeProcessor:: + bool TreeSizeProcessor:: process (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, diff --git a/xsde/cxx/hybrid/tree-size-processor.hxx b/xsde/cxx/hybrid/tree-size-processor.hxx index 6f13401..0023904 100644 --- a/xsde/cxx/hybrid/tree-size-processor.hxx +++ b/xsde/cxx/hybrid/tree-size-processor.hxx @@ -6,24 +6,21 @@ #ifndef CXX_HYBRID_TREE_SIZE_PROCESSOR_HXX #define CXX_HYBRID_TREE_SIZE_PROCESSOR_HXX -#include - #include -#include - #include +#include + +#include namespace CXX { namespace Hybrid { - using namespace Cult::Types; - class TreeSizeProcessor { public: - Boolean + bool process (options const& options, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, diff --git a/xsde/cxx/hybrid/tree-source.cxx b/xsde/cxx/hybrid/tree-source.cxx index dac6528..d6aed3a 100644 --- a/xsde/cxx/hybrid/tree-source.cxx +++ b/xsde/cxx/hybrid/tree-source.cxx @@ -22,7 +22,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { os << strlit (e.name ()); @@ -40,7 +40,7 @@ namespace CXX names_ >> enumerator_; } - virtual Void + virtual void traverse (Type& e) { // First see if we should delegate this one to the Complex @@ -251,7 +251,7 @@ namespace CXX } } - virtual Void + virtual void comma (Type&) { os << "," << endl; @@ -273,7 +273,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename_custom (l)); @@ -284,7 +284,7 @@ namespace CXX if (!name) return; - Boolean poly (polymorphic (l)); + bool poly (polymorphic (l)); SemanticGraph::Context& lc (l.context ()); if (poly || clone) @@ -453,7 +453,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename_custom (u)); @@ -464,7 +464,7 @@ namespace CXX if (!name) return; - Boolean poly (polymorphic (u)); + bool poly (polymorphic (u)); SemanticGraph::Context& uc (u.context ()); os << "// " << comment (u.name ()) << endl @@ -647,7 +647,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (a.default_p ()) @@ -722,12 +722,12 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { SemanticGraph::Type& t (e.type ()); - Boolean fund (false); + bool fund (false); { FundamentalType test (fund); test.dispatch (t); @@ -909,7 +909,7 @@ namespace CXX << "}"; } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { String const& member (emember (c)); @@ -1044,7 +1044,7 @@ namespace CXX struct ChoiceFunc: Traversal::Choice, Context { - ChoiceFunc (Context& c, Boolean in_choice) + ChoiceFunc (Context& c, bool in_choice) : Context (c), in_choice_ (in_choice), particle_free_ (c, ChoiceParticle::free), @@ -1054,14 +1054,14 @@ namespace CXX contains_alloc_ >> particle_alloc_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (!in_choice_ && c.max () == 1 && c.min () == 1) { String const& arm_tag (earm_tag (c)); String const& arm_member (earm_member (c)); - UnsignedLong bad_tag (arm_tag_count (c)); + size_t bad_tag (arm_tag_count (c)); // void // arm (arm_tag) @@ -1097,7 +1097,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; ChoiceParticle particle_free_; Traversal::ContainsParticle contains_free_; @@ -1108,12 +1108,12 @@ namespace CXX struct SequenceFunc: Traversal::Sequence, Context { - SequenceFunc (Context& c, Boolean in_choice) + SequenceFunc (Context& c, bool in_choice) : Context (c), in_choice_ (in_choice) { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we generate nested class even @@ -1124,7 +1124,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; }; // @@ -1138,13 +1138,13 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (!a.fixed_p ()) { - Boolean def (a.default_p ()); - Boolean fl (fixed_length (a.type ())); + bool def (a.default_p ()); + bool fl (fixed_length (a.type ())); if (!fl) { @@ -1170,12 +1170,12 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () == 1) { - Boolean fl (fixed_length (e.type ())); + bool fl (fixed_length (e.type ())); if (!fl) os << "this->" << emember (e) << " = 0;"; @@ -1193,7 +1193,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -1218,7 +1218,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.max () == 1) @@ -1246,7 +1246,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () == 1) @@ -1275,7 +1275,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (!a.fixed_p ()) @@ -1299,7 +1299,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (e.max () == 1) @@ -1322,7 +1322,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -1356,7 +1356,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.max () == 1) @@ -1393,7 +1393,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () == 1) @@ -1431,7 +1431,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (!a.fixed_p ()) @@ -1458,7 +1458,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& member (emember (e)); @@ -1482,7 +1482,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { if (a.min () == 0) @@ -1507,7 +1507,7 @@ namespace CXX contains_copy_ >> particle_copy_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.min () == 0) @@ -1547,7 +1547,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.min () == 0) @@ -1575,7 +1575,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (!a.fixed_p ()) @@ -1602,7 +1602,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& member (emember (e)); @@ -1626,7 +1626,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { if (a.min () == 0) @@ -1651,7 +1651,7 @@ namespace CXX contains_assign_ >> particle_assign_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.min () == 0) @@ -1691,7 +1691,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.min () == 0) @@ -1719,7 +1719,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (!a.fixed_p ()) @@ -1727,7 +1727,7 @@ namespace CXX String const& name (ename (a)); SemanticGraph::Type& t (a.type ()); - Boolean opt (a.optional_p () && !a.default_p ()); + bool opt (a.optional_p () && !a.default_p ()); if (opt) os << "if (this->" << epresent (a) << " ())"; @@ -1753,7 +1753,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& name (ename (e)); @@ -1772,7 +1772,7 @@ namespace CXX { SemanticGraph::Type& t (e.type ()); - Boolean opt (e.min () == 0); + bool opt (e.min () == 0); if (opt) os << "if (this->" << epresent (e) << " ())"; @@ -1797,7 +1797,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -1840,7 +1840,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (s.max () != 1) @@ -1892,7 +1892,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { os << "case " << etag (e) << ":" @@ -1904,7 +1904,7 @@ namespace CXX << "}"; } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { // In choice there are no inline compositors. @@ -1924,7 +1924,7 @@ namespace CXX } else { - Boolean opt (c.min () == 0); + bool opt (c.min () == 0); if (opt) os << "if (this->" << epresent (c) << " ())"; @@ -1962,7 +1962,7 @@ namespace CXX contains_particle_ >> particle_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (c.max () != 1) @@ -2047,7 +2047,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1} @@ -2056,7 +2056,7 @@ namespace CXX if (a.min () != 0) return; - Boolean fl (fixed_length (a)); + bool fl (fixed_length (a)); String const& type (etype (a)); String const& scope (Context::scope (a)); @@ -2208,7 +2208,7 @@ namespace CXX struct Choice: Traversal::Choice, Context { Choice (Context& c, - Boolean in_choice, + bool in_choice, Traversal::ContainsParticle& contains_func) : Context (c), in_choice_ (in_choice), @@ -2226,7 +2226,7 @@ namespace CXX contains_clone_ >> particle_clone_; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { // When choice is in choice we generate nested class even @@ -2238,11 +2238,11 @@ namespace CXX String const& arm (earm (c)); String const& arm_tag (earm_tag (c)); String const& arm_member (earm_member (c)); - UnsignedLong bad_tag (arm_tag_count (c)); + size_t bad_tag (arm_tag_count (c)); String const& scope (Context::scope (c)); - Boolean fl (fixed_length (c)); + bool fl (fixed_length (c)); // c-tor () // @@ -2435,7 +2435,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; Traversal::ContainsParticle& contains_func_; ChoiceParticle particle_free_; @@ -2458,7 +2458,7 @@ namespace CXX struct Sequence: Traversal::Sequence, Context { Sequence (Context& c, - Boolean in_choice, + bool in_choice, Traversal::ContainsParticle& contains_ctor, Traversal::ContainsParticle& contains_dtor, Traversal::ContainsParticle& contains_copy, @@ -2476,7 +2476,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { // When sequence is in choice we generate nested class even @@ -2487,7 +2487,7 @@ namespace CXX String const& type (etype (s)); String const& scope (Context::scope (s)); - Boolean fl (fixed_length (s)); + bool fl (fixed_length (s)); // c-tor () // @@ -2632,7 +2632,7 @@ namespace CXX } private: - Boolean in_choice_; + bool in_choice_; Traversal::ContainsParticle& contains_ctor_; Traversal::ContainsParticle& contains_dtor_; Traversal::ContainsParticle& contains_copy_; @@ -2835,7 +2835,7 @@ namespace CXX contains_compositor_ >> sequence_in_sequence_; } - virtual Void + virtual void traverse (Type& c) { String const& name (ename_custom (c)); @@ -2846,9 +2846,9 @@ namespace CXX if (!name) return; - Boolean fl (fixed_length (c)); - Boolean poly (polymorphic (c)); - Boolean restriction (restriction_p (c)); + bool fl (fixed_length (c)); + bool poly (polymorphic (c)); + bool restriction (restriction_p (c)); os << "// " << comment (c.name ()) << endl << "//" << endl @@ -3221,7 +3221,7 @@ namespace CXX }; } - Void + void generate_tree_source (Context& ctx) { // Needed for placement new. diff --git a/xsde/cxx/hybrid/tree-source.hxx b/xsde/cxx/hybrid/tree-source.hxx index 0c017aa..199f4e6 100644 --- a/xsde/cxx/hybrid/tree-source.hxx +++ b/xsde/cxx/hybrid/tree-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Hybrid { - Void + void generate_tree_source (Context&); } } diff --git a/xsde/cxx/hybrid/tree-type-map.cxx b/xsde/cxx/hybrid/tree-type-map.cxx index 7825725..3304b7c 100644 --- a/xsde/cxx/hybrid/tree-type-map.cxx +++ b/xsde/cxx/hybrid/tree-type-map.cxx @@ -3,15 +3,16 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include +#include + #include #include #include #include -#include - -#include +using namespace std; namespace CXX { @@ -47,7 +48,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { String const& xn (t.name ()); @@ -55,7 +56,7 @@ namespace CXX if (parser_ != 0) { - if (t.context ().get ("fixed")) + if (t.context ().get ("fixed")) parser_->types_push_back (xn, qn); else parser_->types_push_back (xn, qn + L"*"); @@ -84,7 +85,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& ns) { String include; @@ -144,7 +145,7 @@ namespace CXX schema_set_.insert (&root); } - virtual Void + virtual void traverse (SemanticGraph::Sources& sr) { SemanticGraph::Schema& s (sr.schema ()); @@ -158,7 +159,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { SemanticGraph::Schema& s (i.schema ()); @@ -170,7 +171,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { SemanticGraph::Schema& s (i.schema ()); @@ -183,11 +184,11 @@ namespace CXX } private: - Containers::Set schema_set_; + set schema_set_; }; } - Void + void generate_tree_type_map (options const& ops, XSDFrontend::SemanticGraph::Schema& tu, XSDFrontend::SemanticGraph::Path const& path, diff --git a/xsde/cxx/hybrid/tree-type-map.hxx b/xsde/cxx/hybrid/tree-type-map.hxx index 0f677cd..186b0d4 100644 --- a/xsde/cxx/hybrid/tree-type-map.hxx +++ b/xsde/cxx/hybrid/tree-type-map.hxx @@ -6,21 +6,17 @@ #ifndef CXX_HYBRID_TREE_TYPE_MAP_HXX #define CXX_HYBRID_TREE_TYPE_MAP_HXX -#include - #include +#include #include - #include namespace CXX { namespace Hybrid { - using namespace Cult::Types; - - Void + void generate_tree_type_map (options const& options, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const&, diff --git a/xsde/cxx/hybrid/validator.cxx b/xsde/cxx/hybrid/validator.cxx index 2b13097..ef1f010 100644 --- a/xsde/cxx/hybrid/validator.cxx +++ b/xsde/cxx/hybrid/validator.cxx @@ -3,16 +3,16 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -#include +#include +#include #include #include #include +#include -#include - -using std::wcerr; +using namespace std; namespace CXX { @@ -30,7 +30,7 @@ namespace CXX SemanticGraph::Path const& path, Hybrid::options const& ops, const WarningSet& disabled_warnings, - Boolean& valid_) + bool& valid_) : Context (std::wcerr, root, path, ops, 0, 0, 0), disabled_warnings_ (disabled_warnings), disabled_warnings_all_ (false), @@ -43,8 +43,8 @@ namespace CXX } public: - Boolean - is_disabled (Char const* w) + bool + is_disabled (char const* w) { return disabled_warnings_all_ || disabled_warnings_.find (w) != disabled_warnings_.end (); @@ -79,10 +79,10 @@ namespace CXX protected: const WarningSet& disabled_warnings_; - Boolean disabled_warnings_all_; - Boolean& valid; - Boolean& subst_group_warning_issued; - Boolean subst_group_warning_issued_; + bool disabled_warnings_all_; + bool& valid; + bool& subst_group_warning_issued; + bool subst_group_warning_issued_; }; // @@ -100,7 +100,7 @@ namespace CXX *this >> schema_names_ >> ns_ >> names_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { using SemanticGraph::Schema; @@ -144,7 +144,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { if (t.named_p ()) @@ -153,7 +153,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (is_disabled ("H001")) @@ -177,7 +177,7 @@ namespace CXX // Return true if root sources s. // - Boolean + bool sources_p (SemanticGraph::Schema& root, SemanticGraph::Schema& s) { using SemanticGraph::Schema; @@ -197,7 +197,7 @@ namespace CXX } private: - Containers::Set types_; + set types_; Sources sources_; @@ -211,12 +211,12 @@ namespace CXX // struct AnonymousMember: protected ValidationContext { - AnonymousMember (ValidationContext& c, Boolean& error_issued) + AnonymousMember (ValidationContext& c, bool& error_issued) : ValidationContext (c), error_issued_ (error_issued) { } - Boolean + bool traverse_common (SemanticGraph::Member& m) { SemanticGraph::Type& t (m.type ()); @@ -258,18 +258,18 @@ namespace CXX } private: - Boolean& error_issued_; + bool& error_issued_; }; struct AnonymousElement: Traversal::Element, AnonymousMember { - AnonymousElement (ValidationContext& c, Boolean& error_issued) + AnonymousElement (ValidationContext& c, bool& error_issued) : AnonymousMember (c, error_issued) { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (traverse_common (e)) @@ -289,12 +289,12 @@ namespace CXX struct AnonymousAttribute: Traversal::Attribute, AnonymousMember { - AnonymousAttribute (ValidationContext& c, Boolean& error_issued) + AnonymousAttribute (ValidationContext& c, bool& error_issued) : AnonymousMember (c, error_issued) { } - virtual Void + virtual void traverse (Type& a) { if (traverse_common (a)) @@ -333,9 +333,9 @@ namespace CXX } private: - Boolean error_issued_; + bool error_issued_; - Containers::Set types_; + set types_; Sources sources_; @@ -354,19 +354,19 @@ namespace CXX struct GlobalElementCount: Traversal::Element { - GlobalElementCount (UnsignedLong& count) + GlobalElementCount (size_t& count) : count_ (count) { } - virtual Void + virtual void traverse (SemanticGraph::Element&) { count_++; } private: - UnsignedLong& count_; + size_t& count_; }; struct ParserValidation: Traversal::All, @@ -383,7 +383,7 @@ namespace CXX *this >> contains_particle_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // For the all compositor, maxOccurs=1 and minOccurs={0,1}. @@ -403,7 +403,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (!issued_) @@ -421,7 +421,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (!issued_) @@ -453,7 +453,7 @@ namespace CXX Traversal::Sequence::traverse (s); } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (!issued_ && !restriction_p (c)) @@ -474,20 +474,20 @@ namespace CXX } private: - Boolean issued_; + bool issued_; Traversal::ContainsCompositor contains_compositor_; Traversal::ContainsParticle contains_particle_; }; } - Boolean Validator:: + bool Validator:: validate (options const& ops, SemanticGraph::Schema& root, SemanticGraph::Path const& path, const WarningSet& disabled_warnings) { - Boolean valid (true); + bool valid (true); ValidationContext ctx (root, path, ops, disabled_warnings, valid); // @@ -502,9 +502,9 @@ namespace CXX // // - Boolean par (ops.generate_parser ()); - Boolean ser (ops.generate_serializer ()); - Boolean agg (ops.generate_aggregate ()); + bool par (ops.generate_parser ()); + bool ser (ops.generate_serializer ()); + bool agg (ops.generate_aggregate ()); if (agg && !par && !ser && !ctx.is_disabled ("H002")) { @@ -524,7 +524,7 @@ namespace CXX ops.root_element ().empty () && !ctx.is_disabled ("H003")) { - UnsignedLong count (0); + size_t count (0); { Traversal::Schema schema; diff --git a/xsde/cxx/hybrid/validator.hxx b/xsde/cxx/hybrid/validator.hxx index ba4cc80..360ebc0 100644 --- a/xsde/cxx/hybrid/validator.hxx +++ b/xsde/cxx/hybrid/validator.hxx @@ -6,24 +6,21 @@ #ifndef CXX_HYBRID_VALIDATOR_HXX #define CXX_HYBRID_VALIDATOR_HXX -#include - #include -#include - #include +#include + +#include namespace CXX { namespace Hybrid { - using namespace Cult::Types; - class Validator { public: - Boolean + bool validate (options const& options, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& tu, -- cgit v1.1