00001 // PSDL_Scope_Visitor.cpp,v 1.2 2003/02/05 08:49:57 jwillemsen Exp 00002 00003 #include "PSDL_Scope_Visitor.h" 00004 #include "PSDL_y.h" 00005 00006 TAO_PSDL_Scope_Visitor::TAO_PSDL_Scope_Visitor (TAO_PSDL_Node *psdl_node) 00007 : psdl_node_ (psdl_node) 00008 { 00009 } 00010 00011 TAO_PSDL_Scope_Visitor::~TAO_PSDL_Scope_Visitor () 00012 { 00013 } 00014 00015 ACE_CString 00016 TAO_PSDL_Scope_Visitor::get_scoped_type (void) 00017 { 00018 return this->scoped_type_; 00019 } 00020 00021 int 00022 TAO_PSDL_Scope_Visitor::visit_module (TAO_PSDL_Module *module) 00023 { 00024 // this->psdl_node_->set_identifier ("module"); 00025 00026 if (module->specification ()->accept (this) == -1) 00027 return -1; 00028 00029 return 0; 00030 } 00031 00032 int 00033 TAO_PSDL_Scope_Visitor::visit_identifier (TAO_PSDL_Identifier *identifier) 00034 { 00035 this->psdl_node_->set_identifier (identifier->value ()); 00036 00037 return 0; 00038 } 00039 00040 int 00041 TAO_PSDL_Scope_Visitor::visit_specification (TAO_PSDL_Specification *specification) 00042 { 00043 if (specification->definition ()->accept (this) == -1) 00044 return -1; 00045 00046 if (specification->specification () != 0) 00047 { 00048 if (specification->specification ()->accept (this) == -1) 00049 return -1; 00050 } 00051 return 0; 00052 } 00053 00054 int TAO_PSDL_Scope_Visitor::visit_definition (TAO_PSDL_Definition *definition) 00055 { 00056 if (definition->definition_type ()->accept (this) == -1) 00057 return -1; 00058 return 0; 00059 } 00060 00061 int 00062 TAO_PSDL_Scope_Visitor::visit_abstract_storagetype (TAO_PSDL_Abstract_Storagetype *) 00063 { 00064 return 0; 00065 } 00066 00067 int 00068 TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_dcl (TAO_PSDL_Abstract_Storagetype_Dcl *) 00069 { 00070 // NOT YET SUPPORTED 00071 return 0; 00072 } 00073 00074 int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_fwd_dcl (TAO_PSDL_Abstract_Storagetype_Fwd_Dcl *) 00075 { 00076 // NOT YET SUPPORTED 00077 return 0; 00078 } 00079 00080 int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_header (TAO_PSDL_Abstract_Storagetype_Header *) 00081 { 00082 // NOT YET SUPPORTED 00083 return 0; 00084 } 00085 00086 int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_body (TAO_PSDL_Abstract_Storagetype_Body *) 00087 { 00088 // NOT YET SUPPORTED 00089 return 0; 00090 } 00091 00092 int 00093 TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_member (TAO_PSDL_Abstract_Storagetype_Member *) 00094 { 00095 // NOT YET SUPPORTED 00096 return 0; 00097 } 00098 00099 int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_inh_spec (TAO_PSDL_Abstract_Storagetype_Inh_Spec *) 00100 { 00101 // NOT YET SUPPORTED 00102 return 0; 00103 } 00104 00105 int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_name (TAO_PSDL_Abstract_Storagetype_Name *) 00106 { 00107 // NOT YET SUPPORTED 00108 return 0; } 00109 00110 int TAO_PSDL_Scope_Visitor::visit_psdl_state_dcl (TAO_PSDL_Psdl_State_Dcl *) 00111 { 00112 // NOT YET SUPPORTED 00113 return 0; 00114 } 00115 00116 int TAO_PSDL_Scope_Visitor::visit_psdl_state_type_spec (TAO_PSDL_Psdl_State_Type_Spec *) 00117 { 00118 // NOT YET SUPPORTED 00119 return 0; 00120 } 00121 00122 int TAO_PSDL_Scope_Visitor::visit_abstract_storagetype_ref_type (TAO_PSDL_Abstract_Storagetype_Ref_Type) 00123 { 00124 // NOT YET SUPPORTED 00125 return 0; 00126 } 00127 00128 int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome (TAO_PSDL_Abstract_Storagehome *) 00129 { 00130 // NOT YET SUPPORTED 00131 return 0; 00132 } 00133 00134 int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_fwd_dcl (TAO_PSDL_Abstract_Storagehome_Fwd_Dcl *) 00135 { // NOT YET SUPPORTED 00136 00137 00138 return 0; } 00139 00140 int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_dcl (TAO_PSDL_Abstract_Storagehome_Dcl *) 00141 { 00142 // NOT YET SUPPORTED 00143 return 0; 00144 } 00145 00146 int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_header (TAO_PSDL_Abstract_Storagehome_Header *) 00147 { 00148 // NOT YET SUPPORTED 00149 return 0; 00150 } 00151 00152 int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_body (TAO_PSDL_Abstract_Storagehome_Body *) 00153 { 00154 // NOT YET SUPPORTED 00155 return 0; 00156 } 00157 00158 int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_member (TAO_PSDL_Abstract_Storagehome_Member *) 00159 { 00160 // NOT YET SUPPORTED 00161 return 0; 00162 } 00163 00164 int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_inh_spec (TAO_PSDL_Abstract_Storagehome_Inh_Spec *) 00165 { 00166 // NOT YET SUPPORTED 00167 return 0; 00168 } 00169 00170 int TAO_PSDL_Scope_Visitor::visit_abstract_storagehome_name (TAO_PSDL_Abstract_Storagehome_Name *) 00171 { // NOT YET SUPPORTED 00172 return 0; 00173 } 00174 00175 int TAO_PSDL_Scope_Visitor::visit_local_op_dcl (TAO_PSDL_Local_Op_Dcl *local_op_dcl) 00176 { 00177 if (local_op_dcl->op_type_spec ()->accept (this) == -1) 00178 return -1; 00179 00180 if (local_op_dcl->identifier ()->accept (this) == -1) 00181 return -1; 00182 00183 if (local_op_dcl->parameter_dcls ()->accept (this) == -1) 00184 return -1; 00185 00186 if (local_op_dcl->raises_expr () != 0) 00187 { 00188 if (local_op_dcl->raises_expr ()->accept (this) == -1) 00189 return -1; 00190 } 00191 return 0; 00192 } 00193 00194 int TAO_PSDL_Scope_Visitor::visit_key_dcl (TAO_PSDL_Key_Dcl *key_dcl) 00195 { 00196 if (key_dcl->identifier ()->accept (this) == -1) 00197 return -1; 00198 00199 if (key_dcl->simple_declarator () != 0) 00200 if (key_dcl->simple_declarator ()->accept (this) == -1) 00201 return -1; 00202 return 0; 00203 } 00204 00205 int TAO_PSDL_Scope_Visitor::visit_catalog (TAO_PSDL_Catalog *) 00206 { 00207 // NOT YET SUPPORTED 00208 return 0; } 00209 00210 int TAO_PSDL_Scope_Visitor::visit_catalog_inh_spec (TAO_PSDL_Catalog_Inh_Spec *) 00211 { 00212 // NOT YET SUPPORTED 00213 return 0; } 00214 00215 int TAO_PSDL_Scope_Visitor::visit_catalog_name (TAO_PSDL_Catalog_Name *) 00216 { // NOT YET SUPPORTED 00217 return 0; } 00218 00219 int TAO_PSDL_Scope_Visitor::visit_catalog_body (TAO_PSDL_Catalog_Body *) 00220 { 00221 // NOT YET SUPPORTED 00222 return 0; 00223 } 00224 00225 int TAO_PSDL_Scope_Visitor::visit_catalog_member (TAO_PSDL_Catalog_Member *) 00226 { 00227 // NOT YET SUPPORTED 00228 return 0; 00229 } 00230 00231 int TAO_PSDL_Scope_Visitor::visit_storagetype_member (TAO_PSDL_Storagetype_Member *) 00232 { 00233 // NOT YET SUPPORTED 00234 return 0; 00235 } 00236 00237 int TAO_PSDL_Scope_Visitor::visit_storagetype_inh_spec (TAO_PSDL_Storagetype_Inh_Spec *) 00238 { 00239 // NOT YET SUPPORTED 00240 return 0; 00241 } 00242 00243 int TAO_PSDL_Scope_Visitor::visit_storagetype_name (TAO_PSDL_Storagetype_Name *storagetype_name) 00244 { 00245 if (storagetype_name->scoped_name ()->accept (this) == -1) 00246 return -1; 00247 00248 return 0; 00249 } 00250 00251 int TAO_PSDL_Scope_Visitor::visit_storagetype_impl_spec (TAO_PSDL_Storagetype_Impl_Spec *) 00252 { 00253 // NOT YET SUPPORTED 00254 return 0; 00255 } 00256 00257 int TAO_PSDL_Scope_Visitor::visit_storagetype_ref_type (TAO_PSDL_Storagetype_Ref_Type *) 00258 { 00259 // NOT YET SUPPORTED 00260 return 0; 00261 } 00262 00263 int TAO_PSDL_Scope_Visitor::visit_store_directive (TAO_PSDL_Store_Directive *) 00264 { 00265 // NOT YET SUPPORTED 00266 return 0; 00267 } 00268 00269 int TAO_PSDL_Scope_Visitor::visit_psdl_concrete_state_type (TAO_PSDL_Psdl_Concrete_State_Type *) 00270 { 00271 // NOT YET SUPPORTED 00272 return 0; 00273 } 00274 00275 int TAO_PSDL_Scope_Visitor::visit_ref_rep_directive (TAO_PSDL_Ref_Rep_Directive *) 00276 { 00277 // NOT YET SUPPORTED 00278 return 0; 00279 } 00280 00281 int TAO_PSDL_Scope_Visitor::visit_storagehome (TAO_PSDL_Storagehome *storagehome) 00282 { 00283 if (storagehome->storagehome_header ()->accept (this) == -1) 00284 return -1; 00285 00286 if (storagehome->storagehome_body () != 0) 00287 if (storagehome->storagehome_body ()->accept (this) == -1) 00288 return -1; 00289 return 0; 00290 } 00291 00292 int TAO_PSDL_Scope_Visitor::visit_storagehome_header (TAO_PSDL_Storagehome_Header *sh_header) 00293 { 00294 if (sh_header->identifier ()->accept (this) == -1) 00295 return -1; 00296 00297 if (sh_header->storagetype_name ()->accept (this) == -1) 00298 return -1; 00299 00300 00301 if (sh_header->storagehome_inh_spec () != 0) 00302 if (sh_header->storagehome_inh_spec ()->accept (this) == -1) 00303 return -1; 00304 00305 if (sh_header->storagehome_impl_spec () != 0) 00306 if (sh_header->storagehome_impl_spec ()->accept (this) == -1) 00307 return -1; 00308 00309 return 0; 00310 } 00311 00312 int TAO_PSDL_Scope_Visitor::visit_storagehome_body (TAO_PSDL_Storagehome_Body *sh_body) 00313 { 00314 if (sh_body->storagehome_member ()->accept (this) == -1) 00315 return -1; 00316 00317 if (sh_body->storagehome_body () != 0) 00318 if (sh_body->storagehome_body ()->accept (this) == -1) 00319 return -1; 00320 return 0; 00321 } 00322 00323 int TAO_PSDL_Scope_Visitor::visit_storagehome_member (TAO_PSDL_Storagehome_Member *sh_member) 00324 { 00325 if (sh_member->key_dcl ()->accept (this) == -1) 00326 return -1; 00327 return 0; 00328 } 00329 00330 int TAO_PSDL_Scope_Visitor::visit_storagehome_inh_spec (TAO_PSDL_Storagehome_Inh_Spec *sh_inh_spec) 00331 { 00332 if (sh_inh_spec->storagehome_name ()->accept (this) == -1) 00333 return -1; 00334 return 0; 00335 } 00336 00337 int TAO_PSDL_Scope_Visitor::visit_storagehome_name (TAO_PSDL_Storagehome_Name *sh_name) 00338 { 00339 if (sh_name->scoped_name ()->accept (this) == -1) 00340 return -1; 00341 return 0; 00342 } 00343 00344 int TAO_PSDL_Scope_Visitor::visit_storagehome_impl_spec (TAO_PSDL_Storagehome_Impl_Spec *sh_impl_spec) 00345 { 00346 if (sh_impl_spec->abstract_storagehome_name ()->accept (this) == -1) 00347 return -1; 00348 return 0; 00349 } 00350 00351 int 00352 TAO_PSDL_Scope_Visitor::visit_primary_key_dcl (TAO_PSDL_Primary_Key_Dcl *primary_key_dcl) 00353 { 00354 if (primary_key_dcl->identifier ()->accept (this) == -1) 00355 return -1; 00356 return 0; 00357 } 00358 00359 int 00360 TAO_PSDL_Scope_Visitor::visit_type_dcl (TAO_PSDL_Type_Dcl *type_dcl) 00361 { 00362 if (type_dcl->key_word () == TAO_PSDL_NATIVE) 00363 { 00364 this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (type_dcl->key_word ())); 00365 00366 this->psdl_node_->set_predefined_type (); 00367 } 00368 00369 if (type_dcl->type_of_type_dcl ()->accept (this) == -1) 00370 return -1; 00371 00372 return 0; 00373 } 00374 00375 int 00376 TAO_PSDL_Scope_Visitor::visit_type_declarator (TAO_PSDL_Type_Declarator *type_declarator) 00377 { 00378 if (type_declarator->type_spec ()->accept (this) == -1) 00379 return -1; 00380 00381 if (type_declarator->declarators ()->accept (this) == -1) 00382 return -1; 00383 00384 return 0; 00385 } 00386 00387 int TAO_PSDL_Scope_Visitor::visit_type_spec (TAO_PSDL_Type_Spec *type_spec) 00388 { 00389 if (type_spec->type_of_type_spec ()->accept (this) == -1) 00390 return -1; 00391 00392 return 0; 00393 } 00394 00395 int 00396 TAO_PSDL_Scope_Visitor::visit_simple_type_spec (TAO_PSDL_Simple_Type_Spec *simple_type_spec) 00397 { 00398 if (simple_type_spec->type_of_simple_type_spec ()->accept (this) == -1) 00399 return -1; 00400 00401 // @@ why this 00402 this->scoped_type_ = TAO_PSDL_Scope::instance ()->get_identifier (); 00403 return 0; 00404 } 00405 00406 int TAO_PSDL_Scope_Visitor::visit_base_type_spec (TAO_PSDL_Base_Type_Spec *base_type_spec) 00407 { 00408 if (base_type_spec->type_of_base_type_spec ()->accept (this) == -1) 00409 return -1; 00410 return 0; } 00411 00412 int TAO_PSDL_Scope_Visitor::visit_template_type_spec (TAO_PSDL_Template_Type_Spec *template_type_spec) 00413 { 00414 if (template_type_spec->type_of_template_type_spec ()->accept (this) == -1) 00415 return -1; 00416 return 0; 00417 } 00418 00419 int TAO_PSDL_Scope_Visitor::visit_constr_type_spec (TAO_PSDL_Constr_Type_Spec *) 00420 { 00421 // NOT YET SUPPORTED 00422 return 0; 00423 } 00424 00425 int TAO_PSDL_Scope_Visitor::visit_declarators (TAO_PSDL_Declarators *declarators) 00426 { 00427 00428 if (declarators->declarator ()->accept (this) == -1) 00429 return -1; 00430 00431 if (declarators->set_of_declarators () != 0) 00432 { 00433 if (declarators->set_of_declarators ()->accept (this) == -1) 00434 return -1; 00435 } 00436 return 0; 00437 } 00438 00439 int TAO_PSDL_Scope_Visitor::visit_declarator (TAO_PSDL_Declarator *declarator) 00440 { 00441 if (declarator->type_of_declarator ()->accept (this) == -1) 00442 return -1; 00443 return 0; 00444 } 00445 00446 int TAO_PSDL_Scope_Visitor::visit_simple_declarator (TAO_PSDL_Simple_Declarator *simple_declarator) 00447 { 00448 00449 if (simple_declarator->identifier ()->accept (this) == -1) 00450 return -1; 00451 00452 if (simple_declarator->simple_declarator () != 0) 00453 { 00454 00455 if (simple_declarator->simple_declarator ()->accept (this) == -1) 00456 return -1; 00457 } 00458 return 0; 00459 } 00460 00461 int TAO_PSDL_Scope_Visitor::visit_simple_declarator_list (TAO_PSDL_Simple_Declarator_List *simple_decl_list) 00462 { 00463 00464 if (simple_decl_list-> simple_declarator ()->accept (this) == -1) 00465 return -1; 00466 00467 if (simple_decl_list->simple_declarator_list () != 0) 00468 { 00469 00470 if (simple_decl_list->simple_declarator_list ()->accept (this) == -1) 00471 return -1; 00472 } 00473 return 0; 00474 } 00475 00476 int TAO_PSDL_Scope_Visitor::visit_complex_declarator (TAO_PSDL_Complex_Declarator *complex_declarator) 00477 { 00478 if (complex_declarator->array_declarator ()->accept (this) == -1) 00479 return -1; 00480 return 0; 00481 } 00482 00483 int 00484 TAO_PSDL_Scope_Visitor::visit_predefined_type (TAO_PSDL_Predefined_Type *predefined_type) 00485 { 00486 if ((predefined_type->type_one () != 0) && (predefined_type->type_one () != TAO_PSDL_SEQUENCE)) 00487 { 00488 // This will happen in the case of typedefs like 00489 // typedef sequence<Istring> Name. We neednot save the sequence 00490 // @@ May be this is a wrong solution ... but atleast a 00491 // temporary one :) 00492 this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (predefined_type->type_one ())); 00493 00494 this->psdl_node_->set_predefined_type (); 00495 } 00496 if (predefined_type->type_two () != 0) {} 00497 00498 if (predefined_type->type_three () != 0) 00499 {} 00500 00501 if (predefined_type->type_of_variable_one () != 0) 00502 { 00503 if (predefined_type->type_of_variable_one ()->accept (this) == -1) 00504 return -1; 00505 } 00506 00507 if (predefined_type->type_of_variable_two () != 0) 00508 { 00509 if (predefined_type->type_of_variable_two ()->accept (this) == -1) 00510 return -1; 00511 00512 // @@ I am not sure now if I need this here. So, commenting it 00513 // out nad will get it back if need arises in future. 00514 // this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->get_identifier ()); 00515 } 00516 00517 if (predefined_type->type_of_variable_three () != 0) 00518 { 00519 if (predefined_type->type_of_variable_three ()->accept (this) == -1) 00520 return -1; 00521 } 00522 return 0; 00523 } 00524 00525 int TAO_PSDL_Scope_Visitor::visit_member_list (TAO_PSDL_Member_List *member_list) 00526 { 00527 if (member_list->member ()->accept (this) == -1) 00528 return -1; 00529 00530 if (member_list->member_list () != 0) 00531 { 00532 if (member_list->member_list ()->accept (this) == -1) 00533 return -1; 00534 } 00535 return 0; 00536 } 00537 00538 int 00539 TAO_PSDL_Scope_Visitor::visit_member (TAO_PSDL_Member *member) 00540 { 00541 if (member->type_spec ()->accept (this) == -1) 00542 return -1; 00543 00544 if (member->declarators ()->accept (this) == -1) 00545 return -1; 00546 00547 return 0; 00548 } 00549 00550 int TAO_PSDL_Scope_Visitor::visit_union_type (TAO_PSDL_Union_Type *) 00551 { // NOT YET SUPPORTED 00552 return 0; 00553 } 00554 00555 int TAO_PSDL_Scope_Visitor::visit_switch_type_spec (TAO_PSDL_Switch_Type_Spec *) 00556 { 00557 // NOT YET SUPPORTED 00558 return 0; 00559 } 00560 00561 int TAO_PSDL_Scope_Visitor::visit_switch_body (TAO_PSDL_Switch_Body *) 00562 { 00563 // NOT YET SUPPORTED 00564 return 0; 00565 } 00566 00567 int TAO_PSDL_Scope_Visitor::visit_case_case (TAO_PSDL_Case *) 00568 { 00569 // NOT YET SUPPORTED 00570 return 0; 00571 } 00572 00573 int TAO_PSDL_Scope_Visitor::visit_case_label (TAO_PSDL_Case_Label *) 00574 { 00575 // NOT YET SUPPORTED 00576 return 0; 00577 } 00578 00579 int TAO_PSDL_Scope_Visitor::visit_element_spec (TAO_PSDL_Element_Spec *) 00580 { 00581 // NOT YET SUPPORTED 00582 return 0; 00583 } 00584 00585 int TAO_PSDL_Scope_Visitor::visit_const_dcl (TAO_PSDL_Const_Dcl *const_dcl) 00586 { 00587 if (const_dcl->const_type () != 0) 00588 { 00589 if (const_dcl->const_type ()->accept (this) == -1) 00590 return -1; 00591 } 00592 00593 if (const_dcl->identifier ()->accept (this) == -1) 00594 return -1; 00595 00596 if (const_dcl->const_exp ()->accept (this) == -1) 00597 return -1; 00598 00599 return 0; 00600 } 00601 00602 int TAO_PSDL_Scope_Visitor::visit_const_type (TAO_PSDL_Const_Type *const_type) 00603 { 00604 if (const_type->type ()->accept (this) == -1) 00605 return -1; 00606 00607 return 0; 00608 } 00609 00610 int TAO_PSDL_Scope_Visitor::visit_const_exp (TAO_PSDL_Const_Exp *) 00611 { 00612 // NOT YET SUPPORTED 00613 return 0; 00614 } 00615 00616 int TAO_PSDL_Scope_Visitor::visit_or_expr (TAO_PSDL_Or_Expr *) 00617 { 00618 // NOT YET SUPPORTED 00619 return 0; 00620 } 00621 00622 int TAO_PSDL_Scope_Visitor::visit_xor_expr (TAO_PSDL_Xor_Expr *) 00623 { 00624 // NOT YET SUPPORTED 00625 return 0; 00626 } 00627 00628 int TAO_PSDL_Scope_Visitor::visit_and_expr (TAO_PSDL_And_Expr *) 00629 { 00630 // NOT YET SUPPORTED 00631 return 0; 00632 } 00633 00634 int TAO_PSDL_Scope_Visitor::visit_shift_expr (TAO_PSDL_Shift_Expr *) 00635 { 00636 // NOT YET SUPPORTED 00637 return 0; 00638 } 00639 00640 int TAO_PSDL_Scope_Visitor::visit_add_expr (TAO_PSDL_Add_Expr *) 00641 { 00642 // NOT YET SUPPORTED 00643 return 0; 00644 } 00645 00646 int TAO_PSDL_Scope_Visitor::visit_mult_expr (TAO_PSDL_Mult_Expr *) 00647 { 00648 // NOT YET SUPPORTED 00649 return 0; 00650 } 00651 00652 int TAO_PSDL_Scope_Visitor::visit_unary_expr (TAO_PSDL_Unary_Expr *) 00653 { 00654 // NOT YET SUPPORTED 00655 return 0; 00656 } 00657 00658 int TAO_PSDL_Scope_Visitor::visit_primary_expr (TAO_PSDL_Primary_Expr *) 00659 { 00660 // NOT YET SUPPORTED 00661 return 0; 00662 } 00663 00664 int TAO_PSDL_Scope_Visitor::visit_except_dcl (TAO_PSDL_Except_Dcl *except_dcl) 00665 { 00666 // @@ Do I really need this. Lets comment it for now and if it is 00667 // really needed will uncomment it later, 00668 /* 00669 if (except_dcl->identifier ()->accept (this) == -1) 00670 return -1; 00671 */ 00672 00673 if (except_dcl->member_list () != 0) 00674 { 00675 if (except_dcl->member_list ()->accept (this) == -1) 00676 return -1; 00677 } 00678 return 0; 00679 } 00680 00681 int 00682 TAO_PSDL_Scope_Visitor::visit_op_dcl (TAO_PSDL_Op_Dcl *op_dcl) 00683 { 00684 if (op_dcl->op_attribute () != 0) 00685 if (op_dcl->op_attribute ()->accept (this) == -1) 00686 return -1; 00687 00688 if (op_dcl->op_type_spec ()->accept (this) == -1) 00689 return -1; 00690 00691 if (op_dcl->identifier ()->accept (this) == -1) 00692 return -1; 00693 00694 if (op_dcl->parameter_dcls ()->accept (this) == -1) 00695 return -1; 00696 00697 if (op_dcl->raises_expr () != 0) 00698 if (op_dcl->raises_expr ()->accept (this) == -1) 00699 return -1; 00700 00701 if (op_dcl->context_expr () != 0) 00702 if (op_dcl->context_expr ()->accept (this) == -1) 00703 return -1; 00704 00705 return 0; 00706 } 00707 00708 int 00709 TAO_PSDL_Scope_Visitor::visit_storagetype (TAO_PSDL_Storagetype *storagetype) 00710 { 00711 if (storagetype->declaration () != 0) 00712 if (storagetype->declaration ()->accept (this) == -1) 00713 return -1; 00714 return 0; 00715 } 00716 00717 int 00718 TAO_PSDL_Scope_Visitor::visit_storagetype_dcl (TAO_PSDL_Storagetype_Dcl *) 00719 { 00720 // NOT YET SUPPORTED 00721 return 0; 00722 } 00723 00724 int 00725 TAO_PSDL_Scope_Visitor::visit_storagetype_fwd_dcl (TAO_PSDL_Storagetype_Fwd_Dcl *) 00726 { 00727 // NOT YET SUPPORTED 00728 return 0; 00729 } 00730 00731 int 00732 TAO_PSDL_Scope_Visitor::visit_storagetype_header (TAO_PSDL_Storagetype_Header *) 00733 { 00734 // NOT YET SUPPORTED 00735 return 0; 00736 } 00737 00738 int 00739 TAO_PSDL_Scope_Visitor::visit_storagetype_body (TAO_PSDL_Storagetype_Body *) 00740 { 00741 // NOT YET SUPPORTED 00742 return 0; 00743 } 00744 00745 int 00746 TAO_PSDL_Scope_Visitor::visit_storagehome_scope (TAO_PSDL_Storagehome_Scope *) 00747 { 00748 // NOT YET SUPPORTED 00749 return 0; 00750 } 00751 00752 int 00753 TAO_PSDL_Scope_Visitor::visit_provides_dcl (TAO_PSDL_Provides_Dcl *) 00754 { 00755 // NOT YET SUPPORTED 00756 return 0; 00757 } 00758 00759 int 00760 TAO_PSDL_Scope_Visitor::visit_op_type_spec (TAO_PSDL_Op_Type_Spec *op_type_spec) 00761 { 00762 if (op_type_spec->type () != 0) 00763 { 00764 this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (op_type_spec->type ())); 00765 00766 this->psdl_node_->set_predefined_type (); 00767 } 00768 00769 if (op_type_spec->type_spec () != 0) 00770 if (op_type_spec->type_spec ()->accept (this) == -1) 00771 return -1; 00772 00773 return 0; 00774 } 00775 00776 int 00777 TAO_PSDL_Scope_Visitor::visit_parameter_dcls (TAO_PSDL_Parameter_Dcls *parameter_dcls) 00778 { 00779 if (parameter_dcls->param_dcl () != 0) 00780 if (parameter_dcls->param_dcl ()->accept (this) == -1) 00781 return -1; 00782 00783 return 0; 00784 } 00785 00786 int TAO_PSDL_Scope_Visitor::visit_param_dcl (TAO_PSDL_Param_Dcl *param_dcl) 00787 { 00788 if (param_dcl->param_attribute ()->accept (this) == -1) 00789 return -1; 00790 00791 if (param_dcl->param_type_spec ()->accept (this) == -1) 00792 return -1; 00793 00794 if (param_dcl->simple_declarator ()->accept (this) == -1) 00795 return -1; 00796 00797 if (param_dcl->param_dcl () != 0) 00798 if (param_dcl->param_dcl ()->accept (this) == -1) 00799 return -1; 00800 00801 return 0; 00802 } 00803 00804 int 00805 TAO_PSDL_Scope_Visitor::visit_raises_expr (TAO_PSDL_Raises_Expr *raises_expr) 00806 { 00807 this->psdl_node_->set_identifier ("raises_exception"); 00808 00809 if (raises_expr->first_scoped_name ()->accept (this) == -1) 00810 return -1; 00811 00812 if (raises_expr->second_scoped_name () != 0) 00813 { 00814 if (raises_expr->second_scoped_name ()->accept (this) == -1) 00815 return -1; 00816 } 00817 return 0; 00818 } 00819 00820 int 00821 TAO_PSDL_Scope_Visitor::visit_context_expr (TAO_PSDL_Context_Expr *context_expr) 00822 { 00823 if (context_expr->string_literal ()->accept (this) == -1) 00824 return -1; 00825 return 0; 00826 } 00827 00828 int 00829 TAO_PSDL_Scope_Visitor::visit_param_type_spec (TAO_PSDL_Param_Type_Spec *param_type_spec) 00830 { 00831 if (param_type_spec->type_of_param ()->accept (this) == -1) 00832 return -1; 00833 return 0; 00834 } 00835 00836 int 00837 TAO_PSDL_Scope_Visitor::visit_fixed_pt_type (TAO_PSDL_Fixed_Pt_Type *fixed_pt_type) 00838 { 00839 if (fixed_pt_type->positive_int_const_one ()->accept (this) == -1) 00840 return -1; 00841 00842 if (fixed_pt_type->positive_int_const_two ()->accept (this) == -1) 00843 return -1; 00844 00845 return 0; 00846 } 00847 00848 int 00849 TAO_PSDL_Scope_Visitor::visit_constr_forward_decl (TAO_PSDL_Constr_Forward_Decl *constr_fwd_dcl) 00850 { 00851 if (constr_fwd_dcl->type ()->accept (this) == -1) 00852 return -1; 00853 00854 if (constr_fwd_dcl->identifier ()->accept (this) == -1) 00855 return -1; 00856 00857 return 0; 00858 } 00859 00860 int TAO_PSDL_Scope_Visitor::visit_interface (TAO_PSDL_Interface *interf) 00861 { 00862 if (interf->type_of_dcl ()->accept (this) == -1) 00863 return -1; 00864 00865 return 0; 00866 } 00867 00868 int TAO_PSDL_Scope_Visitor::visit_interface_body (TAO_PSDL_Interface_Body *interface_body) 00869 { 00870 if (interface_body->export_variable ()->accept (this) == -1) 00871 return -1; 00872 00873 if (interface_body->interface_body () != 0) 00874 { 00875 if (interface_body->interface_body ()->accept (this) == -1) 00876 return -1; 00877 } 00878 return 0; 00879 } 00880 00881 int TAO_PSDL_Scope_Visitor::visit_interface_dcl (TAO_PSDL_Interface_Dcl *interface_dcl) 00882 { 00883 if (interface_dcl->interface_header ()->accept (this) == -1) 00884 return -1; 00885 00886 if (interface_dcl->interface_body () != 0) 00887 { 00888 if (interface_dcl->interface_body ()->accept (this) == -1) 00889 return -1; 00890 } 00891 return 0; 00892 } 00893 00894 int 00895 TAO_PSDL_Scope_Visitor::visit_forward_dcl (TAO_PSDL_Forward_Dcl *forward_dcl) 00896 { 00897 if (forward_dcl->identifier ()->accept (this) == -1) 00898 return -1; 00899 00900 if (forward_dcl->type () != 0) 00901 { 00902 this->psdl_node_->set_identifier (TAO_PSDL_Scope::instance ()->convert_str (forward_dcl->type ())); 00903 this->psdl_node_->set_predefined_type (); 00904 } 00905 return 0; 00906 } 00907 00908 int 00909 TAO_PSDL_Scope_Visitor::visit_interface_header (TAO_PSDL_Interface_Header *interface_header) 00910 { 00911 // @@ Do I really need this. Lets comment it for now and if it is 00912 // really needed will uncomment it later, 00913 00914 /* 00915 if (interface_header->identifier ()->accept (this) == -1) 00916 return -1; 00917 */ 00918 00919 if (interface_header->type () != 0) 00920 { 00921 if (interface_header->type ()->accept (this) == -1) 00922 return -1; 00923 } 00924 00925 if (interface_header->interface_inheritance_spec () != 0) 00926 { 00927 if (interface_header->interface_inheritance_spec ()->accept (this) == -1) 00928 return -1; 00929 } 00930 return 0; 00931 } 00932 00933 int TAO_PSDL_Scope_Visitor::visit_export_dcl (TAO_PSDL_Export_Dcl *export_dcl) 00934 { 00935 if (export_dcl->type_of_export_one ()->accept (this) == -1) 00936 return -1; 00937 00938 if (export_dcl->type_of_export_two () != 0) 00939 { 00940 00941 if (export_dcl->type_of_export_two ()->accept (this) == -1) 00942 return -1; 00943 } 00944 return 0; 00945 } 00946 00947 int 00948 TAO_PSDL_Scope_Visitor::visit_interface_inheritance_spec (TAO_PSDL_Interface_Inheritance_Spec *interface_inh_spec) 00949 { 00950 if (interface_inh_spec->interface_name ()->accept (this) == -1) 00951 return -1; 00952 00953 return 0; 00954 } 00955 00956 int 00957 TAO_PSDL_Scope_Visitor::visit_interface_name (TAO_PSDL_Interface_Name *interface_name) 00958 { 00959 if (interface_name->scoped_name ()->accept (this) == -1) 00960 return -1; 00961 00962 if (interface_name->interface_name () != 0) 00963 { 00964 if (interface_name->interface_name ()->accept (this) == -1) 00965 return -1; 00966 } 00967 return 0; 00968 } 00969 00970 int 00971 TAO_PSDL_Scope_Visitor::visit_scoped_name (TAO_PSDL_Scoped_Name *scoped_name) 00972 { 00973 if (scoped_name->identifier ()->accept (this) == -1) 00974 return -1; 00975 00976 if (scoped_name->scoped_name () != 0) 00977 { 00978 if (scoped_name->scoped_name ()->accept (this) == -1) 00979 return -1; 00980 } 00981 00982 return 0; 00983 } 00984 00985 int 00986 TAO_PSDL_Scope_Visitor::visit_value (TAO_PSDL_Value *) 00987 { 00988 // NOT YET SUPPORTED 00989 return 0; 00990 } 00991 00992 int 00993 TAO_PSDL_Scope_Visitor::visit_value_common_base (TAO_PSDL_Value_Common_Base *) 00994 { 00995 // NOT YET SUPPORTED 00996 return 0; 00997 } 00998 00999 int 01000 TAO_PSDL_Scope_Visitor::visit_value_forward_dcl (TAO_PSDL_Value_Forward_Dcl *) 01001 { 01002 // NOT YET SUPPORTED 01003 return 0; 01004 } 01005 01006 int 01007 TAO_PSDL_Scope_Visitor::visit_value_box_dcl (TAO_PSDL_Value_Box_Dcl *) 01008 { 01009 // NOT YET SUPPORTED 01010 return 0; 01011 } 01012 01013 int 01014 TAO_PSDL_Scope_Visitor::visit_value_abs_dcl (TAO_PSDL_Value_Abs_Dcl *) 01015 { 01016 // NOT YET SUPPORTED 01017 return 0; } 01018 01019 int 01020 TAO_PSDL_Scope_Visitor::visit_value_dcl (TAO_PSDL_Value_Dcl *) 01021 { 01022 // NOT YET SUPPORTED 01023 return 0; 01024 } 01025 01026 int 01027 TAO_PSDL_Scope_Visitor::visit_value_header (TAO_PSDL_Value_Header *) 01028 { 01029 // NOT YET SUPPORTED 01030 return 0; 01031 } 01032 01033 int 01034 TAO_PSDL_Scope_Visitor::visit_value_inheritance_spec (TAO_PSDL_Value_Inheritance_Spec *) 01035 { 01036 // NOT YET SUPPORTED 01037 return 0; 01038 } 01039 01040 int 01041 TAO_PSDL_Scope_Visitor::visit_value_name (TAO_PSDL_Value_Name *) 01042 { 01043 // NOT YET SUPPORTED 01044 return 0; 01045 } 01046 01047 int 01048 TAO_PSDL_Scope_Visitor::visit_value_element (TAO_PSDL_Value_Element *) 01049 { 01050 // NOT YET SUPPORTED 01051 return 0; 01052 } 01053 01054 int 01055 TAO_PSDL_Scope_Visitor::visit_array_declarator (TAO_PSDL_Array_Declarator *) 01056 { 01057 // NOT YET SUPPORTED 01058 return 0; 01059 } 01060 01061 int 01062 TAO_PSDL_Scope_Visitor::visit_fixed_array_size (TAO_PSDL_Fixed_Array_Size *) 01063 { 01064 // NOT YET SUPPORTED 01065 return 0; 01066 } 01067 01068 int 01069 TAO_PSDL_Scope_Visitor::visit_enumerator (TAO_PSDL_Enumerator *enumerator) 01070 { 01071 if (enumerator->identifier ()->accept (this) == -1) 01072 return -1; 01073 01074 if (enumerator->enumerator () != 0) 01075 { 01076 if (enumerator->enumerator ()->accept (this) == -1) 01077 return -1; 01078 } 01079 return 0; 01080 } 01081 01082 int 01083 TAO_PSDL_Scope_Visitor::visit_literal (TAO_PSDL_Literal *) 01084 { 01085 // NOT YET SUPPORTED 01086 return 0; 01087 } 01088 01089 int 01090 TAO_PSDL_Scope_Visitor::visit_state_member (TAO_PSDL_State_Member *) 01091 { 01092 // NOT YET SUPPORTED 01093 return 0; 01094 } 01095 01096 int 01097 TAO_PSDL_Scope_Visitor::visit_init_dcl (TAO_PSDL_Init_Dcl *) 01098 { 01099 // NOT YET SUPPORTED 01100 return 0; 01101 } 01102 01103 int 01104 TAO_PSDL_Scope_Visitor::visit_init_param_decls (TAO_PSDL_Init_Param_Decls *) 01105 { 01106 // NOT YET SUPPORTED 01107 return 0; 01108 } 01109 01110 int TAO_PSDL_Scope_Visitor::visit_init_param_decl (TAO_PSDL_Init_Param_Decl *) 01111 { 01112 // NOT YET SUPPORTED 01113 return 0; 01114 } 01115 01116 int TAO_PSDL_Scope_Visitor::visit_factory_parameters (TAO_PSDL_Factory_Parameters *) 01117 { 01118 // NOT YET SUPPORTED 01119 return 0; 01120 } 01121 01122 int TAO_PSDL_Scope_Visitor::visit_attr_dcl (TAO_PSDL_Attr_Dcl *attr_dcl) 01123 { 01124 if (attr_dcl->readonly () != 0) 01125 { 01126 ACE_DEBUG ((LM_DEBUG, 01127 "{ %s }\n", 01128 attr_dcl->readonly ())); 01129 } 01130 01131 if (attr_dcl->param_type_spec ()->accept (this) == -1) 01132 return -1; 01133 01134 if (attr_dcl->simple_declarator ()->accept (this) == -1) 01135 return -1; 01136 01137 return 0; 01138 } 01139 01140 int TAO_PSDL_Scope_Visitor::visit_factory_dcl (TAO_PSDL_Factory_Dcl *) 01141 { 01142 // NOT YET SUPPORTED 01143 return 0; 01144 } 01145 01146 int TAO_PSDL_Scope_Visitor::visit_positive_int_const (TAO_PSDL_Positive_Int_Const *) 01147 { 01148 // NOT YET SUPPORTED 01149 return 0; 01150 }