summaryrefslogtreecommitdiff
path: root/TAO/CIAO/CCF/CCF/IDL2/Traversal/Typedef.hpp
blob: 76f0017078793638f3293902c3f54c58254b9874 (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
// file      : CCF/IDL2/Traversal/Typedef.hpp
// author    : Boris Kolpackov <boris@dre.vanderbilt.edu>
// cvs-id    : $Id$

#ifndef CCF_IDL2_TRAVERSAL_TYPEDEF_HPP
#define CCF_IDL2_TRAVERSAL_TYPEDEF_HPP

#include "CCF/IDL2/Traversal/Elements.hpp"
#include "CCF/IDL2/SyntaxTree/Typedef.hpp"

namespace CCF
{
  namespace IDL2
  {
    namespace Traversal
    {
      //
      //
      //
      template <typename T>
      struct TypedefDecl : Traverser
      {
        typedef
        SyntaxTree::StrictPtr<T>
        NodePtr;

        TypedefDecl ()
        {
          map (typeid (SyntaxTree::TypedefDecl), this);
        }

        virtual bool
        traverse (SyntaxTree::NodePtr const& n)
        {
          //@@ gcc bug
          if (n->template is_a<T> ())
          {
            traverse (n->template dynamic_type<T> ());
            return true;
          }
          else
          {
            return false;
          }
        }

        virtual void
        traverse (NodePtr const& n)
        {
          delegate (n);
        }
      };
    }
  }
}

#endif  // CCF_IDL2_TRAVERSAL_TYPEDEF_HPP