blob: 49b8f202449e9e613b46df7f7a9e07b09a1d4949 (
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 IR_Simulator_visitor.h
* @author William R. Otte <wotte@dre.vanderbilt.edu>
* $Id$
* Implements a visitor that generates XMI for the CARDAMOM
* code generation facility.
*
* This IDL->XMI mapping appears to be based on a IDL->UML->XMI
* mapping, and should be valid XMI version 1.1
*/
#ifndef CIAO_IR_SIMULATOR_VISITOR_H
#define CIAO_IR_SIMULATOR_VISITOR_H
#include "ace/Containers.h"
#include "ace/Hash_Map_Manager.h"
#include "ace/Null_Mutex.h"
#include "ace/SString.h"
#include "xercesc/util/XercesDefs.hpp"
#include "ast_visitor.h"
#include "ast_component.h"
#include "utl_scoped_name.h"
#include "Literals.h"
#include "XML/XercesString.h"
#include "CIAO_IDL3_TO_XMI_Export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
class TAO_OutStream;
class UTL_ExceptList;
#include <set>
#include <string>
namespace CIAO
{
namespace XMI
{
/**
* @class ir_simulator_visitor
* @brief Visitor that generates XMI for the CARDAMOM code
* generation facilities.
*/
class CIAO_IDL3_TO_XMI_Export ir_simulator_visitor : public ast_visitor
{
public:
ir_simulator_visitor (void);
virtual ~ir_simulator_visitor (void);
virtual int visit_decl (AST_Decl *d);
virtual int visit_scope (UTL_Scope *node);
virtual int visit_type (AST_Type *node);
virtual int visit_predefined_type (AST_PredefinedType *node);
virtual int visit_module (AST_Module *node);
virtual int visit_interface (AST_Interface *node);
virtual int visit_interface_fwd (AST_InterfaceFwd *node);
virtual int visit_valuebox (AST_ValueBox *node);
virtual int visit_valuetype (AST_ValueType *node);
void visit_valuetype_impl (AST_ValueType *);
virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node);
virtual int visit_component (AST_Component *node);
virtual int visit_component_fwd (AST_ComponentFwd *node);
virtual int visit_eventtype (AST_EventType *node);
virtual int visit_eventtype_fwd (AST_EventTypeFwd *node);
virtual int visit_home (AST_Home *node);
virtual int visit_factory (AST_Factory *node);
virtual int visit_structure (AST_Structure *node);
void visit_struct_impl (AST_Structure *node);
virtual int visit_structure_fwd (AST_StructureFwd *node);
virtual int visit_exception (AST_Exception *node);
virtual int visit_expression (AST_Expression *node);
virtual int visit_enum (AST_Enum *node);
virtual int visit_operation (AST_Operation *node);
virtual int visit_field (AST_Field *node);
virtual int visit_argument (AST_Argument *node);
virtual int visit_attribute (AST_Attribute *node);
virtual int visit_union (AST_Union *node);
virtual int visit_union_fwd (AST_UnionFwd *node);
virtual int visit_union_branch (AST_UnionBranch *node);
virtual int visit_union_label (AST_UnionLabel *node);
virtual int visit_constant (AST_Constant *node);
virtual int visit_enum_val (AST_EnumVal *node);
virtual int visit_array (AST_Array *node);
virtual int visit_sequence (AST_Sequence *node);
virtual int visit_string (AST_String *node);
virtual int visit_typedef (AST_Typedef *node);
virtual int visit_root (AST_Root *node);
virtual int visit_native (AST_Native *node);
struct Error
{
Error (const ACE_CString &diag, AST_Decl *node = 0)
: diag_ (diag),
node_ (node)
{}
void node (AST_Decl *node) { if (node_ == 0) node_ = node; }
const ACE_CString diag_;
AST_Decl *node_;
};
private:
typedef ACE_Unbounded_Queue<AST_Component::port_description> PORTS;
void component_ports (PORTS &ports);
bool do_i_care (AST_Decl *node);
size_t associating_;
std::set <std::string> seen_types_;
};
}
}
#endif
|