From 54110801525371740298d5cae378bfc778749935 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Jun 2012 11:50:03 +0200 Subject: Get rid of dependency on libcult --- xsd/cxx/parser/attribute-validation-source.cxx | 22 ++-- xsd/cxx/parser/attribute-validation-source.hxx | 2 +- xsd/cxx/parser/characters-validation-source.cxx | 4 +- xsd/cxx/parser/characters-validation-source.hxx | 2 +- xsd/cxx/parser/driver-source.cxx | 138 ++++++++++---------- xsd/cxx/parser/driver-source.hxx | 2 +- xsd/cxx/parser/element-validation-source.cxx | 125 ++++++++++--------- xsd/cxx/parser/element-validation-source.hxx | 2 +- xsd/cxx/parser/elements.cxx | 8 +- xsd/cxx/parser/elements.hxx | 44 +++---- xsd/cxx/parser/generator.cxx | 39 +++--- xsd/cxx/parser/generator.hxx | 15 +-- xsd/cxx/parser/impl-header.cxx | 12 +- xsd/cxx/parser/impl-header.hxx | 2 +- xsd/cxx/parser/impl-source.cxx | 14 +-- xsd/cxx/parser/impl-source.hxx | 2 +- xsd/cxx/parser/name-processor.cxx | 143 ++++++++++----------- xsd/cxx/parser/name-processor.hxx | 6 +- xsd/cxx/parser/options.cli | 18 ++- xsd/cxx/parser/parser-forward.cxx | 10 +- xsd/cxx/parser/parser-forward.hxx | 2 +- xsd/cxx/parser/parser-header.cxx | 159 ++++++++++++------------ xsd/cxx/parser/parser-header.hxx | 4 +- xsd/cxx/parser/parser-inline.cxx | 39 +++--- xsd/cxx/parser/parser-inline.hxx | 2 +- xsd/cxx/parser/parser-source.cxx | 42 +++---- xsd/cxx/parser/parser-source.hxx | 2 +- xsd/cxx/parser/print-impl-common.hxx | 84 ++++++------- xsd/cxx/parser/state-processor.cxx | 63 +++++----- xsd/cxx/parser/state-processor.hxx | 7 +- xsd/cxx/parser/type-processor.cxx | 40 +++--- xsd/cxx/parser/type-processor.hxx | 10 +- xsd/cxx/parser/validator.cxx | 75 +++++------ xsd/cxx/parser/validator.hxx | 11 +- 34 files changed, 572 insertions(+), 578 deletions(-) (limited to 'xsd/cxx/parser') diff --git a/xsd/cxx/parser/attribute-validation-source.cxx b/xsd/cxx/parser/attribute-validation-source.cxx index 2f07125..4aadb62 100644 --- a/xsd/cxx/parser/attribute-validation-source.cxx +++ b/xsd/cxx/parser/attribute-validation-source.cxx @@ -23,7 +23,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { String const& name (a.name ()); @@ -39,7 +39,7 @@ namespace CXX os << "n == " << strlit (name) << " && ns.empty ()"; } - virtual Void + virtual void traverse (SemanticGraph::AnyAttribute& a) { String const& ns (a.definition_namespace ().name ()); @@ -93,7 +93,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& name (ename (a)); @@ -149,7 +149,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { os << "if ("; @@ -177,7 +177,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { if (!a.optional_p ()) @@ -195,7 +195,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { if (!a.optional_p ()) @@ -227,16 +227,16 @@ namespace CXX names_attribute_state_check_ >> attribute_state_check_; } - virtual Void + virtual void traverse (Type& c) { - Boolean has_att (has (c)); - Boolean has_any (has (c)); + bool has_att (has (c)); + bool has_any (has (c)); if (!has_att && !has_any) return; - Boolean has_req_att (false); + bool has_req_att (false); if (has_att) { RequiredAttributeTest test (has_req_att); @@ -380,7 +380,7 @@ namespace CXX }; } - Void + void generate_attribute_validation_source (Context& ctx) { Traversal::Schema schema; diff --git a/xsd/cxx/parser/attribute-validation-source.hxx b/xsd/cxx/parser/attribute-validation-source.hxx index dd76ba6..72010b6 100644 --- a/xsd/cxx/parser/attribute-validation-source.hxx +++ b/xsd/cxx/parser/attribute-validation-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_attribute_validation_source (Context&); } } diff --git a/xsd/cxx/parser/characters-validation-source.cxx b/xsd/cxx/parser/characters-validation-source.cxx index 69803e5..900bc0d 100644 --- a/xsd/cxx/parser/characters-validation-source.cxx +++ b/xsd/cxx/parser/characters-validation-source.cxx @@ -23,7 +23,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { if (!c.mixed_p ()) @@ -46,7 +46,7 @@ namespace CXX }; } - Void + void generate_characters_validation_source (Context& ctx) { //@@ Most of the time there is no mixed content type so diff --git a/xsd/cxx/parser/characters-validation-source.hxx b/xsd/cxx/parser/characters-validation-source.hxx index 445f168..46135cd 100644 --- a/xsd/cxx/parser/characters-validation-source.hxx +++ b/xsd/cxx/parser/characters-validation-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_characters_validation_source (Context&); } } diff --git a/xsd/cxx/parser/driver-source.cxx b/xsd/cxx/parser/driver-source.cxx index 4d0294e..6a69442 100644 --- a/xsd/cxx/parser/driver-source.cxx +++ b/xsd/cxx/parser/driver-source.cxx @@ -3,16 +3,17 @@ // 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 -#include - -#include +using namespace std; namespace CXX { @@ -20,11 +21,8 @@ namespace CXX { namespace { - typedef - Cult::Containers::Map - TypeInstanceMap; - - typedef Cult::Containers::Set InstanceSet; + typedef map TypeInstanceMap; + typedef set InstanceSet; // For base types we only want member's types, but not the // base itself. @@ -38,7 +36,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c); @@ -47,7 +45,7 @@ namespace CXX names (c); } - virtual Void + virtual void traverse (SemanticGraph::List& l) { def_.dispatch (l.argumented ().type ()); @@ -130,7 +128,7 @@ namespace CXX names_ >> member_ >> belongs_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { if (map_.find (&t) == map_.end ()) @@ -142,7 +140,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (map_.find (&l) == map_.end ()) @@ -156,7 +154,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (map_.find (&c) == map_.end ()) @@ -175,13 +173,13 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { fund_type (t, "any_type"); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { fund_type (t, "any_simple_type"); @@ -189,7 +187,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { fund_type (t, "boolean"); @@ -197,79 +195,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"); @@ -277,19 +275,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"); @@ -297,49 +295,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"); @@ -348,7 +346,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { fund_type (t, "qname"); @@ -357,19 +355,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"); @@ -377,7 +375,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { fund_type (t, "uri"); @@ -385,13 +383,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"); @@ -400,55 +398,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"); @@ -456,20 +454,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 Void + virtual void fund_type (SemanticGraph::Type& t, String const& name) { if (map_.find (&t) == map_.end ()) @@ -487,7 +485,7 @@ namespace CXX String base_name (escape (raw_name + L"_p")); String name (base_name); - 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; @@ -527,7 +525,7 @@ namespace CXX names_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -536,7 +534,7 @@ namespace CXX names (c, names_); } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (!first_) @@ -547,7 +545,7 @@ namespace CXX os << map_[&l.argumented ().type ()]; } - virtual Void + virtual void traverse (SemanticGraph::Member& m) { if (skip (m)) @@ -567,7 +565,7 @@ namespace CXX Traversal::Inherits inherits_; Traversal::Names names_; - Boolean first_; + bool first_; }; struct ParserConnect: Traversal::List, @@ -585,7 +583,7 @@ namespace CXX names_ >> member_ >> belongs_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (type_set_.find (&l) == type_set_.end ()) @@ -598,7 +596,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (type_set_.find (&c) == type_set_.end ()) @@ -624,7 +622,7 @@ namespace CXX } private: - Boolean + bool has_members (SemanticGraph::Complex& c) { using SemanticGraph::Complex; @@ -647,7 +645,7 @@ namespace CXX private: TypeInstanceMap& map_; - Cult::Containers::Set type_set_; + set type_set_; BaseType base_; Traversal::Inherits inherits_; @@ -658,7 +656,7 @@ namespace CXX }; } - Void + void generate_driver_source (Context& ctx) { // Figure out the root element. Validator should have made sure diff --git a/xsd/cxx/parser/driver-source.hxx b/xsd/cxx/parser/driver-source.hxx index b346720..956f733 100644 --- a/xsd/cxx/parser/driver-source.hxx +++ b/xsd/cxx/parser/driver-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_driver_source (Context&); } } diff --git a/xsd/cxx/parser/element-validation-source.cxx b/xsd/cxx/parser/element-validation-source.cxx index 4f55ad1..3acba34 100644 --- a/xsd/cxx/parser/element-validation-source.cxx +++ b/xsd/cxx/parser/element-validation-source.cxx @@ -3,12 +3,14 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include + #include #include #include -#include +using namespace std; namespace CXX { @@ -16,8 +18,7 @@ namespace CXX { namespace { - typedef Cult::Containers::Vector Particles; - + typedef vector Particles; // // @@ -31,7 +32,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String const& name (e.name ()); @@ -62,7 +63,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& ns (a.definition_namespace ().name ()); @@ -109,7 +110,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { // This compositor should already have been tested for @@ -117,9 +118,9 @@ namespace CXX // Particles const& p (c.context ().get ("prefixes")); - Boolean paren (p.size () != 1); + bool paren (p.size () != 1); - for (Particles::ConstIterator i (p.begin ()), e (p.end ()); + for (Particles::const_iterator i (p.begin ()), e (p.end ()); i != e;) { if (paren) @@ -150,21 +151,21 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { String ns (e.qualified_p () ? e.namespace_ ().name () : String ()); os << strlit (ns) << ", " << strlit (e.name ()); } - virtual Void + virtual void traverse (SemanticGraph::Any& a) { String const& ns (*a.namespace_begin ()); os << strlit (ns) << ", " << L << "\"*\""; } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { Particles const& p (c.context ().get ("prefixes")); @@ -187,7 +188,7 @@ namespace CXX // Generate sub-parser setup code as well as the pre/post calls. // - Void + void pre_post_calls (SemanticGraph::Particle& p) { using SemanticGraph::Element; @@ -197,7 +198,7 @@ namespace CXX { SemanticGraph::Type& type (e->type ()); String const& fq_type (fq_name (type)); - Boolean poly (polymorphic && !anonymous (type)); + bool poly (polymorphic && !anonymous (type)); String name, inst, def_parser, map; @@ -342,10 +343,10 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { - UnsignedLong state (e.context ().get ("state")); + size_t state (e.context ().get ("state")); if (state != 0) os << "else "; @@ -393,14 +394,14 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Particle& p) { using SemanticGraph::Element; - UnsignedLong state (p.context ().get ("state")); + size_t state (p.context ().get ("state")); - UnsignedLong min (p.min ()), max (p.max ()); + size_t min (p.min ()), max (p.max ()); os << "case " << state << "UL:" << endl << "{"; @@ -476,15 +477,15 @@ namespace CXX << "}"; // case } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { using SemanticGraph::Compositor; - UnsignedLong max (c.max ()); - UnsignedLong min (c.context ().get ("effective-min")); - UnsignedLong n (c.context ().get ("comp-number")); - UnsignedLong state (c.context ().get ("state")); + size_t max (c.max ()); + size_t min (c.context ().get ("effective-min")); + size_t n (c.context ().get ("comp-number")); + size_t state (c.context ().get ("state")); String func (c.is_a () ? "choice_" : "sequence_"); @@ -494,7 +495,7 @@ namespace CXX << "unsigned long s (~0UL);" << endl; - Boolean first (true); + bool first (true); for (Compositor::ContainsIterator ci (c.contains_begin ()); ci != c.contains_end (); ++ci) @@ -507,7 +508,7 @@ namespace CXX if (!p.context ().count ("prefix")) break; - UnsignedLong state (p.context ().get ("state")); + size_t state (p.context ().get ("state")); if (first) first = false; @@ -610,8 +611,8 @@ namespace CXX ParticleInCompositor { ParticleInSequence (Context& c, - UnsignedLong state, - UnsignedLong next_state, + size_t state, + size_t next_state, SemanticGraph::Complex& type) : ParticleInCompositor (c, type), state_ (state), particle_name_ (c) @@ -628,10 +629,10 @@ namespace CXX next_state_ = L"~0"; } - virtual Void + virtual void traverse (SemanticGraph::Particle& p) { - UnsignedLong min (p.min ()), max (p.max ()); + size_t min (p.min ()), max (p.max ()); os << "case " << state_ << "UL:" << endl << "{" @@ -705,14 +706,14 @@ namespace CXX << "}"; // case } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) { using SemanticGraph::Compositor; - UnsignedLong max (c.max ()); - UnsignedLong min (c.context ().get ("effective-min")); - UnsignedLong n (c.context ().get ("comp-number")); + size_t max (c.max ()); + size_t min (c.context ().get ("effective-min")); + size_t n (c.context ().get ("comp-number")); String func (c.is_a () ? "choice_" : "sequence_"); @@ -722,7 +723,7 @@ namespace CXX << "unsigned long s (~0UL);" << endl; - Boolean first (true); + bool first (true); for (Compositor::ContainsIterator ci (c.contains_begin ()); ci != c.contains_end (); ++ci) @@ -735,7 +736,7 @@ namespace CXX if (!p.context ().count ("prefix")) break; - UnsignedLong state (p.context ().get ("state")); + size_t state (p.context ().get ("state")); if (first) first = false; @@ -827,7 +828,7 @@ namespace CXX } private: - UnsignedLong state_; + size_t state_; String next_state_; ParticleName particle_name_; @@ -848,7 +849,7 @@ namespace CXX } - virtual Void + virtual void traverse (SemanticGraph::All& a) { if (!a.context().count ("comp-number")) // Empty compositor. @@ -889,7 +890,7 @@ namespace CXX Element& e (dynamic_cast (ci->particle ())); String ns (e.qualified_p () ? e.namespace_ ().name () : String ()); - UnsignedLong state (e.context ().get ("state")); + size_t state (e.context ().get ("state")); os << "if (count[" << state << "UL] == 0)" << endl << "this->_expected_element (" << endl @@ -905,7 +906,7 @@ namespace CXX << "}"; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (!c.context().count ("comp-number")) // Empty compositor. @@ -913,7 +914,7 @@ namespace CXX using SemanticGraph::Compositor; - UnsignedLong n (c.context ().get ("comp-number")); + size_t n (c.context ().get ("comp-number")); os << "void " << ename (type_) << "::" << endl << "choice_" << n << " (unsigned long& state," << endl @@ -951,7 +952,7 @@ namespace CXX Traversal::Choice::traverse (c); } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (!s.context().count ("comp-number")) // Empty compositor. @@ -959,7 +960,7 @@ namespace CXX using SemanticGraph::Compositor; - UnsignedLong n (s.context ().get ("comp-number")); + size_t n (s.context ().get ("comp-number")); os << "void " << ename (type_) << "::" << endl << "sequence_" << n << " (unsigned long& state," << endl @@ -974,7 +975,7 @@ namespace CXX << "switch (state)" << "{"; - UnsignedLong state (0); + size_t state (0); for (Compositor::ContainsIterator ci (s.contains_begin ()), ce (s.contains_end ()); ci != ce;) @@ -997,7 +998,7 @@ namespace CXX ci->particle ().is_a () && !ci->particle ().context().count ("comp-number")); - UnsignedLong next (ci == ce ? 0 : state + 1); + size_t next (ci == ce ? 0 : state + 1); ParticleInSequence t (*this, state++, next, type_); t.dispatch (p); @@ -1030,7 +1031,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { // Clear the counts and push the initial state. @@ -1042,7 +1043,7 @@ namespace CXX traverse (c); } - virtual Void + virtual void traverse (SemanticGraph::Compositor&) // Choice and sequence. { os << "v_state_& vs = *static_cast< v_state_* > (" << @@ -1071,7 +1072,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All&) { // The 'all' state machine reaches the final state only @@ -1089,14 +1090,14 @@ namespace CXX << endl; } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) // Choice and sequence. { using SemanticGraph::Compositor; - UnsignedLong max (c.max ()); - UnsignedLong min (c.context ().get ("effective-min")); - UnsignedLong n (c.context ().get ("comp-number")); + size_t max (c.max ()); + size_t min (c.context ().get ("effective-min")); + size_t n (c.context ().get ("comp-number")); String func (c.is_a () ? "choice_" : "sequence_"); @@ -1128,7 +1129,7 @@ namespace CXX << "unsigned long s = ~0UL;" << endl; - Boolean first (true); + bool first (true); // Note that we don't need to worry about the compositor // being empty - this case is handled by our caller. @@ -1144,7 +1145,7 @@ namespace CXX if (!p.context ().count ("prefix")) break; - UnsignedLong state (p.context ().get ("state")); + size_t state (p.context ().get ("state")); if (first) first = false; @@ -1246,7 +1247,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All&) { os << "all_0 (vd.state, v_all_count_.top (), " << @@ -1254,7 +1255,7 @@ namespace CXX << endl; } - virtual Void + virtual void traverse (SemanticGraph::Compositor&) // Choice and sequence. { os << "assert (vd.func != 0);" @@ -1281,7 +1282,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { using SemanticGraph::Element; @@ -1300,7 +1301,7 @@ namespace CXX << "all_0 (vd.state, v_all_count_.top (), empty, empty, 0, true);" << "}"; - if (a.context ().get ("effective-min") != 0) + if (a.context ().get ("effective-min") != 0) { os << "else" << endl << "this->_expected_element (" << endl; @@ -1315,10 +1316,10 @@ namespace CXX << "v_all_count_.pop ();"; } - virtual Void + virtual void traverse (SemanticGraph::Compositor& c) // Choice and sequence. { - UnsignedLong min (c.context ().get ("effective-min")); + size_t min (c.context ().get ("effective-min")); os << "v_state_& vs = *static_cast< v_state_* > (" << "this->v_state_stack_.top ());" @@ -1368,7 +1369,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { // Nothing to generate if we don't have any elements and wildcards. @@ -1385,7 +1386,7 @@ namespace CXX // Don't use restriction_p here since we don't want special // treatment of anyType. // - Boolean restriction ( + bool restriction ( c.inherits_p () && c.inherits ().is_a ()); @@ -1570,7 +1571,7 @@ namespace CXX }; } - Void + void generate_element_validation_source (Context& ctx) { ctx.os << "#include " << endl diff --git a/xsd/cxx/parser/element-validation-source.hxx b/xsd/cxx/parser/element-validation-source.hxx index 276cbe2..9feb9a2 100644 --- a/xsd/cxx/parser/element-validation-source.hxx +++ b/xsd/cxx/parser/element-validation-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_element_validation_source (Context&); } } diff --git a/xsd/cxx/parser/elements.cxx b/xsd/cxx/parser/elements.cxx index 556398a..a721ea8 100644 --- a/xsd/cxx/parser/elements.cxx +++ b/xsd/cxx/parser/elements.cxx @@ -129,7 +129,7 @@ namespace CXX { } - Boolean Context:: + bool Context:: anonymous (SemanticGraph::Type& t) { return t.context ().count ("anonymous"); @@ -179,20 +179,20 @@ namespace CXX // Includes // - Void TypeForward:: + void TypeForward:: traverse (SemanticGraph::Type& t) { os << "class " << t.context ().get (name_key_) << ";"; } - Void Includes:: + void Includes:: traverse_ (SemanticGraph::Uses& u) { // Support for weak (forward) inclusion used in the file-per-type // compilation model. // SemanticGraph::Schema& s (u.schema ()); - Boolean weak (u.context ().count ("weak")); + bool weak (u.context ().count ("weak")); if (weak && (type_ == header || type_ == impl_header)) { diff --git a/xsd/cxx/parser/elements.hxx b/xsd/cxx/parser/elements.hxx index 8b57b61..e9cbb6f 100644 --- a/xsd/cxx/parser/elements.hxx +++ b/xsd/cxx/parser/elements.hxx @@ -54,7 +54,7 @@ namespace CXX Context (Context& c, std::wostream& o); public: - Boolean + bool restriction_p (SemanticGraph::Complex& c) const { if (c.inherits_p () && @@ -73,7 +73,7 @@ namespace CXX content (SemanticGraph::Complex&); public: - static Boolean + static bool anonymous (SemanticGraph::Type&); public: @@ -110,8 +110,8 @@ namespace CXX String& cerr_inst; String& parser_map; String& std_string_type; - Boolean& validation; - Boolean& polymorphic; + bool& validation; + bool& polymorphic; Regex const* hxx_expr; Regex const* ixx_expr; @@ -126,20 +126,20 @@ namespace CXX String cerr_inst_; String parser_map_; String std_string_type_; - Boolean validation_; - Boolean polymorphic_; + bool validation_; + bool polymorphic_; }; // // struct RequiredAttributeTest: Traversal::Attribute { - RequiredAttributeTest (Boolean& result) + RequiredAttributeTest (bool& result) : result_ (result) { } - virtual Void + virtual void traverse (Type& a) { if (!result_ && !a.optional_p ()) @@ -147,7 +147,7 @@ namespace CXX } private: - Boolean& result_; + bool& result_; }; // @@ -157,14 +157,14 @@ namespace CXX Traversal::Member, Context { - ParserParamDecl (Context& c, Boolean name_arg) + ParserParamDecl (Context& c, bool name_arg) : Context (c), first_ (true), name_arg_ (name_arg) { inherits_ >> *this; names_ >> *this; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -173,7 +173,7 @@ namespace CXX names (c, names_); } - virtual Void + virtual void traverse (SemanticGraph::List& l) { if (!first_) @@ -189,7 +189,7 @@ namespace CXX os << " /* " << comment (l.name ()) << " item */"; } - virtual Void + virtual void traverse (SemanticGraph::Member& m) { if (skip (m)) return; @@ -211,8 +211,8 @@ namespace CXX Traversal::Inherits inherits_; Traversal::Names names_; - Boolean first_; - Boolean name_arg_; + bool first_; + bool name_arg_; }; @@ -220,16 +220,16 @@ namespace CXX // struct TypeForward: Traversal::Type, Context { - TypeForward (Context& c, Char const* name_key) + TypeForward (Context& c, char const* name_key) : Context (c), name_key_ (name_key) { } - virtual Void + virtual void traverse (SemanticGraph::Type& t); private: - Char const* name_key_; + char const* name_key_; }; struct Includes: Traversal::Imports, @@ -251,20 +251,20 @@ 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: @@ -290,7 +290,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (options_.root_element_first ()) diff --git a/xsd/cxx/parser/generator.cxx b/xsd/cxx/parser/generator.cxx index 338705e..7ef7183 100644 --- a/xsd/cxx/parser/generator.cxx +++ b/xsd/cxx/parser/generator.cxx @@ -9,9 +9,6 @@ #include -#include -#include - #include #include #include @@ -71,7 +68,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, an XML Schema to\n" @@ -105,7 +102,7 @@ namespace CXX "// in the accompanying FLOSSE file.\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, an XML Schema\n" @@ -115,7 +112,7 @@ namespace CXX "// conditions.\n" "//\n\n"; - Char const copyright_impl[] = + char const copyright_impl[] = "// Not copyrighted - public domain.\n" "//\n" "// This sample parser implementation was generated by CodeSynthesis XSD,\n" @@ -124,7 +121,7 @@ namespace CXX "//\n\n"; } - Void Parser::Generator:: + void Parser::Generator:: usage () { CXX::Parser::options::print_usage (wcout); @@ -134,7 +131,7 @@ namespace CXX namespace { template - Void + void open (S& ifs, NarrowString const& path) { try @@ -159,7 +156,7 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowString const& path, WideInputFileStream& default_is) @@ -179,7 +176,7 @@ namespace CXX } } - Void + void append (WideOutputFileStream& os, NarrowStrings const& primary, NarrowStrings const& def) @@ -195,13 +192,13 @@ namespace CXX } - UnsignedLong Parser::Generator:: + size_t Parser::Generator:: generate (Parser::options const& ops, Schema& schema, Path const& file_path, - Boolean fpt, + bool fpt, StringLiteralMap const& string_literal_map, - Boolean gen_driver, + bool gen_driver, const WarningSet& disabled_warnings, FileList& file_list, AutoUnlinks& unlinks) @@ -212,7 +209,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 @@ -228,11 +225,11 @@ namespace CXX } } - Boolean impl (!generate_xml_schema && + bool impl (!generate_xml_schema && (ops.generate_noop_impl () || ops.generate_print_impl ())); - Boolean driver (gen_driver && !generate_xml_schema && + bool driver (gen_driver && !generate_xml_schema && ops.generate_test_driver ()); // Evaluate the graph for possibility of generating something useful. @@ -251,7 +248,7 @@ namespace CXX proc.process (ops, schema, file_path, string_literal_map); } - Boolean validation ((ops.xml_parser () == "expat" || + bool validation ((ops.xml_parser () == "expat" || ops.generate_validation ()) && !ops.suppress_validation ()); @@ -393,8 +390,8 @@ namespace CXX // // - Boolean inline_ (ops.generate_inline () && !generate_xml_schema); - Boolean source (!generate_xml_schema); + bool inline_ (ops.generate_inline () && !generate_xml_schema); + bool source (!generate_xml_schema); // Generate code. // @@ -697,7 +694,7 @@ namespace CXX // Print copyright and license. // - Char const* copyright ( + char const* copyright ( ops.proprietary_license () ? copyright_proprietary : copyright_gpl); hxx << copyright; @@ -740,7 +737,7 @@ namespace CXX // SLOC counter. // size_t sloc_total (0); - Boolean show_sloc (ops.show_sloc ()); + bool show_sloc (ops.show_sloc ()); typedef compiler::ostream_filter diff --git a/xsd/cxx/parser/generator.hxx b/xsd/cxx/parser/generator.hxx index 8391553..2af6d60 100644 --- a/xsd/cxx/parser/generator.hxx +++ b/xsd/cxx/parser/generator.hxx @@ -6,14 +6,11 @@ #ifndef CXX_PARSER_GENERATOR_HXX #define CXX_PARSER_GENERATOR_HXX -#include - -#include - #include // Path #include #include +#include #include #include @@ -22,23 +19,21 @@ namespace CXX { namespace Parser { - using namespace Cult::Types; - class Generator { public: - static Void + static void usage (); struct Failed {}; - static UnsignedLong + static size_t generate (options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, - Boolean file_per_type, + bool file_per_type, StringLiteralMap const&, - Boolean gen_driver, + bool gen_driver, const WarningSet& disabled_warnings, FileList& file_list, AutoUnlinks& unlinks); diff --git a/xsd/cxx/parser/impl-header.cxx b/xsd/cxx/parser/impl-header.cxx index 5d47cae..99e80dd 100644 --- a/xsd/cxx/parser/impl-header.cxx +++ b/xsd/cxx/parser/impl-header.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String const& name (eimpl (e)); @@ -51,7 +51,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (eimpl (l)); @@ -98,7 +98,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (eimpl (u)); @@ -130,7 +130,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -161,7 +161,7 @@ namespace CXX names_parser_callback_ >> parser_callback_; } - virtual Void + virtual void traverse (Type& c) { String const& name (eimpl (c)); @@ -202,7 +202,7 @@ namespace CXX }; } - Void + void generate_impl_header (Context& ctx) { Traversal::Schema schema; diff --git a/xsd/cxx/parser/impl-header.hxx b/xsd/cxx/parser/impl-header.hxx index 0d0b06d..4f769d6 100644 --- a/xsd/cxx/parser/impl-header.hxx +++ b/xsd/cxx/parser/impl-header.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_impl_header (Context&); } } diff --git a/xsd/cxx/parser/impl-source.cxx b/xsd/cxx/parser/impl-source.cxx index 3f5aec5..bf605c7 100644 --- a/xsd/cxx/parser/impl-source.cxx +++ b/xsd/cxx/parser/impl-source.cxx @@ -22,7 +22,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String const& name (eimpl (e)); @@ -91,7 +91,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (eimpl (l)); @@ -164,7 +164,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (eimpl (u)); @@ -221,7 +221,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -268,12 +268,12 @@ namespace CXX names_parser_callback_ >> parser_callback_; } - virtual Void + virtual void traverse (Type& c) { String const& name (eimpl (c)); - Boolean restriction (restriction_p (c)); + bool restriction (restriction_p (c)); os << "// " << name << endl << "//" << endl @@ -354,7 +354,7 @@ namespace CXX }; } - Void + void generate_impl_source (Context& ctx) { if (ctx.options.generate_print_impl ()) diff --git a/xsd/cxx/parser/impl-source.hxx b/xsd/cxx/parser/impl-source.hxx index eabcd1c..a958c4a 100644 --- a/xsd/cxx/parser/impl-source.hxx +++ b/xsd/cxx/parser/impl-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_impl_source (Context&); } } diff --git a/xsd/cxx/parser/name-processor.cxx b/xsd/cxx/parser/name-processor.cxx index 2812ef4..7cd959c 100644 --- a/xsd/cxx/parser/name-processor.cxx +++ b/xsd/cxx/parser/name-processor.cxx @@ -3,15 +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 +using namespace std; namespace CXX { @@ -27,7 +30,7 @@ namespace CXX { // // - typedef Cult::Containers::Set NameSet; + typedef set NameSet; class Context: public CXX::Context { @@ -67,7 +70,7 @@ namespace CXX String base_name (escape (n)); String name (base_name); - 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; @@ -82,16 +85,16 @@ namespace CXX String const skel_suffix_; String const impl_suffix_; - Cult::Containers::Map global_type_names_; + map global_type_names_; public: - Boolean const impl; + bool const impl; String const& skel_suffix; String const& impl_suffix; - Cult::Containers::Map& global_type_names; + map& global_type_names; - Boolean polymorphic; + bool polymorphic; }; @@ -104,7 +107,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (Parser::Context::skip (m)) @@ -124,7 +127,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (Parser::Context::skip (m)) @@ -227,7 +230,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (Parser::Context::skip (m)) @@ -264,13 +267,13 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (Parser::Context::skip (m)) return; - Boolean poly (polymorphic && + bool poly (polymorphic && m.is_a () && !m.type ().context ().count ("anonymous")); @@ -328,7 +331,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { SemanticGraph::Context& cc (c.context ()); @@ -350,7 +353,7 @@ namespace CXX // inheriting by restriction in which case we need to have // the same names as our base. // - Boolean restriction (false); + bool restriction (false); if (c.inherits_p ()) { @@ -443,7 +446,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { SemanticGraph::Context& c (t.context ()); @@ -512,7 +515,7 @@ namespace CXX String base_name (escape (L"post_" + n)); String post (base_name); - for (UnsignedLong i (1); set.find (post) != set.end (); ++i) + for (size_t i (1); set.find (post) != set.end (); ++i) { std::wostringstream os; os << i; @@ -535,7 +538,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& ns) { NameSet& type_set (global_type_names[ns.name ()]); @@ -613,7 +616,7 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { t.context ().set ("name", make_skel_name ("any_type")); @@ -621,7 +624,7 @@ namespace CXX t.context ().set ("post", String ("post_any_type")); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { t.context ().set ("name", make_skel_name ("any_simple_type")); @@ -631,7 +634,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { t.context ().set ("name", make_skel_name ("boolean")); @@ -641,7 +644,7 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { t.context ().set ("name", make_skel_name ("byte")); @@ -649,7 +652,7 @@ namespace CXX t.context ().set ("post", String ("post_byte")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { t.context ().set ("name", make_skel_name ("unsigned_byte")); @@ -657,7 +660,7 @@ namespace CXX t.context ().set ("post", String ("post_unsigned_byte")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { t.context ().set ("name", make_skel_name ("short")); @@ -665,7 +668,7 @@ namespace CXX t.context ().set ("post", String ("post_short")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { t.context ().set ("name", make_skel_name ("unsigned_short")); @@ -673,7 +676,7 @@ namespace CXX t.context ().set ("post", String ("post_unsigned_short")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { t.context ().set ("name", make_skel_name ("int")); @@ -681,7 +684,7 @@ namespace CXX t.context ().set ("post", String ("post_int")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { t.context ().set ("name", make_skel_name ("unsigned_int")); @@ -689,7 +692,7 @@ namespace CXX t.context ().set ("post", String ("post_unsigned_int")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { t.context ().set ("name", make_skel_name ("long")); @@ -697,7 +700,7 @@ namespace CXX t.context ().set ("post", String ("post_long")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { t.context ().set ("name", make_skel_name ("unsigned_long")); @@ -705,7 +708,7 @@ namespace CXX t.context ().set ("post", String ("post_unsigned_long")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { t.context ().set ("name", make_skel_name ("integer")); @@ -713,7 +716,7 @@ namespace CXX t.context ().set ("post", String ("post_integer")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { t.context ().set ("name", make_skel_name ("non_positive_integer")); @@ -721,7 +724,7 @@ namespace CXX t.context ().set ("post", String ("post_non_positive_integer")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { t.context ().set ("name", make_skel_name ("non_negative_integer")); @@ -729,7 +732,7 @@ namespace CXX t.context ().set ("post", String ("post_non_negative_integer")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { t.context ().set ("name", make_skel_name ("positive_integer")); @@ -737,7 +740,7 @@ namespace CXX t.context ().set ("post", String ("post_positive_integer")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { t.context ().set ("name", make_skel_name ("negative_integer")); @@ -747,7 +750,7 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { t.context ().set ("name", make_skel_name ("float")); @@ -755,7 +758,7 @@ namespace CXX t.context ().set ("post", String ("post_float")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { t.context ().set ("name", make_skel_name ("double")); @@ -763,7 +766,7 @@ namespace CXX t.context ().set ("post", String ("post_double")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { t.context ().set ("name", make_skel_name ("decimal")); @@ -773,7 +776,7 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { t.context ().set ("name", make_skel_name ("string")); @@ -781,7 +784,7 @@ namespace CXX t.context ().set ("post", String ("post_string")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { t.context ().set ("name", make_skel_name ("normalized_string")); @@ -789,7 +792,7 @@ namespace CXX t.context ().set ("post", String ("post_normalized_string")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { t.context ().set ("name", make_skel_name ("token")); @@ -797,7 +800,7 @@ namespace CXX t.context ().set ("post", String ("post_token")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { t.context ().set ("name", make_skel_name ("nmtoken")); @@ -805,7 +808,7 @@ namespace CXX t.context ().set ("post", String ("post_nmtoken")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { t.context ().set ("name", make_skel_name ("nmtokens")); @@ -813,7 +816,7 @@ namespace CXX t.context ().set ("post", String ("post_nmtokens")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { t.context ().set ("name", make_skel_name ("name")); @@ -821,7 +824,7 @@ namespace CXX t.context ().set ("post", String ("post_name")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { t.context ().set ("name", make_skel_name ("ncname")); @@ -829,7 +832,7 @@ namespace CXX t.context ().set ("post", String ("post_ncname")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { t.context ().set ("name", make_skel_name ("language")); @@ -840,7 +843,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { t.context ().set ("name", make_skel_name ("qname")); @@ -851,7 +854,7 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { t.context ().set ("name", make_skel_name ("id")); @@ -859,7 +862,7 @@ namespace CXX t.context ().set ("post", String ("post_id")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { t.context ().set ("name", make_skel_name ("idref")); @@ -867,7 +870,7 @@ namespace CXX t.context ().set ("post", String ("post_idref")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { t.context ().set ("name", make_skel_name ("idrefs")); @@ -877,7 +880,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { t.context ().set ("name", make_skel_name ("uri")); @@ -887,7 +890,7 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { t.context ().set ("name", make_skel_name ("base64_binary")); @@ -895,7 +898,7 @@ namespace CXX t.context ().set ("post", String ("post_base64_binary")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { t.context ().set ("name", make_skel_name ("hex_binary")); @@ -906,7 +909,7 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { t.context ().set ("name", make_skel_name ("date")); @@ -914,7 +917,7 @@ namespace CXX t.context ().set ("post", String ("post_date")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { t.context ().set ("name", make_skel_name ("date_time")); @@ -922,7 +925,7 @@ namespace CXX t.context ().set ("post", String ("post_date_time")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { t.context ().set ("name", make_skel_name ("duration")); @@ -930,7 +933,7 @@ namespace CXX t.context ().set ("post", String ("post_duration")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { t.context ().set ("name", make_skel_name ("gday")); @@ -938,7 +941,7 @@ namespace CXX t.context ().set ("post", String ("post_gday")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { t.context ().set ("name", make_skel_name ("gmonth")); @@ -946,7 +949,7 @@ namespace CXX t.context ().set ("post", String ("post_gmonth")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { t.context ().set ("name", make_skel_name ("gmonth_day")); @@ -954,7 +957,7 @@ namespace CXX t.context ().set ("post", String ("post_gmonth_day")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { t.context ().set ("name", make_skel_name ("gyear")); @@ -962,7 +965,7 @@ namespace CXX t.context ().set ("post", String ("post_gyear")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { t.context ().set ("name", make_skel_name ("gyear_month")); @@ -970,7 +973,7 @@ namespace CXX t.context ().set ("post", String ("post_gyear_month")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { t.context ().set ("name", make_skel_name ("time")); @@ -980,7 +983,7 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity& t) { t.context ().set ("name", make_skel_name ("entity")); @@ -988,7 +991,7 @@ namespace CXX t.context ().set ("post", String ("post_entity")); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities& t) { t.context ().set ("name", make_skel_name ("entities")); @@ -1017,7 +1020,7 @@ namespace CXX Traversal::Includes, Traversal::Imports { - virtual Void + virtual void traverse (SemanticGraph::Sources& sr) { SemanticGraph::Schema& s (sr.schema ()); @@ -1029,7 +1032,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Includes& i) { SemanticGraph::Schema& s (i.schema ()); @@ -1041,7 +1044,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Imports& i) { SemanticGraph::Schema& s (i.schema ()); @@ -1059,7 +1062,7 @@ namespace CXX // struct Implies: Traversal::Implies { - virtual Void + virtual void traverse (SemanticGraph::Implies& i) { SemanticGraph::Schema& s (i.schema ()); @@ -1072,7 +1075,7 @@ namespace CXX } }; - Void + void process_impl (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, @@ -1168,7 +1171,7 @@ namespace CXX } } - Void NameProcessor:: + void NameProcessor:: process (options const& ops, SemanticGraph::Schema& tu, SemanticGraph::Path const& file, diff --git a/xsd/cxx/parser/name-processor.hxx b/xsd/cxx/parser/name-processor.hxx index 558ca2a..a6c41ff 100644 --- a/xsd/cxx/parser/name-processor.hxx +++ b/xsd/cxx/parser/name-processor.hxx @@ -8,6 +8,8 @@ #include +#include + #include #include @@ -15,14 +17,12 @@ namespace CXX { namespace Parser { - using namespace Cult::Types; - class NameProcessor { public: NameProcessor (); // Dummy ctor, helps with long symbols on HP-UX. - Void + void process (options const&, XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file, diff --git a/xsd/cxx/parser/options.cli b/xsd/cxx/parser/options.cli index 9bbaf0f..9261778 100644 --- a/xsd/cxx/parser/options.cli +++ b/xsd/cxx/parser/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 ; @@ -17,7 +15,7 @@ namespace CXX { class options: CXX::options { - std::vector --type-map + NarrowStrings --type-map { "", "Read XML Schema to C++ type mapping information from . @@ -27,7 +25,7 @@ namespace CXX TYPE MAP section below for more information." }; - Cult::Types::NarrowString --xml-parser = "xerces" + NarrowString --xml-parser = "xerces" { "", "Use as the underlying XML parser. Valid values are @@ -108,7 +106,7 @@ namespace CXX implementation." }; - Cult::Types::NarrowString --root-element + NarrowString --root-element { "", "Indicate that is the document root. This information is @@ -117,21 +115,21 @@ namespace CXX // Suffixes. // - Cult::Types::NarrowString --skel-type-suffix = "_pskel" + NarrowString --skel-type-suffix = "_pskel" { "", "Use the provided instead of the default \cb{_pskel} to construct the names of the generated parser skeletons." }; - Cult::Types::NarrowString --skel-file-suffix = "-pskel" + NarrowString --skel-file-suffix = "-pskel" { "", "Use the provided instead of the default \cb{-pskel} to construct the names of the generated parser skeleton files." }; - Cult::Types::NarrowString --impl-type-suffix = "_pimpl" + NarrowString --impl-type-suffix = "_pimpl" { "", "Use the provided instead of the default \cb{_pimpl} to @@ -139,7 +137,7 @@ namespace CXX XML Schema types as well as sample parser implementations." }; - Cult::Types::NarrowString --impl-file-suffix = "-pimpl" + NarrowString --impl-file-suffix = "-pimpl" { "", "Use the provided instead of the default \cb{-pimpl} to diff --git a/xsd/cxx/parser/parser-forward.cxx b/xsd/cxx/parser/parser-forward.cxx index 5451268..409dcb0 100644 --- a/xsd/cxx/parser/parser-forward.cxx +++ b/xsd/cxx/parser/parser-forward.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { os << "class " << ename (e) << ";"; @@ -37,7 +37,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { os << "class " << ename (l) << ";"; @@ -53,7 +53,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { os << "class " << ename (u) << ";"; @@ -69,7 +69,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& c) { os << "class " << ename (c) << ";"; @@ -77,7 +77,7 @@ namespace CXX }; } - Void + void generate_parser_forward (Context& ctx) { ctx.os << "// Forward declarations" << endl diff --git a/xsd/cxx/parser/parser-forward.hxx b/xsd/cxx/parser/parser-forward.hxx index 6402e63..12174f6 100644 --- a/xsd/cxx/parser/parser-forward.hxx +++ b/xsd/cxx/parser/parser-forward.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_parser_forward (Context&); } } diff --git a/xsd/cxx/parser/parser-header.cxx b/xsd/cxx/parser/parser-header.cxx index c717fc8..5db1ef4 100644 --- a/xsd/cxx/parser/parser-header.cxx +++ b/xsd/cxx/parser/parser-header.cxx @@ -3,11 +3,15 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include + #include #include #include +using namespace std; + namespace CXX { namespace Parser @@ -21,7 +25,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String const& name (ename (e)); @@ -41,7 +45,7 @@ namespace CXX String const& ret (ret_type (e)); - Boolean same (ret == ret_type (base)); + bool same (ret == ret_type (base)); os << "virtual " << ret << endl << post_name (e) << " ()" << @@ -71,7 +75,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename (l)); @@ -173,7 +177,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename (u)); @@ -222,7 +226,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) return; @@ -251,7 +255,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -281,7 +285,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -315,14 +319,13 @@ namespace CXX } - virtual Void + virtual void traverse (SemanticGraph::All& a) { if (!a.context().count ("comp-number")) return; - UnsignedLong state_count ( - a.context().get ("state-count")); + size_t state_count (a.context().get ("state-count")); os << "void" << endl << "all_0 (unsigned long& state," << endl @@ -337,13 +340,13 @@ namespace CXX << endl; } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { if (!c.context().count ("comp-number")) return; - UnsignedLong n (c.context ().get ("comp-number")); + size_t n (c.context ().get ("comp-number")); os << "void" << endl << "choice_" << n << " (unsigned long& state," << endl @@ -357,13 +360,13 @@ namespace CXX Traversal::Choice::traverse (c); } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { if (!s.context().count ("comp-number")) return; - UnsignedLong n (s.context ().get ("comp-number")); + size_t n (s.context ().get ("comp-number")); os << "void" << endl << "sequence_" << n << " (unsigned long& state," << endl @@ -391,7 +394,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { if (!a.optional_p ()) @@ -418,7 +421,7 @@ namespace CXX names_attribute_validation_state_ >> attribute_validation_state_; } - virtual Void + virtual void traverse (Type& c) { String const& name (ename (c)); @@ -427,15 +430,15 @@ namespace CXX // generate parser callbacks, etc. since they are the same as in // the base. We only need the parsing/validation code. // - Boolean restriction (restriction_p (c)); + bool restriction (restriction_p (c)); - Boolean he (has (c)); - Boolean ha (has (c)); + 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 hra (false); // Has required attribute. + bool hra (false); // Has required attribute. if (ha) { RequiredAttributeTest test (hra); @@ -471,7 +474,7 @@ namespace CXX String const& ret (ret_type (c)); - Boolean same (c.inherits_p () && + bool same (c.inherits_p () && ret == ret_type (c.inherits ().base ())); os << "virtual " << ret << endl @@ -605,7 +608,7 @@ namespace CXX if (validation && (he || hae)) { - UnsignedLong depth (c.context ().get ("depth")); + size_t depth (c.context ().get ("depth")); os << "protected:" << endl; @@ -769,13 +772,13 @@ namespace CXX // anyType & anySimpleType. // - virtual Void + virtual void traverse (SemanticGraph::AnyType& t) { gen_typedef (t, "void", "any_type_pskel", "any_type_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::AnySimpleType& t) { gen_typedef (t, "void", @@ -784,7 +787,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { gen_typedef (t, "bool", "boolean_pskel", "boolean_pimpl"); @@ -792,72 +795,72 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { gen_typedef (t, "signed char", "byte_pskel", "byte_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { gen_typedef (t, "unsigned char", "unsigned_byte_pskel", "unsigned_byte_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { gen_typedef (t, "short", "short_pskel", "short_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { gen_typedef (t, "unsigned short", "unsigned_short_pskel", "unsigned_short_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { gen_typedef (t, "int", "int_pskel", "int_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { gen_typedef (t, "unsigned int", "unsigned_int_pskel", "unsigned_int_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { gen_typedef (t, "long long", "long_pskel", "long_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { gen_typedef (t, "unsigned long long", "unsigned_long_pskel", "unsigned_long_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { gen_typedef (t, "long long", "integer_pskel", "integer_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { gen_typedef (t, "long long", "negative_integer_pskel", "negative_integer_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { gen_typedef (t, "long long", @@ -865,14 +868,14 @@ namespace CXX "non_positive_integer_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { gen_typedef (t, "unsigned long long", "positive_integer_pskel", "positive_integer_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { gen_typedef (t, "unsigned long long", @@ -882,19 +885,19 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { gen_typedef (t, "float", "float_pskel", "float_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { gen_typedef (t, "double", "double_pskel", "double_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { gen_typedef (t, "double", "decimal_pskel", "decimal_pimpl"); @@ -902,33 +905,33 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { gen_typedef (t, string_type_, "string_pskel", "string_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { gen_typedef (t, string_type_, "normalized_string_pskel", "normalized_string_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { gen_typedef (t, string_type_, "token_pskel", "token_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { nmtoken_ = gen_typedef (t, string_type_, "nmtoken_pskel", "nmtoken_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { // NMTOKENS uses NMTOKEN implementation to parse individual items. @@ -940,19 +943,19 @@ namespace CXX "nmtokens_pskel", "nmtokens_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { gen_typedef (t, string_type_, "name_pskel", "name_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { gen_typedef (t, string_type_, "ncname_pskel", "ncname_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { gen_typedef (t, string_type_, "language_pskel", "language_pimpl"); @@ -960,7 +963,7 @@ namespace CXX // Qualified name. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { gen_typedef (t, xs_ns_ + L"::qname", "qname_pskel", "qname_pimpl"); @@ -968,19 +971,19 @@ namespace CXX // ID/IDREF. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { gen_typedef (t, string_type_, "id_pskel", "id_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { idref_ = gen_typedef (t, string_type_, "idref_pskel", "idref_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { // IDREFS uses IDREF implementation to parse individual items. @@ -994,7 +997,7 @@ namespace CXX // URI. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { gen_typedef (t, string_type_, "uri_pskel", "uri_pimpl"); @@ -1002,7 +1005,7 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { String buffer (L"::std::auto_ptr< " + xs_ns_ + L"::buffer >"); @@ -1010,7 +1013,7 @@ namespace CXX "base64_binary_pskel", "base64_binary_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { String buffer (L"::std::auto_ptr< " + xs_ns_ + L"::buffer >"); @@ -1020,60 +1023,60 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { gen_typedef (t, xs_ns_ + L"::date", "date_pskel", "date_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { gen_typedef (t, xs_ns_ + L"::date_time", "date_time_pskel", "date_time_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { gen_typedef (t, xs_ns_ + L"::duration", "duration_pskel", "duration_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { gen_typedef (t, xs_ns_ + L"::gday", "gday_pskel", "gday_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { gen_typedef (t, xs_ns_ + L"::gmonth", "gmonth_pskel", "gmonth_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { gen_typedef (t, xs_ns_ + L"::gmonth_day", "gmonth_day_pskel", "gmonth_day_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { gen_typedef (t, xs_ns_ + L"::gyear", "gyear_pskel", "gyear_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { gen_typedef (t, xs_ns_ + L"::gyear_month", "gyear_month_pskel", "gyear_month_pimpl"); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { gen_typedef (t, xs_ns_ + L"::time", "time_pskel", "time_pimpl"); @@ -1081,18 +1084,18 @@ namespace CXX // Entity. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entity&) { } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Entities&) { } private: - Boolean + bool gen_typedef (SemanticGraph::Type& t, String const& type, String const& pskel, @@ -1119,8 +1122,8 @@ namespace CXX String impl_ns_; String string_type_; - Boolean idref_; - Boolean nmtoken_; + bool idref_; + bool nmtoken_; }; struct FundNamespace: Namespace, Context @@ -1257,8 +1260,8 @@ namespace CXX }; } - Void - generate_parser_header (Context& ctx, Boolean generate_xml_schema) + void + generate_parser_header (Context& ctx, bool generate_xml_schema) { String c (ctx.char_type); @@ -1307,12 +1310,12 @@ namespace CXX // if (ctx.schema_root.context ().count ("includes")) { - typedef Cult::Containers::Set Includes; + typedef set Includes; Includes const& is ( ctx.schema_root.context ().get ("includes")); - for (Includes::ConstReverseIterator i (is.rbegin ()); + for (Includes::const_reverse_iterator i (is.rbegin ()); i != is.rend (); ++i) { ctx.os << "#include " << *i << endl; @@ -1356,12 +1359,12 @@ namespace CXX // if (ctx.schema_root.context ().count ("includes")) { - typedef Cult::Containers::Set Includes; + typedef set Includes; Includes const& is ( ctx.schema_root.context ().get ("includes")); - for (Includes::ConstReverseIterator i (is.rbegin ()); + for (Includes::const_reverse_iterator i (is.rbegin ()); i != is.rend (); ++i) { ctx.os << "#include " << *i << endl; diff --git a/xsd/cxx/parser/parser-header.hxx b/xsd/cxx/parser/parser-header.hxx index cfe8af4..6699472 100644 --- a/xsd/cxx/parser/parser-header.hxx +++ b/xsd/cxx/parser/parser-header.hxx @@ -12,8 +12,8 @@ namespace CXX { namespace Parser { - Void - generate_parser_header (Context&, Boolean generate_xml_schema); + void + generate_parser_header (Context&, bool generate_xml_schema); } } diff --git a/xsd/cxx/parser/parser-inline.cxx b/xsd/cxx/parser/parser-inline.cxx index e549e24..03eab94 100644 --- a/xsd/cxx/parser/parser-inline.cxx +++ b/xsd/cxx/parser/parser-inline.cxx @@ -23,7 +23,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename (l)); @@ -75,7 +75,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -84,7 +84,7 @@ namespace CXX String const& scope (ename (m.scope ())); String const& parser (eparser (m)); - Boolean poly (polymorphic && + bool poly (polymorphic && m.is_a () && !anonymous (m.type ())); @@ -117,7 +117,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) return; @@ -138,7 +138,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) return; @@ -159,14 +159,14 @@ namespace CXX } } - Boolean + bool comma () const { return !first_; } private: - Boolean first_; + bool first_; }; struct ParserBaseSet: Traversal::Complex, @@ -180,7 +180,7 @@ namespace CXX names_ >> member_; } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { inherits (c, inherits_); @@ -189,7 +189,7 @@ namespace CXX names (c, names_); } - virtual Void + virtual void traverse (SemanticGraph::List& l) { String const& name (ename (l)); @@ -212,14 +212,13 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { if (!a.context().count ("comp-number")) return; - UnsignedLong state_count ( - a.context().get ("state-count")); + size_t state_count (a.context().get ("state-count")); os << "," << endl << " v_all_count_ (" << state_count << "UL, v_all_first_)"; @@ -242,15 +241,15 @@ namespace CXX names_parser_member_set_ >> parser_member_set_; } - virtual Void + virtual void traverse (Type& c) { - Boolean he (has (c)); - Boolean ha (has (c)); + bool he (has (c)); + bool ha (has (c)); - Boolean hae (has_particle (c)); + bool hae (has_particle (c)); - Boolean hra (false); // Has required attribute. + bool hra (false); // Has required attribute. if (ha) { RequiredAttributeTest test (hra); @@ -258,7 +257,7 @@ namespace CXX names (c, names_test); } - Boolean restriction (restriction_p (c)); + bool restriction (restriction_p (c)); if (!((!restriction && (he || ha)) || (validation && (he || hae || hra)))) @@ -305,7 +304,7 @@ namespace CXX << name << " ()" << endl << ": "; - Boolean comma (false); + bool comma (false); if (!restriction && (he || ha)) { @@ -364,7 +363,7 @@ namespace CXX }; } - Void + void generate_parser_inline (Context& ctx) { // Emit "weak" header includes that are used in the file-per-type diff --git a/xsd/cxx/parser/parser-inline.hxx b/xsd/cxx/parser/parser-inline.hxx index 23ece92..bcf0cf8 100644 --- a/xsd/cxx/parser/parser-inline.hxx +++ b/xsd/cxx/parser/parser-inline.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_parser_inline (Context&); } } diff --git a/xsd/cxx/parser/parser-source.cxx b/xsd/cxx/parser/parser-source.cxx index b9928bc..a83a19d 100644 --- a/xsd/cxx/parser/parser-source.cxx +++ b/xsd/cxx/parser/parser-source.cxx @@ -21,7 +21,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { String const& name (ename (e)); @@ -29,7 +29,7 @@ namespace CXX SemanticGraph::Type& base (e.inherits ().base ()); - Boolean same (ret == ret_type (base)); + bool same (ret == ret_type (base)); if (same || ret == L"void" || polymorphic) { @@ -79,7 +79,7 @@ namespace CXX if (validation) { - Boolean gen (!anonymous (e)); + bool gen (!anonymous (e)); // We normally don't need to enter anonymous types into // the inheritance map. The only exception is when an @@ -131,7 +131,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& l) { String const& name (ename (l)); @@ -227,7 +227,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& u) { String const& name (ename (u)); @@ -282,13 +282,13 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (skip (e)) return; - Boolean poly (polymorphic && !anonymous (e.type ())); + bool poly (polymorphic && !anonymous (e.type ())); os << "if ("; @@ -384,13 +384,13 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (skip (e)) return; - Boolean poly (polymorphic && !anonymous (e.type ())); + bool poly (polymorphic && !anonymous (e.type ())); String const& name (ename (e)); os << "if ("; @@ -468,7 +468,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& a) { String const& name (ename (a)); @@ -519,7 +519,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& m) { if (skip (m)) @@ -557,14 +557,14 @@ namespace CXX names_attribute_ >> attribute_; } - virtual Void + virtual void traverse (Type& c) { - Boolean he (has (c)); - Boolean ha (has (c)); + bool he (has (c)); + bool ha (has (c)); String const& ret (ret_type (c)); - Boolean same (c.inherits_p () && + bool same (c.inherits_p () && ret == ret_type (c.inherits ().base ())); String const& name (ename (c)); @@ -600,7 +600,7 @@ namespace CXX if (c.inherits_p () && validation) { - Boolean gen (!anonymous (c)); + bool gen (!anonymous (c)); // We normally don't need to enter anonymous types into // the inheritance map. The only exception is when an @@ -679,7 +679,7 @@ namespace CXX // Don't use restriction_p here since we don't want special // treatment of anyType. // - Boolean restriction ( + bool restriction ( c.inherits_p () && c.inherits ().is_a ()); @@ -806,7 +806,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (e.substitutes_p ()) @@ -833,7 +833,7 @@ namespace CXX }; } - Void + void generate_parser_source (Context& ctx) { if (ctx.polymorphic) @@ -846,8 +846,8 @@ namespace CXX else ctx.os << endl; - Boolean import_maps (ctx.options.import_maps ()); - Boolean export_maps (ctx.options.export_maps ()); + bool import_maps (ctx.options.import_maps ()); + bool export_maps (ctx.options.export_maps ()); if (import_maps || export_maps) { diff --git a/xsd/cxx/parser/parser-source.hxx b/xsd/cxx/parser/parser-source.hxx index 4212c15..43c3455 100644 --- a/xsd/cxx/parser/parser-source.hxx +++ b/xsd/cxx/parser/parser-source.hxx @@ -12,7 +12,7 @@ namespace CXX { namespace Parser { - Void + void generate_parser_source (Context&); } } diff --git a/xsd/cxx/parser/print-impl-common.hxx b/xsd/cxx/parser/print-impl-common.hxx index 55fe648..db26ea8 100644 --- a/xsd/cxx/parser/print-impl-common.hxx +++ b/xsd/cxx/parser/print-impl-common.hxx @@ -74,7 +74,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Type&) { gen_user_type (); @@ -82,7 +82,7 @@ namespace CXX // Boolean. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Boolean& t) { if (default_type (t, "bool")) @@ -96,7 +96,7 @@ namespace CXX // Integral types. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Byte& t) { if (default_type (t, "signed char")) @@ -108,7 +108,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedByte& t) { if (default_type (t, "unsigned char")) @@ -120,7 +120,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Short& t) { if (default_type (t, "short")) @@ -132,7 +132,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedShort& t) { if (default_type (t, "unsigned short")) @@ -144,7 +144,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Int& t) { if (default_type (t, "int")) @@ -156,7 +156,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedInt& t) { if (default_type (t, "unsigned int")) @@ -168,7 +168,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Long& t) { if (default_type (t, "long long")) @@ -180,7 +180,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::UnsignedLong& t) { if (default_type (t, "unsigned long long")) @@ -192,7 +192,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Integer& t) { if (default_type (t, "long long")) @@ -204,7 +204,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NegativeInteger& t) { if (default_type (t, "long long")) @@ -216,7 +216,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonPositiveInteger& t) { if (default_type (t, "long long")) @@ -228,7 +228,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::PositiveInteger& t) { if (default_type (t, "unsigned long long")) @@ -240,7 +240,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NonNegativeInteger& t) { if (default_type (t, "unsigned long long")) @@ -254,7 +254,7 @@ namespace CXX // Floats. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Float& t) { if (default_type (t, "float")) @@ -266,7 +266,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Double& t) { if (default_type (t, "double")) @@ -278,7 +278,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Decimal& t) { if (default_type (t, "double")) @@ -292,61 +292,61 @@ namespace CXX // Strings. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::String& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NormalizedString& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Token& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameToken& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Name& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NCName& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Language& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Id& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRef& t) { gen_string (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::AnyURI& t) { gen_string (t); @@ -355,13 +355,13 @@ namespace CXX // String sequences. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::NameTokens& t) { gen_sequence (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::IdRefs& t) { gen_sequence (t); @@ -370,7 +370,7 @@ namespace CXX // QName // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::QName& t) { if (default_type (t, xs_ns_name () + L"::qname")) @@ -391,13 +391,13 @@ namespace CXX // Binary. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Base64Binary& t) { gen_buffer (t); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::HexBinary& t) { gen_buffer (t); @@ -405,7 +405,7 @@ namespace CXX // Date/time. // - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Date& t) { if (default_type (t, xs_ns_name () + L"::date")) @@ -421,7 +421,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::DateTime& t) { if (default_type (t, xs_ns_name () + L"::date_time")) @@ -440,7 +440,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Duration& t) { if (default_type (t, xs_ns_name () + L"::duration")) @@ -463,7 +463,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Day& t) { if (default_type (t, xs_ns_name () + L"::gday")) @@ -477,7 +477,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Month& t) { if (default_type (t, xs_ns_name () + L"::gmonth")) @@ -491,7 +491,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::MonthDay& t) { if (default_type (t, xs_ns_name () + L"::gmonth_day")) @@ -506,7 +506,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Year& t) { if (default_type (t, xs_ns_name () + L"::gyear")) @@ -520,7 +520,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::YearMonth& t) { if (default_type (t, xs_ns_name () + L"::gyear_month")) @@ -535,7 +535,7 @@ namespace CXX gen_user_type (); } - virtual Void + virtual void traverse (SemanticGraph::Fundamental::Time& t) { if (default_type (t, xs_ns_name () + L"::time")) diff --git a/xsd/cxx/parser/state-processor.cxx b/xsd/cxx/parser/state-processor.cxx index 568154d..8664886 100644 --- a/xsd/cxx/parser/state-processor.cxx +++ b/xsd/cxx/parser/state-processor.cxx @@ -3,6 +3,9 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include +#include + #include #include @@ -10,9 +13,7 @@ #include #include -#include - -#include +using namespace std; namespace CXX { @@ -20,7 +21,7 @@ namespace CXX { namespace { - typedef Cult::Containers::Vector Particles; + typedef vector Particles; void print (Particles const& p) @@ -30,7 +31,7 @@ namespace CXX wcerr << "prefixes: " << endl; - for (Particles::ConstIterator i (p.begin ()); i != p.end (); ++i) + for (Particles::const_iterator i (p.begin ()); i != p.end (); ++i) { if (SemanticGraph::Element* e = dynamic_cast (*i)) @@ -52,10 +53,10 @@ namespace CXX Traversal::Choice, Traversal::Sequence { - Particle (UnsignedLong& all, - UnsignedLong& choice, - UnsignedLong& sequence, - UnsignedLong& depth) + Particle (size_t& all, + size_t& choice, + size_t& sequence, + size_t& depth) : all_ (all), choice_ (choice), sequence_ (sequence), @@ -63,7 +64,7 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::All& a) { using SemanticGraph::Compositor; @@ -78,8 +79,8 @@ namespace CXX // compositor cannot contain any nested compositors. // - UnsignedLong state (0); - UnsignedLong min (0); + size_t state (0); + size_t min (0); for (Compositor::ContainsIterator ci (a.contains_begin ()); ci != a.contains_end (); ++ci) @@ -101,7 +102,7 @@ namespace CXX { a.context ().set ("comp-number", choice_++); a.context ().set ("prefixes", prefixes_); - a.context ().set ("state-count", UnsignedLong (prefixes_.size ())); + a.context ().set ("state-count", size_t (prefixes_.size ())); // effective-min = min * actual-min // @@ -114,7 +115,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Choice& c) { using SemanticGraph::Compositor; @@ -126,8 +127,8 @@ namespace CXX // the actual value specified in the schema. // - UnsignedLong state (0); - UnsignedLong min (1); + size_t state (0); + size_t min (1); for (Compositor::ContainsIterator ci (c.contains_begin ()); ci != c.contains_end (); ++ci) @@ -144,7 +145,7 @@ namespace CXX } else { - UnsignedLong depth (0); + size_t depth (0); Particle t (all_, choice_, sequence_, depth); t.dispatch (p); @@ -159,7 +160,7 @@ namespace CXX t.prefixes_.end ().base ()); if (min == 1 && - p.context ().get ("effective-min") == 0) + p.context ().get ("effective-min") == 0) min = 0; } @@ -183,7 +184,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Sequence& s) { using SemanticGraph::Compositor; @@ -195,9 +196,9 @@ namespace CXX // of the actual value specified in the schema. // - Boolean prefix (true); - UnsignedLong state (0); - UnsignedLong min (0); + bool prefix (true); + size_t state (0); + size_t min (0); for (Compositor::ContainsIterator ci (s.contains_begin ()); ci != s.contains_end (); ++ci) @@ -217,7 +218,7 @@ namespace CXX } else { - UnsignedLong depth (0); + size_t depth (0); Particle t (all_, choice_, sequence_, depth); t.dispatch (p); @@ -233,7 +234,7 @@ namespace CXX t.prefixes_.begin ().base (), t.prefixes_.end ().base ()); - if (p.context ().get ("effective-min") != 0) + if (p.context ().get ("effective-min") != 0) min = 1; } } @@ -266,11 +267,11 @@ namespace CXX private: Particles prefixes_; - UnsignedLong& all_; - UnsignedLong& choice_; - UnsignedLong& sequence_; + size_t& all_; + size_t& choice_; + size_t& sequence_; - UnsignedLong& depth_; + size_t& depth_; }; @@ -278,12 +279,12 @@ namespace CXX // struct Complex: Traversal::Complex { - virtual Void + virtual void traverse (Type& c) { if (c.contains_compositor_p ()) { - UnsignedLong all (0), choice (0), sequence (0), depth (0); + size_t all (0), choice (0), sequence (0), depth (0); Particle t (all, choice, sequence, depth); t.dispatch (c.contains_compositor ().compositor ()); @@ -296,7 +297,7 @@ namespace CXX }; } - Void StateProcessor:: + void StateProcessor:: process (SemanticGraph::Schema& tu, SemanticGraph::Path const&) { Traversal::Schema schema; diff --git a/xsd/cxx/parser/state-processor.hxx b/xsd/cxx/parser/state-processor.hxx index c243f9d..3321582 100644 --- a/xsd/cxx/parser/state-processor.hxx +++ b/xsd/cxx/parser/state-processor.hxx @@ -6,19 +6,18 @@ #ifndef CXX_PARSER_STATE_PROCESSOR_HXX #define CXX_PARSER_STATE_PROCESSOR_HXX -#include #include +#include + namespace CXX { namespace Parser { - using namespace Cult::Types; - class StateProcessor { public: - Void + void process (XSDFrontend::SemanticGraph::Schema&, XSDFrontend::SemanticGraph::Path const& file); }; diff --git a/xsd/cxx/parser/type-processor.cxx b/xsd/cxx/parser/type-processor.cxx index 1fefeb3..fa60b3c 100644 --- a/xsd/cxx/parser/type-processor.cxx +++ b/xsd/cxx/parser/type-processor.cxx @@ -3,7 +3,7 @@ // copyright : Copyright (c) 2006-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -#include +#include #include #include @@ -11,6 +11,8 @@ #include #include +using namespace std; + namespace CXX { namespace Parser @@ -29,14 +31,14 @@ namespace CXX { Type (SemanticGraph::Schema& schema, TypeMap::Namespaces& type_map, - Boolean add_includes) + bool add_includes) : schema_ (schema), type_map_ (type_map), add_includes_ (add_includes) { } - virtual Void + virtual void traverse (SemanticGraph::Type& type) { using TypeMap::Namespace; @@ -54,7 +56,7 @@ namespace CXX // match the type in order to add include directives to the // new root schema. // - Boolean set (true); + bool set (true); if (tc.count ("ret-type")) { @@ -75,12 +77,12 @@ namespace CXX //std::wcerr << "traversing: " << ns_name << "#" << t_name << endl; - for (Namespaces::ConstIterator n (type_map_.begin ()); + for (Namespaces::const_iterator n (type_map_.begin ()); n != type_map_.end (); ++n) { // Check if the namespace matches. // - Boolean ns_match; + bool ns_match; if (!n->xsd_name ().empty ()) { @@ -143,7 +145,7 @@ namespace CXX arg_type = ret_type; else { - WideChar last (ret_type[ret_type.size () - 1]); + wchar_t last (ret_type[ret_type.size () - 1]); // If it is already a pointer or reference then use // it as is. @@ -170,7 +172,7 @@ namespace CXX { if (n->includes_begin () != n->includes_end ()) { - typedef Cult::Containers::Set Includes; + typedef std::set Includes; if (!schema_.context ().count ("includes")) schema_.context ().set ("includes", Includes ()); @@ -196,7 +198,7 @@ namespace CXX private: SemanticGraph::Schema& schema_; TypeMap::Namespaces& type_map_; - Boolean add_includes_; + bool add_includes_; }; @@ -209,7 +211,7 @@ namespace CXX { GlobalType (SemanticGraph::Schema& schema, TypeMap::Namespaces& type_map, - Boolean add_includes) + bool add_includes) : type_ (schema, type_map, add_includes) { inherits_ >> type_; @@ -217,20 +219,20 @@ namespace CXX argumented_ >> type_; } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { type_.traverse (t); } - virtual Void + virtual void traverse (SemanticGraph::List& l) { type_.traverse (l); Traversal::List::argumented (l, argumented_); } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { type_.traverse (c); @@ -238,7 +240,7 @@ namespace CXX Complex::names (c, names_); } - virtual Void + virtual void traverse (SemanticGraph::Enumeration& e) { type_.traverse (e); @@ -254,10 +256,10 @@ namespace CXX Traversal::Argumented argumented_; }; - Void + void process_impl (options const& ops, XSDFrontend::SemanticGraph::Schema& tu, - Boolean gen_driver, + bool gen_driver, TypeMap::Namespaces& type_map) { if (tu.names_begin ()->named ().name () == @@ -281,7 +283,7 @@ namespace CXX // If --extern-xml-schema is specified, then we don't want // includes from the XML Schema type map. // - Boolean extern_xml_schema (ops.extern_xml_schema ()); + bool extern_xml_schema (ops.extern_xml_schema ()); // // @@ -341,10 +343,10 @@ namespace CXX } } - Void TypeProcessor:: + void TypeProcessor:: process (options const& ops, XSDFrontend::SemanticGraph::Schema& s, - Boolean gen_driver, + bool gen_driver, TypeMap::Namespaces& tm) { process_impl (ops, s, gen_driver, tm); diff --git a/xsd/cxx/parser/type-processor.hxx b/xsd/cxx/parser/type-processor.hxx index 2165846..2889138 100644 --- a/xsd/cxx/parser/type-processor.hxx +++ b/xsd/cxx/parser/type-processor.hxx @@ -6,10 +6,10 @@ #ifndef CXX_PARSER_TYPE_PROCESSOR_HXX #define CXX_PARSER_TYPE_PROCESSOR_HXX -#include - #include +#include + #include #include @@ -18,17 +18,15 @@ namespace CXX { namespace Parser { - using namespace Cult::Types; - class TypeProcessor { public: TypeProcessor (); // Dummy ctor, helps with long symbols on HP-UX. - Void + void process (options const&, XSDFrontend::SemanticGraph::Schema&, - Boolean gen_driver, + bool gen_driver, TypeMap::Namespaces&); }; } diff --git a/xsd/cxx/parser/validator.cxx b/xsd/cxx/parser/validator.cxx index 96110f1..e808e27 100644 --- a/xsd/cxx/parser/validator.cxx +++ b/xsd/cxx/parser/validator.cxx @@ -3,6 +3,9 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include +#include + #include #include @@ -10,9 +13,7 @@ #include -#include - -using std::wcerr; +using namespace std; namespace CXX { @@ -27,7 +28,7 @@ namespace CXX SemanticGraph::Path const& path, Parser::options const& ops, const WarningSet& disabled_warnings, - Boolean& valid_) + bool& valid_) : Context (std::wcerr, root, path, ops, 0, 0, 0, 0), disabled_warnings_ (disabled_warnings), disabled_warnings_all_ (false), @@ -38,8 +39,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 (); @@ -74,10 +75,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_; }; // @@ -98,20 +99,20 @@ namespace CXX { } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (skip (e)) return; using SemanticGraph::Any; - Boolean q (e.qualified_p ()); + bool q (e.qualified_p ()); String ns (q ? e.namespace_ ().name () : ""); for (Any::NamespaceIterator i (any_.namespace_begin ()); i != any_.namespace_end (); ++i) { - Boolean failed (false); + bool failed (false); if (*i == L"##any") { @@ -184,14 +185,14 @@ namespace CXX { } - virtual Void + virtual void post (Type& c) { // Go down the inheritance hierarchy. // if (down_) { - Boolean up = up_; + bool up = up_; up_ = false; if (c.inherits_p ()) @@ -204,7 +205,7 @@ namespace CXX // if (up_) { - Boolean down = down_; + bool down = down_; down_ = false; for (Type::BegetsIterator i (c.begets_begin ()); @@ -218,10 +219,10 @@ namespace CXX } private: - Boolean up_, down_; + bool up_, down_; }; - virtual Void + virtual void traverse (SemanticGraph::Any& a) { using SemanticGraph::Compositor; @@ -273,7 +274,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { using SemanticGraph::Schema; @@ -319,7 +320,7 @@ namespace CXX Complex::traverse (c); } - virtual Void + virtual void traverse (SemanticGraph::Type& t) { if (t.named_p ()) @@ -328,7 +329,7 @@ namespace CXX } } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (is_disabled ("P002")) @@ -352,7 +353,7 @@ namespace CXX // Return true if root sources s. // - Boolean + bool sources_p (SemanticGraph::Schema& root, SemanticGraph::Schema& s) { using SemanticGraph::Schema; @@ -372,7 +373,7 @@ namespace CXX } private: - Containers::Set types_; + set types_; Sources sources_; @@ -405,7 +406,7 @@ namespace CXX *this >> names_; } - Boolean + bool traverse_common (SemanticGraph::Member& m) { SemanticGraph::Type& t (m.type ()); @@ -446,7 +447,7 @@ namespace CXX return false; } - virtual Void + virtual void traverse (SemanticGraph::Element& e) { if (skip (e)) return; @@ -464,7 +465,7 @@ namespace CXX Traversal::Element::traverse (e); } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { if (traverse_common (a)) @@ -481,9 +482,9 @@ namespace CXX } private: - Boolean anonymous_error_issued_; + bool anonymous_error_issued_; - Containers::Set types_; + set types_; Sources sources_; @@ -500,7 +501,7 @@ namespace CXX { } - virtual Void + virtual void traverse (Type& e) { if (!valid) @@ -550,14 +551,14 @@ namespace CXX // Dummy ctor, helps with long symbols on HP-UX. } - Boolean Validator:: + bool Validator:: validate (options const& ops, SemanticGraph::Schema& root, SemanticGraph::Path const& path, - Boolean gen_driver, + bool gen_driver, const WarningSet& disabled_warnings) { - Boolean valid (true); + bool valid (true); ValidationContext ctx (root, path, ops, disabled_warnings, valid); // @@ -629,9 +630,9 @@ namespace CXX // // { - Boolean ref (ops.root_element_first ()); - Boolean rel (ops.root_element_last ()); - Boolean re (ops.root_element ()); + bool ref (ops.root_element_first ()); + bool rel (ops.root_element_last ()); + bool re (ops.root_element ()); if ((ref && rel) || (ref && re) || (rel && re)) { @@ -646,8 +647,8 @@ namespace CXX // // - Boolean import_maps (ops.import_maps ()); - Boolean export_maps (ops.export_maps ()); + bool import_maps (ops.import_maps ()); + bool export_maps (ops.export_maps ()); if (import_maps && export_maps) { diff --git a/xsd/cxx/parser/validator.hxx b/xsd/cxx/parser/validator.hxx index 35c13fc..036e38c 100644 --- a/xsd/cxx/parser/validator.hxx +++ b/xsd/cxx/parser/validator.hxx @@ -6,27 +6,26 @@ #ifndef CXX_PARSER_VALIDATOR_HXX #define CXX_PARSER_VALIDATOR_HXX +#include +#include + #include #include -#include - namespace CXX { namespace Parser { - using namespace Cult::Types; - class Validator { public: Validator (); // Dummy ctor, helps with long symbols on HP-UX. - Boolean + bool validate (options const&, SemanticGraph::Schema&, SemanticGraph::Path const& tu, - Boolean gen_driver, + bool gen_driver, const WarningSet& disabled_warnings); }; } -- cgit v1.1