summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-15 04:23:40 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-15 04:23:40 +0000
commitb608d1066a61c3793c879266c93ab0a97b063f4c (patch)
tree330242725b8b5a464aa612d38ebc38821d20a08d /TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp
parent43d57c766dfd3d460d9d20264482dfe3a5b1279b (diff)
downloadATCD-ACE-4_5_55.tar.gz
This commit was manufactured by cvs2svn to create tag 'ACE-4_5_55'.ACE-4_5_55
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp379
1 files changed, 0 insertions, 379 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp
deleted file mode 100644
index a7598d8b9d1..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp
+++ /dev/null
@@ -1,379 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// upcall_ss.cpp
-//
-// = DESCRIPTION
-// Visitor that generates code that passes argument variables to the
-// upcall.
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, upcall_ss, "$Id$")
-
-
-// ************************************************************************
-// visitor for passing arguments to the upcall
-// ************************************************************************
-
-be_visitor_args_upcall_ss::be_visitor_args_upcall_ss (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_upcall_ss::~be_visitor_args_upcall_ss (void)
-{
-}
-
-int be_visitor_args_upcall_ss::visit_argument (be_argument *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- this->ctx_->node (node); // save the argument node
-
- // retrieve the type
- be_type *bt = be_type::narrow_from_decl (node->field_type ());
- if (!bt)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_upcall_ss::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- // Different types have different mappings when used as in/out or
- // inout parameters. Let this visitor deal with the type
-
- if (bt->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_upcall_ss::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == be_decl::VARIABLE)
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- else
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".in ()";
- break;
- case AST_Argument::dir_INOUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".inout ()";
- break;
- case AST_Argument::dir_OUT:
- // *os << arg->local_name ();
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".in ()";
- break;
- case AST_Argument::dir_INOUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".inout ()";
- break;
- case AST_Argument::dir_OUT:
- // *os << arg->local_name ();
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- } // end switch direction
- } // end of if
- else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".in ()";
- break;
- case AST_Argument::dir_INOUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".inout ()";
- break;
- case AST_Argument::dir_OUT:
- // *os << arg->local_name ();
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- case AST_Argument::dir_OUT:
- *os << arg->local_name ();
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".in ()";
- break;
- case AST_Argument::dir_INOUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".inout ()";
- break;
- case AST_Argument::dir_OUT:
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == be_decl::VARIABLE)
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- else
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
- be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument
- // node
-
- os->indent ();
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- case AST_Argument::dir_INOUT:
- *os << arg->local_name ();
- break;
- case AST_Argument::dir_OUT:
- if (node->size_type () == be_decl::VARIABLE)
- if (this->ctx_->state ()
- == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS)
- *os << arg->local_name ();
- else
- *os << arg->local_name () << ".out ()";
- else
- *os << arg->local_name ();
- break;
- }
- return 0;
-}
-
-int be_visitor_args_upcall_ss::visit_typedef (be_typedef *node)
-{
- this->ctx_->alias (node);
- if (node->primitive_base_type ()->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_args_upcall_ss::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}