summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-12-29 21:10:42 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-12-29 21:10:42 +0000
commit14e33369646f450af13418003d29d0721144321d (patch)
treeab3071b702e71455b797d71b7cea16c3a1edd514 /TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp
parent2956e635769e45475a3c67325bbfdb5fdf273b6f (diff)
downloadATCD-14e33369646f450af13418003d29d0721144321d.tar.gz
This commit was manufactured by cvs2svn to create tag 'ACE-4_6_10'.ACE-4_6_10
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp314
1 files changed, 0 insertions, 314 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp
deleted file mode 100644
index dadb0375cb8..00000000000
--- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp
+++ /dev/null
@@ -1,314 +0,0 @@
-//
-// $Id$
-//
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO IDL
-//
-// = FILENAME
-// arglist.cpp
-//
-// = DESCRIPTION
-// Visitor that generates the parameters in an Operation signature
-//
-// = AUTHOR
-// Aniruddha Gokhale
-//
-// ============================================================================
-
-#include "idl.h"
-#include "be.h"
-#include "be_visitor_argument.h"
-
-ACE_RCSID(be_visitor_argument, arglist, "$Id$")
-
-
-// ************************************************************
-// be_visitor_args_arglist for parameter list in method declarations and
-// definitions
-// ************************************************************
-
-be_visitor_args_arglist::be_visitor_args_arglist (be_visitor_context *ctx)
- : be_visitor_args (ctx)
-{
-}
-
-be_visitor_args_arglist::~be_visitor_args_arglist (void)
-{
-}
-
-int be_visitor_args_arglist::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_arglist::"
- "visit_argument - "
- "Bad argument type\n"),
- -1);
- }
-
- os->indent (); // start with current indentation level
-
- // 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_arglist::"
- "visit_argument - "
- "cannot accept visitor\n"),
- -1);
- }
-
- *os << " " << node->local_name () << ",\n";
- return 0;
-}
-
-int be_visitor_args_arglist::visit_array (be_array *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node);
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node);
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_enum (be_enum *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node);
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_interface (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node, "_ptr");
- break;
- case AST_Argument::dir_INOUT: // inout
- *os << this->type_name (node, "_ptr") << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_interface_fwd (be_interface_fwd *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node, "_ptr");
- break;
- case AST_Argument::dir_INOUT: // inout
- *os << this->type_name (node, "_ptr") << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_native (be_native *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node);
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node) << " &";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_predefined_type (be_predefined_type *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get output stream
-
- // check if the type is an any
- if (node->pt () == AST_PredefinedType::PT_any)
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_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:
- *os << this->type_name (node, "_ptr");
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node, "_ptr") << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- } // end switch direction
- } // end else if
- else // simple predefined types
- {
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << this->type_name (node);
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- } // end switch direction
- } // end of else
-
- return 0;
-}
-
-int be_visitor_args_arglist::visit_sequence (be_sequence *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_string (be_string *)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const char *";
- break;
- case AST_Argument::dir_INOUT:
- *os << "char *&";
- break;
- case AST_Argument::dir_OUT:
- *os << "CORBA::String_out";
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_structure (be_structure *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::visit_union (be_union *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // get the stream
-
- switch (this->direction ())
- {
- case AST_Argument::dir_IN:
- *os << "const " << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_INOUT:
- *os << this->type_name (node) << " &";
- break;
- case AST_Argument::dir_OUT:
- *os << this->type_name (node, "_out");
- break;
- }
- return 0;
-}
-
-int be_visitor_args_arglist::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_arglist::"
- "visit_typedef - "
- "accept on primitive type failed\n"),
- -1);
- }
- this->ctx_->alias (0);
- return 0;
-}