summaryrefslogtreecommitdiff
path: root/libxsd-frontend/xsd-frontend/generators/dependencies.cxx
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:11 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-06 10:24:11 +0100
commit4538829ab86b5a1cd4e845e7eab165029c9d6d46 (patch)
treebbadf39aed0610c8f8f7b41fefff47773b8ac205 /libxsd-frontend/xsd-frontend/generators/dependencies.cxx
parent23d41842168ac1a1580111b9c5c73500ceee3d57 (diff)
parentaad5ad9bf0c02aa4e79bc6b7d6c934612fff4026 (diff)
Update upstream source from tag 'upstream/4.2.0'
Update to upstream version '4.2.0' with Debian dir 1b38df7bbcf313223de3c50107ac0255090fe647
Diffstat (limited to 'libxsd-frontend/xsd-frontend/generators/dependencies.cxx')
-rw-r--r--libxsd-frontend/xsd-frontend/generators/dependencies.cxx70
1 files changed, 0 insertions, 70 deletions
diff --git a/libxsd-frontend/xsd-frontend/generators/dependencies.cxx b/libxsd-frontend/xsd-frontend/generators/dependencies.cxx
deleted file mode 100644
index 55e7ae8..0000000
--- a/libxsd-frontend/xsd-frontend/generators/dependencies.cxx
+++ /dev/null
@@ -1,70 +0,0 @@
-// file : xsd-frontend/generators/dependencies.cxx
-// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC
-// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
-
-#include <xsd-frontend/semantic-graph.hxx>
-#include <xsd-frontend/traversal.hxx>
-
-#include <xsd-frontend/generators/dependencies.hxx>
-
-namespace XSDFrontend
-{
- typedef std::vector<SemanticGraph::Path> Paths;
-
- namespace
- {
- // Go into included/imported (but not implied) schemas while making
- // sure we don't process the same stuff more than once.
- //
- struct Uses: Traversal::Uses
- {
- Uses (Paths& p): paths_ (p) {}
-
- virtual void
- traverse (Type& u)
- {
- if (u.is_a<SemanticGraph::Implies> ())
- return;
-
- SemanticGraph::Schema& s (u.schema ());
-
- if (!s.context ().count ("xsd-frontend-dependencies-seen"))
- {
- s.context ().set ("xsd-frontend-dependencies-seen", true);
-
- // While the edge contains the exact path that was found in the
- // schema, the schema node itself has the reative to the including
- // or importing schema path, which is what we want.
- //
- paths_.push_back (s.file ());
- Traversal::Uses::traverse (u);
- }
- }
-
- private:
- Paths& paths_;
- };
- }
-
- namespace Generators
- {
- Paths Dependencies::
- generate (SemanticGraph::Schema& s, SemanticGraph::Path const& p)
- {
- Paths r;
- r.push_back (p);
-
- Traversal::Schema schema;
- Uses uses (r);
-
- schema >> uses >> schema;
-
- // Some twisted schemas do recusive inclusions.
- //
- s.context ().set ("xsd-frontend-dependencies-seen", true);
-
- schema.dispatch (s);
- return r;
- }
- }
-}