summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-02-03 21:44:11 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-02-03 21:44:11 +0000
commit5582c43417f35d40d206e73a877e2cd5acc3b3e5 (patch)
tree33c7340cd5edc4a8da1ab9b28e9f642f8328b9e8
parent07b92abe78acc25ab4a87d70de693bfaeac840f7 (diff)
downloadATCD-idl3_plus_backend2.tar.gz
ChangeLogTag: Wed Feb 3 21:41:50 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>idl3_plus_backend2
-rw-r--r--modules/CIAO/ChangeLog21
-rw-r--r--modules/CIAO/ciao/Servants/Home_Servant_Impl_T.h5
-rw-r--r--modules/CIAO/tests/IDL_Test/IDL3_Plus/KitchenSink.idl38
-rw-r--r--modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.cpp11
-rw-r--r--modules/CIAO/tools/IDL3_to_IDL2/basic_visitor.h1
-rw-r--r--modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp126
-rw-r--r--modules/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h7
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 <j.parsons@vanderbilt.edu>
+
+ * 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 <j.parsons@vanderbilt.edu>
* 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<iface> ifaceSeq;
@@ -29,6 +31,7 @@ eventtype ev
{
};
+
module GlobalTyped<typename A, typename B>
{
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<iface, ifaceSeq> Nested_Inst;
@@ -87,6 +103,8 @@ module B
};
};
+module B::second_B<iface, ifaceSeq> second_B_Inst;
+
module Ast<typename T,
eventtype E,
exception S,
@@ -96,15 +114,26 @@ module Ast<typename T,
{
interface Foo : T
{
- attribute T Foo_Attr;
+ attribute T Foo_Attr getraises (S);
- void Foo_Op (in TSeq inarg) raises (S);
+ void Foo_Op (inout long inoutarg,
+ in T inarg,
+ out T outarg,
+ in TSeq seq_inarg)
+ raises (S);
};
alias second<T, S> 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<typename T,
const unsigned long Ast_Const = M;
const unsigned long LC = 7;
+
typedef sequence<T, M> AnotherTSeq;
struct boo
{
T T_field;
+ Foo Foo_field;
};
typedef T T_array[M][Ast_Const][LC];
+
};
module Ast<iface,
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 */