From 949a9f572341b6cd07690f0b78b1b1941d320055 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 15 Dec 2020 22:23:46 +0300 Subject: Switch to build2 --- xsd-frontend/semantic-graph/annotation.cxx | 44 - xsd-frontend/semantic-graph/annotation.hxx | 74 -- xsd-frontend/semantic-graph/any-attribute.cxx | 110 --- xsd-frontend/semantic-graph/any-attribute.hxx | 79 -- xsd-frontend/semantic-graph/any.cxx | 121 --- xsd-frontend/semantic-graph/any.hxx | 84 -- xsd-frontend/semantic-graph/attribute-group.cxx | 33 - xsd-frontend/semantic-graph/attribute-group.hxx | 23 - xsd-frontend/semantic-graph/attribute.cxx | 40 - xsd-frontend/semantic-graph/attribute.hxx | 35 - xsd-frontend/semantic-graph/complex.cxx | 44 - xsd-frontend/semantic-graph/complex.hxx | 93 --- xsd-frontend/semantic-graph/compositors.cxx | 99 --- xsd-frontend/semantic-graph/compositors.hxx | 233 ------ xsd-frontend/semantic-graph/element-group.cxx | 33 - xsd-frontend/semantic-graph/element-group.hxx | 41 - xsd-frontend/semantic-graph/element.cxx | 52 -- xsd-frontend/semantic-graph/element.hxx | 93 --- xsd-frontend/semantic-graph/elements.cxx | 299 ------- xsd-frontend/semantic-graph/elements.hxx | 1003 ----------------------- xsd-frontend/semantic-graph/enumeration.cxx | 58 -- xsd-frontend/semantic-graph/enumeration.hxx | 29 - xsd-frontend/semantic-graph/fundamental.cxx.m4 | 209 ----- xsd-frontend/semantic-graph/fundamental.hxx.m4 | 153 ---- xsd-frontend/semantic-graph/fundamental.m4 | 16 - xsd-frontend/semantic-graph/list.cxx | 33 - xsd-frontend/semantic-graph/list.hxx | 21 - xsd-frontend/semantic-graph/namespace.cxx | 33 - xsd-frontend/semantic-graph/namespace.hxx | 26 - xsd-frontend/semantic-graph/particle.cxx | 53 -- xsd-frontend/semantic-graph/particle.hxx | 139 ---- xsd-frontend/semantic-graph/schema.cxx | 129 --- xsd-frontend/semantic-graph/schema.hxx | 236 ------ xsd-frontend/semantic-graph/union.cxx | 33 - xsd-frontend/semantic-graph/union.hxx | 21 - 35 files changed, 3822 deletions(-) delete mode 100644 xsd-frontend/semantic-graph/annotation.cxx delete mode 100644 xsd-frontend/semantic-graph/annotation.hxx delete mode 100644 xsd-frontend/semantic-graph/any-attribute.cxx delete mode 100644 xsd-frontend/semantic-graph/any-attribute.hxx delete mode 100644 xsd-frontend/semantic-graph/any.cxx delete mode 100644 xsd-frontend/semantic-graph/any.hxx delete mode 100644 xsd-frontend/semantic-graph/attribute-group.cxx delete mode 100644 xsd-frontend/semantic-graph/attribute-group.hxx delete mode 100644 xsd-frontend/semantic-graph/attribute.cxx delete mode 100644 xsd-frontend/semantic-graph/attribute.hxx delete mode 100644 xsd-frontend/semantic-graph/complex.cxx delete mode 100644 xsd-frontend/semantic-graph/complex.hxx delete mode 100644 xsd-frontend/semantic-graph/compositors.cxx delete mode 100644 xsd-frontend/semantic-graph/compositors.hxx delete mode 100644 xsd-frontend/semantic-graph/element-group.cxx delete mode 100644 xsd-frontend/semantic-graph/element-group.hxx delete mode 100644 xsd-frontend/semantic-graph/element.cxx delete mode 100644 xsd-frontend/semantic-graph/element.hxx delete mode 100644 xsd-frontend/semantic-graph/elements.cxx delete mode 100644 xsd-frontend/semantic-graph/elements.hxx delete mode 100644 xsd-frontend/semantic-graph/enumeration.cxx delete mode 100644 xsd-frontend/semantic-graph/enumeration.hxx delete mode 100644 xsd-frontend/semantic-graph/fundamental.cxx.m4 delete mode 100644 xsd-frontend/semantic-graph/fundamental.hxx.m4 delete mode 100644 xsd-frontend/semantic-graph/fundamental.m4 delete mode 100644 xsd-frontend/semantic-graph/list.cxx delete mode 100644 xsd-frontend/semantic-graph/list.hxx delete mode 100644 xsd-frontend/semantic-graph/namespace.cxx delete mode 100644 xsd-frontend/semantic-graph/namespace.hxx delete mode 100644 xsd-frontend/semantic-graph/particle.cxx delete mode 100644 xsd-frontend/semantic-graph/particle.hxx delete mode 100644 xsd-frontend/semantic-graph/schema.cxx delete mode 100644 xsd-frontend/semantic-graph/schema.hxx delete mode 100644 xsd-frontend/semantic-graph/union.cxx delete mode 100644 xsd-frontend/semantic-graph/union.hxx (limited to 'xsd-frontend/semantic-graph') diff --git a/xsd-frontend/semantic-graph/annotation.cxx b/xsd-frontend/semantic-graph/annotation.cxx deleted file mode 100644 index c13be1f..0000000 --- a/xsd-frontend/semantic-graph/annotation.cxx +++ /dev/null @@ -1,44 +0,0 @@ -// file : xsd-frontend/semantic-graph/annotation.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - using compiler::type_info; - - // Annotates - // - namespace - { - struct AnnotatesInit - { - AnnotatesInit () - { - type_info ti (typeid (Annotates)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } annotates_init_; - } - - // Annotation - // - namespace - { - struct AnnotationInit - { - AnnotationInit () - { - type_info ti (typeid (Annotation)); - ti.add_base (typeid (Node)); - insert (ti); - } - } annotation_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/annotation.hxx b/xsd-frontend/semantic-graph/annotation.hxx deleted file mode 100644 index 67b5dba..0000000 --- a/xsd-frontend/semantic-graph/annotation.hxx +++ /dev/null @@ -1,74 +0,0 @@ -// file : xsd-frontend/semantic-graph/annotation.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ANNOTATION_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ANNOTATION_HXX - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // - // - class Annotation; - - class Annotates: public virtual Edge - { - public: - Annotation& - annotation () - { - return *annotation_; - } - - public: - Annotates (): annotation_ (0) {} - - void - set_left_node (Annotation& a) - { - annotation_ = &a; - } - - void - set_right_node (Node&) {} - - void - set_right_node (Edge&) {} - - private: - Annotation* annotation_; - }; - - // - // - class Annotation: public virtual Node - { - public: - String const& - documentation () const - { - return documentation_; - } - - public: - Annotation (Path const& file, - unsigned long line, - unsigned long column, - String const& documentation) - : Node (file, line, column), documentation_ (documentation) - { - } - - void - add_edge_left (Annotates&) {} - - private: - String documentation_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ANNOTATION_HXX diff --git a/xsd-frontend/semantic-graph/any-attribute.cxx b/xsd-frontend/semantic-graph/any-attribute.cxx deleted file mode 100644 index 4753c9d..0000000 --- a/xsd-frontend/semantic-graph/any-attribute.cxx +++ /dev/null @@ -1,110 +0,0 @@ -// file : xsd-frontend/semantic-graph/any-attribute.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - AnyAttribute:: - AnyAttribute (Path const& file, - unsigned long line, - unsigned long column, - String const& namespaces) - : Node (file, line, column), - prototype_ (0) - { - // Not sure if the separator is just space or any white-space - // chararcter. - // - - for (size_t i (0), j (namespaces.find (L' '));;) - { - if (j != String::npos) - { - namespaces_.push_back (String (namespaces, i, j - i)); - - i = j + 1; - j = namespaces.find (L' ', i); - } - else - { - // Last element. - // - namespaces_.push_back (String (namespaces, i)); - break; - } - } - } - - AnyAttribute:: - AnyAttribute (Path const& file, - unsigned long line, - unsigned long column, - NamespaceIterator begin, - NamespaceIterator end) - : Node (file, line, column), - prototype_ (0) - { - for (; begin != end; ++begin) - namespaces_.push_back (*begin); - } - - namespace - { - Namespace& - namespace_ (Nameable& n) - { - // The basic idea goes like this: go up Names edges until you - // reach Namespace. There are, however, anonymous types which - // need special handling. In the case of an anonymous type we - // will go up the first Belongs edge (because the first edge - // is where the type was defined. - // - - if (n.named_p ()) - { - Scope& s (n.scope ()); - Namespace* ns (dynamic_cast (&n)); - - return ns ? *ns : namespace_ (s); - } - else - { - Type& t (dynamic_cast (n)); - Belongs& b (*t.classifies_begin ()); - - return namespace_ (b.instance ()); - } - } - } - - Namespace& AnyAttribute:: - definition_namespace () - { - if (prototype_p ()) - return prototype ().definition_namespace (); - - return namespace_ (scope ()); - } - - namespace - { - using compiler::type_info; - - struct AnyAttributeInit - { - AnyAttributeInit () - { - type_info ti (typeid (AnyAttribute)); - ti.add_base (typeid (Nameable)); - insert (ti); - } - } any_attribute_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/any-attribute.hxx b/xsd-frontend/semantic-graph/any-attribute.hxx deleted file mode 100644 index f16ef69..0000000 --- a/xsd-frontend/semantic-graph/any-attribute.hxx +++ /dev/null @@ -1,79 +0,0 @@ -// file : xsd-frontend/semantic-graph/any-attribute.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ANY_ATTRIBUTE_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ANY_ATTRIBUTE_HXX - -#include - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class AnyAttribute: public virtual Nameable - { - typedef std::vector Namespaces; - - public: - typedef Namespaces::const_iterator NamespaceIterator; - - NamespaceIterator - namespace_begin () const - { - return namespaces_.begin (); - } - - NamespaceIterator - namespace_end () const - { - return namespaces_.end (); - } - - public: - bool - prototype_p () - { - return prototype_ != 0; - } - - AnyAttribute& - prototype () - { - assert (prototype_ != 0); - return *prototype_; - } - - void - prototype (AnyAttribute& a) - { - assert (prototype_ == 0); - prototype_ = &a; - } - - public: - Namespace& - definition_namespace (); - - public: - AnyAttribute (Path const& file, - unsigned long line, - unsigned long column, - String const& namespaces); - - AnyAttribute (Path const& file, - unsigned long line, - unsigned long column, - NamespaceIterator begin, - NamespaceIterator end); - - private: - AnyAttribute* prototype_; - Namespaces namespaces_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ANY_ATTRIBUTE_HXX diff --git a/xsd-frontend/semantic-graph/any.cxx b/xsd-frontend/semantic-graph/any.cxx deleted file mode 100644 index 92d02e6..0000000 --- a/xsd-frontend/semantic-graph/any.cxx +++ /dev/null @@ -1,121 +0,0 @@ -// file : xsd-frontend/semantic-graph/any.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - Any:: - Any (Path const& file, - unsigned long line, - unsigned long column, - String const& namespaces) - : Node (file, line, column), - prototype_ (0) - { - // Not sure if the separator is just space or any white-space - // chararcter. - // - - for (size_t i (0), j (namespaces.find (L' '));;) - { - if (j != String::npos) - { - namespaces_.push_back (String (namespaces, i, j - i)); - - i = j + 1; - j = namespaces.find (L' ', i); - } - else - { - // Last element. - // - namespaces_.push_back (String (namespaces, i)); - break; - } - } - } - - Any:: - Any (Path const& file, - unsigned long line, - unsigned long column, - NamespaceIterator begin, - NamespaceIterator end) - : Node (file, line, column), - prototype_ (0) - { - for (; begin != end; ++begin) - namespaces_.push_back (*begin); - } - - namespace - { - Namespace& - namespace_ (Nameable& n) - { - // The basic idea goes like this: go up Names edges until you - // reach Namespace. There are, however, anonymous types which - // need special handling. In the case of an anonymous type we - // will go up the first Belongs edge (because the first edge - // is where the type was defined. - // - - if (n.named_p ()) - { - Scope& s (n.scope ()); - Namespace* ns (dynamic_cast (&n)); - - return ns ? *ns : namespace_ (s); - } - else - { - Type& t (dynamic_cast (n)); - Belongs& b (*t.classifies_begin ()); - - return namespace_ (b.instance ()); - } - } - } - - Namespace& Any:: - definition_namespace () - { - if (prototype_p ()) - return prototype ().definition_namespace (); - - // Get to our scope. - // - Compositor* c (&contained_particle ().compositor ()); - - while(!c->contained_compositor_p ()) - c = &c->contained_particle ().compositor (); - - Scope& scope ( - dynamic_cast (c->contained_compositor ().container ())); - - return namespace_ (scope); - } - - namespace - { - using compiler::type_info; - - struct AnyInit - { - AnyInit () - { - type_info ti (typeid (Any)); - ti.add_base (typeid (Nameable)); - ti.add_base (typeid (Particle)); - insert (ti); - } - } any_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/any.hxx b/xsd-frontend/semantic-graph/any.hxx deleted file mode 100644 index 6f7527e..0000000 --- a/xsd-frontend/semantic-graph/any.hxx +++ /dev/null @@ -1,84 +0,0 @@ -// file : xsd-frontend/semantic-graph/any.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ANY_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ANY_HXX - -#include - -#include -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class Any: public virtual Nameable, - public virtual Particle - { - typedef std::vector Namespaces; - - public: - typedef Namespaces::const_iterator NamespaceIterator; - - NamespaceIterator - namespace_begin () const - { - return namespaces_.begin (); - } - - NamespaceIterator - namespace_end () const - { - return namespaces_.end (); - } - - public: - bool - prototype_p () - { - return prototype_ != 0; - } - - Any& - prototype () - { - assert (prototype_ != 0); - return *prototype_; - } - - void - prototype (Any& a) - { - assert (prototype_ == 0); - prototype_ = &a; - } - - public: - Namespace& - definition_namespace (); - - public: - Any (Path const& file, - unsigned long line, - unsigned long column, - String const& namespaces); - - Any (Path const& file, - unsigned long line, - unsigned long column, - NamespaceIterator begin, - NamespaceIterator end); - - using Nameable::add_edge_right; - using Particle::add_edge_right; - - private: - Any* prototype_; - Namespaces namespaces_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ANY_HXX diff --git a/xsd-frontend/semantic-graph/attribute-group.cxx b/xsd-frontend/semantic-graph/attribute-group.cxx deleted file mode 100644 index f1a1b7a..0000000 --- a/xsd-frontend/semantic-graph/attribute-group.cxx +++ /dev/null @@ -1,33 +0,0 @@ -// file : xsd-frontend/semantic-graph/attribute-group.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - AttributeGroup:: - AttributeGroup (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - namespace - { - using compiler::type_info; - - struct AttributeGroupInit - { - AttributeGroupInit () - { - type_info ti (typeid (AttributeGroup)); - ti.add_base (typeid (Scope)); - insert (ti); - } - } attribute_group_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/attribute-group.hxx b/xsd-frontend/semantic-graph/attribute-group.hxx deleted file mode 100644 index ff5a14b..0000000 --- a/xsd-frontend/semantic-graph/attribute-group.hxx +++ /dev/null @@ -1,23 +0,0 @@ -// file : xsd-frontend/semantic-graph/attribute-group.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ATTRIBUTE_GROUP_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ATTRIBUTE_GROUP_HXX - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class AttributeGroup: public virtual Scope - { - public: - AttributeGroup (Path const& file, - unsigned long line, - unsigned long column); - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ATTRIBUTE_GROUP_HXX diff --git a/xsd-frontend/semantic-graph/attribute.cxx b/xsd-frontend/semantic-graph/attribute.cxx deleted file mode 100644 index 2a75688..0000000 --- a/xsd-frontend/semantic-graph/attribute.cxx +++ /dev/null @@ -1,40 +0,0 @@ -// file : xsd-frontend/semantic-graph/attribute.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - Attribute:: - Attribute (Path const& file, - unsigned long line, - unsigned long column, - bool optional, - bool global, - bool qualified) - : Node (file, line, column), - Member (global, qualified), - optional_ (optional) - { - } - - namespace - { - using compiler::type_info; - - struct AttributeInit - { - AttributeInit () - { - type_info ti (typeid (Attribute)); - ti.add_base (typeid (Member)); - insert (ti); - } - } attribute_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/attribute.hxx b/xsd-frontend/semantic-graph/attribute.hxx deleted file mode 100644 index 1eb5999..0000000 --- a/xsd-frontend/semantic-graph/attribute.hxx +++ /dev/null @@ -1,35 +0,0 @@ -// file : xsd-frontend/semantic-graph/attribute.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ATTRIBUTE_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ATTRIBUTE_HXX - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class Attribute: public virtual Member - { - public: - bool - optional_p () const - { - return optional_; - } - - public: - Attribute (Path const& file, - unsigned long line, - unsigned long column, - bool optional, - bool global, - bool qualified); - private: - bool optional_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ATTRIBUTE_HXX diff --git a/xsd-frontend/semantic-graph/complex.cxx b/xsd-frontend/semantic-graph/complex.cxx deleted file mode 100644 index d1c2f7a..0000000 --- a/xsd-frontend/semantic-graph/complex.cxx +++ /dev/null @@ -1,44 +0,0 @@ -// file : xsd-frontend/semantic-graph/complex.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - Complex:: - Complex () - : abstract_ (false), mixed_ (false), contains_compositor_ (0) - { - } - - Complex:: - Complex (Path const& file, - unsigned long line, - unsigned long column, - bool abstract) - : Node (file, line, column), - abstract_ (abstract), mixed_ (false), contains_compositor_ (0) - { - } - - namespace - { - using compiler::type_info; - - struct ComplexInit - { - ComplexInit () - { - type_info ti (typeid (Complex)); - ti.add_base (typeid (Type)); - ti.add_base (typeid (Scope)); - insert (ti); - } - } complex_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/complex.hxx b/xsd-frontend/semantic-graph/complex.hxx deleted file mode 100644 index 13fc1f8..0000000 --- a/xsd-frontend/semantic-graph/complex.hxx +++ /dev/null @@ -1,93 +0,0 @@ -// file : xsd-frontend/semantic-graph/complex.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_COMPLEX_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_COMPLEX_HXX - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class Complex: public virtual Type, public virtual Scope - { - public: - bool - abstract_p () const {return abstract_;} - - bool - mixed_p () const - { - if (mixed_) - return true; - - // If we have empty content, then we have the same content - // type as our base. - // - if (!contains_compositor_p () && inherits_p ()) - { - if (Complex* b = dynamic_cast (&inherits ().base ())) - return b->mixed_p (); - } - - return false; - } - - public: - bool - contains_compositor_p () const - { - return contains_compositor_ != 0; - } - - ContainsCompositor& - contains_compositor () - { - assert (contains_compositor_ != 0); - return *contains_compositor_; - } - - public: - void - mixed_p (bool m) - { - mixed_ = m; - } - - public: - Complex (Path const& file, - unsigned long line, - unsigned long column, - bool abstract); - - void - add_edge_left (ContainsCompositor& e) - { - contains_compositor_ = &e; - } - - void - remove_edge_left (ContainsCompositor& e) - { - assert (contains_compositor_ == &e); - contains_compositor_ = 0; - } - - using Type::add_edge_right; - using Type::add_edge_left; - using Scope::add_edge_left; - - protected: - Complex (); // For virtual inheritance (Enumeration). - - private: - bool abstract_; - bool mixed_; - ContainsCompositor* contains_compositor_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_COMPLEX_HXX diff --git a/xsd-frontend/semantic-graph/compositors.cxx b/xsd-frontend/semantic-graph/compositors.cxx deleted file mode 100644 index 2098dc1..0000000 --- a/xsd-frontend/semantic-graph/compositors.cxx +++ /dev/null @@ -1,99 +0,0 @@ -// file : xsd-frontend/semantic-graph/compositor.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // ContainsCompositor - // - ContainsCompositor:: - ContainsCompositor (unsigned long min, unsigned long max) - : compositor_ (0), container_ (0), min_ (min), max_ (max) - { - } - - // All - // - All:: - All (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - // Choice - // - Choice:: - Choice (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - // Sequence - // - Sequence:: - Sequence (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - namespace - { - using compiler::type_info; - - struct ContainsCompositorInit - { - ContainsCompositorInit () - { - type_info ti (typeid (ContainsCompositor)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } contains_compositor_init_; - - struct CompositorInit - { - CompositorInit () - { - type_info ti (typeid (Compositor)); - ti.add_base (typeid (Particle)); - insert (ti); - } - } compositor_init_; - - struct AllInit - { - AllInit () - { - type_info ti (typeid (All)); - ti.add_base (typeid (Compositor)); - insert (ti); - } - } all_init_; - - struct ChoiceInit - { - ChoiceInit () - { - type_info ti (typeid (Choice)); - ti.add_base (typeid (Compositor)); - insert (ti); - } - } choice_init_; - - struct SequenceInit - { - SequenceInit () - { - type_info ti (typeid (Sequence)); - ti.add_base (typeid (Compositor)); - insert (ti); - } - } sequence_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/compositors.hxx b/xsd-frontend/semantic-graph/compositors.hxx deleted file mode 100644 index e4db571..0000000 --- a/xsd-frontend/semantic-graph/compositors.hxx +++ /dev/null @@ -1,233 +0,0 @@ -// file : xsd-frontend/semantic-graph/compositors.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_COMPOSITORS_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_COMPOSITORS_HXX - -#include - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // - // - class ContainsCompositor: public virtual Edge - { - public: - Compositor& - compositor () const - { - return *compositor_; - } - - Node& - container () const - { - return *container_; - } - - public: - unsigned long - min () const - { - return min_; - } - - unsigned long - max () const - { - return max_; - } - - public: - ContainsCompositor (unsigned long min, unsigned long max); - - void - set_left_node (Node& n) - { - container_ = &n; - } - - void - set_right_node (Compositor& n) - { - compositor_ = &n; - } - - void - clear_left_node (Node& n) - { - assert (container_ == &n); - container_ = 0; - } - - void - clear_right_node (Compositor& n) - { - assert (compositor_ == &n); - compositor_ = 0; - } - - private: - Compositor* compositor_; - Node* container_; - unsigned long min_, max_; - }; - - // - // - class Compositor: public virtual Particle - { - typedef std::list ContainsList; - - public: - typedef pointer_iterator ContainsIterator; - typedef - pointer_iterator - ContainsConstIterator; - - ContainsIterator - contains_begin () - { - return contains_.begin (); - } - - ContainsIterator - contains_end () - { - return contains_.end (); - } - - ContainsConstIterator - contains_begin () const - { - return contains_.begin (); - } - - ContainsConstIterator - contains_end () const - { - return contains_.end (); - } - - public: - bool - contained_compositor_p () - { - return contained_compositor_ != 0; - } - - ContainsCompositor& - contained_compositor () - { - assert (contained_compositor_ != 0); - return *contained_compositor_; - } - - public: - unsigned long - min () const - { - if (contained_compositor_ != 0) - return contained_compositor_->min (); - else - return Particle::min (); - } - - unsigned long - max () const - { - if (contained_compositor_ != 0) - return contained_compositor_->max (); - else - return Particle::max (); - } - - public: - Compositor (): contained_compositor_ (0) {} - - void - add_edge_left (ContainsParticle& e) - { - contains_.push_back (&e); - } - - void - add_edge_left (ContainsParticle& e, ContainsIterator const& after) - { - if (after.base () == contains_.end ()) - contains_.push_front (&e); - else - { - ContainsList::iterator i (after.base ()); - contains_.insert (++i, &e); - } - } - - void - remove_edge_left (ContainsParticle& e) - { - for (ContainsList::iterator i (contains_.begin ()); - i != contains_.end (); ++i) - { - if (*i == &e) - { - contains_.erase (i); - break; - } - } - } - - void - add_edge_right (ContainsCompositor& e) - { - contained_compositor_ = &e; - } - - void - remove_edge_right (ContainsCompositor& e) - { - assert (contained_compositor_ == &e); - contained_compositor_ = 0; - } - - using Node::add_edge_right; - using Particle::add_edge_right; - using Particle::remove_edge_right; - - private: - ContainsList contains_; - ContainsCompositor* contained_compositor_; - }; - - // - // - class All: public virtual Compositor - { - public: - All (Path const& file, unsigned long line, unsigned long column); - }; - - // - // - class Choice: public virtual Compositor - { - public: - Choice (Path const& file, unsigned long line, unsigned long column); - }; - - // - // - class Sequence: public virtual Compositor - { - public: - Sequence (Path const& file, unsigned long line, unsigned long column); - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_COMPOSITORS_HXX diff --git a/xsd-frontend/semantic-graph/element-group.cxx b/xsd-frontend/semantic-graph/element-group.cxx deleted file mode 100644 index 8d657e4..0000000 --- a/xsd-frontend/semantic-graph/element-group.cxx +++ /dev/null @@ -1,33 +0,0 @@ -// file : xsd-frontend/semantic-graph/element-group.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - ElementGroup:: - ElementGroup (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column), contains_compositor_ (0) - { - } - - namespace - { - using compiler::type_info; - - struct ElementGroupInit - { - ElementGroupInit () - { - type_info ti (typeid (ElementGroup)); - ti.add_base (typeid (Scope)); - insert (ti); - } - } element_group_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/element-group.hxx b/xsd-frontend/semantic-graph/element-group.hxx deleted file mode 100644 index 79b0725..0000000 --- a/xsd-frontend/semantic-graph/element-group.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : xsd-frontend/semantic-graph/element-group.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENT_GROUP_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENT_GROUP_HXX - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class ElementGroup: public virtual Scope - { - public: - ContainsCompositor& - contains_compositor () - { - assert (contains_compositor_ != 0); - return *contains_compositor_; - } - - public: - ElementGroup (Path const& file, unsigned long line, unsigned long column); - - void - add_edge_left (ContainsCompositor& e) - { - contains_compositor_ = &e; - } - - using Scope::add_edge_left; - - private: - ContainsCompositor* contains_compositor_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENT_GROUP_HXX diff --git a/xsd-frontend/semantic-graph/element.cxx b/xsd-frontend/semantic-graph/element.cxx deleted file mode 100644 index 882c9e9..0000000 --- a/xsd-frontend/semantic-graph/element.cxx +++ /dev/null @@ -1,52 +0,0 @@ -// file : xsd-frontend/semantic-graph/element.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // Element - // - Element:: - Element (Path const& file, - unsigned long line, - unsigned long column, - bool global, - bool qualified) - : Node (file, line, column), - Member (global, qualified), - substitutes_ (0) - { - } - - namespace - { - using compiler::type_info; - - struct SubstitutesInit - { - SubstitutesInit () - { - type_info ti (typeid (Substitutes)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } substitutes_init_; - - struct ElementInit - { - ElementInit () - { - type_info ti (typeid (Element)); - ti.add_base (typeid (Member)); - ti.add_base (typeid (Particle)); - insert (ti); - } - } element_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/element.hxx b/xsd-frontend/semantic-graph/element.hxx deleted file mode 100644 index 9c9f2b3..0000000 --- a/xsd-frontend/semantic-graph/element.hxx +++ /dev/null @@ -1,93 +0,0 @@ -// file : xsd-frontend/semantic-graph/element.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENT_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENT_HXX - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class Element; - - class Substitutes: public virtual Edge - { - public: - Element& - substitution () const - { - return *substitution_; - } - - Element& - root () const - { - return *root_; - } - - public: - void - set_left_node (Element& n) - { - substitution_ = &n; - } - - void - set_right_node (Element& n) - { - root_ = &n; - } - - private: - Element* root_; - Element* substitution_; - }; - - - class Element: public virtual Member, - public virtual Particle - { - public: - bool - substitutes_p () const - { - return substitutes_ != 0; - } - - Substitutes& - substitutes () const - { - assert (substitutes_ != 0); - return *substitutes_; - } - - public: - Element (Path const& file, - unsigned long line, - unsigned long column, - bool global, - bool qualified); - - void - add_edge_left (Substitutes& e) - { - substitutes_ = &e; - } - - void - add_edge_right (Substitutes&) {} - - using Member::add_edge_left; - using Member::add_edge_right; - using Particle::add_edge_right; - - private: - Substitutes* substitutes_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENT_HXX diff --git a/xsd-frontend/semantic-graph/elements.cxx b/xsd-frontend/semantic-graph/elements.cxx deleted file mode 100644 index 8a521af..0000000 --- a/xsd-frontend/semantic-graph/elements.cxx +++ /dev/null @@ -1,299 +0,0 @@ -// file : xsd-frontend/semantic-graph/elements.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include -#include - -#include - -#include -#include - -using namespace std; - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // Node - // - Annotation& Node:: - annotation () - { - return annotates_->annotation (); - } - - // Type - // - void Type:: - remove_edge_left (Arguments& a) - { - ArgumentsSet::iterator i (arguments_.find (&a)); - assert (i != arguments_.end ()); - arguments_.erase (i); - } - - // Specialization - // - void Specialization:: - remove_edge_right (Arguments& a) - { - // The number of entries should be small so linear search will do. - // - Argumented::iterator i ( - std::find (argumented_.begin (), argumented_.end (), &a)); - - assert (i != argumented_.end ()); - argumented_.erase (i); - } - - using compiler::type_info; - - namespace - { - // Edge - // - struct EdgeInit - { - EdgeInit () - { - type_info ti (typeid (Edge)); - insert (ti); - } - } edge_init_; - - // Node - // - struct NodeInit - { - NodeInit () - { - type_info ti (typeid (Node)); - insert (ti); - } - } node_init_; - - // Names - // - struct NamesInit - { - NamesInit () - { - type_info ti (typeid (Names)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } names_init_; - - // Nameable - // - struct NameableInit - { - NameableInit () - { - type_info ti (typeid (Nameable)); - ti.add_base (typeid (Node)); - insert (ti); - } - } nameable_init_; - - // Scope - // - struct ScopeInit - { - ScopeInit () - { - type_info ti (typeid (Scope)); - ti.add_base (typeid (Nameable)); - insert (ti); - } - } scope_init_; - - // Type - // - struct TypeInit - { - TypeInit () - { - type_info ti (typeid (Type)); - ti.add_base (typeid (Nameable)); - insert (ti); - } - } type_init_; - - // Instance - // - struct InstanceInit - { - InstanceInit () - { - type_info ti (typeid (Instance)); - ti.add_base (typeid (Nameable)); - insert (ti); - } - } instance_init_; - - // Belongs - // - struct BelongsInit - { - BelongsInit () - { - type_info ti (typeid (Belongs)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } belongs_init_; - - // Inherits - // - struct InheritsInit - { - InheritsInit () - { - type_info ti (typeid (Inherits)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } inherits_init_; - - // Extends - // - struct ExtendsInit - { - ExtendsInit () - { - type_info ti (typeid (Extends)); - ti.add_base (typeid (Inherits)); - insert (ti); - } - } extends_init_; - - // Restricts - // - struct RestrictsInit - { - RestrictsInit () - { - type_info ti (typeid (Restricts)); - ti.add_base (typeid (Inherits)); - insert (ti); - } - } restricts_init_; - - // BelongsToNamespace - // - struct BelongsToNamespaceInit - { - BelongsToNamespaceInit () - { - type_info ti (typeid (BelongsToNamespace)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } belongs_to_namespace_init_; - - // Member - // - struct MemberInit - { - MemberInit () - { - type_info ti (typeid (Member)); - ti.add_base (typeid (Instance)); - insert (ti); - } - } member_init_; - - // Specialization - // - struct SpecializationInit - { - SpecializationInit () - { - type_info ti (typeid (Specialization)); - ti.add_base (typeid (Type)); - insert (ti); - } - } specialization_init_; - - // Arguments - // - struct ArgumentsInit - { - ArgumentsInit () - { - type_info ti (typeid (Arguments)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } arguments_init_; - - /* - // Contains - // - struct ContainsInit - { - ContainsInit () - { - type_info ti (typeid (Contains)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } contains_init_; - - // Container - // - struct ContainerInit - { - ContainerInit () - { - type_info ti (typeid (Container)); - ti.add_base (typeid (Node)); - insert (ti); - } - } container_init_; - */ - - // AnyType - // - struct AnyTypeInit - { - AnyTypeInit () - { - type_info ti (typeid (AnyType)); - ti.add_base (typeid (SemanticGraph::Type)); - insert (ti); - } - } any_type_init_; - - // AnySimpleType - // - struct AnySimpleTypeInit - { - AnySimpleTypeInit () - { - type_info ti (typeid (AnySimpleType)); - ti.add_base (typeid (Type)); - insert (ti); - } - } any_simple_type_init_; - } - - // Instance - // - Type& Instance:: - type () const - { - return belongs ().type (); - } - } -} - -// Path -// -std::wostream& -operator<< (std::wostream& os, XSDFrontend::SemanticGraph::Path const& path) -{ - return os << path.string ().c_str (); -} diff --git a/xsd-frontend/semantic-graph/elements.hxx b/xsd-frontend/semantic-graph/elements.hxx deleted file mode 100644 index 96f8f92..0000000 --- a/xsd-frontend/semantic-graph/elements.hxx +++ /dev/null @@ -1,1003 +0,0 @@ -// file : xsd-frontend/semantic-graph/elements.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENTS_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENTS_HXX - -#include -#include -#include -#include -#include -#include // std::size_t -#include // std::pair -#include // abort -#include - -#include -#include -#include -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - using namespace cutl; - - using container::pointer_iterator; - - // - // - typedef fs::path Path; - typedef fs::invalid_path InvalidPath; - typedef std::vector Paths; - - typedef compiler::context Context; - - // - // - class Node; - class Edge; - - // - // - class Annotates; - class Annotation; - - // - // - class Edge - { - public: - Context& - context () const - { - return context_; - } - - virtual - ~Edge () - { - } - - public: - template - bool - is_a () const - { - return dynamic_cast (this) != 0; - } - - private: - mutable Context context_; - }; - - inline bool - operator== (Edge const& x, Edge const& y) - { - return &x == &y; - } - - - // - // - class Node - { - public: - Context& - context () const - { - return context_; - } - - public: - Path const& - file () const - { - return file_; - } - - unsigned long - line () const - { - return line_; - } - - unsigned long - column () const - { - return column_; - } - - public: - bool - annotated_p () const - { - return annotates_ != 0; - } - - Annotates& - annotated () const - { - return *annotates_; - } - - Annotation& - annotation (); - - public: - template - bool - is_a () const - { - return dynamic_cast (this) != 0; - } - - public: - virtual - ~Node () {} - - Node (Path const& file, unsigned long line, unsigned long column) - : annotates_ (0), file_ (file), line_ (line), column_ (column) - { - } - - void - add_edge_right (Annotates& a) - { - annotates_ = &a; - } - - protected: - Node () // For virtual inheritance. - { - abort (); // Told you so! - } - - private: - mutable Context context_; - Annotates* annotates_; - Path file_; - unsigned long line_; - unsigned long column_; - }; - - inline bool - operator== (Node const& x, Node const& y) - { - return &x == &y; - } - - // - // - typedef container::graph graph; - - // - // - typedef String Name; - - - // - // - class Scope; - class Nameable; - - - // - // - class Names: public virtual Edge - { - public: - Name - name () const - { - return name_; - } - - Scope& - scope () const - { - return *scope_; - } - - Nameable& - named () const - { - return *named_; - } - - public: - Names (Name const& name): name_ (name) {} - - void - set_left_node (Scope& n) - { - scope_ = &n; - } - - void - set_right_node (Nameable& n) - { - named_ = &n; - } - - void - clear_left_node (Scope& n) - { - assert (scope_ == &n); - scope_ = 0; - } - - void - clear_right_node (Nameable& n) - { - assert (named_ == &n); - named_ = 0; - } - - private: - Scope* scope_; - Nameable* named_; - Name name_; - }; - - - class Nameable: public virtual Node - { - public: - bool - named_p () const - { - return named_ != 0; - } - - Name - name () const - { - assert (named_p ()); - return named_->name (); - } - - Scope& - scope () - { - assert (named_p ()); - return named_->scope (); - } - - Names& - named () - { - assert (named_p ()); - return *named_; - } - - public: - Nameable (): named_ (0) {} - - void - add_edge_right (Names& e) - { - named_ = &e; - } - - void - remove_edge_right (Names& e) - { - assert (named_ == &e); - named_ = 0; - } - - using Node::add_edge_right; - - private: - Names* named_; - }; - - // - // - typedef std::set Nameables; - - // - // - class Scope: public virtual Nameable - { - protected: - typedef std::list NamesList; - typedef std::map ListIteratorMap; - typedef std::map NamesMap; - - public: - typedef pointer_iterator NamesIterator; - typedef pointer_iterator NamesConstIterator; - - typedef - std::pair - NamesIteratorPair; - - NamesIterator - names_begin () - { - return names_.begin (); - } - - NamesIterator - names_end () - { - return names_.end (); - } - - NamesConstIterator - names_begin () const - { - return names_.begin (); - } - - NamesConstIterator - names_end () const - { - return names_.end (); - } - - std::size_t - names_size () const - { - return names_.size (); - } - - virtual NamesIteratorPair - find (Name const& name) const - { - NamesMap::const_iterator i (names_map_.find (name)); - - if (i == names_map_.end ()) - return NamesIteratorPair (names_.end (), names_.end ()); - else - return NamesIteratorPair (i->second.begin (), i->second.end ()); - } - - NamesIterator - find (Names& e) - { - ListIteratorMap::iterator i (iterator_map_.find (&e)); - return i != iterator_map_.end () ? i->second : names_.end (); - } - - public: - Scope (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - void - add_edge_left (Names& e) - { - NamesList::iterator i (names_.insert (names_.end (), &e)); - iterator_map_[&e] = i; - names_map_[e.name ()].push_back (&e); - } - - void - remove_edge_left (Names& e) - { - ListIteratorMap::iterator i (iterator_map_.find (&e)); - assert (i != iterator_map_.end ()); - - names_.erase (i->second); - iterator_map_.erase (i); - - NamesMap::iterator j (names_map_.find (e.name ())); - - for (NamesList::iterator i (j->second.begin ()); - i != j->second.end (); ++i) - { - if (*i == &e) - i = j->second.erase (i); - } - } - - void - add_edge_left (Names& e, NamesIterator const& after) - { - NamesList::iterator i; - - if (after.base () == names_.end ()) - i = names_.insert (names_.begin (), &e); - else - { - NamesList::iterator j (after.base ()); - i = names_.insert (++j, &e); - } - - iterator_map_[&e] = i; - names_map_[e.name ()].push_back (&e); - } - - using Nameable::add_edge_right; - - protected: - Scope () {} - - private: - NamesList names_; - ListIteratorMap iterator_map_; - NamesMap names_map_; - }; - - - // - // - class Belongs; - class Inherits; - class Arguments; - - class Type: public virtual Nameable - { - protected: - typedef std::vector Classifies; - typedef std::vector Begets; - typedef std::set ArgumentsSet; - - public: - typedef pointer_iterator ClassifiesIterator; - - ClassifiesIterator - classifies_begin () const - { - return classifies_.begin (); - } - - ClassifiesIterator - classifies_end () const - { - return classifies_.end (); - } - - // - // - bool - inherits_p () const - { - return inherits_ != 0; - } - - Inherits& - inherits () const - { - assert (inherits_ != 0); - return *inherits_; - } - - // - // - typedef pointer_iterator BegetsIterator; - - BegetsIterator - begets_begin () const - { - return begets_.begin (); - } - - BegetsIterator - begets_end () const - { - return begets_.end (); - } - - // - // - typedef pointer_iterator ArgumentsIterator; - - ArgumentsIterator - arguments_begin () const - { - return arguments_.begin (); - } - - ArgumentsIterator - arguments_end () const - { - return arguments_.end (); - } - - public: - Type (): inherits_ (0) {} - - void - add_edge_right (Belongs& e) - { - classifies_.push_back (&e); - } - - void - add_edge_right (Inherits& e) - { - begets_.push_back (&e); - } - - using Nameable::add_edge_right; - - void - add_edge_left (Arguments& a) - { - arguments_.insert (&a); - } - - void - remove_edge_left (Arguments&); - - void - add_edge_left (Inherits& e) - { - inherits_ = &e; - } - - private: - Inherits* inherits_; - Begets begets_; - Classifies classifies_; - ArgumentsSet arguments_; - }; - - class Instance: public virtual Nameable - { - public: - Belongs& - belongs () const - { - return *belongs_; - } - - Type& - type () const; - - bool - typed_p () const - { - return belongs_ != 0; - } - - public: - Instance (): belongs_ (0) {} - - void - add_edge_left (Belongs& e) - { - belongs_ = &e; - } - - private: - Belongs* belongs_; - }; - - - class Belongs: public virtual Edge - { - public: - Instance& - instance () const - { - return *instance_; - } - - Type& - type () const - { - return *type_; - } - - public: - void - set_left_node (Instance& n) - { - instance_ = &n; - } - - void - set_right_node (Type& n) - { - type_ = &n; - } - - private: - Instance* instance_; - Type* type_; - }; - - - // - // - class Inherits: public virtual Edge - { - public: - Type& - base () const - { - return *base_; - } - - Type& - derived () const - { - return *derived_; - } - - public: - void - set_left_node (Type& n) - { - derived_ = &n; - } - - void - set_right_node (Type& n) - { - base_ = &n; - } - - private: - Type* base_; - Type* derived_; - }; - - class Extends: public virtual Inherits - { - }; - - class Restricts: public virtual Inherits - { - public: - typedef std::map Facets; - typedef Facets::iterator FacetIterator; - - bool - facet_empty () - { - return facets_.empty (); - } - - FacetIterator - facet_begin () - { - return facets_.begin (); - } - - FacetIterator - facet_end () - { - return facets_.end (); - } - - FacetIterator - facet_find (String const& name) - { - return facets_.find (name); - } - - void - facet_insert (String const& name, String const& value) - { - facets_[name] = value; - } - - Facets const& - facets () const - { - return facets_; - } - - protected: - Facets facets_; - }; - - - // - // - class Member; - class Namespace; - - class BelongsToNamespace: public virtual Edge - { - public: - Member& - member () const - { - assert (member_ != 0); - return *member_; - } - - Namespace& - namespace_ () const - { - assert (namespace__ != 0); - return *namespace__; - } - - public: - BelongsToNamespace (): member_ (0), namespace__ (0) {} - - void - set_left_node (Member& n) - { - member_ = &n; - } - - void - set_right_node (Namespace& n) - { - namespace__ = &n; - } - - private: - Member* member_; - Namespace* namespace__; - }; - - // - // - class Member: public virtual Instance - { - public: - // Member is global either if it is defined outside any type - // or it is a ref="" of a global member. - // - bool - global_p () const - { - return global_; - } - - bool - qualified_p () const - { - return qualified_; - } - - // Note that only qualified members belong to a namespace. - // - Namespace& - namespace_ () const - { - assert (belongs_to_namespace_ != 0); - return belongs_to_namespace_->namespace_ (); - } - - - // Default and fixed value API. Note that the fixed value semantics - // is a superset of the default value semantics. As such setting the - // fixed value appears as if the default value was also set. - // - bool - default_p () const - { - return value_type_ != ValueType::none; - } - - bool - fixed_p () const - { - return value_type_ == ValueType::fixed; - } - - struct NoValue {}; - - String - value () const - { - if (value_type_ != ValueType::none) - return value_; - else - throw NoValue (); - } - - // - // - void - default_ (String const& v) - { - value_ = v; - value_type_ = ValueType::default_; - } - - void - fixed (String const& v) - { - value_ = v; - value_type_ = ValueType::fixed; - } - - public: - Member (bool global, bool qualified) - : global_ (global), - qualified_ (qualified), - belongs_to_namespace_ (0), - value_type_ (ValueType::none) - { - } - - void - add_edge_left (BelongsToNamespace& e) - { - // In the parser we sometimes re-add the same adge. - // - belongs_to_namespace_ = &e; - } - - using Instance::add_edge_left; - - private: - bool global_; - bool qualified_; - BelongsToNamespace* belongs_to_namespace_; - - struct ValueType - { - enum Value - { - none, - default_, - fixed - }; - }; - - String value_; - ValueType::Value value_type_; - }; - - - // Parametric types. - // - - class Specialization: public virtual Type - { - typedef std::vector Argumented; - - public: - typedef pointer_iterator ArgumentedIterator; - typedef - pointer_iterator - ArgumentedConstIterator; - - ArgumentedIterator - argumented_begin () - { - return argumented_.begin (); - } - - ArgumentedConstIterator - argumented_begin () const - { - return argumented_.begin (); - } - - ArgumentedIterator - argumented_end () - { - return argumented_.end (); - } - - ArgumentedConstIterator - argumented_end () const - { - return argumented_.end (); - } - - // Shortcut for one-argument specializations. - // - Arguments& - argumented () const - { - return *argumented_[0]; - } - - public: - using Type::add_edge_right; - - void - add_edge_right (Arguments& a) - { - argumented_.push_back (&a); - } - - void - add_edge_right (Arguments& a, ArgumentedIterator const& pos) - { - argumented_.insert (pos.base (), &a); - } - - void - remove_edge_right (Arguments&); - - private: - Argumented argumented_; - }; - - class Arguments: public virtual Edge - { - public: - Type& - type () const - { - return *type_; - } - - Specialization& - specialization () const - { - return *specialization_; - } - - public: - void - set_left_node (Type& n) - { - type_ = &n; - } - - void - clear_left_node (Type& n) - { - assert (type_ == &n); - type_ = 0; - } - - void - set_right_node (Specialization& s) - { - specialization_ = &s; - } - - void - clear_right_node (Specialization& s) - { - assert (specialization_ == &s); - specialization_ = 0; - } - - private: - Type* type_; - Specialization* specialization_; - }; - - - // - // - class AnyType: public virtual Type - { - public: - AnyType (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - protected: - AnyType () {} // For virtual inheritance. - }; - - - // - // - class AnySimpleType: public virtual Type - { - public: - AnySimpleType (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - protected: - AnySimpleType () {} // For virtual inheritance. - }; - } -} - -// ADL won't find it because Path is a typedef. Note that this -// function prints in native format. -// -std::wostream& -operator<< (std::wostream& os, XSDFrontend::SemanticGraph::Path const& path); - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ELEMENTS_HXX diff --git a/xsd-frontend/semantic-graph/enumeration.cxx b/xsd-frontend/semantic-graph/enumeration.cxx deleted file mode 100644 index 74d7fbf..0000000 --- a/xsd-frontend/semantic-graph/enumeration.cxx +++ /dev/null @@ -1,58 +0,0 @@ -// file : xsd-frontend/semantic-graph/enumeration.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // Enumeration - // - Enumeration:: - Enumeration (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - // Enumerator - // - Enumerator:: - Enumerator (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - namespace - { - using compiler::type_info; - - // Enumeration - // - struct EnumerationInit - { - EnumerationInit () - { - type_info ti (typeid (Enumeration)); - ti.add_base (typeid (Complex)); - insert (ti); - } - } enumeration_init_; - - - // Enumerator - // - struct EnumeratorInit - { - EnumeratorInit () - { - type_info ti (typeid (Enumerator)); - ti.add_base (typeid (Instance)); - insert (ti); - } - } enumerator_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/enumeration.hxx b/xsd-frontend/semantic-graph/enumeration.hxx deleted file mode 100644 index 0580dbc..0000000 --- a/xsd-frontend/semantic-graph/enumeration.hxx +++ /dev/null @@ -1,29 +0,0 @@ -// file : xsd-frontend/semantic-graph/enumeration.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_ENUMERATION_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_ENUMERATION_HXX - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class Enumeration: public virtual Complex - { - public: - Enumeration (Path const& file, unsigned long line, unsigned long column); - }; - - - class Enumerator: public virtual Instance - { - public: - Enumerator (Path const& file, unsigned long line, unsigned long column); - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_ENUMERATION_HXX diff --git a/xsd-frontend/semantic-graph/fundamental.cxx.m4 b/xsd-frontend/semantic-graph/fundamental.cxx.m4 deleted file mode 100644 index 31e3847..0000000 --- a/xsd-frontend/semantic-graph/fundamental.cxx.m4 +++ /dev/null @@ -1,209 +0,0 @@ -divert(-1) - -# file : xsd-frontend/semantic-graph/fundamental.cxx.m4 -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include(`fundamental.m4') - -define(`fundamental_type', - `fundamental_type_impl(`make_class_name(`$1')', `make_var_name(`$1')')') - - -define(`fundamental_type_impl', ` - - // $1 - // - namespace - { - struct $1Init - { - $1Init () - { - type_info ti (typeid ($1)); - ti.add_base (typeid (Type)); - insert (ti); - } - - } $2_init_; - } - - $1:: - $1 (Path const& file, - unsigned long line, - unsigned long column) - : Node (file, line, column) - { - }') - -divert(0)dnl -dnl -dnl -dnl -// file : xsd-frontend/semantic-graph/fundamental.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Note, that this file is automatically generated! -// - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - namespace Fundamental - { - using compiler::type_info; - - // Type - // - namespace - { - struct TypeInit - { - TypeInit () - { - type_info ti (typeid (Type)); - ti.add_base (typeid (SemanticGraph::Type)); - insert (ti); - } - } any_type_init_; - } - - Type:: - Type () - { - } -dnl -dnl Integers. -dnl -fundamental_type(`byte') -fundamental_type(`unsigned byte') -fundamental_type(`short') -fundamental_type(`unsigned short') -fundamental_type(`int') -fundamental_type(`unsigned int') -fundamental_type(`long') -fundamental_type(`unsigned long') -fundamental_type(`integer') -fundamental_type(`non positive integer') -fundamental_type(`non negative integer') -fundamental_type(`positive integer') -fundamental_type(`negative integer') -dnl -dnl Boolean. -dnl -fundamental_type(`boolean') -dnl -dnl Floats. -dnl -fundamental_type(`float') -fundamental_type(`double') -fundamental_type(`decimal') -dnl -dnl Strings. -dnl -fundamental_type(`string') -fundamental_type(`normalized string') -fundamental_type(`token') -fundamental_type(`name') -fundamental_type(`name token') -fundamental_type(`name tokens') -fundamental_type(`NC name') -fundamental_type(`language') -dnl -dnl Qualified name. -dnl -fundamental_type(`q name') -dnl -dnl ID/IDREF. -dnl -fundamental_type(`id') - - - // IdRef - // - namespace - { - struct IdRefInit - { - IdRefInit () - { - type_info ti (typeid (IdRef)); - ti.add_base (typeid (Type)); - ti.add_base (typeid (Specialization)); - insert (ti); - } - - } id_ref_init_; - } - - IdRef:: - IdRef (Path const& file, - unsigned long line, - unsigned long column) - : Node (file, line, column) - { - } - - - // IdRefs - // - namespace - { - struct IdRefsInit - { - IdRefsInit () - { - type_info ti (typeid (IdRefs)); - ti.add_base (typeid (Type)); - ti.add_base (typeid (Specialization)); - insert (ti); - } - - } id_refs_init_; - } - - IdRefs:: - IdRefs (Path const& file, - unsigned long line, - unsigned long column) - : Node (file, line, column) - { - } -dnl -dnl URI. -dnl -fundamental_type(`any URI') -dnl -dnl Binary. -dnl -fundamental_type(`base 64 binary') -fundamental_type(`hex binary') -dnl -dnl Date/time. -dnl -fundamental_type(`date') -fundamental_type(`date time') -fundamental_type(`duration') -fundamental_type(`day') -fundamental_type(`month') -fundamental_type(`month day') -fundamental_type(`year') -fundamental_type(`year month') -fundamental_type(`time') -dnl -dnl Entity. -dnl -fundamental_type(`entity') -fundamental_type(`entities') -dnl -dnl Notation. -dnl -fundamental_type(`notation') -dnl - } - } -} diff --git a/xsd-frontend/semantic-graph/fundamental.hxx.m4 b/xsd-frontend/semantic-graph/fundamental.hxx.m4 deleted file mode 100644 index eb02874..0000000 --- a/xsd-frontend/semantic-graph/fundamental.hxx.m4 +++ /dev/null @@ -1,153 +0,0 @@ -divert(-1) - -# file : xsd-frontend/semantic-graph/fundamental.hxx.m4 -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include(`fundamental.m4') - -define(`fundamental_type', `fundamental_type_impl(`make_class_name(`$1')', `$1')') - -define(`fundamental_type_impl', ` - - // - // - class $1: public virtual Type - { - public: - $1 (Path const& file, - unsigned long line, - unsigned long column); - };') -divert(0)dnl -dnl -dnl -dnl -// file : xsd-frontend/semantic-graph/fundamental.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Note, that this file is automatically generated! -// - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_FUNDAMENTAL_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_FUNDAMENTAL_HXX - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - namespace Fundamental - { - // - // - class Type: public virtual SemanticGraph::Type - { - protected: - Type (); - }; -dnl -dnl Integers. -dnl -fundamental_type(`byte') -fundamental_type(`unsigned byte') -fundamental_type(`short') -fundamental_type(`unsigned short') -fundamental_type(`int') -fundamental_type(`unsigned int') -fundamental_type(`long') -fundamental_type(`unsigned long') -fundamental_type(`integer') -fundamental_type(`non positive integer') -fundamental_type(`non negative integer') -fundamental_type(`positive integer') -fundamental_type(`negative integer') -dnl -dnl Boolean. -dnl -fundamental_type(`boolean') -dnl -dnl Floats. -dnl -fundamental_type(`float') -fundamental_type(`double') -fundamental_type(`decimal') -dnl -dnl Strings. -dnl -fundamental_type(`string') -fundamental_type(`normalized string') -fundamental_type(`token') -fundamental_type(`name') -fundamental_type(`name token') -fundamental_type(`name tokens') -fundamental_type(`NC name') -fundamental_type(`language') -dnl -dnl Qualified name. -dnl -fundamental_type(`q name') -dnl -dnl ID/IDREF. -dnl -fundamental_type(`id') - - - // - // - class IdRef: public virtual Type, - public virtual Specialization - { - public: - IdRef (Path const& file, - unsigned long line, - unsigned long column); - }; - - - // - // - class IdRefs: public virtual Type, - public virtual Specialization - { - public: - IdRefs (Path const& file, - unsigned long line, - unsigned long column); - }; -dnl -dnl URI. -dnl -fundamental_type(`any URI') -dnl -dnl Binary. -dnl -fundamental_type(`base 64 binary') -fundamental_type(`hex binary') -dnl -dnl Date/time. -dnl -fundamental_type(`date') -fundamental_type(`date time') -fundamental_type(`duration') -fundamental_type(`day') -fundamental_type(`month') -fundamental_type(`month day') -fundamental_type(`year') -fundamental_type(`year month') -fundamental_type(`time') -dnl -dnl Entity. -dnl -fundamental_type(`entity') -fundamental_type(`entities') -dnl -dnl Notation. -dnl -fundamental_type(`notation') -dnl - } - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_FUNDAMENTAL_HXX diff --git a/xsd-frontend/semantic-graph/fundamental.m4 b/xsd-frontend/semantic-graph/fundamental.m4 deleted file mode 100644 index c92881d..0000000 --- a/xsd-frontend/semantic-graph/fundamental.m4 +++ /dev/null @@ -1,16 +0,0 @@ -# file : xsd-frontend/semantic-graph/fundamental.m4 -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -define(`upcase', `translit(`$*', `a-z', `A-Z')') - - -define(`capitalize_word', - `regexp(`$1', `^\(.\)\(.*\)', `upcase(`\1')`\2'')') - - -define(`capitalize', - `patsubst(`$1', `\w+', `capitalize_word(`\&')')') - -define(`make_class_name', `patsubst(capitalize(`$1'), ` ')') - -define(`make_var_name', `patsubst(`$1', ` ', `_')') diff --git a/xsd-frontend/semantic-graph/list.cxx b/xsd-frontend/semantic-graph/list.cxx deleted file mode 100644 index b1f6f30..0000000 --- a/xsd-frontend/semantic-graph/list.cxx +++ /dev/null @@ -1,33 +0,0 @@ -// file : xsd-frontend/semantic-graph/list.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - List:: - List (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - namespace - { - using compiler::type_info; - - struct ListInit - { - ListInit () - { - type_info ti (typeid (List)); - ti.add_base (typeid (Specialization)); - insert (ti); - } - } list_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/list.hxx b/xsd-frontend/semantic-graph/list.hxx deleted file mode 100644 index ae9a65d..0000000 --- a/xsd-frontend/semantic-graph/list.hxx +++ /dev/null @@ -1,21 +0,0 @@ -// file : xsd-frontend/semantic-graph/list.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_LIST_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_LIST_HXX - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class List: public virtual Specialization - { - public: - List (Path const& file, unsigned long line, unsigned long column); - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_LIST_HXX diff --git a/xsd-frontend/semantic-graph/namespace.cxx b/xsd-frontend/semantic-graph/namespace.cxx deleted file mode 100644 index ec3c29e..0000000 --- a/xsd-frontend/semantic-graph/namespace.cxx +++ /dev/null @@ -1,33 +0,0 @@ -// file : xsd-frontend/semantic-graph/namespace.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - Namespace:: - Namespace (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - namespace - { - using compiler::type_info; - - struct NamespaceInit - { - NamespaceInit () - { - type_info ti (typeid (Namespace)); - ti.add_base (typeid (Scope)); - insert (ti); - } - } namespace_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/namespace.hxx b/xsd-frontend/semantic-graph/namespace.hxx deleted file mode 100644 index 8155ffd..0000000 --- a/xsd-frontend/semantic-graph/namespace.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// file : xsd-frontend/semantic-graph/namespace.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_NAMESPACE_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_NAMESPACE_HXX - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class Namespace : public virtual Scope - { - public: - Namespace (Path const& file, unsigned long line, unsigned long column); - - void - add_edge_right (BelongsToNamespace&) {} - - using Scope::add_edge_right; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_NAMESPACE_HXX diff --git a/xsd-frontend/semantic-graph/particle.cxx b/xsd-frontend/semantic-graph/particle.cxx deleted file mode 100644 index c303b8f..0000000 --- a/xsd-frontend/semantic-graph/particle.cxx +++ /dev/null @@ -1,53 +0,0 @@ -// file : xsd-frontend/semantic-graph/particle.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // ContainsParticle - // - ContainsParticle:: - ContainsParticle (unsigned long min, unsigned long max) - : particle_ (0), compositor_ (0), min_ (min), max_ (max) - { - } - - // Particle - // - Particle:: - Particle () - : contained_particle_ (0) - { - } - - namespace - { - using compiler::type_info; - - struct ContainsParticleInit - { - ContainsParticleInit () - { - type_info ti (typeid (ContainsParticle)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } contains_particle_init_; - - struct ParticleInit - { - ParticleInit () - { - type_info ti (typeid (Particle)); - ti.add_base (typeid (Node)); - insert (ti); - } - } particle_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/particle.hxx b/xsd-frontend/semantic-graph/particle.hxx deleted file mode 100644 index 2f208f4..0000000 --- a/xsd-frontend/semantic-graph/particle.hxx +++ /dev/null @@ -1,139 +0,0 @@ -// file : xsd-frontend/semantic-graph/particle.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_PARTICLE_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_PARTICLE_HXX - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // - // - class Particle; - class Compositor; - - - // - // - class ContainsParticle: public virtual Edge - { - public: - Particle& - particle () const - { - return *particle_; - } - - Compositor& - compositor () const - { - return *compositor_; - } - - public: - unsigned long - min () const - { - return min_; - } - - unsigned long - max () const - { - return max_; - } - - public: - ContainsParticle (unsigned long min, unsigned long max); - - void - set_left_node (Compositor& n) - { - compositor_ = &n; - } - - void - set_right_node (Particle& n) - { - particle_ = &n; - } - - void - clear_left_node (Compositor& n) - { - assert (compositor_ == &n); - compositor_ = 0; - } - - void - clear_right_node (Particle& n) - { - assert (particle_ == &n); - particle_ = 0; - } - - private: - Particle* particle_; - Compositor* compositor_; - unsigned long min_, max_; - }; - - // - // - class Particle: public virtual Node - { - public: - bool - contained_particle_p () - { - return contained_particle_ != 0; - } - - ContainsParticle& - contained_particle () - { - assert (contained_particle_ != 0); - return *contained_particle_; - } - - public: - unsigned long - min () const - { - assert (contained_particle_ != 0); - return contained_particle_->min (); - } - - unsigned long - max () const - { - assert (contained_particle_ != 0); - return contained_particle_->max (); - } - - public: - Particle (); - - void - add_edge_right (ContainsParticle& e) - { - contained_particle_ = &e; - } - - void - remove_edge_right (ContainsParticle& e) - { - assert (contained_particle_ == &e); - contained_particle_ = 0; - } - - private: - ContainsParticle* contained_particle_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_PARTICLE_HXX diff --git a/xsd-frontend/semantic-graph/schema.cxx b/xsd-frontend/semantic-graph/schema.cxx deleted file mode 100644 index 190b12b..0000000 --- a/xsd-frontend/semantic-graph/schema.cxx +++ /dev/null @@ -1,129 +0,0 @@ -// file : xsd-frontend/semantic-graph/schema.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - // Schema - // - Schema::NamesIteratorPair Schema:: - find (Name const& name) const - { - // Here we are going to create an illusion that the namespace - // hierarchy is flat. - names_.clear (); - schemas_.clear (); - - find_ (name, names_, schemas_); - - return NamesIteratorPair (NamesConstIterator (names_.begin ()), - NamesConstIterator (names_.end ())); - } - - void Schema:: - find_ (Name const& name, NamesList& names, SchemaSet& set) const - { - set.insert (this); - - // Check our own namespace first so it will end up first in the list. - // - NamesIteratorPair pair (Scope::find (name)); - names.insert (names.end (), pair.first.base (), pair.second.base ()); - - for (UsesIterator i (uses_begin ()), end (uses_end ()); i != end; ++i) - { - Schema& s (i->schema ()); - - if (set.find (&s) == set.end ()) - s.find_ (name, names, set); - } - } - - namespace - { - using compiler::type_info; - - // Uses - // - struct UsesInit - { - UsesInit () - { - type_info ti (typeid (Uses)); - ti.add_base (typeid (Edge)); - insert (ti); - } - } uses_init_; - - - // Implies - // - struct ImpliesInit - { - ImpliesInit () - { - type_info ti (typeid (Implies)); - ti.add_base (typeid (Uses)); - insert (ti); - } - } implies_init_; - - - // Sources - // - struct SourcesInit - { - SourcesInit () - { - type_info ti (typeid (Sources)); - ti.add_base (typeid (Uses)); - insert (ti); - } - } sources_init_; - - - // Includes - // - struct IncludesInit - { - IncludesInit () - { - type_info ti (typeid (Includes)); - ti.add_base (typeid (Uses)); - insert (ti); - } - } includes_init_; - - - // Imports - // - struct ImportsInit - { - ImportsInit () - { - type_info ti (typeid (Imports)); - ti.add_base (typeid (Uses)); - insert (ti); - } - } imports_init_; - - - // Schema - // - struct SchemaInit - { - SchemaInit () - { - type_info ti (typeid (Schema)); - ti.add_base (typeid (Scope)); - insert (ti); - } - } schema_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/schema.hxx b/xsd-frontend/semantic-graph/schema.hxx deleted file mode 100644 index 4c2907f..0000000 --- a/xsd-frontend/semantic-graph/schema.hxx +++ /dev/null @@ -1,236 +0,0 @@ -// file : xsd-frontend/semantic-graph/schema.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_SCHEMA_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_SCHEMA_HXX - -#include -#include - -#include -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class Schema; - - class Uses: public virtual Edge - { - public: - Schema& - user () const - { - return *user_; - } - - Schema& - schema () const - { - return *schema_; - } - - Path - path () const - { - return path_; - } - - public: - Uses (Path const& path): path_ (path) {} - - void - set_left_node (Schema& s) - { - user_ = &s; - } - - void - set_right_node (Schema& s) - { - schema_ = &s; - } - - private: - Path path_; - Schema* user_; - Schema* schema_; - }; - - - // - // - class Implies: public virtual Uses - { - public: - Implies (Path const& path): Uses (path) {} - }; - - - // - // - class Sources: public virtual Uses - { - public: - Sources (Path const& path): Uses (path) {} - }; - - - // - // - class Includes: public virtual Uses - { - public: - Includes (Path const& path): Uses (path) {} - }; - - - // - // - class Imports: public virtual Uses - { - public: - Imports (Path const& path): Uses (path) {} - }; - - // - // - class Schema: public graph, public virtual Scope - { - typedef std::vector UsesList; - typedef std::vector UsedList; - - public: - Schema (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column), graph_ (*this) - { - } - - private: - Schema (Schema const&); - Schema& operator= (Schema const&); - - public: - typedef pointer_iterator UsesIterator; - - UsesIterator - uses_begin () const - { - return uses_.begin (); - } - - UsesIterator - uses_end () const - { - return uses_.end (); - } - - public: - typedef pointer_iterator UsedIterator; - - UsedIterator - used_begin () const - { - return used_.begin (); - } - - UsedIterator - used_end () const - { - return used_.end (); - } - - bool - used_p () const - { - return used_begin () != used_end (); - } - - virtual NamesIteratorPair - find (Name const& name) const; - - public: - using graph::new_edge; - using graph::reset_left_node; - using graph::reset_right_node; - using graph::add_edge_left; - using graph::add_edge_right; - using graph::delete_node; - using graph::delete_edge; - - template - T& - new_node (Path const& file, unsigned long line, unsigned long column) - { - return graph_.new_node (file, line, column); - } - - template - T& - new_node (Path const& file, unsigned long line, unsigned long column, - A0 const& a0) - { - return graph_.new_node (file, line, column, a0); - } - - template - T& - new_node (Path const& file, unsigned long line, unsigned long column, - A0 const& a0, A1 const& a1) - { - return graph_.new_node (file, line, column, a0, a1); - } - - template - T& - new_node (Path const& file, unsigned long line, unsigned long column, - A0 const& a0, A1 const& a1, A2 const& a2) - { - return graph_.new_node (file, line, column, a0, a1, a2); - } - - template - T& - new_node (Path const& file, unsigned long line, unsigned long column, - A0 const& a0, A1 const& a1, A2 const& a2, A3 const& a3) - { - return graph_.new_node (file, line, column, a0, a1, a2, a3); - } - - public: - using Scope::add_edge_left; - using Node::add_edge_right; - - void - add_edge_left (Uses& e) - { - uses_.push_back (&e); - } - - void - add_edge_right (Uses& e) - { - used_.push_back (&e); - } - - private: - typedef std::set SchemaSet; - - void - find_ (Name const& name, NamesList&, SchemaSet&) const; - - private: - graph& graph_; - - UsesList uses_; - UsedList used_; - - mutable NamesList names_; - mutable SchemaSet schemas_; - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_SCHEMA_HXX diff --git a/xsd-frontend/semantic-graph/union.cxx b/xsd-frontend/semantic-graph/union.cxx deleted file mode 100644 index 778c73a..0000000 --- a/xsd-frontend/semantic-graph/union.cxx +++ /dev/null @@ -1,33 +0,0 @@ -// file : xsd-frontend/semantic-graph/union.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - Union:: - Union (Path const& file, unsigned long line, unsigned long column) - : Node (file, line, column) - { - } - - namespace - { - using compiler::type_info; - - struct UnionInit - { - UnionInit () - { - type_info ti (typeid (Union)); - ti.add_base (typeid (Specialization)); - insert (ti); - } - } union_init_; - } - } -} diff --git a/xsd-frontend/semantic-graph/union.hxx b/xsd-frontend/semantic-graph/union.hxx deleted file mode 100644 index 7a54fb0..0000000 --- a/xsd-frontend/semantic-graph/union.hxx +++ /dev/null @@ -1,21 +0,0 @@ -// file : xsd-frontend/semantic-graph/union.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef XSD_FRONTEND_SEMANTIC_GRAPH_UNION_HXX -#define XSD_FRONTEND_SEMANTIC_GRAPH_UNION_HXX - -#include - -namespace XSDFrontend -{ - namespace SemanticGraph - { - class Union: public virtual Specialization - { - public: - Union (Path const& file, unsigned long line, unsigned long column); - }; - } -} - -#endif // XSD_FRONTEND_SEMANTIC_GRAPH_UNION_HXX -- cgit v1.1