aboutsummaryrefslogtreecommitdiff
path: root/xsd-frontend/transformations
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-05-09 17:23:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-05-09 17:23:47 +0200
commit90801c5afeb37e4297076bdd5354ba41a7009a3f (patch)
tree98960b76e80c46814f38d345c63d9fb6edcc5f22 /xsd-frontend/transformations
parentcf2783f792ee634ffbbb36311c9f69956b1d107e (diff)
Use standard types instead of ones from libcult
Diffstat (limited to 'xsd-frontend/transformations')
-rw-r--r--xsd-frontend/transformations/anonymous.cxx68
-rw-r--r--xsd-frontend/transformations/anonymous.hxx4
-rw-r--r--xsd-frontend/transformations/enum-synthesis.cxx8
-rw-r--r--xsd-frontend/transformations/enum-synthesis.hxx2
-rw-r--r--xsd-frontend/transformations/restriction.cxx20
-rw-r--r--xsd-frontend/transformations/restriction.hxx2
-rw-r--r--xsd-frontend/transformations/schema-per-type.cxx34
-rw-r--r--xsd-frontend/transformations/schema-per-type.hxx4
-rw-r--r--xsd-frontend/transformations/simplifier.cxx14
-rw-r--r--xsd-frontend/transformations/simplifier.hxx2
10 files changed, 79 insertions, 79 deletions
diff --git a/xsd-frontend/transformations/anonymous.cxx b/xsd-frontend/transformations/anonymous.cxx
index 9dcbf45..afaf66a 100644
--- a/xsd-frontend/transformations/anonymous.cxx
+++ b/xsd-frontend/transformations/anonymous.cxx
@@ -32,12 +32,12 @@ namespace XSDFrontend
Traversal::Any,
Traversal::AnyAttribute
{
- CompareMembers (SemanticGraph::Nameable& m, Boolean& r)
+ CompareMembers (SemanticGraph::Nameable& m, bool& r)
: member_ (m), result_ (r)
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Element& x)
{
using SemanticGraph::Element;
@@ -52,7 +52,7 @@ namespace XSDFrontend
traverse_member (x);
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Attribute& x)
{
using SemanticGraph::Attribute;
@@ -67,7 +67,7 @@ namespace XSDFrontend
traverse_member (x);
}
- virtual Void
+ virtual void
traverse_member (SemanticGraph::Member& x)
{
using SemanticGraph::Member;
@@ -108,13 +108,13 @@ namespace XSDFrontend
result_ = true;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Any&)
{
//@@ TODO
}
- virtual Void
+ virtual void
traverse (SemanticGraph::AnyAttribute&)
{
//@@ TODO
@@ -122,7 +122,7 @@ namespace XSDFrontend
private:
SemanticGraph::Nameable& member_;
- Boolean& result_;
+ bool& result_;
};
// Compare two types for structural equality.
@@ -132,13 +132,13 @@ namespace XSDFrontend
Traversal::Enumeration,
Traversal::Complex
{
- CompareTypes (SemanticGraph::Type& t, Boolean& r)
+ CompareTypes (SemanticGraph::Type& t, bool& r)
: type_ (t), result_ (r)
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::List&)
{
using SemanticGraph::List;
@@ -146,7 +146,7 @@ namespace XSDFrontend
//List& y (dynamic_cast<List&> (type_));
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Union& x)
{
using SemanticGraph::Union;
@@ -168,7 +168,7 @@ namespace XSDFrontend
result_ = true;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Enumeration& x)
{
using SemanticGraph::Enumeration;
@@ -207,7 +207,7 @@ namespace XSDFrontend
result_ = true;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& x)
{
using SemanticGraph::Complex;
@@ -261,7 +261,7 @@ namespace XSDFrontend
if (typeid (ix->named ()) != typeid (iy->named ()))
return;
- Boolean equal (false);
+ bool equal (false);
CompareMembers t (iy->named (), equal);
t.dispatch (ix->named ());
@@ -277,7 +277,7 @@ namespace XSDFrontend
private:
SemanticGraph::Type& type_;
- Boolean& result_;
+ bool& result_;
};
//
@@ -288,7 +288,7 @@ namespace XSDFrontend
Context (SemanticGraph::Schema& schema_,
SemanticGraph::Path const& file,
AnonymousNameTranslator& trans_,
- Boolean du)
+ bool du)
: schema_path_ (file),
ns_ (0),
failed_ (false),
@@ -321,7 +321,7 @@ namespace XSDFrontend
if (typeid (x) != typeid (y))
return false;
- Boolean r (false);
+ bool r (false);
CompareTypes t (y, r);
t.dispatch (x);
return r;
@@ -450,17 +450,17 @@ namespace XSDFrontend
private:
SemanticGraph::Path const schema_path_;
SemanticGraph::Namespace* ns_;
- Boolean failed_;
+ bool failed_;
public:
AnonymousNameTranslator& trans;
- Boolean detect_unstable;
+ bool detect_unstable;
public:
SemanticGraph::Schema& schema;
SemanticGraph::Path const& schema_path;
SemanticGraph::Namespace*& ns;
- Boolean& failed;
+ bool& failed;
};
@@ -469,7 +469,7 @@ namespace XSDFrontend
//
struct Uses: Traversal::Uses
{
- virtual Void
+ virtual void
traverse (Type& u)
{
SemanticGraph::Schema& s (u.schema ());
@@ -491,13 +491,13 @@ namespace XSDFrontend
{
}
- Void
+ void
pre (SemanticGraph::Namespace& ns)
{
ns_ = &ns;
}
- Void
+ void
post (SemanticGraph::Namespace&)
{
ns_ = 0;
@@ -519,7 +519,7 @@ namespace XSDFrontend
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::List& l)
{
SemanticGraph::Type& t (l.argumented ().type ());
@@ -555,7 +555,7 @@ namespace XSDFrontend
// Make sure the name is unique.
//
- UnsignedLong n (1);
+ unsigned long n (1);
String escaped (name);
while (conflict (escaped))
@@ -597,7 +597,7 @@ namespace XSDFrontend
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Union& u)
{
String file_str;
@@ -639,7 +639,7 @@ namespace XSDFrontend
// Make sure the name is unique.
//
- UnsignedLong n (1);
+ unsigned long n (1);
String escaped (name);
while (conflict (escaped))
@@ -682,7 +682,7 @@ namespace XSDFrontend
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
if (!c.inherits_p ())
@@ -721,7 +721,7 @@ namespace XSDFrontend
// Make sure the name is unique.
//
- UnsignedLong n (1);
+ unsigned long n (1);
String escaped (name);
while (conflict (escaped))
@@ -776,7 +776,7 @@ namespace XSDFrontend
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Element& e)
{
SemanticGraph::Type& t (e.type ());
@@ -819,7 +819,7 @@ namespace XSDFrontend
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Attribute& a)
{
SemanticGraph::Type& t (a.type ());
@@ -862,7 +862,7 @@ namespace XSDFrontend
}
}
- Void
+ void
traverse_ (SemanticGraph::Member& m)
{
using SemanticGraph::Type;
@@ -918,7 +918,7 @@ namespace XSDFrontend
// Check if this name conflicts.
//
- UnsignedLong n (1);
+ unsigned long n (1);
String escaped (name);
while (SemanticGraph::Type* other = conflict (escaped))
@@ -965,10 +965,10 @@ namespace XSDFrontend
{
}
- Void Anonymous::
+ void Anonymous::
transform (SemanticGraph::Schema& s,
SemanticGraph::Path const& f,
- Boolean duc)
+ bool duc)
{
Context ctx (s, f, trans_, duc);
diff --git a/xsd-frontend/transformations/anonymous.hxx b/xsd-frontend/transformations/anonymous.hxx
index 285a468..992b7ff 100644
--- a/xsd-frontend/transformations/anonymous.hxx
+++ b/xsd-frontend/transformations/anonymous.hxx
@@ -46,10 +46,10 @@ namespace XSDFrontend
Anonymous (AnonymousNameTranslator&);
- Void
+ void
transform (SemanticGraph::Schema&,
SemanticGraph::Path const&,
- Boolean detect_unstable_conflicts);
+ bool detect_unstable_conflicts);
private:
AnonymousNameTranslator& trans_;
diff --git a/xsd-frontend/transformations/enum-synthesis.cxx b/xsd-frontend/transformations/enum-synthesis.cxx
index 165d162..c1ef5a7 100644
--- a/xsd-frontend/transformations/enum-synthesis.cxx
+++ b/xsd-frontend/transformations/enum-synthesis.cxx
@@ -28,7 +28,7 @@ namespace XSDFrontend
{
}
- virtual Void
+ virtual void
traverse (Type& e)
{
String const& name (e.name ());
@@ -64,7 +64,7 @@ namespace XSDFrontend
{
}
- virtual Void
+ virtual void
traverse (Type& u)
{
using SemanticGraph::Enumeration;
@@ -208,7 +208,7 @@ namespace XSDFrontend
//
struct Uses: Traversal::Uses
{
- virtual Void
+ virtual void
traverse (Type& u)
{
SemanticGraph::Schema& s (u.schema ());
@@ -224,7 +224,7 @@ namespace XSDFrontend
namespace Transformations
{
- Void EnumSynthesis::
+ void EnumSynthesis::
transform (SemanticGraph::Schema& s, SemanticGraph::Path const&)
{
Traversal::Schema schema;
diff --git a/xsd-frontend/transformations/enum-synthesis.hxx b/xsd-frontend/transformations/enum-synthesis.hxx
index e21fd7e..97658a3 100644
--- a/xsd-frontend/transformations/enum-synthesis.hxx
+++ b/xsd-frontend/transformations/enum-synthesis.hxx
@@ -24,7 +24,7 @@ namespace XSDFrontend
class EnumSynthesis
{
public:
- Void
+ void
transform (SemanticGraph::Schema&, SemanticGraph::Path const&);
};
}
diff --git a/xsd-frontend/transformations/restriction.cxx b/xsd-frontend/transformations/restriction.cxx
index 8b3bac7..dae1f03 100644
--- a/xsd-frontend/transformations/restriction.cxx
+++ b/xsd-frontend/transformations/restriction.cxx
@@ -33,7 +33,7 @@ namespace XSDFrontend
{
}
- virtual Void
+ virtual void
traverse (Type& c)
{
using namespace SemanticGraph;
@@ -152,7 +152,7 @@ namespace XSDFrontend
}
private:
- Void
+ void
handle (SemanticGraph::Particle& r, SemanticGraph::Particle& b)
{
using namespace SemanticGraph;
@@ -214,7 +214,7 @@ namespace XSDFrontend
}
}
- Boolean
+ bool
match (SemanticGraph::Particle& r, SemanticGraph::Particle& b)
{
using namespace SemanticGraph;
@@ -281,7 +281,7 @@ namespace XSDFrontend
return false;
}
- Void
+ void
merge_attributes (SemanticGraph::Complex& c,
SemanticGraph::Complex& base)
{
@@ -363,7 +363,7 @@ namespace XSDFrontend
}
}
- Void
+ void
handle_any_attributes (SemanticGraph::Complex& c, BaseList& bl)
{
using namespace SemanticGraph;
@@ -459,7 +459,7 @@ namespace XSDFrontend
public:
- virtual Void
+ virtual void
traverse (SemanticGraph::Element& e)
{
SemanticGraph::Type& t (e.type ());
@@ -478,7 +478,7 @@ namespace XSDFrontend
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Attribute& a)
{
SemanticGraph::Type& t (a.type ());
@@ -506,7 +506,7 @@ namespace XSDFrontend
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
if (d1_)
@@ -531,7 +531,7 @@ namespace XSDFrontend
//
struct Uses: Traversal::Uses
{
- virtual Void
+ virtual void
traverse (Type& u)
{
SemanticGraph::Schema& s (u.schema ());
@@ -547,7 +547,7 @@ namespace XSDFrontend
namespace Transformations
{
- Void Restriction::
+ void Restriction::
transform (SemanticGraph::Schema& s, SemanticGraph::Path const&)
{
Traversal::Schema schema;
diff --git a/xsd-frontend/transformations/restriction.hxx b/xsd-frontend/transformations/restriction.hxx
index 1c92681..8cf4cd8 100644
--- a/xsd-frontend/transformations/restriction.hxx
+++ b/xsd-frontend/transformations/restriction.hxx
@@ -30,7 +30,7 @@ namespace XSDFrontend
public:
struct Failed {};
- Void
+ void
transform (SemanticGraph::Schema&, SemanticGraph::Path const&);
};
}
diff --git a/xsd-frontend/transformations/schema-per-type.cxx b/xsd-frontend/transformations/schema-per-type.cxx
index 9c7be34..69b43ca 100644
--- a/xsd-frontend/transformations/schema-per-type.cxx
+++ b/xsd-frontend/transformations/schema-per-type.cxx
@@ -36,7 +36,7 @@ namespace XSDFrontend
//
struct FileComparator
{
- Boolean
+ bool
operator() (NarrowString const& x, NarrowString const& y) const
{
return strcasecmp (x.c_str (), y.c_str ()) < 0;
@@ -60,7 +60,7 @@ namespace XSDFrontend
xsd_ = 0;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Includes& i)
{
SemanticGraph::Schema& s (i.schema ());
@@ -73,7 +73,7 @@ namespace XSDFrontend
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Imports& i)
{
SemanticGraph::Schema& s (i.schema ());
@@ -86,7 +86,7 @@ namespace XSDFrontend
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Implies& i)
{
if (xsd_ == 0)
@@ -98,13 +98,13 @@ namespace XSDFrontend
SemanticGraph::Schema*& xsd_;
};
- Void
+ void
process_schema (SemanticGraph::Schema& s,
SemanticGraph::Schema& root,
SemanticGraph::Schema& xsd,
TypeSchemaMap& tsm,
FileSet& file_set,
- Boolean fat_type_file,
+ bool fat_type_file,
Transformations::SchemaPerTypeTranslator& trans)
{
using namespace SemanticGraph;
@@ -155,7 +155,7 @@ namespace XSDFrontend
//
NarrowString file_name (base);
- for (UnsignedLong i (1);
+ for (unsigned long i (1);
file_set.find (file_name) != file_set.end ();
++i)
{
@@ -261,7 +261,7 @@ namespace XSDFrontend
*this >> names_ >> *this;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::List& l)
{
// Treat item type as base type since it is impossible
@@ -271,7 +271,7 @@ namespace XSDFrontend
set_dep (t, false);
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
if (c.inherits_p ())
@@ -280,22 +280,22 @@ namespace XSDFrontend
Traversal::Complex::names (c);
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Member& m)
{
SemanticGraph::Type& t (m.type ());
- Boolean weak (
+ bool weak (
by_value_key_ == 0 ||
!t.context ().count (by_value_key_) ||
- !t.context ().get<Boolean> (by_value_key_));
+ !t.context ().get<bool> (by_value_key_));
set_dep (t, weak);
}
private:
- Void
- set_dep (SemanticGraph::Type& t, Boolean weak)
+ void
+ set_dep (SemanticGraph::Type& t, bool weak)
{
using namespace SemanticGraph;
@@ -345,7 +345,7 @@ namespace XSDFrontend
{
SchemaPerType::
SchemaPerType (SchemaPerTypeTranslator& trans,
- Boolean fat,
+ bool fat,
Char const* key)
: fat_type_file_ (fat), by_value_key_ (key), trans_ (trans)
{
@@ -402,7 +402,7 @@ namespace XSDFrontend
NarrowString tf (trans_.translate_schema (abs_path));
NarrowString file (tf ? tf : path.leaf ());
- Size p (file.rfind ('.'));
+ size_t p (file.rfind ('.'));
NarrowString ext (
p != NarrowString::npos ? NarrowString (file, p) : "");
@@ -413,7 +413,7 @@ namespace XSDFrontend
//
NarrowString new_name (base);
- for (UnsignedLong n (1);
+ for (unsigned long n (1);
file_set.find (new_name) != file_set.end ();
++n)
{
diff --git a/xsd-frontend/transformations/schema-per-type.hxx b/xsd-frontend/transformations/schema-per-type.hxx
index 65499a2..6e034d6 100644
--- a/xsd-frontend/transformations/schema-per-type.hxx
+++ b/xsd-frontend/transformations/schema-per-type.hxx
@@ -48,14 +48,14 @@ namespace XSDFrontend
// for this type is included "strongly".
//
SchemaPerType (SchemaPerTypeTranslator&,
- Boolean fat_type_file,
+ bool fat_type_file,
Char const* by_value_key = 0);
std::vector<SemanticGraph::Schema*>
transform (SemanticGraph::Schema&);
private:
- Boolean fat_type_file_;
+ bool fat_type_file_;
Char const* by_value_key_;
SchemaPerTypeTranslator& trans_;
};
diff --git a/xsd-frontend/transformations/simplifier.cxx b/xsd-frontend/transformations/simplifier.cxx
index c87779b..ba6b04f 100644
--- a/xsd-frontend/transformations/simplifier.cxx
+++ b/xsd-frontend/transformations/simplifier.cxx
@@ -23,7 +23,7 @@ namespace XSDFrontend
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::All& a)
{
// The all compositor cannot contain compositors.
@@ -32,7 +32,7 @@ namespace XSDFrontend
remove (a);
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Choice& c)
{
// Do the depth-first traversal so that we take into account
@@ -52,7 +52,7 @@ namespace XSDFrontend
remove (c);
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Sequence& s)
{
// Do the depth-first traversal so that we take into account
@@ -71,7 +71,7 @@ namespace XSDFrontend
}
private:
- virtual Void
+ virtual void
remove (SemanticGraph::Compositor& c)
{
using SemanticGraph::Node;
@@ -104,7 +104,7 @@ namespace XSDFrontend
//
struct Type: Traversal::Complex
{
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
if (c.contains_compositor_p ())
@@ -117,7 +117,7 @@ namespace XSDFrontend
//
struct Uses: Traversal::Uses
{
- virtual Void
+ virtual void
traverse (Type& u)
{
SemanticGraph::Schema& s (u.schema ());
@@ -133,7 +133,7 @@ namespace XSDFrontend
namespace Transformations
{
- Void Simplifier::
+ void Simplifier::
transform (SemanticGraph::Schema& s, SemanticGraph::Path const&)
{
Traversal::Schema schema;
diff --git a/xsd-frontend/transformations/simplifier.hxx b/xsd-frontend/transformations/simplifier.hxx
index 9485041..44a3429 100644
--- a/xsd-frontend/transformations/simplifier.hxx
+++ b/xsd-frontend/transformations/simplifier.hxx
@@ -24,7 +24,7 @@ namespace XSDFrontend
class Simplifier
{
public:
- Void
+ void
transform (SemanticGraph::Schema&, SemanticGraph::Path const&);
};
}