diff options
author | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <jff@merkur> | 2014-05-18 16:08:14 +0200 |
commit | a15cf65c44d5c224169c32ef5495b68c758134b7 (patch) | |
tree | 3419f58fc8e1b315ba8171910ee044c5d467c162 /libxsd-frontend/xsd-frontend/traversal/compositors.cxx |
Imported Upstream version 3.3.0.2upstream/3.3.0.2
Diffstat (limited to 'libxsd-frontend/xsd-frontend/traversal/compositors.cxx')
-rw-r--r-- | libxsd-frontend/xsd-frontend/traversal/compositors.cxx | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/libxsd-frontend/xsd-frontend/traversal/compositors.cxx b/libxsd-frontend/xsd-frontend/traversal/compositors.cxx new file mode 100644 index 0000000..d3089fc --- /dev/null +++ b/libxsd-frontend/xsd-frontend/traversal/compositors.cxx @@ -0,0 +1,165 @@ +// file : xsd-frontend/traversal/compositors.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include <xsd-frontend/traversal/compositors.hxx> + +namespace XSDFrontend +{ + namespace Traversal + { + // ContainsParticle + // + Void ContainsParticle:: + traverse (Type& c) + { + dispatch (c.particle ()); + } + + + // ContainsCompositor + // + Void ContainsCompositor:: + traverse (Type& c) + { + dispatch (c.compositor ()); + } + + + // Compositor + // + Void Compositor:: + traverse (Type& c) + { + pre (c); + contains (c); + post (c); + } + + Void Compositor:: + pre (Type&) + { + } + + Void Compositor:: + contains (Type& c) + { + iterate_and_dispatch ( + c.contains_begin (), c.contains_end (), edge_traverser ()); + } + + Void Compositor:: + contains (Type& c, EdgeDispatcherBase& d) + { + iterate_and_dispatch (c.contains_begin (), c.contains_end (), d); + } + + Void Compositor:: + post (Type&) + { + } + + + // All + // + Void All:: + traverse (Type& c) + { + pre (c); + contains (c); + post (c); + } + + Void All:: + pre (Type&) + { + } + + Void All:: + contains (Type& c) + { + iterate_and_dispatch ( + c.contains_begin (), c.contains_end (), edge_traverser ()); + } + + Void All:: + contains (Type& c, EdgeDispatcherBase& d) + { + iterate_and_dispatch (c.contains_begin (), c.contains_end (), d); + } + + Void All:: + post (Type&) + { + } + + + // Choice + // + Void Choice:: + traverse (Type& c) + { + pre (c); + contains (c); + post (c); + } + + Void Choice:: + pre (Type&) + { + } + + Void Choice:: + contains (Type& c) + { + iterate_and_dispatch ( + c.contains_begin (), c.contains_end (), edge_traverser ()); + } + + Void Choice:: + contains (Type& c, EdgeDispatcherBase& d) + { + iterate_and_dispatch (c.contains_begin (), c.contains_end (), d); + } + + Void Choice:: + post (Type&) + { + } + + + // Sequence + // + Void Sequence:: + traverse (Type& c) + { + pre (c); + contains (c); + post (c); + } + + Void Sequence:: + pre (Type&) + { + } + + Void Sequence:: + contains (Type& c) + { + iterate_and_dispatch ( + c.contains_begin (), c.contains_end (), edge_traverser ()); + } + + Void Sequence:: + contains (Type& c, EdgeDispatcherBase& d) + { + iterate_and_dispatch (c.contains_begin (), c.contains_end (), d); + } + + Void Sequence:: + post (Type&) + { + } + } +} |