diff options
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp index f557bb052c8..09aa699302e 100644 --- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp @@ -569,6 +569,90 @@ be_visitor_amh_pre_proc::visit_operation (be_operation *node) return 0; } +// @@@ (JP) I think this can be removed. It is doing nothing +// that the generic visit_scope() is not doing. +int +be_visitor_amh_pre_proc::visit_scope (be_scope *node) +{ + // proceed if the number of members in our scope is greater than 0 + if (node->nmembers () > 0) + { + int number_of_elements = 0; + + { + // initialize an iterator to iterate thru our scope + for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls); + !si.is_done (); + si.next ()) + { + ++number_of_elements; + } + } + + AST_Decl **elements; + ACE_NEW_RETURN (elements, + AST_Decl *[number_of_elements], + -1); + + { + int position = 0; + // initialize an iterator to iterate thru our scope + for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls); + !si.is_done (); + si.next ()) + { + elements[position++] = si.item (); + } + } + + + int elem_number = 0; + + // continue until each element is visited + while (elem_number < number_of_elements) + { + AST_Decl *d = elements[elem_number]; + + if (!d) + { + delete [] elements; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_scope::visit_scope - " + "bad node in this scope\n"), + -1); + + } + + be_decl *bd = be_decl::narrow_from_decl (d); + + // set the scope node as "node" in which the code is being + // generated so that elements in the node's scope can use it + // for code generation + this->ctx_->scope (node->decl ()); + + // set the node to be visited + this->ctx_->node (bd); + ++elem_number; + + + // Send the visitor. + if (bd == 0 || bd->accept (this) == -1) + { + delete [] elements; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_scope::visit_scope - " + "codegen for scope failed\n"), + -1); + + } + } // end of while loop + + delete [] elements; + } // end of if + + return 0; +} + be_valuetype * be_visitor_amh_pre_proc::create_exception_holder (be_interface *node) { |