summaryrefslogtreecommitdiff
path: root/libxsd-frontend/xsd-frontend/traversal/schema.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libxsd-frontend/xsd-frontend/traversal/schema.hxx')
-rw-r--r--libxsd-frontend/xsd-frontend/traversal/schema.hxx149
1 files changed, 149 insertions, 0 deletions
diff --git a/libxsd-frontend/xsd-frontend/traversal/schema.hxx b/libxsd-frontend/xsd-frontend/traversal/schema.hxx
new file mode 100644
index 0000000..a38ddfd
--- /dev/null
+++ b/libxsd-frontend/xsd-frontend/traversal/schema.hxx
@@ -0,0 +1,149 @@
+// file : xsd-frontend/traversal/schema.hxx
+// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC
+// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+#ifndef XSD_FRONTEND_TRAVERSAL_SCHEMA_HXX
+#define XSD_FRONTEND_TRAVERSAL_SCHEMA_HXX
+
+#include <xsd-frontend/traversal/elements.hxx>
+#include <xsd-frontend/semantic-graph/schema.hxx>
+
+namespace XSDFrontend
+{
+ namespace Traversal
+ {
+ //
+ //
+ struct Uses: Edge<SemanticGraph::Uses>
+ {
+ Uses ()
+ {
+ }
+
+ Uses (NodeBase& n)
+ {
+ node_traverser (n);
+ }
+
+ virtual void
+ traverse (Type& e)
+ {
+ dispatch (e.schema ());
+ }
+ };
+
+ //
+ //
+ struct Implies: Edge<SemanticGraph::Implies>
+ {
+ Implies ()
+ {
+ }
+
+ Implies (NodeBase& n)
+ {
+ node_traverser (n);
+ }
+
+ virtual void
+ traverse (Type& e)
+ {
+ dispatch (e.schema ());
+ }
+ };
+
+
+ //
+ //
+ struct Sources: Edge<SemanticGraph::Sources>
+ {
+ Sources ()
+ {
+ }
+
+ Sources (NodeBase& n)
+ {
+ node_traverser (n);
+ }
+
+ virtual void
+ traverse (Type& e)
+ {
+ dispatch (e.schema ());
+ }
+ };
+
+
+ //
+ //
+ struct Includes: Edge<SemanticGraph::Includes>
+ {
+ Includes ()
+ {
+ }
+
+ Includes (NodeBase& n)
+ {
+ node_traverser (n);
+ }
+
+ virtual void
+ traverse (Type& e)
+ {
+ dispatch (e.schema ());
+ }
+ };
+
+
+ //
+ //
+ struct Imports: Edge<SemanticGraph::Imports>
+ {
+ Imports ()
+ {
+ }
+
+ Imports (NodeBase& n)
+ {
+ node_traverser (n);
+ }
+
+ virtual void
+ traverse (Type& e)
+ {
+ dispatch (e.schema ());
+ }
+ };
+
+
+ //
+ //
+ struct Schema: ScopeTemplate<SemanticGraph::Schema>
+ {
+ virtual void
+ traverse (Type& s)
+ {
+ pre (s);
+
+ iterate_and_dispatch (
+ s.uses_begin (), s.uses_end (), edge_traverser ());
+
+ names (s);
+
+ post (s);
+ }
+
+ virtual void
+ pre (Type&)
+ {
+ }
+
+ virtual void
+ post (Type&)
+ {
+ }
+ };
+ }
+}
+
+#endif // XSD_FRONTEND_TRAVERSAL_SCHEMA_HXX