ifr_adding_visitor.h

Go to the documentation of this file.
00001 // ifr_adding_visitor.h,v 1.18 2005/06/20 16:24:06 gmaxey Exp
00002 
00003 /* -*- C++ -*- */
00004 // ============================================================================
00005 //
00006 // = LIBRARY
00007 //    TAO_IFR_BE_DLL
00008 //
00009 // = FILENAME
00010 //    ifr_adding_visitor.h
00011 //
00012 // = DESCRIPTION
00013 //    Header file for class ifr_adding_visitor.
00014 //
00015 // = AUTHOR
00016 //    Jeff Parsons <parsons@cs.wustl.edu>
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 /* ACE_LACKS_PRAGMA_ONCE */
00029 
00030 class UTL_ExceptList;
00031 
00032 class ifr_adding_visitor : public ifr_visitor
00033 {
00034   //
00035   // = TITLE
00036   //    ifr_adding_visitor.
00037   //
00038   // = DESCRIPTION
00039   //    This visitor adds items found in the IDL file being processed
00040   //    to the Interface Repository.
00041   //
00042 public:
00043   ifr_adding_visitor (AST_Decl *scope,
00044                       CORBA::Boolean in_reopened = 0);
00045   // Constructor.
00046 
00047   virtual ~ifr_adding_visitor (void);
00048   // Destructor.
00049 
00050   virtual int visit_scope (UTL_Scope *node);
00051   // Visit the scope.
00052 
00053   virtual int visit_predefined_type (AST_PredefinedType *node);
00054   // Visit the predefined type.
00055 
00056   virtual int visit_module (AST_Module *node);
00057   // Visit module.
00058 
00059   virtual int visit_interface (AST_Interface *node);
00060   // Visit interface.
00061 
00062   virtual int visit_interface_fwd (AST_InterfaceFwd *node);
00063   // Visit interface_fwd.
00064 
00065   virtual int visit_valuebox (AST_ValueBox *node);
00066   // Visit valuebox.
00067 
00068   virtual int visit_valuetype (AST_ValueType *node);
00069   // Visit valuetype.
00070 
00071   virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node);
00072   // Visit valuetype_fwd.
00073 
00074   virtual int visit_component (AST_Component *node);
00075   // Visit component.
00076 
00077   virtual int visit_component_fwd (AST_ComponentFwd *node);
00078   // Visit component_fwd
00079 
00080   virtual int visit_eventtype (AST_EventType *node);
00081   // Visit valuetype.
00082 
00083   virtual int visit_eventtype_fwd (AST_EventTypeFwd *node);
00084   // Visit valuetype_fwd
00085 
00086   virtual int visit_home (AST_Home *node);
00087   // Visit component home.
00088 
00089   virtual int visit_factory (AST_Factory *node);
00090   // Visit a factory construct.
00091 
00092   virtual int visit_structure (AST_Structure *node);
00093   // Visit a structure.
00094 
00095   virtual int visit_exception (AST_Exception *node);
00096   // Visit exception
00097 
00098   virtual int visit_enum (AST_Enum *node);
00099   // Visit an enum.
00100 
00101   virtual int visit_operation (AST_Operation *node);
00102   // Visit an operation.
00103 
00104   virtual int visit_field (AST_Field *node);
00105   // Visit a field.
00106 
00107   virtual int visit_attribute (AST_Attribute *node);
00108   // Visit an attribute.
00109 
00110   virtual int visit_union (AST_Union *node);
00111   // Visit union.
00112 
00113   virtual int visit_constant (AST_Constant *node);
00114   // Visit a constant.
00115 
00116   virtual int visit_array (AST_Array *node);
00117   // Visit an array.
00118 
00119   virtual int visit_sequence (AST_Sequence *node);
00120   // Visit a sequence.
00121 
00122   virtual int visit_string (AST_String *node);
00123   // Visit a string.
00124 
00125   virtual int visit_typedef (AST_Typedef *node);
00126   // Visit a typedef.
00127 
00128   virtual int visit_root (AST_Root *node);
00129   // Visit the root.
00130 
00131   virtual int visit_native (AST_Native *node);
00132   // Visit a native.
00133 
00134 protected:
00135   CORBA::PrimitiveKind expr_type_to_pkind (AST_Expression::ExprType et);
00136   CORBA::PrimitiveKind predefined_type_to_pkind (AST_PredefinedType *node);
00137   // Conversion functions.
00138 
00139   void load_any (AST_Expression::AST_ExprValue *ev,
00140                  CORBA::Any &any);
00141   // Determine the primitive type and insert into the Any.
00142 
00143   void element_type (AST_Type *base_type
00144                      ACE_ENV_ARG_DECL);
00145   // Creates or looks up the element type of an array or sequence,
00146   // and stores the result in ir_current_.
00147 
00148   int create_interface_def (AST_Interface *node
00149                             ACE_ENV_ARG_DECL);
00150   // Code encapsulated out of visit_interface().
00151 
00152   int create_value_def (AST_ValueType *node
00153                         ACE_ENV_ARG_DECL);
00154   // Code encapsulated out of visit_valuetype().
00155 
00156   int create_component_def (AST_Component *node
00157                             ACE_ENV_ARG_DECL);
00158   // Code encapsulated out of visit_component().
00159 
00160   int create_home_def (AST_Home *node
00161                        ACE_ENV_ARG_DECL);
00162   // Code encapsulated out of visit_home().
00163 
00164   int create_event_def (AST_EventType *node
00165                         ACE_ENV_ARG_DECL);
00166   // Code encapsulated out of visit_eventtype().
00167 
00168   int create_value_member (AST_Field *node);
00169   // Conditional call from visit_field().
00170 
00171   void get_referenced_type (AST_Type *node
00172                             ACE_ENV_ARG_DECL);
00173   // Utility method to update ir_current_ for struct members, union
00174   // members, operation parameters and operation return types.
00175 
00176   void fill_base_value (CORBA::ValueDef_ptr &result,
00177                         AST_ValueType *node
00178                         ACE_ENV_ARG_DECL);
00179 
00180   void fill_base_component (CORBA::ComponentIR::ComponentDef_ptr &result,
00181                             AST_Component *node
00182                             ACE_ENV_ARG_DECL);
00183 
00184   void fill_base_home (CORBA::ComponentIR::HomeDef_ptr &result,
00185                        AST_Home *node
00186                        ACE_ENV_ARG_DECL);
00187 
00188   void fill_managed_component (CORBA::ComponentIR::ComponentDef_ptr &result,
00189                                AST_Home *node
00190                                ACE_ENV_ARG_DECL);
00191 
00192   void fill_primary_key (CORBA::ValueDef_ptr &result,
00193                          AST_Home *node
00194                          ACE_ENV_ARG_DECL);
00195 
00196   void fill_abstract_base_values (CORBA::ValueDefSeq &result,
00197                                   AST_ValueType *node
00198                                   ACE_ENV_ARG_DECL);
00199 
00200   void fill_inherited_interfaces (CORBA::InterfaceDefSeq &result,
00201                                   AST_Interface *node
00202                                   ACE_ENV_ARG_DECL);
00203 
00204   void fill_supported_interfaces (CORBA::InterfaceDefSeq &result,
00205                                   AST_Interface *node
00206                                   ACE_ENV_ARG_DECL);
00207 
00208   void fill_interfaces (CORBA::InterfaceDefSeq &result,
00209                         AST_Interface **list,
00210                         CORBA::Long length
00211                         ACE_ENV_ARG_DECL);
00212 
00213   void fill_initializers (CORBA::ExtInitializerSeq &result,
00214                           AST_ValueType *node
00215                           ACE_ENV_ARG_DECL);
00216 
00217   void fill_get_exceptions (CORBA::ExceptionDefSeq &result,
00218                             AST_Attribute *node
00219                             ACE_ENV_ARG_DECL);
00220 
00221   void fill_set_exceptions (CORBA::ExceptionDefSeq &result,
00222                             AST_Attribute *node
00223                             ACE_ENV_ARG_DECL);
00224 
00225   void fill_exceptions (CORBA::ExceptionDefSeq &result,
00226                         AST_Decl *node
00227                         ACE_ENV_ARG_DECL);
00228 
00229   void fill_exceptions (CORBA::ExceptionDefSeq &result,
00230                         UTL_ExceptList *list
00231                         ACE_ENV_ARG_DECL);
00232 
00233   void fill_params (CORBA::ParDescriptionSeq &result,
00234                     AST_Operation *node
00235                     ACE_ENV_ARG_DECL);
00236 
00237   void visit_all_provides (AST_Component *node,
00238                            CORBA::ComponentIR::ComponentDef_ptr c
00239                            ACE_ENV_ARG_DECL);
00240 
00241   void visit_all_uses (AST_Component *node,
00242                        CORBA::ComponentIR::ComponentDef_ptr c
00243                        ACE_ENV_ARG_DECL);
00244 
00245   void visit_all_emits (AST_Component *node,
00246                         CORBA::ComponentIR::ComponentDef_ptr c
00247                         ACE_ENV_ARG_DECL);
00248 
00249   void visit_all_publishes (AST_Component *node,
00250                             CORBA::ComponentIR::ComponentDef_ptr c
00251                             ACE_ENV_ARG_DECL);
00252 
00253   void visit_all_consumes (AST_Component *node,
00254                            CORBA::ComponentIR::ComponentDef_ptr c
00255                            ACE_ENV_ARG_DECL);
00256 
00257   void visit_all_factories (AST_Home *node,
00258                             CORBA::ComponentIR::HomeDef_ptr h
00259                             ACE_ENV_ARG_DECL);
00260 
00261   void visit_all_finders (AST_Home *node,
00262                           CORBA::ComponentIR::HomeDef_ptr h
00263                           ACE_ENV_ARG_DECL);
00264 
00265   void expand_id (ACE_CString &str,
00266                   const char *local_name);
00267 
00268 protected:
00269   CORBA::IDLType_var ir_current_;
00270   // Holder for the IR object most recently created or looked up by
00271   // the visitor. This makes it accessible by visitor methods that
00272   // need the result of a call to another visitor method that
00273   // creates an IR object.
00274 
00275   AST_Decl *scope_;
00276   // Store the node whose scope (if any) we will be visiting.
00277 
00278   CORBA::Boolean in_reopened_;
00279   // Are we traversing the scope of a reopened module?
00280 };
00281 
00282 #endif /* TAO_IFR_ADDING_VISITOR_H */

Generated on Thu Nov 9 14:11:50 2006 for TAO_IFR by doxygen 1.3.6