PSDL_Node_Visitor.cpp

Go to the documentation of this file.
00001 // PSDL_Node_Visitor.cpp,v 1.3 2003/02/05 08:49:57 jwillemsen Exp
00002 
00003 #include "PSDL_Node_Visitor.h"
00004 #include "PSDL_Visitor_Factory.h"
00005 #include "PSDL_Typecode_Defn.h"
00006 #include "PSDL_y.h"
00007 
00008 TAO_PSDL_Node_Visitor::TAO_PSDL_Node_Visitor ()
00009   : identifiers_ (0),
00010     predefined_type_ (0),
00011     count_ (0),
00012     node_visitor_ (0)
00013 {
00014   ACE_NEW (this->visitor_factory_,
00015            TAO_PSDL_Visitor_Factory);
00016 }
00017 
00018 TAO_PSDL_Node_Visitor::~TAO_PSDL_Node_Visitor ()
00019 {
00020 }
00021 
00022 int
00023 TAO_PSDL_Node_Visitor::visit_specification (TAO_PSDL_Specification *specification)
00024 {
00025   if (specification->definition ()->accept (this) == -1)
00026       return -1;
00027 
00028   if (specification->specification () != 0)
00029     {
00030       if (specification->specification ()->accept (this) == -1)
00031         return -1;
00032     }
00033   return 0;
00034 }
00035 
00036 int
00037 TAO_PSDL_Node_Visitor::visit_definition (TAO_PSDL_Definition *definition)
00038 {
00039   if (definition->definition_type ()->accept (this) == -1)
00040     return -1;
00041 
00042   return 0;
00043 }
00044 
00045 int
00046 TAO_PSDL_Node_Visitor::visit_module (TAO_PSDL_Module *module)
00047 {
00048   this->node_visitor_ =
00049     this->visitor_factory_->make_visitor (module->type_of_node ());
00050 
00051   if (this->node_visitor_ != 0)
00052     {
00053       return this->node_visitor_->visit_module (module);
00054     }
00055   else
00056     {
00057       return -1;
00058     }
00059 }
00060 
00061 int TAO_PSDL_Node_Visitor::visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *)
00062 { return 0; }
00063 
00064 int
00065 TAO_PSDL_Node_Visitor::visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *)
00066 {
00067   return 0;
00068 }
00069 
00070 int
00071 TAO_PSDL_Node_Visitor::visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *)
00072 {
00073   return 0;
00074 }
00075 
00076 int
00077 TAO_PSDL_Node_Visitor::visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *)
00078 {
00079   return 0;
00080 }
00081 
00082 int TAO_PSDL_Node_Visitor::visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *)
00083 {
00084   return 0;
00085 }
00086 
00087 int
00088 TAO_PSDL_Node_Visitor::visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *)
00089 {
00090   return 0;
00091 }
00092 
00093 int
00094 TAO_PSDL_Node_Visitor::visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *)
00095 {
00096   return 0;
00097 }
00098 
00099 int
00100 TAO_PSDL_Node_Visitor::visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *)
00101 {
00102   return 0;
00103 }
00104 
00105 int
00106 TAO_PSDL_Node_Visitor::visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *)
00107 {
00108   return 0;
00109 }
00110 
00111 int
00112 TAO_PSDL_Node_Visitor::visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *)
00113 {
00114   return 0;
00115 }
00116 
00117 int
00118 TAO_PSDL_Node_Visitor::visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type)
00119 {
00120   return 0;
00121 }
00122 
00123 int
00124 TAO_PSDL_Node_Visitor::visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *)
00125 {
00126   return 0;
00127 }
00128 
00129 int
00130 TAO_PSDL_Node_Visitor::visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *)
00131 {
00132   return 0;
00133 }
00134 
00135 int
00136 TAO_PSDL_Node_Visitor::visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *)
00137 {
00138   return 0;
00139 }
00140 
00141 int
00142 TAO_PSDL_Node_Visitor::visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *)
00143 {
00144   return 0;
00145 }
00146 
00147 int
00148 TAO_PSDL_Node_Visitor::visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body  *)
00149 {
00150   return 0;
00151 }
00152 
00153 int
00154 TAO_PSDL_Node_Visitor::visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *)
00155 {
00156   return 0;
00157 }
00158 
00159 int TAO_PSDL_Node_Visitor::visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *) { return 0; }
00160 int TAO_PSDL_Node_Visitor::visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *) { return 0; }
00161 int TAO_PSDL_Node_Visitor::visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *) { return 0; }
00162 int TAO_PSDL_Node_Visitor::visit_key_dcl (TAO_PSDL_Key_Dcl *) { return 0; }
00163 int TAO_PSDL_Node_Visitor::visit_catalog (TAO_PSDL_Catalog *) { return 0; }
00164 int TAO_PSDL_Node_Visitor::visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *) { return 0; }
00165 int TAO_PSDL_Node_Visitor::visit_catalog_name (TAO_PSDL_Catalog_Name *) { return 0; }
00166 int TAO_PSDL_Node_Visitor::visit_catalog_body (TAO_PSDL_Catalog_Body *) { return 0; }
00167 int TAO_PSDL_Node_Visitor::visit_catalog_member (TAO_PSDL_Catalog_Member *) { return 0; }
00168 int TAO_PSDL_Node_Visitor::visit_storagetype_member (TAO_PSDL_Storagetype_Member *) { return 0; }
00169 int TAO_PSDL_Node_Visitor::visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *) { return 0; }
00170 int TAO_PSDL_Node_Visitor::visit_storagetype_name (TAO_PSDL_Storagetype_Name *) { return 0; }
00171 int TAO_PSDL_Node_Visitor::visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *) { return 0; }
00172 int TAO_PSDL_Node_Visitor::visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *) { return 0; }
00173 int TAO_PSDL_Node_Visitor::visit_store_directive (TAO_PSDL_Store_Directive *) { return 0; }
00174 int TAO_PSDL_Node_Visitor::visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *)  { return 0; }
00175 int TAO_PSDL_Node_Visitor::visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *)  { return 0; }
00176 int TAO_PSDL_Node_Visitor::visit_storagehome (TAO_PSDL_Storagehome *)  { return 0; }
00177 int TAO_PSDL_Node_Visitor::visit_storagehome_header (TAO_PSDL_Storagehome_Header *)  { return 0; }
00178 int TAO_PSDL_Node_Visitor::visit_storagehome_body  (TAO_PSDL_Storagehome_Body *)  { return 0; }
00179 int TAO_PSDL_Node_Visitor::visit_storagehome_member  (TAO_PSDL_Storagehome_Member *)  { return 0; }
00180 int TAO_PSDL_Node_Visitor::visit_storagehome_inh_spec  (TAO_PSDL_Storagehome_Inh_Spec *)  { return 0; }
00181 int TAO_PSDL_Node_Visitor::visit_storagehome_name  (TAO_PSDL_Storagehome_Name *)  { return 0; }
00182 
00183 int TAO_PSDL_Node_Visitor::visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *)  { return 0; }
00184 
00185 int
00186 TAO_PSDL_Node_Visitor::visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *)
00187 {
00188   return 0;
00189 }
00190 
00191 int
00192 TAO_PSDL_Node_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier)
00193 {
00194   if (this->identifiers_.size () == 0)
00195     {
00196       this->identifiers_.size (1);
00197       this->count_ = 0;
00198     }
00199 
00200   this->identifiers_ [this->count_] = identifier->value ();
00201   ++this->count_;
00202 
00203   return 0;
00204 }
00205 
00206 int
00207 TAO_PSDL_Node_Visitor::visit_type_dcl (TAO_PSDL_Type_Dcl *type_dcl)
00208 {
00209  if (type_dcl->type_of_type_dcl ()->accept (this) == -1)
00210     return -1;
00211 
00212   return 0;
00213 }
00214 
00215 int
00216 TAO_PSDL_Node_Visitor::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator)
00217 {
00218   int type = TAO_PSDL_TYPEDEF;
00219   this->node_visitor_ =
00220     this->visitor_factory_->make_visitor (type);
00221 
00222   // Generates code into the client header
00223   if (this->node_visitor_ != 0)
00224       return this->node_visitor_->visit_type_declarator (type_declarator);
00225   else
00226     return -1;
00227 }
00228 
00229 int
00230 TAO_PSDL_Node_Visitor::visit_type_spec (TAO_PSDL_Type_Spec *type_spec)
00231 {
00232   if (type_spec->type_of_type_spec ()->accept (this) == -1)
00233     return -1;
00234 
00235   return 0;
00236 }
00237 
00238 int
00239 TAO_PSDL_Node_Visitor::visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *simple_type_spec)
00240 {
00241   if (simple_type_spec->type_of_simple_type_spec ()->accept (this) == -1)
00242     return -1;
00243 
00244   return 0;
00245 }
00246 
00247 int
00248 TAO_PSDL_Node_Visitor::visit_base_type_spec (TAO_PSDL_Base_Type_Spec *base_type_spec)
00249 {
00250 
00251 
00252   if (base_type_spec->type_of_base_type_spec ()->accept (this) == -1)
00253     return -1;
00254 
00255   return 0;
00256 }
00257 
00258 int
00259 TAO_PSDL_Node_Visitor::visit_template_type_spec (TAO_PSDL_Template_Type_Spec *template_type_spec)
00260 {
00261   if (template_type_spec->type_of_template_type_spec ()->accept (this) == -1)
00262     return -1;
00263 
00264   return 0;
00265 }
00266 
00267 int
00268 TAO_PSDL_Node_Visitor::visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *)
00269 {
00270   return 0;
00271 }
00272 
00273 int
00274 TAO_PSDL_Node_Visitor::visit_declarators (TAO_PSDL_Declarators *declarators)
00275 {
00276   if (declarators->declarator ()->accept (this) == -1)
00277     return -1;
00278 
00279   if (declarators->set_of_declarators () != 0)
00280     {
00281       if (declarators->set_of_declarators ()->accept (this) == -1)
00282         return -1;
00283     }
00284   return 0;
00285 }
00286 
00287 int
00288 TAO_PSDL_Node_Visitor::visit_declarator (TAO_PSDL_Declarator *declarator)
00289 {
00290   if (declarator->type_of_declarator ()->accept (this) == -1)
00291     return -1;
00292   return 0;
00293 }
00294 
00295 int
00296 TAO_PSDL_Node_Visitor::visit_simple_declarator (TAO_PSDL_Simple_Declarator *simple_declarator)
00297 {
00298   if (simple_declarator->identifier ()->accept (this) == -1)
00299     return -1;
00300 
00301   if (simple_declarator->simple_declarator () != 0)
00302     {
00303       if (simple_declarator->simple_declarator ()->accept (this) == -1)
00304         return -1;
00305     }
00306 
00307   return 0;
00308 }
00309 
00310 int
00311 TAO_PSDL_Node_Visitor::visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *)  { return 0; }
00312 
00313 int
00314 TAO_PSDL_Node_Visitor::visit_complex_declarator  (TAO_PSDL_Complex_Declarator *)
00315 {
00316   return 0;
00317 }
00318 
00319 int
00320 TAO_PSDL_Node_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type)
00321 {
00322   if (predefined_type->type_one () != 0)
00323     {
00324       // @@ mainly for case 291:struct as of now.
00325       this->node_visitor_ =
00326         this->visitor_factory_->make_visitor (predefined_type->type_one ());
00327 
00328       if (this->node_visitor_ != 0)
00329         {
00330           int result =
00331             this->node_visitor_->visit_predefined_type (predefined_type);
00332 
00333           if (result != 0)
00334             return result;
00335 
00336           this->node_visitor_->gen_code_for_si ();
00337           this->node_visitor_->gen_code_for_sinline ();
00338         }
00339     }
00340 
00341   if (predefined_type->type_two () != 0)
00342     {}
00343 
00344   if (predefined_type->type_three () != 0)
00345     {}
00346 
00347   // @@ Abt predefined PSDL_Nodes later.
00348   return 0;
00349 }
00350 
00351 int
00352 TAO_PSDL_Node_Visitor::visit_member_list (TAO_PSDL_Member_List *member_list)
00353 {
00354   if (member_list->member ()->accept (this) == -1)
00355     return -1;
00356 
00357   if (member_list->member_list () != 0)
00358     {
00359       if (member_list->member_list ()->accept (this) == -1)
00360         return -1;
00361     }
00362 
00363   return 0;
00364 }
00365 
00366 int
00367 TAO_PSDL_Node_Visitor::visit_member (TAO_PSDL_Member *member)
00368 {
00369   if (member->type_spec ()->accept (this) == -1)
00370     return -1;
00371 
00372   if (member->declarators ()->accept (this) == -1)
00373     return -1;
00374 
00375   return 0;
00376 }
00377 
00378 int
00379 TAO_PSDL_Node_Visitor::visit_union_type (TAO_PSDL_Union_Type *)
00380 {
00381   return 0;
00382 }
00383 
00384 int
00385 TAO_PSDL_Node_Visitor::visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *)
00386 {
00387   return 0;
00388 }
00389 
00390 int
00391 TAO_PSDL_Node_Visitor::visit_switch_body (TAO_PSDL_Switch_Body *)
00392 {
00393   return 0;
00394 }
00395 
00396 int TAO_PSDL_Node_Visitor::visit_case_case (TAO_PSDL_Case *)  { return 0; }
00397 int TAO_PSDL_Node_Visitor::visit_case_label (TAO_PSDL_Case_Label *)  { return 0; }
00398 int TAO_PSDL_Node_Visitor::visit_element_spec (TAO_PSDL_Element_Spec *)  { return 0; }
00399 int TAO_PSDL_Node_Visitor::visit_const_dcl (TAO_PSDL_Const_Dcl *)  { return 0; }
00400 int TAO_PSDL_Node_Visitor::visit_const_type (TAO_PSDL_Const_Type *)  { return 0; }
00401 int TAO_PSDL_Node_Visitor::visit_const_exp (TAO_PSDL_Const_Exp *)  { return 0; }
00402 int TAO_PSDL_Node_Visitor::visit_or_expr (TAO_PSDL_Or_Expr *)  { return 0; }
00403 int TAO_PSDL_Node_Visitor::visit_xor_expr (TAO_PSDL_Xor_Expr *)  { return 0; }
00404 int TAO_PSDL_Node_Visitor::visit_and_expr (TAO_PSDL_And_Expr *)  { return 0; }
00405 int TAO_PSDL_Node_Visitor::visit_shift_expr (TAO_PSDL_Shift_Expr *)  { return 0; }
00406 int TAO_PSDL_Node_Visitor::visit_add_expr (TAO_PSDL_Add_Expr *)  { return 0; }
00407 int TAO_PSDL_Node_Visitor::visit_mult_expr (TAO_PSDL_Mult_Expr *)  { return 0; }
00408 int TAO_PSDL_Node_Visitor::visit_unary_expr (TAO_PSDL_Unary_Expr *)  { return 0; }
00409 int TAO_PSDL_Node_Visitor::visit_primary_expr (TAO_PSDL_Primary_Expr *)  { return 0; }
00410 
00411 int
00412 TAO_PSDL_Node_Visitor::visit_except_dcl (TAO_PSDL_Except_Dcl *except_dcl)
00413 {
00414   int type = TAO_PSDL_EXCEPTION;
00415   this->node_visitor_ =
00416     this->visitor_factory_->make_visitor (type);
00417 
00418   if (this->node_visitor_ != 0)
00419     return this->node_visitor_->visit_except_dcl (except_dcl);
00420 
00421   /*
00422     if (except_dcl->identifier ()->accept (this) == -1)
00423     return -1;
00424 
00425   if (except_dcl->member () != 0)
00426     {
00427       if (except_dcl->member ()->accept (&body_visitor) == -1)
00428         return -1;
00429     }
00430   */
00431   return -1;
00432 }
00433 
00434 int
00435 TAO_PSDL_Node_Visitor::visit_op_dcl (TAO_PSDL_Op_Dcl *)
00436 {
00437   return 0;
00438 }
00439 
00440 int TAO_PSDL_Node_Visitor::visit_storagetype (TAO_PSDL_Storagetype *)  { return 0; }
00441 int TAO_PSDL_Node_Visitor::visit_storagetype_dcl (TAO_PSDL_Storagetype_Dcl *)  { return 0; }
00442 int TAO_PSDL_Node_Visitor::visit_storagetype_fwd_dcl (TAO_PSDL_Storagetype_Fwd_Dcl *)  { return 0; }
00443 int TAO_PSDL_Node_Visitor::visit_storagetype_header (TAO_PSDL_Storagetype_Header *)  { return 0; }
00444 int TAO_PSDL_Node_Visitor::visit_storagetype_body (TAO_PSDL_Storagetype_Body *)  { return 0; }
00445 int TAO_PSDL_Node_Visitor::visit_storagehome_scope (TAO_PSDL_Storagehome_Scope *) { return 0; }
00446 int TAO_PSDL_Node_Visitor::visit_provides_dcl (TAO_PSDL_Provides_Dcl *) { return 0; }
00447 int TAO_PSDL_Node_Visitor::visit_op_type_spec (TAO_PSDL_Op_Type_Spec *) { return 0; }
00448 int TAO_PSDL_Node_Visitor::visit_parameter_dcls (TAO_PSDL_Parameter_Dcls *) { return 0; }
00449 int TAO_PSDL_Node_Visitor::visit_param_dcl (TAO_PSDL_Param_Dcl *) { return 0; }
00450 int TAO_PSDL_Node_Visitor::visit_raises_expr (TAO_PSDL_Raises_Expr *) { return 0; }
00451 int TAO_PSDL_Node_Visitor::visit_context_expr (TAO_PSDL_Context_Expr *) { return 0; }
00452 int TAO_PSDL_Node_Visitor::visit_param_type_spec (TAO_PSDL_Param_Type_Spec *) { return 0; }
00453 int TAO_PSDL_Node_Visitor::visit_fixed_pt_type (TAO_PSDL_Fixed_Pt_Type *) { return 0; }
00454 
00455 int
00456 TAO_PSDL_Node_Visitor::visit_constr_forward_decl (TAO_PSDL_Constr_Forward_Decl *)
00457 {
00458   return 0;
00459 }
00460 
00461 int
00462 TAO_PSDL_Node_Visitor::visit_interface (TAO_PSDL_Interface *interf)
00463 {
00464   if (interf->type_of_dcl ()->accept (this) == -1)
00465     return -1;
00466 
00467   return 0;
00468 }
00469 
00470 int
00471 TAO_PSDL_Node_Visitor::visit_interface_body (TAO_PSDL_Interface_Body *interface_body)
00472 {
00473   if (interface_body->export_variable ()->accept (this) == -1)
00474     return -1;
00475 
00476   if (interface_body->interface_body () != 0)
00477     {
00478       if (interface_body->interface_body ()->accept (this) == -1)
00479         return -1;
00480 
00481     }
00482   return 0;
00483 }
00484 
00485 int
00486 TAO_PSDL_Node_Visitor::visit_interface_dcl (TAO_PSDL_Interface_Dcl *interface_dcl)
00487 {
00488   int type = TAO_PSDL_INTERFACE;
00489   this->node_visitor_ =
00490     this->visitor_factory_->make_visitor (type);
00491 
00492   if (this->node_visitor_ != 0)
00493     {
00494       this->node_visitor_->visit_interface_dcl (interface_dcl);
00495       this->node_visitor_->gen_code_for_si ();
00496     }
00497   else
00498     return -1;
00499 
00500   return 0;
00501 }
00502 
00503 int
00504 TAO_PSDL_Node_Visitor::visit_forward_dcl (TAO_PSDL_Forward_Dcl *forward_dcl)
00505 {
00506   int type = TAO_PSDL_INTERFACE;
00507   this->node_visitor_ =
00508     this->visitor_factory_->make_visitor (type);
00509 
00510   if (this->node_visitor_ != 0)
00511     return this->node_visitor_->visit_forward_dcl (forward_dcl);
00512 
00513   return -1;
00514 }
00515 
00516 int
00517 TAO_PSDL_Node_Visitor::visit_interface_header (TAO_PSDL_Interface_Header *interface_header)
00518 {
00519   int type = 325;
00520   this->node_visitor_ =
00521     this->visitor_factory_->make_visitor (type);
00522 
00523   if (this->node_visitor_ != 0)
00524     return this->node_visitor_->visit_interface_header (interface_header);
00525   else
00526     return -1;
00527 }
00528 
00529 int
00530 TAO_PSDL_Node_Visitor::visit_export_dcl (TAO_PSDL_Export_Dcl *export_dcl)
00531 {
00532   if (export_dcl->type_of_export_one ()->accept (this) == -1)
00533       return -1;
00534 
00535   if (export_dcl->type_of_export_two () != 0)
00536     {
00537       if (export_dcl->type_of_export_two ()->accept (this) == -1)
00538         return -1;
00539       }
00540 
00541   return 0;
00542 }
00543 
00544 int TAO_PSDL_Node_Visitor::visit_interface_inheritance_spec (TAO_PSDL_Interface_Inheritance_Spec *) { return 0; }
00545 int TAO_PSDL_Node_Visitor::visit_interface_name (TAO_PSDL_Interface_Name *) { return 0; }
00546 int TAO_PSDL_Node_Visitor::visit_scoped_name (TAO_PSDL_Scoped_Name *) { return 0; }
00547 int TAO_PSDL_Node_Visitor::visit_value (TAO_PSDL_Value *) { return 0; }
00548 int TAO_PSDL_Node_Visitor::visit_value_common_base (TAO_PSDL_Value_Common_Base *) { return 0; }
00549 int TAO_PSDL_Node_Visitor::visit_value_forward_dcl (TAO_PSDL_Value_Forward_Dcl *) { return 0; }
00550 int TAO_PSDL_Node_Visitor::visit_value_box_dcl (TAO_PSDL_Value_Box_Dcl *) { return 0; }
00551 int TAO_PSDL_Node_Visitor::visit_value_abs_dcl (TAO_PSDL_Value_Abs_Dcl *) { return 0; }
00552 int TAO_PSDL_Node_Visitor::visit_value_dcl (TAO_PSDL_Value_Dcl *) { return 0; }
00553 int TAO_PSDL_Node_Visitor::visit_value_header (TAO_PSDL_Value_Header *) { return 0; }
00554 int TAO_PSDL_Node_Visitor::visit_value_inheritance_spec (TAO_PSDL_Value_Inheritance_Spec *) { return 0; }
00555 int TAO_PSDL_Node_Visitor::visit_value_name (TAO_PSDL_Value_Name *) { return 0; }
00556 int TAO_PSDL_Node_Visitor::visit_value_element (TAO_PSDL_Value_Element *) { return 0; }
00557 int TAO_PSDL_Node_Visitor::visit_array_declarator (TAO_PSDL_Array_Declarator *) { return 0; }
00558 int TAO_PSDL_Node_Visitor::visit_fixed_array_size (TAO_PSDL_Fixed_Array_Size *) { return 0; }
00559 int TAO_PSDL_Node_Visitor::visit_enumerator (TAO_PSDL_Enumerator *) { return 0; }
00560 int TAO_PSDL_Node_Visitor::visit_literal (TAO_PSDL_Literal *) { return 0; }
00561 int TAO_PSDL_Node_Visitor::visit_state_member (TAO_PSDL_State_Member *) { return 0; }
00562 int TAO_PSDL_Node_Visitor::visit_init_dcl (TAO_PSDL_Init_Dcl *) { return 0; }
00563 int TAO_PSDL_Node_Visitor::visit_init_param_decls (TAO_PSDL_Init_Param_Decls *) { return 0; }
00564 int TAO_PSDL_Node_Visitor::visit_init_param_decl (TAO_PSDL_Init_Param_Decl *) { return 0; }
00565 int TAO_PSDL_Node_Visitor::visit_factory_parameters (TAO_PSDL_Factory_Parameters *) { return 0; }
00566 
00567 int
00568 TAO_PSDL_Node_Visitor::visit_attr_dcl (TAO_PSDL_Attr_Dcl *)
00569 {
00570   return 0;
00571 }
00572 
00573 int
00574 TAO_PSDL_Node_Visitor::visit_factory_dcl (TAO_PSDL_Factory_Dcl *)
00575 {
00576   return 0;
00577 }
00578 
00579 int
00580 TAO_PSDL_Node_Visitor::visit_positive_int_const (TAO_PSDL_Positive_Int_Const *)
00581 {
00582   return 0;
00583 }
00584 
00585 int
00586 TAO_PSDL_Node_Visitor::base_type (const ACE_CString &identifier,
00587                                   ACE_CString &identifier_type)
00588 {
00589   ACE_CString identifier_name = identifier;
00590   TAO_PSDL_Scope::instance ()->to_lower_case (identifier_name);
00591 
00592   int result =
00593     TAO_PSDL_Scope::instance ()->find (identifier_name,
00594                                        identifier_type);
00595 
00596   if (result == 0)
00597     {
00598       // check if the base type is a predefined base type defined in
00599       // PSDL.yy
00600       if (ACE_OS::strcmp (identifier_type.c_str (), "enum") == 0)
00601         return 0;
00602 
00603       // The way I am deciding is trying to find the idn
00604       result = TAO_PSDL_Scope::instance ()->find (identifier_type);
00605 
00606       if (result == 0)
00607         {
00608           return 0;
00609         }
00610       else
00611         {
00612           return 1;
00613         }
00614     }
00615 
00616   // identifier_name is a predefined type like char *.
00617   identifier_type = identifier_name;
00618 
00619   return 1;
00620 }
00621 
00622 ACE_CString
00623 TAO_PSDL_Node_Visitor::version_for_stub (ACE_CString identifier_type)
00624 {
00625   if (ACE_OS::strcmp (identifier_type.c_str (), "char *") == 0)
00626     {
00627       return "CORBA::String";
00628     }
00629   else if (ACE_OS::strcmp (identifier_type.c_str (), "long") == 0)
00630     {
00631       return "CORBA::Long";
00632     }
00633   else
00634     return identifier_type;
00635 }
00636 
00637 void
00638 TAO_PSDL_Node_Visitor::gen_code_for_si (void)
00639 {
00640   return;
00641 }
00642 
00643 void
00644 TAO_PSDL_Node_Visitor::gen_code_for_sinline (void)
00645 {
00646   return;
00647 }

Generated on Thu Nov 9 14:07:04 2006 for TAO_PSS by doxygen 1.3.6