summaryrefslogtreecommitdiff
path: root/contrib/utility/Example/Introspection/Traversal/SyntaxTree.cpp
blob: 71115ff2b24c2de73a7473503f506846ffe8829e (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// file      : Example/Introspection/Traversal/SyntaxTree.cpp
// author    : Boris Kolpackov <boris@kolpackov.net>
// copyright : Copyright (c) 2002-2003 Boris Kolpackov
// license   : http://kolpackov.net/license.html

#include "SyntaxTree.hpp"

using namespace Utility::Introspection;

namespace SyntaxTree
{

  // Node
  //
  //

  namespace
  {
    TypeInfo
    node_init_ ()
    {
      TypeInfo ti (typeid (Node));
      ti.add_base (Access::PUBLIC, true, Object::static_type_info ());
      return ti;
    }

    TypeInfo node_ (node_init_ ());
  }

  TypeInfo const& Node::
  static_type_info () { return node_; }


  // Declaration
  //
  //

  namespace
  {
    TypeInfo
    declaration_init_ ()
    {
      TypeInfo ti (typeid (Declaration));
      ti.add_base (Access::PUBLIC, true, Node::static_type_info ());
      return ti;
    }

    TypeInfo declaration_ (declaration_init_ ());
  }

  TypeInfo const& Declaration::
  static_type_info () { return declaration_; }


  // Scope
  //
  //

  namespace
  {
    TypeInfo
    scope_init_ ()
    {
      TypeInfo ti (typeid (Scope));
      ti.add_base (Access::PUBLIC, true, Declaration::static_type_info ());
      return ti;
    }

    TypeInfo scope_ (scope_init_ ());
  }

  TypeInfo const& Scope::
  static_type_info () { return scope_; }


  // InterfaceDecl
  //
  //

  namespace
  {
    TypeInfo
    interface_decl_init_ ()
    {
      TypeInfo ti (typeid (InterfaceDecl));
      ti.add_base (Access::PUBLIC, true, Declaration::static_type_info ());
      return ti;
    }

    TypeInfo interface_decl_ (interface_decl_init_ ());
  }

  TypeInfo const& InterfaceDecl::
  static_type_info () { return interface_decl_; }


  // InterfaceDef
  //
  //

  namespace
  {
    TypeInfo
    interface_def_init_ ()
    {
      TypeInfo ti (typeid (InterfaceDef));
      ti.add_base (Access::PUBLIC, true, InterfaceDecl::static_type_info ());
      ti.add_base (Access::PUBLIC, true, Scope::static_type_info ());
      return ti;
    }

    TypeInfo interface_def_ (interface_def_init_ ());
  }

  TypeInfo const& InterfaceDef::
  static_type_info () { return interface_def_; }

}
//$Id$