From 5582c43417f35d40d206e73a877e2cd5acc3b3e5 Mon Sep 17 00:00:00 2001 From: parsons Date: Wed, 3 Feb 2010 21:44:11 +0000 Subject: ChangeLogTag: Wed Feb 3 21:41:50 UTC 2010 Jeff Parsons --- modules/CIAO/ChangeLog | 21 ++++ modules/CIAO/ciao/Servants/Home_Servant_Impl_T.h | 5 +- .../CIAO/tests/IDL_Test/IDL3_Plus/KitchenSink.idl | 38 ++++++- modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp | 11 -- modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.h | 1 - .../tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp | 126 ++++++++------------- .../CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h | 7 +- 7 files changed, 108 insertions(+), 101 deletions(-) diff --git a/modules/CIAO/ChangeLog b/modules/CIAO/ChangeLog index a79507c3700..deb9084516e 100644 --- a/modules/CIAO/ChangeLog +++ b/modules/CIAO/ChangeLog @@ -1,3 +1,24 @@ +Wed Feb 3 21:41:50 UTC 2010 Jeff Parsons + + * tools/IDL3_to_IDL2/basic_visitor.cpp: + * tools/IDL3_to_IDL2/basic_visitor.h: + * tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp: + * tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h: + + Updated this backend to be in synch with recent + changes to the TAO_IDL frontend and other backends, + names the handling of home factories and fincers to + be as nodes in the home's scope, rather than as + member lists in the home AST node class. + + * tests/IDL_Test/IDL3_Plus/KitchenSink.idl: + + Greatly updated and expanded with more test cases. + + * ciao/Servants/Home_Servant_Impl_T.h: + + Cosmetic changes. + Fri Jan 29 17:59:53 UTC 2010 Jeff Parsons * tools/IDL3_to_IDL2/checking_visitor.h: diff --git a/modules/CIAO/ciao/Servants/Home_Servant_Impl_T.h b/modules/CIAO/ciao/Servants/Home_Servant_Impl_T.h index 80b57189ef1..2d980998ae9 100644 --- a/modules/CIAO/ciao/Servants/Home_Servant_Impl_T.h +++ b/modules/CIAO/ciao/Servants/Home_Servant_Impl_T.h @@ -33,7 +33,6 @@ namespace CIAO class Container; typedef Container *Container_ptr; - /** * @class Home_Servant_Impl * @@ -60,10 +59,10 @@ namespace CIAO virtual void remove_component (Components::CCMObject_ptr comp); // Operations for keyless home interface. - virtual ::Components::CCMObject_ptr create_component (); + virtual ::Components::CCMObject_ptr create_component (void); // Operations for implicit home interface. - virtual typename COMP_SVNT::_stub_ptr_type create (); + virtual typename COMP_SVNT::_stub_ptr_type create (void); virtual void update_component_map (PortableServer::ObjectId &oid); diff --git a/modules/CIAO/tests/IDL_Test/IDL3_Plus/KitchenSink.idl b/modules/CIAO/tests/IDL_Test/IDL3_Plus/KitchenSink.idl index 2addbda8afb..6bd10e2b9ee 100644 --- a/modules/CIAO/tests/IDL_Test/IDL3_Plus/KitchenSink.idl +++ b/modules/CIAO/tests/IDL_Test/IDL3_Plus/KitchenSink.idl @@ -21,6 +21,8 @@ module mod interface iface { exception iface_excep {}; + + void iface_op (in string inarg); }; typedef sequence ifaceSeq; @@ -29,6 +31,7 @@ eventtype ev { }; + module GlobalTyped { typedef short x; @@ -47,6 +50,19 @@ module A interface XX { }; + + union Nested_Union switch (y) + { + case 2: string strmem; + case 0: T Tmem; + }; + + enum Nested_Enum + { + ZERO, + ONE, + TWO + }; // A regular module may be nested inside a template module, // but another template module may not. @@ -59,7 +75,7 @@ module A { typedef S S_Tdef; }; -*/ +*/ }; module Nested Nested_Inst; @@ -87,6 +103,8 @@ module B }; }; +module B::second_B second_B_Inst; + module Ast second_ref; valuetype VT_T : V supports T { + private T T_member; + + factory make_VT_T (); + + factory create_VT_T (in T T_arg, + in string str_arg) + raises (S); }; porttype PT_T @@ -146,14 +175,17 @@ module Ast AnotherTSeq; struct boo { T T_field; + Foo Foo_field; }; typedef T T_array[M][Ast_Const][LC]; + }; module Astimported ()) - { - return 0; - } - *os << be_nl; *os << "factory " @@ -358,12 +353,6 @@ basic_visitor::visit_factory (AST_Factory *node) return 0; } -int -basic_visitor::visit_finder (AST_Finder *) -{ - return 0; -} - int basic_visitor::visit_structure (AST_Structure *node) { 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; @@ -549,6 +551,45 @@ idl3_to_idl2_visitor::visit_home (AST_Home *node) return 0; } +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) { @@ -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 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 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 */ -- cgit v1.2.1