diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-05 16:29:23 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-05 16:29:23 +0200 |
commit | 4974b4763bd60eb875f93a71dbe2fe82ecfed9fc (patch) | |
tree | 9353fb3fec3fa5f77f1faaf6da8185e3d006e7ba /cli/traversal/option.cxx | |
parent | e2299f6d95ba3264072d6ddc49f153ad73fd9d24 (diff) |
Add semantic graph and traversal mechanism
The parser now builds the semantic graph.
Diffstat (limited to 'cli/traversal/option.cxx')
-rw-r--r-- | cli/traversal/option.cxx | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/cli/traversal/option.cxx b/cli/traversal/option.cxx new file mode 100644 index 0000000..64e728c --- /dev/null +++ b/cli/traversal/option.cxx @@ -0,0 +1,60 @@ +// file : cli/traversal/option.cxx +// author : Boris Kolpackov <boris@codesynthesis.com> +// copyright : Copyright (c) 2009 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#include <traversal/option.hxx> +#include <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&) + { + } +} |