summaryrefslogtreecommitdiff
path: root/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2010-02-04 10:23:45 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2010-02-04 10:23:45 +0000
commitc1732461964d40901c89aa8ea84cf30b43a2b19c (patch)
tree15231945967359a6c8b71a2ca618d97f0f7f4aef /CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp
parent99b45dfa6d40758ac8a8ae3c857d0448817c8298 (diff)
downloadATCD-c1732461964d40901c89aa8ea84cf30b43a2b19c.tar.gz
Thu Feb 4 10:23:43 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* tools/IDL3_to_IDL2/basic_visitor.cpp * tools/IDL3_to_IDL2/basic_visitor.h * tools/IDL3_to_IDL2/checking_visitor.cpp * tools/IDL3_to_IDL2/checking_visitor.h * tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp * tools/IDL3_to_IDL2/idl3_to_idl2_visitor.h * tools/IDL3_to_XMI/IDL3_to_XMI_visitor.cpp * tools/IDL3_to_XMI/IDL3_to_XMI_visitor.h * tools/IDL3_to_XMI/IR_Simulator_visitor.cpp * tools/IDL3_to_XMI/IR_Simulator_visitor.h Merged changes from idl3_plus_backend2 branch to svn head
Diffstat (limited to 'CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp')
-rw-r--r--CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp126
1 files changed, 45 insertions, 81 deletions
diff --git a/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp b/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp
index 843cee92f42..00b8205dd4b 100644
--- a/CIAO/tools/IDL3_to_IDL2/idl3_to_idl2_visitor.cpp
+++ b/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)
{
}
@@ -436,6 +439,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";
@@ -480,9 +485,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;
@@ -556,6 +558,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,
@@ -686,80 +727,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;
- }
-}
-