summaryrefslogtreecommitdiff
path: root/cli/cli/traversal/option.cxx
blob: ff5dcce2417d91e658ab74c4956d577c8f68ed13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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&)
  {
  }
}