From 720c5a33b6a49cf328fdd7611f49153cf8f60247 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 8 Apr 2020 14:51:57 +0300 Subject: Separate tests and examples into individual packages Also make cli module to be explicitly enabled via the config.cli configuration variable. --- cli/cli/traversal/option.cxx | 59 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 cli/cli/traversal/option.cxx (limited to 'cli/cli/traversal/option.cxx') diff --git a/cli/cli/traversal/option.cxx b/cli/cli/traversal/option.cxx new file mode 100644 index 0000000..ff5dcce --- /dev/null +++ b/cli/cli/traversal/option.cxx @@ -0,0 +1,59 @@ +// file : cli/traversal/option.cxx +// author : Boris Kolpackov +// license : MIT; see accompanying LICENSE file + +#include +#include + +namespace traversal +{ + // belongs + // + void belongs:: + traverse (type& e) + { + dispatch (e.type ()); + } + + // initialized + // + void initialized:: + traverse (type& e) + { + dispatch (e.expression ()); + } + + // option + // + void option:: + traverse (type& o) + { + pre (o); + belongs (o); + if (o.initialized_p ()) + initialized (o); + post (o); + } + + void option:: + pre (type&) + { + } + + void option:: + belongs (type& o) + { + belongs (o, edge_traverser ()); + } + + void option:: + initialized (type& o) + { + initialized (o, edge_traverser ()); + } + + void option:: + post (type&) + { + } +} -- cgit v1.1