summaryrefslogtreecommitdiff
path: root/TAO/CIAO/CCF/CCF/CIDL/CIDL_SyntaxTree.cpp
blob: 577b426e73c8958569123e5bcd0d26d3bfaec429 (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
60
61
// $Id$
#include "CIDL_Traversal.hpp"
#include "CIDL_SyntaxTree.hpp"

namespace CIDL
{
  namespace SyntaxTree
  {
    using CCF::Traversal::try_visit;

    namespace
    {
      //@@ repetition of what's already in IDL2 & IDL3
      bool
      try_visit_scope (CCF::Traversal::Visitor* v,
                       ScopePtr const& node)
      {
        return try_visit<Traversal::Scope> (
          &Traversal::Scope::visit_scope,
          v,
          node);
      }
    }

    //
    // Composition
    //

    void Composition::
    accept (CCF::Traversal::Visitor* v)
    {
      CompositionPtr self (ReferenceCounting::add_ref (this));

      if (!try_visit<Traversal::Composition> (
            &Traversal::Composition::visit_composition,
            v,
            self))
      {
        try_visit_scope (v, self);
      }
    }

    //
    // Home
    //

    void HomeExecutor::
    accept (CCF::Traversal::Visitor* v)
    {
      HomeExecutorPtr self (ReferenceCounting::add_ref (this));

      if (!try_visit<Traversal::HomeExecutor> (
            &Traversal::HomeExecutor::visit_home_executor,
            v,
            self))
      {
        try_visit_scope (v, self);
      }
    }
  }
}