From bada6666c70977a058755ccf232e7d67b24adeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:21:29 +0200 Subject: New upstream release --- .../xsd-frontend/transformations/restriction.cxx | 56 ++++++++++------------ 1 file changed, 25 insertions(+), 31 deletions(-) (limited to 'libxsd-frontend/xsd-frontend/transformations/restriction.cxx') diff --git a/libxsd-frontend/xsd-frontend/transformations/restriction.cxx b/libxsd-frontend/xsd-frontend/transformations/restriction.cxx index c58d98f..edd74be 100644 --- a/libxsd-frontend/xsd-frontend/transformations/restriction.cxx +++ b/libxsd-frontend/xsd-frontend/transformations/restriction.cxx @@ -1,27 +1,21 @@ // file : xsd-frontend/transformations/restriction.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -#include +#include +#include #include #include -#include - -#include +#include -using std::wcerr; -using std::endl; +using namespace std; namespace XSDFrontend { - using namespace Cult; - - typedef WideString String; typedef Transformations::Restriction::Failed Failed; - typedef Containers::Vector BaseList; + typedef std::vector BaseList; namespace { @@ -34,7 +28,7 @@ namespace XSDFrontend { } - virtual Void + virtual void traverse (Type& c) { using namespace SemanticGraph; @@ -107,7 +101,7 @@ namespace XSDFrontend else { Compositor::ContainsIterator i (root.contains_begin ()); - BaseList::ReverseIterator j (base_model.rbegin ()); + BaseList::reverse_iterator j (base_model.rbegin ()); for (; i != root.contains_end (); ++i, ++j) { @@ -153,7 +147,7 @@ namespace XSDFrontend } private: - Void + void handle (SemanticGraph::Particle& r, SemanticGraph::Particle& b) { using namespace SemanticGraph; @@ -215,7 +209,7 @@ namespace XSDFrontend } } - Boolean + bool match (SemanticGraph::Particle& r, SemanticGraph::Particle& b) { using namespace SemanticGraph; @@ -282,7 +276,7 @@ namespace XSDFrontend return false; } - Void + void merge_attributes (SemanticGraph::Complex& c, SemanticGraph::Complex& base) { @@ -364,12 +358,12 @@ namespace XSDFrontend } } - Void + void handle_any_attributes (SemanticGraph::Complex& c, BaseList& bl) { using namespace SemanticGraph; - BaseList::ReverseIterator bi (bl.rbegin ()), be (bl.rend ()); + BaseList::reverse_iterator bi (bl.rbegin ()), be (bl.rend ()); Scope::NamesIterator si; if (bi != be) @@ -432,14 +426,14 @@ namespace XSDFrontend struct Anonymous : Traversal::Element, Traversal::Attribute { - Anonymous (Traversal::NodeDispatcherBase& d1) + Anonymous (Traversal::NodeDispatcher& d1) : complex_ (&d1, 0) { *this >> belongs_ >> complex_; } - Anonymous (Traversal::NodeDispatcherBase& d1, - Traversal::NodeDispatcherBase& d2) + Anonymous (Traversal::NodeDispatcher& d1, + Traversal::NodeDispatcher& d2) : complex_ (&d1, &d2) { *this >> belongs_ >> complex_; @@ -460,7 +454,7 @@ namespace XSDFrontend public: - virtual Void + virtual void traverse (SemanticGraph::Element& e) { SemanticGraph::Type& t (e.type ()); @@ -479,7 +473,7 @@ namespace XSDFrontend } } - virtual Void + virtual void traverse (SemanticGraph::Attribute& a) { SemanticGraph::Type& t (a.type ()); @@ -501,13 +495,13 @@ namespace XSDFrontend private: struct Complex : Traversal::Complex { - Complex (Traversal::NodeDispatcherBase* d1, - Traversal::NodeDispatcherBase* d2) + Complex (Traversal::NodeDispatcher* d1, + Traversal::NodeDispatcher* d2) : d1_ (d1), d2_ (d2) { } - virtual Void + virtual void traverse (SemanticGraph::Complex& c) { if (d1_) @@ -518,8 +512,8 @@ namespace XSDFrontend } private: - Traversal::NodeDispatcherBase* d1_; - Traversal::NodeDispatcherBase* d2_; + Traversal::NodeDispatcher* d1_; + Traversal::NodeDispatcher* d2_; } complex_; @@ -532,7 +526,7 @@ namespace XSDFrontend // struct Uses: Traversal::Uses { - virtual Void + virtual void traverse (Type& u) { SemanticGraph::Schema& s (u.schema ()); @@ -548,7 +542,7 @@ namespace XSDFrontend namespace Transformations { - Void Restriction:: + void Restriction:: transform (SemanticGraph::Schema& s, SemanticGraph::Path const&) { Traversal::Schema schema; -- cgit v1.2.3