summaryrefslogtreecommitdiff
path: root/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp
blob: 9c5ac4df6262938f4363ba7c439167eeebfdeee6 (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
// file      : CCF/IDL2/SemanticAction/Impl/Factory.cpp
// author    : Boris Kolpackov <boris@dre.vanderbilt.edu>
// cvs-id    : $Id$

#include "CCF/IDL2/SemanticGraph/Fundamental.hpp"

#include "CCF/IDL2/SemanticAction/Impl/Factory.hpp"


namespace CCF
{
  namespace IDL2
  {
    namespace SemanticAction
    {
      namespace Impl
      {
        using namespace SemanticGraph;

        Factory::
        Factory (CompilerElements::Context& context,
                 Diagnostic::Stream&,
                 SemanticGraph::TranslationUnit& tu)
            : ctx_ (context.get ("trace-semantic-action", false), tu),

              attribute_ (ctx_),
              const__ (ctx_),
              enum__ (ctx_),
              exception_ (ctx_),
              include_ (ctx_),
              interface_ (ctx_),
              member_ (ctx_),
              module_ (ctx_),
              native_ (ctx_),
              numeric_expression_ (ctx_),
              operation_ (ctx_),
              struct__ (ctx_),
              typedef__ (ctx_),
              type_id_ (ctx_),
              type_prefix_ (ctx_),
              union__ (ctx_),
              value_type_ (ctx_),
              value_type_factory_ (ctx_),
              value_type_member_ (ctx_)
        {
          // Implied translation region with fundamental types.
          //
          TranslationRegion& ftr (tu.new_node<TranslationRegion> ());
          tu.new_edge<ContainsImplied> (tu, ftr, ".fundamental");

          Root& fr (tu.new_node<Root> ());
          tu.new_edge<ContainsRoot> (ftr, fr);

          tu.new_edge<Defines> (fr, tu.new_node<Object> (), "Object");
          tu.new_edge<Defines> (fr, tu.new_node<ValueBase> (), "ValueBase");
          tu.new_edge<Defines> (fr, tu.new_node<Any> (), "any");
          tu.new_edge<Defines> (fr, tu.new_node<Boolean> (), "boolean");
          tu.new_edge<Defines> (fr, tu.new_node<Char> (), "char");
          tu.new_edge<Defines> (fr, tu.new_node<Double> (), "double");
          tu.new_edge<Defines> (fr, tu.new_node<Float> (), "float");
          tu.new_edge<Defines> (fr, tu.new_node<Long> (), "long");
          tu.new_edge<Defines> (fr, tu.new_node<LongDouble> (), "long double");
          tu.new_edge<Defines> (fr, tu.new_node<LongLong> (), "long long");
          tu.new_edge<Defines> (fr, tu.new_node<Octet> (), "octet");
          tu.new_edge<Defines> (fr, tu.new_node<Short> (), "short");
          tu.new_edge<Defines> (fr, tu.new_node<String> (), "string");
          tu.new_edge<Defines> (fr, tu.new_node<UnsignedLong> (), "unsigned long");
          tu.new_edge<Defines> (fr, tu.new_node<UnsignedLongLong> (), "unsigned long long");
          tu.new_edge<Defines> (fr, tu.new_node<UnsignedShort> (), "unsigned short");
          tu.new_edge<Defines> (fr, tu.new_node<Void> (), "void");
          tu.new_edge<Defines> (fr, tu.new_node<Wchar> (), "wchar");
          tu.new_edge<Defines> (fr, tu.new_node<Wstring> (), "wstring");

          TranslationRegion& principal (tu.new_node<TranslationRegion> ());
          tu.new_edge<ContainsPrincipal> (tu, principal);

          Root& root (tu.new_node<Root> ());
          tu.new_edge<ContainsRoot> (principal, root);

          ctx_.region (principal);
          ctx_.scope (root);
        }
      }
    }
  }
}