diff options
Diffstat (limited to 'modules/CIAO/tools')
4 files changed, 50 insertions, 95 deletions
diff --git a/modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp b/modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp index 22d5886854a..fddb464b442 100644 --- a/modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp +++ b/modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp @@ -334,11 +334,6 @@ basic_visitor::visit_consumes (AST_Consumes *) int basic_visitor::visit_factory (AST_Factory *node) { - if (node->imported ()) - { - return 0; - } - *os << be_nl; *os << "factory " @@ -359,12 +354,6 @@ basic_visitor::visit_factory (AST_Factory *node) } int -basic_visitor::visit_finder (AST_Finder *) -{ - return 0; -} - -int basic_visitor::visit_structure (AST_Structure *node) { if (node->imported ()) diff --git a/modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.h b/modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.h index c8bfcb931be..a8d0be526c0 100644 --- a/modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.h +++ b/modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.h @@ -71,7 +71,6 @@ public: virtual int visit_eventtype_fwd (AST_EventTypeFwd *node) = 0; virtual int visit_home (AST_Home *node) = 0; virtual int visit_factory (AST_Factory *node); - virtual int visit_finder (AST_Finder *node); virtual int visit_structure (AST_Structure *node); virtual int visit_structure_fwd (AST_StructureFwd *node); virtual int visit_exception (AST_Exception *node); diff --git a/modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp b/modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp index 69aa084c186..04c5dcacf68 100644 --- a/modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp +++ b/modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp @@ -15,15 +15,18 @@ #include "ast_eventtype.h" #include "ast_eventtype_fwd.h" #include "ast_home.h" +#include "ast_finder.h" #include "ast_operation.h" #include "ast_root.h" + #include "utl_exceptlist.h" #include "utl_identifier.h" #include "global_extern.h" #include "nr_extern.h" idl3_to_idl2_visitor::idl3_to_idl2_visitor (void) - : basic_visitor () + : basic_visitor (), + home_ (0) { } @@ -430,6 +433,8 @@ idl3_to_idl2_visitor::visit_home (AST_Home *node) { return 0; } + + this->home_ = node; ACE_CString explicit_name = node->original_local_name ()->get_string (); explicit_name += "Explicit"; @@ -474,9 +479,6 @@ idl3_to_idl2_visitor::visit_home (AST_Home *node) // Reset the home's decls to be defined in the explicit home interface. this->tranfer_scope_elements (node, xplicit); - this->gen_factories (node, xplicit); - this->gen_finders (node, xplicit); - *os << be_uidt_nl << "};" << be_nl << be_nl; @@ -550,6 +552,45 @@ idl3_to_idl2_visitor::visit_home (AST_Home *node) } int +idl3_to_idl2_visitor::visit_factory (AST_Factory *node) +{ + Identifier *id = node->original_local_name (); + + *os << be_nl << be_nl; + + if (this->home_ == 0) + { + *os << "factory "; + } + else + { + AST_Component *c = this->home_->managed_component (); + + *os << IdentifierHelper::orig_sn (c->name ()).c_str () + << " "; + } + + *os << IdentifierHelper::try_escape (id).c_str () + << " ("; + + this->gen_params (node, node->argument_count ()); + + *os << ")"; + + this->gen_exception_list (node->exceptions ()); + + *os << ";"; + + return 0; +} + +int +idl3_to_idl2_visitor::visit_finder (AST_Finder *node) +{ + return this->visit_factory (node); +} + +int idl3_to_idl2_visitor::visit_root (AST_Root *node) { int status = be_global->outfile_init (this->os, @@ -680,80 +721,3 @@ idl3_to_idl2_visitor::tranfer_scope_elements (AST_Home *src, } } } - -void -idl3_to_idl2_visitor::gen_factories (AST_Home *node, - AST_Interface &) -{ - AST_Operation **item = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->factories ()); - ! i.done (); - i.advance ()) - { - i.next (item); - - *os << be_nl << be_nl - << IdentifierHelper::orig_sn (node->managed_component ()->name ()).c_str () - << " " - << IdentifierHelper::try_escape ((*item)->original_local_name ()).c_str () - << " ("; - - this->gen_params (*item, (*item)->argument_count ()); - - *os << ")"; - - UTL_ExceptList *exceps = (*item)->exceptions (); - - if (exceps != 0 && exceps->length () > 0) - { - this->gen_exception_list (exceps, "", false); - } - else - { - *os << be_idt_nl - << "raises ("; - } - - *os << "Components::CreateFailure);" << be_uidt; - } -} - -void -idl3_to_idl2_visitor::gen_finders (AST_Home *node, - AST_Interface &) -{ - AST_Operation **item = 0; - - for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->finders ()); - ! i.done (); - i.advance ()) - { - i.next (item); - - *os << be_nl << be_nl - << IdentifierHelper::orig_sn (node->managed_component ()->name ()).c_str () - << " " - << IdentifierHelper::try_escape( (*item)->original_local_name ()).c_str () - << " ("; - - this->gen_params (*item, (*item)->argument_count ()); - - *os << ")"; - - UTL_ExceptList *exceps = (*item)->exceptions (); - - if (exceps != 0 && exceps->length () > 0) - { - this->gen_exception_list (exceps, "", false); - } - else - { - *os << be_idt_nl - << "raises ("; - } - - *os << "Components::FinderFailure);" << be_uidt; - } -} - diff --git a/modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h b/modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h index 17e8abcb38e..00e511a973e 100644 --- a/modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h +++ b/modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h @@ -59,6 +59,8 @@ public: virtual int visit_eventtype (AST_EventType *node); virtual int visit_eventtype_fwd (AST_EventTypeFwd *node); virtual int visit_home (AST_Home *node); + virtual int visit_factory (AST_Factory *node); + virtual int visit_finder (AST_Finder *node); virtual int visit_root (AST_Root *node); private: @@ -67,8 +69,9 @@ private: const char *suffix, AST_Decl *parent); void tranfer_scope_elements (AST_Home *src, AST_Interface &dst); - void gen_factories (AST_Home *node, AST_Interface &xplicit); - void gen_finders (AST_Home *node, AST_Interface &xplicit); + +private: + AST_Home *home_; }; #endif /* TAO_IDL3_TO_IDL2_VISITOR_H */ |