00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef TAO_IFR_ADDING_VISITOR_H
00021 #define TAO_IFR_ADDING_VISITOR_H
00022
00023 #include "ifr_visitor.h"
00024 #include "tao/IFR_Client/IFR_ComponentsC.h"
00025
00026 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00027 # pragma once
00028 #endif
00029
00030 class UTL_ExceptList;
00031
00032 class ifr_adding_visitor : public ifr_visitor
00033 {
00034
00035
00036
00037
00038
00039
00040
00041
00042 public:
00043 ifr_adding_visitor (AST_Decl *scope,
00044 CORBA::Boolean in_reopened = 0);
00045
00046 virtual ~ifr_adding_visitor (void);
00047
00048 virtual int visit_scope (UTL_Scope *node);
00049 virtual int visit_predefined_type (AST_PredefinedType *node);
00050 virtual int visit_module (AST_Module *node);
00051 virtual int visit_interface (AST_Interface *node);
00052 virtual int visit_interface_fwd (AST_InterfaceFwd *node);
00053 virtual int visit_valuebox (AST_ValueBox *node);
00054 virtual int visit_valuetype (AST_ValueType *node);
00055 virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node);
00056 virtual int visit_component (AST_Component *node);
00057 virtual int visit_component_fwd (AST_ComponentFwd *node);
00058 virtual int visit_eventtype (AST_EventType *node);
00059 virtual int visit_eventtype_fwd (AST_EventTypeFwd *node);
00060 virtual int visit_home (AST_Home *node);
00061 virtual int visit_factory (AST_Factory *node);
00062 virtual int visit_structure (AST_Structure *node);
00063 virtual int visit_structure_fwd (AST_StructureFwd *node);
00064 virtual int visit_exception (AST_Exception *node);
00065 virtual int visit_enum (AST_Enum *node);
00066 virtual int visit_operation (AST_Operation *node);
00067 virtual int visit_field (AST_Field *node);
00068 virtual int visit_attribute (AST_Attribute *node);
00069 virtual int visit_union (AST_Union *node);
00070 virtual int visit_union_fwd (AST_UnionFwd *node);
00071 virtual int visit_constant (AST_Constant *node);
00072 virtual int visit_array (AST_Array *node);
00073 virtual int visit_sequence (AST_Sequence *node);
00074 virtual int visit_string (AST_String *node);
00075 virtual int visit_typedef (AST_Typedef *node);
00076 virtual int visit_root (AST_Root *node);
00077 virtual int visit_native (AST_Native *node);
00078
00079 protected:
00080 CORBA::PrimitiveKind expr_type_to_pkind (AST_Expression::ExprType et);
00081 CORBA::PrimitiveKind predefined_type_to_pkind (AST_PredefinedType *node);
00082
00083
00084 void load_any (AST_Expression::AST_ExprValue *ev,
00085 CORBA::Any &any);
00086
00087
00088 void element_type (AST_Type *base_type, bool owned = false);
00089
00090
00091
00092 int create_interface_def (AST_Interface *node);
00093
00094
00095 int create_value_def (AST_ValueType *node);
00096
00097
00098 int create_component_def (AST_Component *node);
00099
00100
00101 int create_home_def (AST_Home *node);
00102
00103
00104 int create_event_def (AST_EventType *node);
00105
00106
00107 int create_value_member (AST_Field *node);
00108
00109
00110 void get_referenced_type (AST_Type *node);
00111
00112
00113
00114 void fill_base_value (CORBA::ValueDef_ptr &result,
00115 AST_ValueType *node);
00116
00117 void fill_base_component (CORBA::ComponentIR::ComponentDef_ptr &result,
00118 AST_Component *node);
00119
00120 void fill_base_home (CORBA::ComponentIR::HomeDef_ptr &result,
00121 AST_Home *node);
00122
00123 void fill_managed_component (CORBA::ComponentIR::ComponentDef_ptr &result,
00124 AST_Home *node);
00125
00126 void fill_primary_key (CORBA::ValueDef_ptr &result,
00127 AST_Home *node);
00128
00129 void fill_abstract_base_values (CORBA::ValueDefSeq &result,
00130 AST_ValueType *node);
00131
00132 void fill_inherited_interfaces (CORBA::InterfaceDefSeq &result,
00133 AST_Interface *node);
00134
00135 void fill_supported_interfaces (CORBA::InterfaceDefSeq &result,
00136 AST_Interface *node);
00137
00138 void fill_interfaces (CORBA::InterfaceDefSeq &result,
00139 AST_Interface **list,
00140 CORBA::Long length);
00141
00142 void fill_initializers (CORBA::ExtInitializerSeq &result,
00143 AST_ValueType *node);
00144
00145 void fill_get_exceptions (CORBA::ExceptionDefSeq &result,
00146 AST_Attribute *node);
00147
00148 void fill_set_exceptions (CORBA::ExceptionDefSeq &result,
00149 AST_Attribute *node);
00150
00151 void fill_exceptions (CORBA::ExceptionDefSeq &result,
00152 AST_Decl *node);
00153
00154 void fill_exceptions (CORBA::ExceptionDefSeq &result,
00155 UTL_ExceptList *list);
00156
00157 void fill_params (CORBA::ParDescriptionSeq &result,
00158 AST_Operation *node);
00159
00160 void visit_all_provides (AST_Component *node,
00161 CORBA::ComponentIR::ComponentDef_ptr c);
00162
00163 void visit_all_uses (AST_Component *node,
00164 CORBA::ComponentIR::ComponentDef_ptr c);
00165
00166 void visit_all_emits (AST_Component *node,
00167 CORBA::ComponentIR::ComponentDef_ptr c);
00168
00169 void visit_all_publishes (AST_Component *node,
00170 CORBA::ComponentIR::ComponentDef_ptr c);
00171
00172 void visit_all_consumes (AST_Component *node,
00173 CORBA::ComponentIR::ComponentDef_ptr c);
00174
00175 void visit_all_factories (AST_Home *node,
00176 CORBA::ComponentIR::HomeDef_ptr h);
00177
00178 void visit_all_finders (AST_Home *node,
00179 CORBA::ComponentIR::HomeDef_ptr h);
00180
00181 void expand_id (ACE_CString &str,
00182 const char *local_name);
00183
00184 protected:
00185 CORBA::IDLType_var ir_current_;
00186
00187
00188
00189
00190
00191 AST_Decl *scope_;
00192
00193
00194 bool in_reopened_;
00195
00196 };
00197
00198 #endif