summaryrefslogtreecommitdiff
path: root/cli/cli/traversal/option.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-08 14:51:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-27 11:38:53 +0300
commit720c5a33b6a49cf328fdd7611f49153cf8f60247 (patch)
tree9725f3d1f42ec90fde84520f49647edea013ce5e /cli/cli/traversal/option.cxx
parent3183f3bb927a90783ae0aeaf190a0919377aabe4 (diff)
Separate tests and examples into individual packages
Also make cli module to be explicitly enabled via the config.cli configuration variable.
Diffstat (limited to 'cli/cli/traversal/option.cxx')
-rw-r--r--cli/cli/traversal/option.cxx59
1 files changed, 59 insertions, 0 deletions
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 <boris@codesynthesis.com>
+// license : MIT; see accompanying LICENSE file
+
+#include <cli/traversal/option.hxx>
+#include <cli/traversal/expression.hxx>
+
+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&)
+ {
+ }
+}