From a15cf65c44d5c224169c32ef5495b68c758134b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 18 May 2014 16:08:14 +0200 Subject: Imported Upstream version 3.3.0.2 --- .../xsd-frontend/traversal/compositors.cxx | 165 +++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 libxsd-frontend/xsd-frontend/traversal/compositors.cxx (limited to 'libxsd-frontend/xsd-frontend/traversal/compositors.cxx') 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 +// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include + +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&) + { + } + } +} -- cgit v1.2.3