aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx/parser/validator.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-22 11:50:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-22 11:50:03 +0200
commit54110801525371740298d5cae378bfc778749935 (patch)
treef0f125135b2a1bcf1eea49a559b49d00ea25d879 /xsd/cxx/parser/validator.cxx
parent3f4a7a6b2a3b708ea69b980494f6e49eb0c02ebc (diff)
Get rid of dependency on libcult
Diffstat (limited to 'xsd/cxx/parser/validator.cxx')
-rw-r--r--xsd/cxx/parser/validator.cxx75
1 files changed, 38 insertions, 37 deletions
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 <set>
+#include <iostream>
+
#include <cxx/parser/validator.hxx>
#include <xsd-frontend/semantic-graph.hxx>
@@ -10,9 +13,7 @@
#include <cxx/parser/elements.hxx>
-#include <iostream>
-
-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<String> types_;
+ set<String> 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<String> types_;
+ set<String> 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)
{