aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-05-09 15:55:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-05-09 15:55:57 +0200
commit0bc53d3b22cedbe9e1f773e0a350280aef805eeb (patch)
tree9886f9aa18b538cf622a78786f43bf0d917a1bca
parent900cdb2da86c6a9c523bac093aef482a1f1033e3 (diff)
Use graph container from libcutl instead of libcult
-rw-r--r--xsd-frontend/semantic-graph/annotation.hxx25
-rw-r--r--xsd-frontend/semantic-graph/any-attribute.hxx4
-rw-r--r--xsd-frontend/semantic-graph/any.hxx4
-rw-r--r--xsd-frontend/semantic-graph/attribute-group.hxx4
-rw-r--r--xsd-frontend/semantic-graph/attribute.hxx4
-rw-r--r--xsd-frontend/semantic-graph/complex.hxx16
-rw-r--r--xsd-frontend/semantic-graph/compositors.hxx65
-rw-r--r--xsd-frontend/semantic-graph/element-group.hxx8
-rw-r--r--xsd-frontend/semantic-graph/element.hxx16
-rw-r--r--xsd-frontend/semantic-graph/elements.hxx165
-rw-r--r--xsd-frontend/semantic-graph/enumeration.hxx8
-rw-r--r--xsd-frontend/semantic-graph/fundamental.hxx.m414
-rw-r--r--xsd-frontend/semantic-graph/list.hxx4
-rw-r--r--xsd-frontend/semantic-graph/namespace.hxx8
-rw-r--r--xsd-frontend/semantic-graph/particle.hxx8
-rw-r--r--xsd-frontend/semantic-graph/schema.hxx106
-rw-r--r--xsd-frontend/semantic-graph/union.hxx4
17 files changed, 131 insertions, 332 deletions
diff --git a/xsd-frontend/semantic-graph/annotation.hxx b/xsd-frontend/semantic-graph/annotation.hxx
index 5505e45..c6e5dfc 100644
--- a/xsd-frontend/semantic-graph/annotation.hxx
+++ b/xsd-frontend/semantic-graph/annotation.hxx
@@ -25,13 +25,8 @@ namespace XSDFrontend
return *annotation_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Annotates ()
- : annotation_ (0)
- {
- }
+ public:
+ Annotates (): annotation_ (0) {}
Void
set_left_node (Annotation& a)
@@ -40,14 +35,10 @@ namespace XSDFrontend
}
Void
- set_right_node (Node&)
- {
- }
+ set_right_node (Node&) {}
Void
- set_right_node (Edge&)
- {
- }
+ set_right_node (Edge&) {}
private:
Annotation* annotation_;
@@ -64,9 +55,7 @@ namespace XSDFrontend
return documentation_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Annotation (Path const& file,
UnsignedLong line,
UnsignedLong column,
@@ -76,9 +65,7 @@ namespace XSDFrontend
}
Void
- add_edge_left (Annotates&)
- {
- }
+ add_edge_left (Annotates&) {}
private:
WideString documentation_;
diff --git a/xsd-frontend/semantic-graph/any-attribute.hxx b/xsd-frontend/semantic-graph/any-attribute.hxx
index 96a8ddd..366bc0b 100644
--- a/xsd-frontend/semantic-graph/any-attribute.hxx
+++ b/xsd-frontend/semantic-graph/any-attribute.hxx
@@ -61,9 +61,7 @@ namespace XSDFrontend
Namespace&
definition_namespace ();
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
AnyAttribute (Path const& file,
UnsignedLong line,
UnsignedLong column,
diff --git a/xsd-frontend/semantic-graph/any.hxx b/xsd-frontend/semantic-graph/any.hxx
index 9dab835..5059ff4 100644
--- a/xsd-frontend/semantic-graph/any.hxx
+++ b/xsd-frontend/semantic-graph/any.hxx
@@ -63,9 +63,7 @@ namespace XSDFrontend
Namespace&
definition_namespace ();
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Any (Path const& file,
UnsignedLong line,
UnsignedLong column,
diff --git a/xsd-frontend/semantic-graph/attribute-group.hxx b/xsd-frontend/semantic-graph/attribute-group.hxx
index 4662dd8..a202ae0 100644
--- a/xsd-frontend/semantic-graph/attribute-group.hxx
+++ b/xsd-frontend/semantic-graph/attribute-group.hxx
@@ -14,9 +14,7 @@ namespace XSDFrontend
{
class AttributeGroup: public virtual Scope
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
AttributeGroup (Path const& file,
UnsignedLong line,
UnsignedLong column);
diff --git a/xsd-frontend/semantic-graph/attribute.hxx b/xsd-frontend/semantic-graph/attribute.hxx
index 128d9f4..49c2019 100644
--- a/xsd-frontend/semantic-graph/attribute.hxx
+++ b/xsd-frontend/semantic-graph/attribute.hxx
@@ -21,9 +21,7 @@ namespace XSDFrontend
return optional_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Attribute (Path const& file,
UnsignedLong line,
UnsignedLong column,
diff --git a/xsd-frontend/semantic-graph/complex.hxx b/xsd-frontend/semantic-graph/complex.hxx
index 7253c46..7fd9e54 100644
--- a/xsd-frontend/semantic-graph/complex.hxx
+++ b/xsd-frontend/semantic-graph/complex.hxx
@@ -45,16 +45,9 @@ namespace XSDFrontend
mixed_ = m;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Complex (); // Virtual inheritance (Enumeration).
+ public:
Complex (Path const& file, UnsignedLong line, UnsignedLong column);
- using Type::add_edge_right;
- using Type::add_edge_left;
- using Scope::add_edge_left;
-
Void
add_edge_left (ContainsCompositor& e)
{
@@ -68,6 +61,13 @@ namespace XSDFrontend
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:
Boolean mixed_;
ContainsCompositor* contains_compositor_;
diff --git a/xsd-frontend/semantic-graph/compositors.hxx b/xsd-frontend/semantic-graph/compositors.hxx
index 4623a3c..f646640 100644
--- a/xsd-frontend/semantic-graph/compositors.hxx
+++ b/xsd-frontend/semantic-graph/compositors.hxx
@@ -45,9 +45,7 @@ namespace XSDFrontend
return max_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
ContainsCompositor (UnsignedLong min, UnsignedLong max);
Void
@@ -82,7 +80,6 @@ namespace XSDFrontend
UnsignedLong min_, max_;
};
-
//
//
class Compositor: public virtual Particle
@@ -157,18 +154,25 @@ namespace XSDFrontend
return Particle::max ();
}
- protected:
- friend class Bits::Graph<Node, Edge>;
+ public:
+ Compositor (): contained_compositor_ (0) {}
- Compositor ()
- : contained_compositor_ (0)
+ Void
+ add_edge_left (ContainsParticle& e)
{
+ contains_.push_back (&e);
}
Void
- add_edge_left (ContainsParticle& e)
+ add_edge_left (ContainsParticle& e, ContainsIterator const& after)
{
- contains_.push_back (&e);
+ if (after.base () == contains_.end ())
+ contains_.push_front (&e);
+ else
+ {
+ ContainsList::Iterator i (after.base ());
+ contains_.insert (++i, &e);
+ }
}
Void
@@ -185,28 +189,6 @@ namespace XSDFrontend
}
}
- //@@ Ideally should be protected but then NodeArg has no way to
- // access it. Maybe when (if) I move NodeArg into Grpah I can
- // resolve this.
- //
- public:
- 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);
- }
- }
-
- protected:
- using Node::add_edge_right;
- using Particle::add_edge_right;
- using Particle::remove_edge_right;
-
Void
add_edge_right (ContainsCompositor& e)
{
@@ -220,41 +202,36 @@ namespace XSDFrontend
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
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
All (Path const& file, UnsignedLong line, UnsignedLong column);
};
-
//
//
class Choice: public virtual Compositor
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Choice (Path const& file, UnsignedLong line, UnsignedLong column);
};
-
//
//
class Sequence: public virtual Compositor
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Sequence (Path const& file, UnsignedLong line, UnsignedLong column);
};
}
diff --git a/xsd-frontend/semantic-graph/element-group.hxx b/xsd-frontend/semantic-graph/element-group.hxx
index cffb884..8de3336 100644
--- a/xsd-frontend/semantic-graph/element-group.hxx
+++ b/xsd-frontend/semantic-graph/element-group.hxx
@@ -23,19 +23,17 @@ namespace XSDFrontend
return *contains_compositor_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
ElementGroup (Path const& file, UnsignedLong line, UnsignedLong column);
- using Scope::add_edge_left;
-
Void
add_edge_left (ContainsCompositor& e)
{
contains_compositor_ = &e;
}
+ using Scope::add_edge_left;
+
private:
ContainsCompositor* contains_compositor_;
};
diff --git a/xsd-frontend/semantic-graph/element.hxx b/xsd-frontend/semantic-graph/element.hxx
index bc5488c..425ddce 100644
--- a/xsd-frontend/semantic-graph/element.hxx
+++ b/xsd-frontend/semantic-graph/element.hxx
@@ -30,13 +30,7 @@ namespace XSDFrontend
return *root_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Substitutes ()
- {
- }
-
+ public:
Void
set_left_node (Element& n)
{
@@ -72,9 +66,7 @@ namespace XSDFrontend
return *substitutes_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Element (Path const& file,
UnsignedLong line,
UnsignedLong column,
@@ -88,9 +80,7 @@ namespace XSDFrontend
}
Void
- add_edge_right (Substitutes&)
- {
- }
+ add_edge_right (Substitutes&) {}
using Member::add_edge_left;
using Member::add_edge_right;
diff --git a/xsd-frontend/semantic-graph/elements.hxx b/xsd-frontend/semantic-graph/elements.hxx
index 180a3b4..2d01c91 100644
--- a/xsd-frontend/semantic-graph/elements.hxx
+++ b/xsd-frontend/semantic-graph/elements.hxx
@@ -12,13 +12,14 @@
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/exception.hpp>
+#include <cutl/container/graph.hxx>
+
#include <cult/types.hxx>
#include <cult/containers/set.hxx>
#include <cult/containers/map.hxx>
#include <cult/containers/list.hxx>
#include <cult/containers/pair.hxx>
-#include <cult/containers/graph.hxx>
#include <cult/containers/vector.hxx>
#include <cutl/compiler/context.hxx>
@@ -33,8 +34,6 @@ namespace XSDFrontend
namespace Bits
{
- using Cult::Containers::Graph;
-
//@@ Should end up in Cult::Meta
//
template <typename X>
@@ -201,13 +200,6 @@ namespace XSDFrontend
return dynamic_cast<X const*> (this) != 0;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Edge ()
- {
- }
-
private:
mutable Context context_;
};
@@ -274,31 +266,26 @@ namespace XSDFrontend
}
public:
-
virtual
- ~Node ()
- {
- }
-
- protected:
- friend class Bits::Graph<Node, Edge>;
+ ~Node () {}
Node (Path const& file, UnsignedLong line, UnsignedLong column)
: annotates_ (0), file_ (file), line_ (line), column_ (column)
{
}
- Node () // For virtual inheritance.
- {
- abort (); // Told you so!
- }
-
Void
add_edge_right (Annotates& a)
{
annotates_ = &a;
}
+ protected:
+ Node () // For virtual inheritance.
+ {
+ abort (); // Told you so!
+ }
+
private:
mutable Context context_;
Annotates* annotates_;
@@ -313,6 +300,9 @@ namespace XSDFrontend
return &x == &y;
}
+ //
+ //
+ typedef container::graph<Node, Edge> graph;
//
//
@@ -348,13 +338,8 @@ namespace XSDFrontend
return *named_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Names (Name const& name)
- : name_ (name)
- {
- }
+ public:
+ Names (Name const& name): name_ (name) {}
Void
set_left_node (Scope& n)
@@ -419,13 +404,8 @@ namespace XSDFrontend
return *named_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Nameable ()
- : named_ (0)
- {
- }
+ public:
+ Nameable (): named_ (0) {}
Void
add_edge_right (Names& e)
@@ -526,18 +506,12 @@ namespace XSDFrontend
return i != iterator_map_.end () ? i->second : names_.end ();
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Scope (Path const& file, UnsignedLong line, UnsignedLong column)
: Node (file, line, column)
{
}
- Scope ()
- {
- }
-
Void
add_edge_left (Names& e)
{
@@ -565,11 +539,6 @@ namespace XSDFrontend
}
}
- //@@ Ideally should be protected but then NodeArg has no way to
- // access it. Maybe when (if) I move NodeArg into Grpah I can
- // resolve this.
- //
- public:
Void
add_edge_left (Names& e, NamesIterator const& after)
{
@@ -587,9 +556,11 @@ namespace XSDFrontend
names_map_[e.name ()].push_back (&e);
}
- protected:
using Nameable::add_edge_right;
+ protected:
+ Scope () {}
+
private:
NamesList names_;
ListIteratorMap iterator_map_;
@@ -686,13 +657,8 @@ namespace XSDFrontend
return arguments_.end ();
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Type ()
- : inherits_ (0)
- {
- }
+ public:
+ Type (): inherits_ (0) {}
Void
add_edge_right (Belongs& e)
@@ -730,7 +696,6 @@ namespace XSDFrontend
ArgumentsSet arguments_;
};
-
class Instance: public virtual Nameable
{
public:
@@ -749,13 +714,8 @@ namespace XSDFrontend
return belongs_ != 0;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Instance ()
- : belongs_ (0)
- {
- }
+ public:
+ Instance (): belongs_ (0) {}
Void
add_edge_left (Belongs& e)
@@ -783,13 +743,7 @@ namespace XSDFrontend
return *type_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Belongs ()
- {
- }
-
+ public:
Void
set_left_node (Instance& n)
{
@@ -825,13 +779,7 @@ namespace XSDFrontend
return *derived_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Inherits ()
- {
- }
-
+ public:
Void
set_left_node (Type& n)
{
@@ -849,15 +797,8 @@ namespace XSDFrontend
Type* derived_;
};
-
class Extends: public virtual Inherits
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Extends ()
- {
- }
};
class Restricts: public virtual Inherits
@@ -908,13 +849,6 @@ namespace XSDFrontend
}
protected:
- friend class Bits::Graph<Node, Edge>;
-
- Restricts ()
- {
- }
-
- protected:
Facets facets_;
};
@@ -941,13 +875,8 @@ namespace XSDFrontend
return *namespace__;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- BelongsToNamespace ()
- : member_ (0), namespace__ (0)
- {
- }
+ public:
+ BelongsToNamespace (): member_ (0), namespace__ (0) {}
Void
set_left_node (Member& n)
@@ -1039,9 +968,7 @@ namespace XSDFrontend
value_type_ = ValueType::fixed;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Member (Boolean global, Boolean qualified)
: global_ (global),
qualified_ (qualified),
@@ -1130,9 +1057,7 @@ namespace XSDFrontend
return *argumented_[0];
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
using Type::add_edge_right;
Void
@@ -1142,20 +1067,18 @@ namespace XSDFrontend
}
Void
- remove_edge_right (Arguments&);
-
- public:
- 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:
@@ -1171,9 +1094,7 @@ namespace XSDFrontend
return *specialization_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
void
set_left_node (Type& n)
{
@@ -1210,17 +1131,14 @@ namespace XSDFrontend
//
class AnyType: public virtual Type
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
AnyType (Path const& file, UnsignedLong line, UnsignedLong column)
: Node (file, line, column)
{
}
- AnyType () // For virtual inheritance.
- {
- }
+ protected:
+ AnyType () {} // For virtual inheritance.
};
@@ -1228,17 +1146,14 @@ namespace XSDFrontend
//
class AnySimpleType: public virtual Type
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
AnySimpleType (Path const& file, UnsignedLong line, UnsignedLong column)
: Node (file, line, column)
{
}
- AnySimpleType () // For virtual inheritance.
- {
- }
+ protected:
+ AnySimpleType () {} // For virtual inheritance.
};
}
}
diff --git a/xsd-frontend/semantic-graph/enumeration.hxx b/xsd-frontend/semantic-graph/enumeration.hxx
index 19a32f6..ca00c07 100644
--- a/xsd-frontend/semantic-graph/enumeration.hxx
+++ b/xsd-frontend/semantic-graph/enumeration.hxx
@@ -15,18 +15,14 @@ namespace XSDFrontend
{
class Enumeration: public virtual Complex
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Enumeration (Path const& file, UnsignedLong line, UnsignedLong column);
};
class Enumerator: public virtual Instance
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Enumerator (Path const& file, UnsignedLong line, UnsignedLong column);
};
}
diff --git a/xsd-frontend/semantic-graph/fundamental.hxx.m4 b/xsd-frontend/semantic-graph/fundamental.hxx.m4
index 3133f19..2474822 100644
--- a/xsd-frontend/semantic-graph/fundamental.hxx.m4
+++ b/xsd-frontend/semantic-graph/fundamental.hxx.m4
@@ -15,9 +15,7 @@ define(`fundamental_type_impl', `
//
class $1: public virtual Type
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
$1 (Path const& file,
SemanticGraph::UnsignedLong line,
SemanticGraph::UnsignedLong column);
@@ -50,8 +48,6 @@ namespace XSDFrontend
class Type: public virtual SemanticGraph::Type
{
protected:
- friend class Bits::Graph<Node, Edge>;
-
Type ();
};
dnl
@@ -106,9 +102,7 @@ fundamental_type(`id')
class IdRef: public virtual Type,
public virtual Specialization
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
IdRef (Path const& file,
SemanticGraph::UnsignedLong line,
SemanticGraph::UnsignedLong column);
@@ -120,9 +114,7 @@ fundamental_type(`id')
class IdRefs: public virtual Type,
public virtual Specialization
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
IdRefs (Path const& file,
SemanticGraph::UnsignedLong line,
SemanticGraph::UnsignedLong column);
diff --git a/xsd-frontend/semantic-graph/list.hxx b/xsd-frontend/semantic-graph/list.hxx
index 9e0d6a8..d9f11d0 100644
--- a/xsd-frontend/semantic-graph/list.hxx
+++ b/xsd-frontend/semantic-graph/list.hxx
@@ -14,9 +14,7 @@ namespace XSDFrontend
{
class List: public virtual Specialization
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
List (Path const& file, UnsignedLong line, UnsignedLong column);
};
}
diff --git a/xsd-frontend/semantic-graph/namespace.hxx b/xsd-frontend/semantic-graph/namespace.hxx
index 12aca2e..7a2e1eb 100644
--- a/xsd-frontend/semantic-graph/namespace.hxx
+++ b/xsd-frontend/semantic-graph/namespace.hxx
@@ -14,15 +14,11 @@ namespace XSDFrontend
{
class Namespace : public virtual Scope
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Namespace (Path const& file, UnsignedLong line, UnsignedLong column);
Void
- add_edge_right (BelongsToNamespace&)
- {
- }
+ add_edge_right (BelongsToNamespace&) {}
using Scope::add_edge_right;
};
diff --git a/xsd-frontend/semantic-graph/particle.hxx b/xsd-frontend/semantic-graph/particle.hxx
index b105f31..e66a1ad 100644
--- a/xsd-frontend/semantic-graph/particle.hxx
+++ b/xsd-frontend/semantic-graph/particle.hxx
@@ -48,9 +48,7 @@ namespace XSDFrontend
return max_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
ContainsParticle (UnsignedLong min, UnsignedLong max);
Void
@@ -118,9 +116,7 @@ namespace XSDFrontend
return contained_particle_->max ();
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Particle ();
Void
diff --git a/xsd-frontend/semantic-graph/schema.hxx b/xsd-frontend/semantic-graph/schema.hxx
index 6658733..e8949a6 100644
--- a/xsd-frontend/semantic-graph/schema.hxx
+++ b/xsd-frontend/semantic-graph/schema.hxx
@@ -15,11 +15,8 @@ namespace XSDFrontend
{
namespace SemanticGraph
{
- //
- //
class Schema;
-
class Uses: public virtual Edge
{
public:
@@ -41,13 +38,8 @@ namespace XSDFrontend
return path_;
}
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Uses (Path const& path)
- : path_ (path)
- {
- }
+ public:
+ Uses (Path const& path): path_ (path) {}
Void
set_left_node (Schema& s)
@@ -72,13 +64,8 @@ namespace XSDFrontend
//
class Implies: public virtual Uses
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Implies (Path const& path)
- : Uses (path)
- {
- }
+ public:
+ Implies (Path const& path): Uses (path) {}
};
@@ -86,13 +73,8 @@ namespace XSDFrontend
//
class Sources: public virtual Uses
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Sources (Path const& path)
- : Uses (path)
- {
- }
+ public:
+ Sources (Path const& path): Uses (path) {}
};
@@ -100,13 +82,8 @@ namespace XSDFrontend
//
class Includes: public virtual Uses
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Includes (Path const& path)
- : Uses (path)
- {
- }
+ public:
+ Includes (Path const& path): Uses (path) {}
};
@@ -114,21 +91,13 @@ namespace XSDFrontend
//
class Imports: public virtual Uses
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
- Imports (Path const& path)
- : Uses (path)
- {
- }
+ public:
+ Imports (Path const& path): Uses (path) {}
};
-
//
//
- class Schema: public virtual Scope,
- private Bits::Graph<Node, Edge>,
- public NonCopyable
+ class Schema: public graph, public virtual Scope
{
typedef
Cult::Containers::Vector<Uses*>
@@ -140,10 +109,14 @@ namespace XSDFrontend
public:
Schema (Path const& file, UnsignedLong line, UnsignedLong column)
- : SemanticGraph::Node (file, line, column)
+ : Node (file, line, column), graph_ (*this)
{
}
+ private:
+ Schema (Schema const&);
+ Schema& operator= (Schema const&);
+
public:
typedef
Bits::PointerIterator<UsesList::ConstIterator>
@@ -187,19 +160,19 @@ namespace XSDFrontend
find (Name const& name) const;
public:
- using Bits::Graph<SemanticGraph::Node, Edge>::new_edge;
- using Bits::Graph<SemanticGraph::Node, Edge>::reset_left_node;
- using Bits::Graph<SemanticGraph::Node, Edge>::reset_right_node;
- using Bits::Graph<SemanticGraph::Node, Edge>::add_edge_left;
- using Bits::Graph<SemanticGraph::Node, Edge>::add_edge_right;
- using Bits::Graph<SemanticGraph::Node, Edge>::delete_node;
- using Bits::Graph<SemanticGraph::Node, Edge>::delete_edge;
+ 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 <typename T>
T&
new_node (Path const& file, UnsignedLong line, UnsignedLong column)
{
- return graph ().new_node<T> (file, line, column);
+ return graph_.new_node<T> (file, line, column);
}
template <typename T, typename A0>
@@ -207,7 +180,7 @@ namespace XSDFrontend
new_node (Path const& file, UnsignedLong line, UnsignedLong column,
A0 const& a0)
{
- return graph ().new_node<T> (file, line, column, a0);
+ return graph_.new_node<T> (file, line, column, a0);
}
template <typename T, typename A0, typename A1>
@@ -215,7 +188,7 @@ namespace XSDFrontend
new_node (Path const& file, UnsignedLong line, UnsignedLong column,
A0 const& a0, A1 const& a1)
{
- return graph ().new_node<T> (file, line, column, a0, a1);
+ return graph_.new_node<T> (file, line, column, a0, a1);
}
template <typename T, typename A0, typename A1, typename A2>
@@ -223,7 +196,7 @@ namespace XSDFrontend
new_node (Path const& file, UnsignedLong line, UnsignedLong column,
A0 const& a0, A1 const& a1, A2 const& a2)
{
- return graph ().new_node<T> (file, line, column, a0, a1, a2);
+ return graph_.new_node<T> (file, line, column, a0, a1, a2);
}
template <typename T, typename A0, typename A1, typename A2,
@@ -232,14 +205,10 @@ namespace XSDFrontend
new_node (Path const& file, UnsignedLong line, UnsignedLong column,
A0 const& a0, A1 const& a1, A2 const& a2, A3 const& a3)
{
- return graph ().new_node<T> (file, line, column, a0, a1, a2, a3);
+ return graph_.new_node<T> (file, line, column, a0, a1, a2, a3);
}
- protected:
- //@@ gcc bug #21146
- //
- friend class Bits::Graph<SemanticGraph::Node, Edge>;
-
+ public:
using Scope::add_edge_left;
using Node::add_edge_right;
@@ -256,22 +225,17 @@ namespace XSDFrontend
}
private:
- Bits::Graph<SemanticGraph::Node, Edge>&
- graph ()
- {
- return *this;
- }
-
- private:
- UsesList uses_;
- UsedList used_;
-
- private:
typedef Cult::Containers::Set<Schema const*> SchemaSet;
Void
find_ (Name const& name, NamesList&, SchemaSet&) const;
+ private:
+ graph& graph_;
+
+ UsesList uses_;
+ UsedList used_;
+
mutable NamesList names_;
mutable SchemaSet schemas_;
};
diff --git a/xsd-frontend/semantic-graph/union.hxx b/xsd-frontend/semantic-graph/union.hxx
index 5a63e6a..b3a130f 100644
--- a/xsd-frontend/semantic-graph/union.hxx
+++ b/xsd-frontend/semantic-graph/union.hxx
@@ -14,9 +14,7 @@ namespace XSDFrontend
{
class Union: public virtual Specialization
{
- protected:
- friend class Bits::Graph<Node, Edge>;
-
+ public:
Union (Path const& file, UnsignedLong line, UnsignedLong column);
};
}