diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-03-15 22:08:29 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-03-15 22:08:29 +0000 |
commit | 1ac601a8568f9d721f4cbbb8c2a8720497767bfd (patch) | |
tree | f9133c8f1eb84f5c451c82b5d087dd61a07a841e | |
parent | 4ef236283784f8373d4a1d97d3b7d95a4b76f453 (diff) | |
download | ATCD-1ac601a8568f9d721f4cbbb8c2a8720497767bfd.tar.gz |
ChangeLogTag: Fri Mar 15 16:02:47 2002 Jeff Parsons <parsons@cs.wustl.edu>
511 files changed, 5767 insertions, 6858 deletions
diff --git a/TAO/TAO_IDL/Makefile.EXE b/TAO/TAO_IDL/Makefile.EXE index e865411339d..33a984ca4d1 100644 --- a/TAO/TAO_IDL/Makefile.EXE +++ b/TAO/TAO_IDL/Makefile.EXE @@ -21,8 +21,6 @@ VPATH = .:driver MAKEFILE=Makefile.EXE FILES = tao_idl \ - driver/drv_init \ - driver/drv_private \ driver/drv_args \ driver/drv_preproc diff --git a/TAO/TAO_IDL/TAO_IDL_BE_DLL.dsp b/TAO/TAO_IDL/TAO_IDL_BE_DLL.dsp index 4fc9f86597c..13d3dd60c0d 100644 --- a/TAO/TAO_IDL/TAO_IDL_BE_DLL.dsp +++ b/TAO/TAO_IDL/TAO_IDL_BE_DLL.dsp @@ -370,10 +370,6 @@ SOURCE=.\be\be_visitor_valuetype_fwd.cpp # PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
-SOURCE=.\be_include\be.h
-# End Source File
-# Begin Source File
-
SOURCE=.\be_include\be_argument.h
# End Source File
# Begin Source File
@@ -414,6 +410,10 @@ SOURCE=.\be_include\be_expression.h # End Source File
# Begin Source File
+SOURCE=.\be_include\be_extern.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_factory.h
# End Source File
# Begin Source File
@@ -526,6 +526,10 @@ SOURCE=.\be_include\be_visitor.h # End Source File
# Begin Source File
+SOURCE=.\be_include\be_visitor_amh_pre_proc.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_visitor_ami_pre_proc.h
# End Source File
# Begin Source File
diff --git a/TAO/TAO_IDL/TAO_IDL_FE_DLL.dsp b/TAO/TAO_IDL/TAO_IDL_FE_DLL.dsp index 07cbddf13d4..5244d62ff79 100644 --- a/TAO/TAO_IDL/TAO_IDL_FE_DLL.dsp +++ b/TAO/TAO_IDL/TAO_IDL_FE_DLL.dsp @@ -342,10 +342,6 @@ SOURCE=.\fe\y.tab.cpp # PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
-SOURCE=.\include\ast.h
-# End Source File
-# Begin Source File
-
SOURCE=.\include\ast_argument.h
# End Source File
# Begin Source File
@@ -490,10 +486,6 @@ SOURCE=.\include\global_extern.h # End Source File
# Begin Source File
-SOURCE=.\include\idl.h
-# End Source File
-# Begin Source File
-
SOURCE=.\include\idl_bool.h
# End Source File
# Begin Source File
@@ -502,14 +494,6 @@ SOURCE=.\include\idl_defines.h # End Source File
# Begin Source File
-SOURCE=.\include\idl_extern.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\include\idl_fwd.h
-# End Source File
-# Begin Source File
-
SOURCE=.\include\idl_global.h
# End Source File
# Begin Source File
@@ -526,10 +510,6 @@ SOURCE=.\TAO_IDL_FE_Export.h # End Source File
# Begin Source File
-SOURCE=.\include\util.h
-# End Source File
-# Begin Source File
-
SOURCE=.\include\utl_decllist.h
# End Source File
# Begin Source File
diff --git a/TAO/TAO_IDL/ast/ast_argument.cpp b/TAO/TAO_IDL/ast/ast_argument.cpp index 877590c6827..7c4349d3824 100644 --- a/TAO/TAO_IDL/ast/ast_argument.cpp +++ b/TAO/TAO_IDL/ast/ast_argument.cpp @@ -70,10 +70,12 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // Additionally they have a direction field which takes values // from the enum AST_Argument::Direction. -#include "idl.h" -#include "idl_extern.h" +#include "ast_argument.h" +#include "ast_visitor.h" -ACE_RCSID(ast, ast_argument, "$Id$") +ACE_RCSID (ast, + ast_argument, + "$Id$") // Static functions. @@ -94,8 +96,6 @@ direction_to_string (AST_Argument::Direction d) return 0; } -// Constructor(s) and destructor. - AST_Argument::AST_Argument (void) : pd_direction (dir_IN) { @@ -117,8 +117,6 @@ AST_Argument::~AST_Argument (void) { } -// Redefinition of inherited virtual operations. - // Dump this AST_Argument node to the ostream o. void AST_Argument::dump (ostream &o) @@ -133,8 +131,6 @@ AST_Argument::ast_accept (ast_visitor *visitor) return visitor->visit_argument (this); } -// Data accessors. - AST_Argument::Direction AST_Argument::direction (void) { diff --git a/TAO/TAO_IDL/ast/ast_array.cpp b/TAO/TAO_IDL/ast/ast_array.cpp index 5fee73926d6..e5451585fc0 100644 --- a/TAO/TAO_IDL/ast/ast_array.cpp +++ b/TAO/TAO_IDL/ast/ast_array.cpp @@ -70,10 +70,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // subtype of AST_ConcreteType. This means that we cannot have // arrays of AST_Interfaces??? -#include "idl.h" -#include "idl_extern.h" +#include "ast_array.h" +#include "ast_expression.h" +#include "ast_visitor.h" +#include "utl_exprlist.h" +#include "utl_identifier.h" -ACE_RCSID(ast, ast_array, "$Id$") +ACE_RCSID (ast, + ast_array, + "$Id$") // Constructor(s) and destructor. @@ -142,13 +147,17 @@ void AST_Array::dump (ACE_OSTREAM_TYPE &o) { pd_base_type->dump (o); + o << " "; + this->local_name ()->dump (o); for (unsigned long i = 0; i < this->pd_n_dims; i++) { o << "["; + pd_dims[i]->dump (o); + o << "]"; } } diff --git a/TAO/TAO_IDL/ast/ast_attribute.cpp b/TAO/TAO_IDL/ast/ast_attribute.cpp index 306fe3a5386..56d7ec3924b 100644 --- a/TAO/TAO_IDL/ast/ast_attribute.cpp +++ b/TAO/TAO_IDL/ast/ast_attribute.cpp @@ -70,8 +70,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // of AST_Type) and a boolean indicating whether the attribute is // readonly. -#include "idl.h" -#include "idl_extern.h" +#include "ast_attribute.h" +#include "ast_visitor.h" ACE_RCSID(ast, ast_attribute, "$Id$") diff --git a/TAO/TAO_IDL/ast/ast_check.cpp b/TAO/TAO_IDL/ast/ast_check.cpp index 70aafe42f82..112f8159ca2 100644 --- a/TAO/TAO_IDL/ast/ast_check.cpp +++ b/TAO/TAO_IDL/ast/ast_check.cpp @@ -67,10 +67,16 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // The check ensures that for every forward declared interface we also // saw a full definition of that interface. -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(ast, ast_check, "$Id$") +#include "ast_extern.h" +#include "ast_interface.h" +#include "ast_interface_fwd.h" +#include "global_extern.h" +#include "utl_err.h" +#include "ace/config-all.h" + +ACE_RCSID (ast, + ast_check, + "$Id$") // Static storage for remembering nodes. static AST_InterfaceFwd **ast_fwds = 0; diff --git a/TAO/TAO_IDL/ast/ast_component.cpp b/TAO/TAO_IDL/ast/ast_component.cpp index 6f76ac0807c..43034dff6cc 100644 --- a/TAO/TAO_IDL/ast/ast_component.cpp +++ b/TAO/TAO_IDL/ast/ast_component.cpp @@ -1,7 +1,10 @@ -#include "idl.h" -#include "idl_extern.h" +// $Id$ -ACE_RCSID(ast, ast_component, "$Id$") +#include "ast_component.h" + +ACE_RCSID (ast, + ast_component, + "$Id$") // Constructor(s) and destructor. diff --git a/TAO/TAO_IDL/ast/ast_concrete_type.cpp b/TAO/TAO_IDL/ast/ast_concrete_type.cpp index cbdeaf9643a..d82d3ae97b1 100644 --- a/TAO/TAO_IDL/ast/ast_concrete_type.cpp +++ b/TAO/TAO_IDL/ast/ast_concrete_type.cpp @@ -67,10 +67,11 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_ConcreteType nodes denote all non-interface types of IDL. // They are AST_Type nodes. -#include "idl.h" -#include "idl_extern.h" +#include "ast_concrete_type.h" -ACE_RCSID(ast, ast_concrete_type, "$Id$") +ACE_RCSID (ast, + ast_concrete_type, + "$Id$") // Constructor(s) and destructor. AST_ConcreteType::AST_ConcreteType (void) diff --git a/TAO/TAO_IDL/ast/ast_constant.cpp b/TAO/TAO_IDL/ast/ast_constant.cpp index a08c833c3a6..d891bc24b99 100644 --- a/TAO/TAO_IDL/ast/ast_constant.cpp +++ b/TAO/TAO_IDL/ast/ast_constant.cpp @@ -71,10 +71,14 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // and the other for use in creating enumerators (see the class // AST_EnumVal). -#include "idl.h" -#include "idl_extern.h" +#include "ast_constant.h" +#include "utl_identifier.h" +#include "ast_visitor.h" +#include "ast_generator.h" -ACE_RCSID(ast, ast_constant, "$Id$") +ACE_RCSID (ast, + ast_constant, + "$Id$") // Static functions. @@ -171,8 +175,11 @@ void AST_Constant::dump (ACE_OSTREAM_TYPE &o) { o << "const " << exprtype_to_string (pd_et) << " "; + this->local_name ()->dump (o); + o << " = "; + this->pd_constant_value->dump (o); } diff --git a/TAO/TAO_IDL/ast/ast_decl.cpp b/TAO/TAO_IDL/ast/ast_decl.cpp index d5fb29f3093..93a8cac6ed9 100644 --- a/TAO/TAO_IDL/ast/ast_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_decl.cpp @@ -62,11 +62,9 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ /* - * ast_decl.cc - Implementation of class AST_Decl - * * AST_Decl is the base class for all AST nodes except AST_Expression. * AST_Decls have a node type (a value from the enum AST_Decl::NodeType) * and a name (a UTL_ScopedName). @@ -76,11 +74,17 @@ trademarks or registered trademarks of Sun Microsystems, Inc. * main file or an #include'd file. */ -#include "idl.h" -#include "idl_extern.h" -#include "ace/SString.h" - -ACE_RCSID(ast, ast_decl, "$Id$") +#include "ast_interface.h" +#include "ast_visitor.h" +#include "global_extern.h" +#include "nr_extern.h" +#include "utl_identifier.h" +#include "utl_scope.h" +#include "utl_err.h" + +ACE_RCSID (ast, + ast_decl, + "$Id$") COMMON_Base::COMMON_Base (idl_bool local, idl_bool abstract) diff --git a/TAO/TAO_IDL/ast/ast_enum.cpp b/TAO/TAO_IDL/ast/ast_enum.cpp index 8499d75889b..41a20e0f217 100644 --- a/TAO/TAO_IDL/ast/ast_enum.cpp +++ b/TAO/TAO_IDL/ast/ast_enum.cpp @@ -64,12 +64,17 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(ast, ast_enum, "$Id$") - -// Constructor(s) and destructor, +#include "ast_enum.h" +#include "ast_enum_val.h" +#include "ast_generator.h" +#include "ast_visitor.h" +#include "utl_identifier.h" +#include "utl_err.h" +#include "utl_indenter.h" + +ACE_RCSID (ast, + ast_enum, + "$Id$") AST_Enum::AST_Enum (void) : pd_enum_counter (0), @@ -94,8 +99,6 @@ AST_Enum::~AST_Enum (void) { } -// Public operations. - // Return the member count. int AST_Enum::member_count (void) @@ -112,7 +115,7 @@ AST_Enum::member_count (void) UTL_ScopedName * AST_Enum::value_to_name (const unsigned long v) { - AST_EnumVal *item = 0; + AST_EnumVal *item = 0; AST_Decl *d = 0; for (UTL_ScopeActiveIterator i (this, IK_decls);!i.is_done ();i.next ()) @@ -197,8 +200,6 @@ munge_name_for_enumval (UTL_ScopedName *n, return hold; } -// Private operations. - // Compute total number of members. int AST_Enum::compute_member_count (void) @@ -308,7 +309,9 @@ AST_Enum::dump (ACE_OSTREAM_TYPE &o) } o << "enum "; + this->local_name ()->dump (o); + o << " {\n"; // Must increment the iterator explicitly inside the loop. @@ -325,6 +328,7 @@ AST_Enum::dump (ACE_OSTREAM_TYPE &o) } idl_global->indent ()->skip_to (o); + o << "}"; } diff --git a/TAO/TAO_IDL/ast/ast_enum_val.cpp b/TAO/TAO_IDL/ast/ast_enum_val.cpp index 77ceeabc8c9..d0f9f95b974 100644 --- a/TAO/TAO_IDL/ast/ast_enum_val.cpp +++ b/TAO/TAO_IDL/ast/ast_enum_val.cpp @@ -68,12 +68,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_EnumVals are a subclass of AST_Constant // AST_EnumVals have no additional fields. -#include "idl.h" -#include "idl_extern.h" +#include "ast_enum_val.h" +#include "ast_visitor.h" -ACE_RCSID(ast, ast_enum_val, "$Id$") +ACE_RCSID (ast, + ast_enum_val, + "$Id$") -// Constructor(s) and destructor. AST_EnumVal::AST_EnumVal (void) { } diff --git a/TAO/TAO_IDL/ast/ast_exception.cpp b/TAO/TAO_IDL/ast/ast_exception.cpp index ac259b4ddce..2380a5d840c 100644 --- a/TAO/TAO_IDL/ast/ast_exception.cpp +++ b/TAO/TAO_IDL/ast/ast_exception.cpp @@ -68,12 +68,20 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_Exceptions are a subclass of AST_Decl (they are not types!) // and of UTL_Scope. -#include "idl.h" -#include "idl_extern.h" +#include "ast_exception.h" +#include "ast_field.h" +#include "ast_union.h" +#include "ast_enum.h" +#include "ast_enum_val.h" +#include "ast_visitor.h" +#include "utl_err.h" +#include "utl_identifier.h" +#include "utl_indenter.h" + +ACE_RCSID (ast, + ast_exception, + "$Id$") -ACE_RCSID(ast, ast_exception, "$Id$") - -// Constructor(s) and destructor. AST_Exception::AST_Exception (void) { } diff --git a/TAO/TAO_IDL/ast/ast_expression.cpp b/TAO/TAO_IDL/ast/ast_expression.cpp index 93898bfe611..219c115b3b7 100644 --- a/TAO/TAO_IDL/ast/ast_expression.cpp +++ b/TAO/TAO_IDL/ast/ast_expression.cpp @@ -66,10 +66,17 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_Expression nodes denote IDL expressions used in the IDL input. -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(ast, ast_expression, "$Id$") +#include "ast_expression.h" +#include "ast_constant.h" +#include "ast_visitor.h" +#include "global_extern.h" +#include "utl_err.h" +#include "utl_scope.h" +#include "utl_string.h" + +ACE_RCSID (ast, + ast_expression, + "$Id$") // Helper function to fill out the details of where this expression // is defined. @@ -2372,7 +2379,7 @@ dump_expr_val (ACE_OSTREAM_TYPE &o, o << (ev->u.bval == I_TRUE ? "TRUE" : "FALSE"); break; case AST_Expression::EV_string: - if (ev->u.strval != NULL) + if (ev->u.strval != 0) ev->u.strval->dump(o); case AST_Expression::EV_longlong: #if ! defined (ACE_LACKS_LONGLONG_T) diff --git a/TAO/TAO_IDL/ast/ast_factory.cpp b/TAO/TAO_IDL/ast/ast_factory.cpp index 1ebde1a4849..c689d40e33d 100644 --- a/TAO/TAO_IDL/ast/ast_factory.cpp +++ b/TAO/TAO_IDL/ast/ast_factory.cpp @@ -68,12 +68,16 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_Factory is a subclass of AST_Decl (it is not a type!) // and of UTL_Scope (the arguments are managed in a scope). -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(ast, ast_factory, "$Id$") - -// Constructor(s) and destructor. +#include "ast_factory.h" +#include "ast_argument.h" +#include "ast_visitor.h" +#include "global_extern.h" +#include "utl_err.h" +#include "utl_identifier.h" + +ACE_RCSID (ast, + ast_factory, + "$Id$") AST_Factory::AST_Factory (void) : argument_count_ (-1), diff --git a/TAO/TAO_IDL/ast/ast_field.cpp b/TAO/TAO_IDL/ast/ast_field.cpp index 7d2c40dd351..cd63688e7c8 100644 --- a/TAO/TAO_IDL/ast/ast_field.cpp +++ b/TAO/TAO_IDL/ast/ast_field.cpp @@ -74,14 +74,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_Field nodes, the other to be used in constructing AST_Argument // nodes and AST_UnionBranch nodes. -#include "idl.h" -#include "idl_extern.h" +#include "ast_field.h" +#include "ast_type.h" +#include "ast_visitor.h" +#include "utl_identifier.h" -ACE_RCSID(ast, ast_field, "$Id$") +ACE_RCSID (ast, ast_field, "$Id$") -// Constructor(s) and destructor. - -// Default constructor. AST_Field::AST_Field (void) : pd_field_type (0), pd_visibility (vis_NA) @@ -115,8 +114,6 @@ AST_Field::~AST_Field (void) { } -// Redefinition of inherited virtual operations. - // Dump this AST_Field node to the ostream o. void AST_Field::dump (ACE_OSTREAM_TYPE &o) @@ -125,16 +122,20 @@ AST_Field::dump (ACE_OSTREAM_TYPE &o) { case vis_PRIVATE: o << "private "; + break; case vis_PUBLIC: o << "public "; + break; case vis_NA: break; } this->pd_field_type->local_name ()->dump (o); + o << " "; + this->local_name ()->dump (o); } @@ -144,8 +145,6 @@ AST_Field::ast_accept (ast_visitor *visitor) return visitor->visit_field (this); } -// Data accessors. - AST_Type * AST_Field::field_type (void) { diff --git a/TAO/TAO_IDL/ast/ast_generator.cpp b/TAO/TAO_IDL/ast/ast_generator.cpp index 666b6845a89..f80e7f4f075 100644 --- a/TAO/TAO_IDL/ast/ast_generator.cpp +++ b/TAO/TAO_IDL/ast/ast_generator.cpp @@ -70,16 +70,28 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // of the AST nodes. It contains an operation for every constructor // of every AST class. -#include "idl.h" -#include "idl_extern.h" +#include "ast_generator.h" +#include "ast_root.h" +#include "ast_interface.h" +#include "ast_interface_fwd.h" +#include "ast_exception.h" +#include "ast_enum.h" +#include "ast_attribute.h" +#include "ast_union.h" +#include "ast_union_branch.h" +#include "ast_enum_val.h" +#include "ast_array.h" +#include "ast_sequence.h" +#include "ast_string.h" +#include "ast_native.h" +#include "ast_factory.h" +#include "utl_identifier.h" +#include "nr_extern.h" + +ACE_RCSID (ast, + ast_generator, + "$Id$") -#include "ace/config-all.h" - -ACE_RCSID(ast, ast_generator, "$Id$") - -// Public operations. - -// Construct an AST_PredefinedType node (a predefined type). AST_PredefinedType * AST_Generator::create_predefined_type (AST_PredefinedType::PredefinedType t, UTL_ScopedName *n) @@ -93,7 +105,6 @@ AST_Generator::create_predefined_type (AST_PredefinedType::PredefinedType t, return retval; } -// Construct an AST_Module node (a module). AST_Module * AST_Generator::create_module (UTL_Scope *s, UTL_ScopedName *n) @@ -171,7 +182,6 @@ AST_Generator::create_module (UTL_Scope *s, return retval; } -// Construct an AST_Root node (a node representing the root of an AST). AST_Root * AST_Generator::create_root (UTL_ScopedName *n) { @@ -183,7 +193,6 @@ AST_Generator::create_root (UTL_ScopedName *n) return retval; } -// Construct an AST_Interface node (an interface). AST_Interface * AST_Generator::create_interface (UTL_ScopedName *n, AST_Interface **ih, @@ -207,8 +216,6 @@ AST_Generator::create_interface (UTL_ScopedName *n, return retval; } -// Construct an AST_InterfaceFwd node (a node representing the forward -// declaration of an interface). AST_InterfaceFwd * AST_Generator::create_interface_fwd (UTL_ScopedName *n, idl_bool local, @@ -229,7 +236,6 @@ AST_Generator::create_interface_fwd (UTL_ScopedName *n, return retval; } -// Create an AST_Interface node which is a valuetype. AST_Interface * AST_Generator::create_valuetype (UTL_ScopedName *n, AST_Interface **ih, @@ -264,8 +270,6 @@ AST_Generator::create_valuetype (UTL_ScopedName *n, return retval; } -// Create an AST_InterfaceFwd node whose full_definition -// member is a valuetype. AST_InterfaceFwd * AST_Generator::create_valuetype_fwd (UTL_ScopedName *n) { @@ -286,7 +290,6 @@ AST_Generator::create_valuetype_fwd (UTL_ScopedName *n) } -// Construct an AST_Exception node (an exception). AST_Exception * AST_Generator::create_exception (UTL_ScopedName *n, idl_bool local, @@ -302,7 +305,6 @@ AST_Generator::create_exception (UTL_ScopedName *n, return retval; } -// Construct an AST_Structure node (a struct). AST_Structure * AST_Generator::create_structure (UTL_ScopedName *n, idl_bool local, @@ -318,7 +320,6 @@ AST_Generator::create_structure (UTL_ScopedName *n, return retval; } -// Construct an AST_Enum node (an enum). AST_Enum * AST_Generator::create_enum (UTL_ScopedName *n, idl_bool local, @@ -334,7 +335,6 @@ AST_Generator::create_enum (UTL_ScopedName *n, return retval; } -// Construct an AST_Operation node (an operation on an interface). AST_Operation * AST_Generator::create_operation (AST_Type *rt, AST_Operation::Flags fl, @@ -354,7 +354,6 @@ AST_Generator::create_operation (AST_Type *rt, return retval; } -// Construct an AST_Field node (a field in a struct, union or exception). AST_Field * AST_Generator::create_field (AST_Type *ft, UTL_ScopedName *n, @@ -370,7 +369,6 @@ AST_Generator::create_field (AST_Type *ft, return retval; } -// Construct an AST_Argument node (an argument to an operation). AST_Argument * AST_Generator::create_argument (AST_Argument::Direction d, AST_Type *ft, @@ -386,7 +384,6 @@ AST_Generator::create_argument (AST_Argument::Direction d, return retval; } -// Construct an AST_Attribute node (an attribute). AST_Attribute * AST_Generator::create_attribute (idl_bool ro, AST_Type *ft, @@ -406,7 +403,6 @@ AST_Generator::create_attribute (idl_bool ro, return retval; } -// Construct an AST_Union node (a union). AST_Union * AST_Generator::create_union (AST_ConcreteType *dt, UTL_ScopedName *n, @@ -424,7 +420,6 @@ AST_Generator::create_union (AST_ConcreteType *dt, return retval; } -// Construct an AST_UnionBranch node (a branch in a union). AST_UnionBranch * AST_Generator::create_union_branch (UTL_LabelList *ll, AST_Type *ft, @@ -440,7 +435,6 @@ AST_Generator::create_union_branch (UTL_LabelList *ll, return retval; } -// Construct an AST_UnionLabel node (a label in a union). AST_UnionLabel * AST_Generator::create_union_label (AST_UnionLabel::UnionLabel ul, AST_Expression *v) @@ -454,7 +448,6 @@ AST_Generator::create_union_label (AST_UnionLabel::UnionLabel ul, return retval; } -// Construct an AST_Constant node (a constant). AST_Constant * AST_Generator::create_constant (AST_Expression::ExprType et, AST_Expression *ev, @@ -470,7 +463,6 @@ AST_Generator::create_constant (AST_Expression::ExprType et, return retval; } -// Construct an AST_Expression node denoting a symbolic name. AST_Expression * AST_Generator::create_expr (UTL_ScopedName *n) { @@ -482,7 +474,6 @@ AST_Generator::create_expr (UTL_ScopedName *n) return retval; } -// Construct an AST_Expression denoting a coercion. AST_Expression * AST_Generator::create_expr (AST_Expression *v, AST_Expression::ExprType t) @@ -496,8 +487,6 @@ AST_Generator::create_expr (AST_Expression *v, return retval; } -// Construct an AST_Expression node denoting a binary combinator. -// of two other AST_Expression nodes AST_Expression * AST_Generator::create_expr (AST_Expression::ExprComb c, AST_Expression *v1, @@ -513,7 +502,6 @@ AST_Generator::create_expr (AST_Expression::ExprComb c, return retval; } -// Construct an AST_Expression node denoting a long integer. AST_Expression * AST_Generator::create_expr (long v) { @@ -525,8 +513,6 @@ AST_Generator::create_expr (long v) return retval; } -// Construct an AST_Expression node denoting a long integer being used. -// as a boolean AST_Expression * AST_Generator::create_expr (long v, AST_Expression::ExprType t) @@ -540,7 +526,6 @@ AST_Generator::create_expr (long v, return retval; } -// Construct an AST_Expression node denoting an unsigned long integer. AST_Expression * AST_Generator::create_expr (unsigned long v) { @@ -552,8 +537,6 @@ AST_Generator::create_expr (unsigned long v) return retval; } -// Construct an AST_Expression node denoting a string (a char * -// encapsulated as String). AST_Expression * AST_Generator::create_expr (UTL_String *s) { @@ -565,7 +548,6 @@ AST_Generator::create_expr (UTL_String *s) return retval; } -// Construct an AST_Expression node denoting a character. AST_Expression * AST_Generator::create_expr (char c) { @@ -577,7 +559,6 @@ AST_Generator::create_expr (char c) return retval; } -// Construct an AST_Expression node denoting a wide character. AST_Expression * AST_Generator::create_expr (ACE_OutputCDR::from_wchar wc) { @@ -589,7 +570,6 @@ AST_Generator::create_expr (ACE_OutputCDR::from_wchar wc) return retval; } -// Construct an AST_Expression node denoting a wide string. AST_Expression * AST_Generator::create_expr (char *s) { @@ -601,7 +581,6 @@ AST_Generator::create_expr (char *s) return retval; } -// Construct an AST_Expression node denoting a 64-bit floating point number. AST_Expression * AST_Generator::create_expr (double d) { @@ -613,7 +592,6 @@ AST_Generator::create_expr (double d) return retval; } -// Construct an AST_EnumVal node (an enumerator). AST_EnumVal * AST_Generator::create_enum_val (unsigned long v, UTL_ScopedName *n) @@ -627,7 +605,6 @@ AST_Generator::create_enum_val (unsigned long v, return retval; } -// Construct an AST_Array node (an array type or field modifier). AST_Array * AST_Generator::create_array (UTL_ScopedName *n, unsigned long ndims, @@ -647,10 +624,10 @@ AST_Generator::create_array (UTL_ScopedName *n, return retval; } -// Construct an AST_Sequence node (a sequence type definition). AST_Sequence * AST_Generator::create_sequence (AST_Expression *ms, AST_Type *bt, + UTL_ScopedName *n, idl_bool local, idl_bool abstract) { @@ -658,6 +635,7 @@ AST_Generator::create_sequence (AST_Expression *ms, ACE_NEW_RETURN (retval, AST_Sequence (ms, bt, + n, local, abstract), 0); @@ -665,7 +643,6 @@ AST_Generator::create_sequence (AST_Expression *ms, return retval; } -// Construct an AST_String node (a string type definition). AST_String * AST_Generator::create_string (AST_Expression *ms) { @@ -683,7 +660,6 @@ AST_Generator::create_string (AST_Expression *ms) return retval; } -// Construct an AST_String node denoting a wide string type definition. AST_String * AST_Generator::create_wstring (AST_Expression *ms) { @@ -707,7 +683,6 @@ AST_Generator::create_wstring (AST_Expression *ms) return retval; } -// Construct an AST_Typedef node (a typedef). AST_Typedef * AST_Generator::create_typedef (AST_Type *bt, UTL_ScopedName *n, @@ -725,7 +700,6 @@ AST_Generator::create_typedef (AST_Type *bt, return retval; } -// Construct an AST_Native node. AST_Native * AST_Generator::create_native (UTL_ScopedName *n) { diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index 106db58a669..e39b58ecbc1 100644 --- a/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/TAO/TAO_IDL/ast/ast_interface.cpp @@ -71,12 +71,28 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // represents the total number of unique (recursively) inherited // interfaces. -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(ast, ast_interface, "$Id$") - -// Constructor(s) and destructor. +#include "ast_interface.h" +#include "ast_interface_fwd.h" +#include "ast_constant.h" +#include "ast_exception.h" +#include "ast_attribute.h" +#include "ast_operation.h" +#include "ast_field.h" +#include "ast_enum.h" +#include "ast_enum_val.h" +#include "ast_union.h" +#include "ast_native.h" +#include "ast_factory.h" +#include "ast_visitor.h" +#include "utl_err.h" +#include "utl_identifier.h" +#include "utl_indenter.h" +#include "global_extern.h" +#include "nr_extern.h" + +ACE_RCSID (ast, + ast_interface, + "$Id$") AST_Interface::AST_Interface (void) : is_valuetype_ (0), diff --git a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp index fe5e2f7bfe9..57815339897 100644 --- a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp @@ -69,12 +69,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // of the interface, which is initialized when that declaration is // encountered. -#include "idl.h" -#include "idl_extern.h" +#include "ast_interface_fwd.h" +#include "ast_interface.h" +#include "ast_visitor.h" +#include "utl_identifier.h" -ACE_RCSID(ast, ast_interface_fwd, "$Id$") +ACE_RCSID( ast, + ast_interface_fwd, + "$Id$") -// Constructor(s) and destructor. AST_InterfaceFwd::AST_InterfaceFwd (void) : pd_full_definition (0) { diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp index 5ac6a424487..016d927e484 100644 --- a/TAO/TAO_IDL/ast/ast_module.cpp +++ b/TAO/TAO_IDL/ast/ast_module.cpp @@ -64,18 +64,31 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -// Implementation of class AST_Module - // AST_Modules denote IDL module declarations // AST_Modules are subclasses of AST_Decl (they are not a type!) and // of UTL_Scope. -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(ast, ast_module, "$Id$") - -// Constructor(s) and destructor. +#include "ast_module.h" +#include "ast_predefined_type.h" +#include "ast_interface.h" +#include "ast_interface_fwd.h" +#include "ast_constant.h" +#include "ast_exception.h" +#include "ast_union.h" +#include "ast_enum.h" +#include "ast_enum_val.h" +#include "ast_native.h" +#include "ast_generator.h" +#include "ast_visitor.h" +#include "utl_err.h" +#include "utl_identifier.h" +#include "utl_indenter.h" +#include "global_extern.h" +#include "nr_extern.h" + +ACE_RCSID (ast, + ast_module, + "$Id$") AST_Module::AST_Module (void) { diff --git a/TAO/TAO_IDL/ast/ast_native.cpp b/TAO/TAO_IDL/ast/ast_native.cpp index f454f9eb4c1..cee1a59b5e1 100644 --- a/TAO/TAO_IDL/ast/ast_native.cpp +++ b/TAO/TAO_IDL/ast/ast_native.cpp @@ -1,14 +1,11 @@ // $Id$ +#include "ast_native.h" +#include "ast_visitor.h" -// AST_Native: New IDL type added by the POA spec - -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(ast, ast_native, "$Id$") - -// Constructor(s). +ACE_RCSID (ast, + ast_native, + "$Id$") AST_Native::AST_Native (void) { @@ -20,7 +17,6 @@ AST_Native::AST_Native (UTL_ScopedName *n) { } -// Destructor. AST_Native::~AST_Native (void) { } diff --git a/TAO/TAO_IDL/ast/ast_operation.cpp b/TAO/TAO_IDL/ast/ast_operation.cpp index cea7e982d24..995046a350f 100644 --- a/TAO/TAO_IDL/ast/ast_operation.cpp +++ b/TAO/TAO_IDL/ast/ast_operation.cpp @@ -74,12 +74,22 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // (implemented as a list of Strings, a UTL_StrList), and a raises // clause (implemented as an array of AST_Exceptions). -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(ast, ast_operation, "$Id$") - -// Constructor(s) and destructor. +#include "ast_operation.h" +#include "ast_predefined_type.h" +#include "ast_argument.h" +#include "ast_exception.h" +#include "ast_visitor.h" +#include "utl_err.h" +#include "utl_namelist.h" +#include "utl_exceptlist.h" +#include "utl_identifier.h" +#include "utl_string.h" +#include "utl_strlist.h" +#include "global_extern.h" + +ACE_RCSID (ast, + ast_operation, + "$Id$") AST_Operation::AST_Operation (void) : pd_return_type (0), diff --git a/TAO/TAO_IDL/ast/ast_predefined_type.cpp b/TAO/TAO_IDL/ast/ast_predefined_type.cpp index 0e8c268662a..9b9b7792438 100644 --- a/TAO/TAO_IDL/ast/ast_predefined_type.cpp +++ b/TAO/TAO_IDL/ast/ast_predefined_type.cpp @@ -71,12 +71,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // type that this node represents. There is only one node in the entire // AST which represents each predefined type, such as long etc. -#include "idl.h" -#include "idl_extern.h" +#include "ast_predefined_type.h" +#include "ast_visitor.h" +#include "utl_identifier.h" +#include "ace/Log_Msg.h" -ACE_RCSID(ast, ast_predefined_type, "$Id$") +ACE_RCSID (ast, + ast_predefined_type, + "$Id$") -// Constructor(s). AST_PredefinedType::AST_PredefinedType (void) : pd_pt (PT_long) { diff --git a/TAO/TAO_IDL/ast/ast_recursive.cpp b/TAO/TAO_IDL/ast/ast_recursive.cpp index cf8b2aa80ea..eb6247fe23f 100644 --- a/TAO/TAO_IDL/ast/ast_recursive.cpp +++ b/TAO/TAO_IDL/ast/ast_recursive.cpp @@ -79,10 +79,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // since it was not bracketed by a sequence). If we don't find the base // type nor a sequence, return FALSE (legal use, since we're not nested). -#include "idl.h" -#include "idl_extern.h" +#include "ast_union.h" +#include "utl_stack.h" +#include "global_extern.h" -ACE_RCSID(ast, ast_recursive, "$Id$") +ACE_RCSID (ast, + ast_recursive, + "$Id$") idl_bool AST_illegal_recursive_type (AST_Decl *t) diff --git a/TAO/TAO_IDL/ast/ast_redef.cpp b/TAO/TAO_IDL/ast/ast_redef.cpp index 433ff34d957..b8e8f49100a 100644 --- a/TAO/TAO_IDL/ast/ast_redef.cpp +++ b/TAO/TAO_IDL/ast/ast_redef.cpp @@ -64,10 +64,11 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -#include "idl.h" -#include "idl_extern.h" +#include "ast_decl.h" -ACE_RCSID(ast, ast_redef, "$Id$") +ACE_RCSID (ast, + ast_redef, + "$Id$") // Return TRUE if the node d represents an IDL construct whose name // can be redefined. diff --git a/TAO/TAO_IDL/ast/ast_root.cpp b/TAO/TAO_IDL/ast/ast_root.cpp index 66353a34507..eaaf3f0ee3f 100644 --- a/TAO/TAO_IDL/ast/ast_root.cpp +++ b/TAO/TAO_IDL/ast/ast_root.cpp @@ -69,12 +69,17 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // to subclass it to associate their own information with an entire // AST. -#include "idl.h" -#include "idl_extern.h" +#include "ast_root.h" +#include "ast_sequence.h" +#include "ast_string.h" +#include "ast_array.h" +#include "ast_visitor.h" +#include "utl_identifier.h" -ACE_RCSID(ast, ast_root, "$Id$") +ACE_RCSID (ast, + ast_root, + "$Id$") -// Constructor(s) and destructor. AST_Root::AST_Root (void) { } @@ -90,8 +95,6 @@ AST_Root::~AST_Root (void) { } -// Add protocol. - // Add this AST_Sequence to the locally defined types in this scope. AST_Sequence * AST_Root::fe_add_sequence (AST_Sequence *t) diff --git a/TAO/TAO_IDL/ast/ast_sequence.cpp b/TAO/TAO_IDL/ast/ast_sequence.cpp index 456767c6e3a..02fd9508c6a 100644 --- a/TAO/TAO_IDL/ast/ast_sequence.cpp +++ b/TAO/TAO_IDL/ast/ast_sequence.cpp @@ -70,12 +70,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // must evaluate to a positive integer) and a base type (a subclass // of AST_Type). -#include "idl.h" -#include "idl_extern.h" +#include "ast_sequence.h" +#include "ast_expression.h" +#include "ast_visitor.h" +#include "utl_identifier.h" -ACE_RCSID(ast, ast_sequence, "$Id$") +ACE_RCSID (ast, + ast_sequence, + "$Id$") -// Constructor(s) and destructor. AST_Sequence::AST_Sequence (void) : pd_max_size (0), pd_base_type (0) @@ -84,12 +87,12 @@ AST_Sequence::AST_Sequence (void) AST_Sequence::AST_Sequence (AST_Expression *ms, AST_Type *bt, + UTL_ScopedName *n, idl_bool local, idl_bool abstract) - : AST_Decl(AST_Decl::NT_sequence, - new UTL_ScopedName (new Identifier ("sequence"), - 0), - I_TRUE), + : AST_Decl (AST_Decl::NT_sequence, + n, + I_TRUE), COMMON_Base (bt->is_local () || local, abstract), pd_max_size (ms), diff --git a/TAO/TAO_IDL/ast/ast_string.cpp b/TAO/TAO_IDL/ast/ast_string.cpp index 15d52b19187..0c16a6a5e02 100644 --- a/TAO/TAO_IDL/ast/ast_string.cpp +++ b/TAO/TAO_IDL/ast/ast_string.cpp @@ -69,14 +69,14 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_String nodes have a maximum size (an AST_Expression which must // evaluate to a positive integer). -#include "idl.h" -#include "idl_extern.h" +#include "ast_string.h" +#include "ast_expression.h" +#include "ast_visitor.h" ACE_RCSID (ast, ast_string, "$Id$") -// Constructor(s) and destructor. AST_String::AST_String (void) : pd_max_size (0), pd_width (sizeof (char)) diff --git a/TAO/TAO_IDL/ast/ast_structure.cpp b/TAO/TAO_IDL/ast/ast_structure.cpp index bea188fa9bd..541031b52b7 100644 --- a/TAO/TAO_IDL/ast/ast_structure.cpp +++ b/TAO/TAO_IDL/ast/ast_structure.cpp @@ -68,12 +68,18 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_Structure is a subclass of AST_ConcreteType and of UTL_Scope (the // structure's fields are managed in a scope). -#include "idl.h" -#include "idl_extern.h" +#include "ast_union.h" +#include "ast_field.h" +#include "ast_enum.h" +#include "ast_enum_val.h" +#include "ast_visitor.h" +#include "utl_err.h" +#include "utl_indenter.h" + +ACE_RCSID (ast, + ast_structure, + "$Id$") -ACE_RCSID(ast, ast_structure, "$Id$") - -// Constructor(s) and destructor. AST_Structure::AST_Structure (void) : member_count_ (-1), local_struct_ (-1) diff --git a/TAO/TAO_IDL/ast/ast_type.cpp b/TAO/TAO_IDL/ast/ast_type.cpp index 2c2deee1fb1..b5c974a4ddf 100644 --- a/TAO/TAO_IDL/ast/ast_type.cpp +++ b/TAO/TAO_IDL/ast/ast_type.cpp @@ -67,12 +67,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_Type is the base class for all AST classes which represent // IDL type constructs. -#include "idl.h" -#include "idl_extern.h" +#include "ast_type.h" +#include "ast_visitor.h" -ACE_RCSID(ast, ast_type, "$Id$") +ACE_RCSID (ast, + ast_type, + "$Id$") -// Constructor(s) and destructor. AST_Type::AST_Type (void) : ifr_added_ (0), ifr_fwd_added_ (0) diff --git a/TAO/TAO_IDL/ast/ast_typedef.cpp b/TAO/TAO_IDL/ast/ast_typedef.cpp index b3e343b3451..8aff97ae8c9 100644 --- a/TAO/TAO_IDL/ast/ast_typedef.cpp +++ b/TAO/TAO_IDL/ast/ast_typedef.cpp @@ -70,12 +70,14 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_Typedef nodes have a base type (a subclass of AST_Type) // and a name (an UTL_ScopedName). -#include "idl.h" -#include "idl_extern.h" +#include "ast_typedef.h" +#include "ast_visitor.h" +#include "utl_identifier.h" -ACE_RCSID(ast, ast_typedef, "$Id$") +ACE_RCSID (ast, + ast_typedef, + "$Id$") -// Constructor(s) and destructor. AST_Typedef::AST_Typedef (void) : pd_base_type (0) { diff --git a/TAO/TAO_IDL/ast/ast_union.cpp b/TAO/TAO_IDL/ast/ast_union.cpp index f503197aaff..4459044aa25 100644 --- a/TAO/TAO_IDL/ast/ast_union.cpp +++ b/TAO/TAO_IDL/ast/ast_union.cpp @@ -73,12 +73,23 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_Expression::ExprType and serves as a cache). This field is used // to compute coercions for labels based on the expected discriminator type. -#include "idl.h" -#include "idl_extern.h" +#include "ast_union.h" +#include "ast_union_branch.h" +#include "ast_union_label.h" +#include "ast_field.h" +#include "ast_predefined_type.h" +#include "ast_enum.h" +#include "ast_enum_val.h" +#include "ast_visitor.h" +#include "utl_err.h" +#include "utl_identifier.h" +#include "utl_indenter.h" +#include "global_extern.h" + +ACE_RCSID (ast, + ast_union, + "$Id$") -ACE_RCSID(ast, ast_union, "$Id$") - -// Constructor(s) and destructor. AST_Union::AST_Union (void) { } diff --git a/TAO/TAO_IDL/ast/ast_union_branch.cpp b/TAO/TAO_IDL/ast/ast_union_branch.cpp index a8f4a10a3eb..0c92a48ebd4 100644 --- a/TAO/TAO_IDL/ast/ast_union_branch.cpp +++ b/TAO/TAO_IDL/ast/ast_union_branch.cpp @@ -69,12 +69,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // AST_UnionBranch is a subclass of AST_Field, adding a label (which // is a subclass of AST_UnionLabel). -#include "idl.h" -#include "idl_extern.h" +#include "ast_union_branch.h" +#include "ast_union_label.h" +#include "ast_visitor.h" +#include "utl_labellist.h" ACE_RCSID(ast, ast_union_branch, "$Id$") -// Constructor(s) and destructor. AST_UnionBranch::AST_UnionBranch (void) : pd_ll (0) { @@ -105,8 +106,10 @@ AST_UnionBranch::dump (ACE_OSTREAM_TYPE &o) for (unsigned long i = 0; i < this->label_list_length (); ++i) { o << "case "; + AST_UnionLabel *ul = this->label (i); ul->dump (o); + o << ": \n"; } diff --git a/TAO/TAO_IDL/ast/ast_union_label.cpp b/TAO/TAO_IDL/ast/ast_union_label.cpp index a92efbf176f..388528b3cc0 100644 --- a/TAO/TAO_IDL/ast/ast_union_label.cpp +++ b/TAO/TAO_IDL/ast/ast_union_label.cpp @@ -69,12 +69,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // enum AST_UnionLabel::LabelKind) and a label value (which is a // subclass of AST_Expression). -#include "idl.h" -#include "idl_extern.h" +#include "ast_union_label.h" +#include "ast_expression.h" +#include "ast_visitor.h" -ACE_RCSID(ast, ast_union_label, "$Id$") - -// Constructor(s) and destructor. +ACE_RCSID (ast, + ast_union_label, + "$Id$") AST_UnionLabel::AST_UnionLabel (void) : pd_label_kind (UL_default), diff --git a/TAO/TAO_IDL/ast/ast_visitor.cpp b/TAO/TAO_IDL/ast/ast_visitor.cpp index 37eacf4542f..35c8f8566f6 100644 --- a/TAO/TAO_IDL/ast/ast_visitor.cpp +++ b/TAO/TAO_IDL/ast/ast_visitor.cpp @@ -1,9 +1,11 @@ // $Id$ #include "ast_visitor.h" -#include "ace/ACE.h" +#include "ace/config-all.h" -ACE_RCSID(ast, ast_visitor, "$Id$") +ACE_RCSID (ast, + ast_visitor, + "$Id$") ast_visitor::ast_visitor (void) { diff --git a/TAO/TAO_IDL/be/be_argument.cpp b/TAO/TAO_IDL/be/be_argument.cpp index 82c9d2e64d1..0a4fc22ffc5 100644 --- a/TAO/TAO_IDL/be/be_argument.cpp +++ b/TAO/TAO_IDL/be/be_argument.cpp @@ -19,11 +19,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_argument.h" +#include "be_visitor.h" -ACE_RCSID(be, be_argument, "$Id$") +ACE_RCSID (be, + be_argument, + "$Id$") be_argument::be_argument (void) { diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp index bc25a29ce0f..bb6a5aa0c39 100644 --- a/TAO/TAO_IDL/be/be_array.cpp +++ b/TAO/TAO_IDL/be/be_array.cpp @@ -19,14 +19,19 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_array.h" +#include "be_codegen.h" +#include "be_scope.h" +#include "be_helper.h" +#include "be_visitor.h" +#include "utl_identifier.h" -ACE_RCSID(be, be_array, "$Id$") +ACE_RCSID (be, + be_array, + "$Id$") be_array::be_array (void) - : tao_name_ (0) + : tao_name_ (0) { } @@ -128,7 +133,9 @@ be_array::create_name (void) UTL_ScopedName *n = 0; be_decl *scope; - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); + ACE_OS::memset (namebuf, + '\0', + NAMEBUFSIZE); // Retrieve the base type. // The name always starts this way. be_type *bt = be_type::narrow_from_decl (this->base_type ()); diff --git a/TAO/TAO_IDL/be/be_attribute.cpp b/TAO/TAO_IDL/be/be_attribute.cpp index fe7f4e604bf..e13b6947ebd 100644 --- a/TAO/TAO_IDL/be/be_attribute.cpp +++ b/TAO/TAO_IDL/be/be_attribute.cpp @@ -19,11 +19,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_attribute.h" +#include "be_visitor.h" -ACE_RCSID(be, be_attribute, "$Id$") +ACE_RCSID (be, + be_attribute, + "$Id$") be_attribute::be_attribute (void) { diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index e87de1ab83b..11afca07a2a 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -16,11 +16,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_codegen, "$Id$") +#include "be_codegen.h" +#include "be_helper.h" +#include "be_visitor_factory.h" +#include "be_stream_factory.h" +#include "be_extern.h" +#include "global_extern.h" +#include "utl_string.h" + +ACE_RCSID (be, + be_codegen, + "$Id$") TAO_IDL_BE_Export TAO_CodeGen *tao_cg = 0; @@ -1208,9 +1214,7 @@ TAO_CodeGen::node (void) void TAO_CodeGen::config_visitor_factory (void) { - // We have removed interpreted marshaling from TAO, so - // TAO_INTERPRETIVE_VISITOR_FACTORY is no more. - this->visitor_factory_ = TAO_COMPILED_VISITOR_FACTORY::instance (); + this->visitor_factory_ = TAO_VISITOR_FACTORY::instance (); } void diff --git a/TAO/TAO_IDL/be/be_constant.cpp b/TAO/TAO_IDL/be/be_constant.cpp index 7242b87f6fd..f934c36dec5 100644 --- a/TAO/TAO_IDL/be/be_constant.cpp +++ b/TAO/TAO_IDL/be/be_constant.cpp @@ -19,9 +19,8 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_constant.h" +#include "be_visitor.h" ACE_RCSID (be, be_constant, diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index 03e9f049216..25c9af4b2bd 100644 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ b/TAO/TAO_IDL/be/be_decl.cpp @@ -19,11 +19,25 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_decl, "$Id$") +#include "be_decl.h" +#include "be_scope.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_module.h" +#include "be_root.h" +#include "be_exception.h" +#include "be_structure.h" +#include "be_union.h" +#include "be_enum.h" +#include "be_operation.h" +#include "be_factory.h" +#include "be_sequence.h" +#include "be_visitor.h" +#include "utl_identifier.h" + +ACE_RCSID (be, + be_decl, + "$Id$") // Default Constructor be_decl::be_decl (void) diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp index 6a57a21f025..791c0a41008 100644 --- a/TAO/TAO_IDL/be/be_enum.cpp +++ b/TAO/TAO_IDL/be/be_enum.cpp @@ -19,11 +19,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_enum.h" +#include "be_visitor.h" -ACE_RCSID(be, be_enum, "$Id$") +ACE_RCSID (be, + be_enum, + "$Id$") be_enum::be_enum (void) { diff --git a/TAO/TAO_IDL/be/be_enum_val.cpp b/TAO/TAO_IDL/be/be_enum_val.cpp index 6739a120681..fb0612bb0cb 100644 --- a/TAO/TAO_IDL/be/be_enum_val.cpp +++ b/TAO/TAO_IDL/be/be_enum_val.cpp @@ -19,9 +19,8 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_enum_val.h" +#include "be_visitor.h" ACE_RCSID (be, be_enum_val, diff --git a/TAO/TAO_IDL/be/be_exception.cpp b/TAO/TAO_IDL/be/be_exception.cpp index 1df3a76eeec..5216b6c8d34 100644 --- a/TAO/TAO_IDL/be/be_exception.cpp +++ b/TAO/TAO_IDL/be/be_exception.cpp @@ -20,11 +20,12 @@ // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_exception.h" +#include "be_visitor.h" -ACE_RCSID(be, be_exception, "$Id$") +ACE_RCSID (be, + be_exception, + "$Id$") be_exception::be_exception (void) { diff --git a/TAO/TAO_IDL/be/be_expression.cpp b/TAO/TAO_IDL/be/be_expression.cpp index 8648991eee1..a8b7838099f 100644 --- a/TAO/TAO_IDL/be/be_expression.cpp +++ b/TAO/TAO_IDL/be/be_expression.cpp @@ -19,9 +19,8 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_expression.h" +#include "be_visitor.h" ACE_RCSID (be, be_expression, diff --git a/TAO/TAO_IDL/be/be_factory.cpp b/TAO/TAO_IDL/be/be_factory.cpp index 0729b1872eb..d09510860f6 100644 --- a/TAO/TAO_IDL/be/be_factory.cpp +++ b/TAO/TAO_IDL/be/be_factory.cpp @@ -19,11 +19,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_factory.h" +#include "be_visitor.h" -ACE_RCSID(be, be_factory, "$Id$") +ACE_RCSID (be, + be_factory, + "$Id$") be_factory::be_factory (void) { diff --git a/TAO/TAO_IDL/be/be_field.cpp b/TAO/TAO_IDL/be/be_field.cpp index 2eeaaba83ff..701b194aec7 100644 --- a/TAO/TAO_IDL/be/be_field.cpp +++ b/TAO/TAO_IDL/be/be_field.cpp @@ -19,11 +19,14 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_field.h" +#include "be_visitor.h" +#include "be_type.h" +#include "ace/Log_Msg.h" -ACE_RCSID(be, be_field, "$Id$") +ACE_RCSID (be, + be_field, + "$Id$") be_field::be_field (void) { diff --git a/TAO/TAO_IDL/be/be_generator.cpp b/TAO/TAO_IDL/be/be_generator.cpp index f9937e74ee7..8094476b3cc 100644 --- a/TAO/TAO_IDL/be/be_generator.cpp +++ b/TAO/TAO_IDL/be/be_generator.cpp @@ -69,12 +69,40 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // This implements the same protocol as AST_Generator but creates instances // of the BE-subclassed classes instead of of AST classes. -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_generator.h" +#include "be_root.h" +#include "be_predefined_type.h" +#include "be_module.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_union.h" +#include "be_structure.h" +#include "be_exception.h" +#include "be_operation.h" +#include "be_enum.h" +#include "be_field.h" +#include "be_argument.h" +#include "be_attribute.h" +#include "be_union_branch.h" +#include "be_union_label.h" +#include "be_constant.h" +#include "be_expression.h" +#include "be_enum_val.h" +#include "be_array.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_typedef.h" +#include "be_native.h" +#include "be_factory.h" +#include "utl_identifier.h" +#include "nr_extern.h" #include "ace/config-all.h" -ACE_RCSID(be, be_generator, "$Id$") +ACE_RCSID (be, + be_generator, + "$Id$") AST_Root * be_generator::create_root (UTL_ScopedName *n) @@ -581,6 +609,7 @@ be_generator::create_array (UTL_ScopedName *n, AST_Sequence * be_generator::create_sequence (AST_Expression *v, AST_Type *bt, + UTL_ScopedName *n, idl_bool local, idl_bool abstract) { @@ -588,6 +617,7 @@ be_generator::create_sequence (AST_Expression *v, ACE_NEW_RETURN (retval, be_sequence (v, bt, + n, local, abstract), 0); diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index 5f1c4225328..0adf9646ba1 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -17,11 +17,14 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_global, "$Id$") +#include "be_global.h" +#include "utl_string.h" +#include "global_extern.h" +#include "ace/ACE.h" + +ACE_RCSID (be, + be_global, + "$Id$") TAO_IDL_BE_Export BE_GlobalData *be_global = 0; diff --git a/TAO/TAO_IDL/be/be_helper.cpp b/TAO/TAO_IDL/be/be_helper.cpp index 63a9d3bd021..b1c09be184c 100644 --- a/TAO/TAO_IDL/be/be_helper.cpp +++ b/TAO/TAO_IDL/be/be_helper.cpp @@ -19,11 +19,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_helper.h" +#include "be_codegen.h" -ACE_RCSID(be, be_helper, "$Id$") +ACE_RCSID (be, + be_helper, + "$Id$") static const char copyright[] = "// -*- C++ -*-\n" diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index ab521d6b5b7..31d132536f0 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -20,13 +20,20 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be_visitor_interface.h" -#include "be.h" +#include "be_interface.h" #include "be_interface_strategy.h" - -ACE_RCSID(be, be_interface, "$Id$") +#include "be_visitor.h" +#include "be_helper.h" +#include "be_stream_factory.h" +#include "be_extern.h" +#include "utl_identifier.h" +#include "ast_attribute.h" +#include "global_extern.h" +#include "ace/Process.h" + +ACE_RCSID (be, + be_interface, + "$Id$") // Default constructor. be_interface::be_interface (void) diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp index 00e1f623e9c..ce83586c051 100644 --- a/TAO/TAO_IDL/be/be_interface_fwd.cpp +++ b/TAO/TAO_IDL/be/be_interface_fwd.cpp @@ -19,11 +19,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_interface_fwd.h" +#include "be_visitor.h" -ACE_RCSID(be, be_interface_fwd, "$Id$") +ACE_RCSID (be, + be_interface_fwd, + "$Id$") be_interface_fwd::be_interface_fwd (void) { diff --git a/TAO/TAO_IDL/be/be_interface_strategy.cpp b/TAO/TAO_IDL/be/be_interface_strategy.cpp index 67f01a66dc8..11c35748ae8 100644 --- a/TAO/TAO_IDL/be/be_interface_strategy.cpp +++ b/TAO/TAO_IDL/be/be_interface_strategy.cpp @@ -17,11 +17,14 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_interface_strategy.h" +#include "be_interface.h" +#include "be_extern.h" +#include "utl_identifier.h" -ACE_RCSID(be, be_interface_strategy, "$Id$") +ACE_RCSID (be, + be_interface_strategy, + "$Id$") be_interface_strategy::be_interface_strategy (be_interface *node, @@ -123,6 +126,7 @@ be_interface_strategy::compute_coll_names (int type, static const char *collocated_names[] = {"_tao_thru_poa_collocated_", "_tao_direct_collocated_"}; static const char *poa = "POA_"; + // Reserve enough room for the "POA_" prefix, the "_tao_collocated_" // prefix and the local name and the (optional) "::" const char *collocated = collocated_names[type]; diff --git a/TAO/TAO_IDL/be/be_module.cpp b/TAO/TAO_IDL/be/be_module.cpp index 043dab1f1a3..017350716db 100644 --- a/TAO/TAO_IDL/be/be_module.cpp +++ b/TAO/TAO_IDL/be/be_module.cpp @@ -19,11 +19,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_module.h" +#include "be_visitor.h" -ACE_RCSID(be, be_module, "$Id$") +ACE_RCSID (be, + be_module, + "$Id$") be_module::be_module (void) { diff --git a/TAO/TAO_IDL/be/be_native.cpp b/TAO/TAO_IDL/be/be_native.cpp index 93e3d1e3d1a..8aa14ed2d39 100644 --- a/TAO/TAO_IDL/be/be_native.cpp +++ b/TAO/TAO_IDL/be/be_native.cpp @@ -16,11 +16,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_native.h" +#include "be_visitor.h" -ACE_RCSID(be, be_native, "$Id$") +ACE_RCSID (be, + be_native, + "$Id$") be_native::be_native (void) diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp index ed791a03c6c..0fadcd038d0 100644 --- a/TAO/TAO_IDL/be/be_operation.cpp +++ b/TAO/TAO_IDL/be/be_operation.cpp @@ -19,11 +19,15 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_operation, "$Id$") +#include "be_operation.h" +#include "be_operation_strategy.h" +#include "be_predefined_type.h" +#include "be_argument.h" +#include "be_visitor.h" + +ACE_RCSID (be, + be_operation, + "$Id$") be_operation::be_operation (void) { diff --git a/TAO/TAO_IDL/be/be_operation_strategy.cpp b/TAO/TAO_IDL/be/be_operation_strategy.cpp index d5bb6273e55..268a092ec3a 100644 --- a/TAO/TAO_IDL/be/be_operation_strategy.cpp +++ b/TAO/TAO_IDL/be/be_operation_strategy.cpp @@ -17,17 +17,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_operation_strategy.h" -ACE_RCSID(be, be_operation_strategy, "$Id$") +ACE_RCSID (be, + be_operation_strategy, + "$Id$") - be_operation_strategy::be_operation_strategy (be_operation *node, - Strategy_Kind strategy_type) - : node_ (node), - strategy_type_ (strategy_type) +be_operation_strategy::be_operation_strategy (be_operation *node, + Strategy_Kind strategy_type) + : node_ (node), + strategy_type_ (strategy_type) { } diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp index 0c9dd051e15..6db4f96ce48 100644 --- a/TAO/TAO_IDL/be/be_predefined_type.cpp +++ b/TAO/TAO_IDL/be/be_predefined_type.cpp @@ -19,11 +19,15 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_predefined_type, "$Id$") +#include "be_predefined_type.h" +#include "be_visitor.h" +#include "utl_identifier.h" +#include "ace/Log_Msg.h" +#include "ace/ACE.h" + +ACE_RCSID (be, + be_predefined_type, + "$Id$") be_predefined_type::be_predefined_type (void) { diff --git a/TAO/TAO_IDL/be/be_produce.cpp b/TAO/TAO_IDL/be/be_produce.cpp index 877afdb32f7..8d993bd5747 100644 --- a/TAO/TAO_IDL/be/be_produce.cpp +++ b/TAO/TAO_IDL/be/be_produce.cpp @@ -62,18 +62,19 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -// BE_produce.cc - Produce the work of the BE - does nothing in the -// dummy BE - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" #include "be_visitor_root.h" -#include "TAO_IDL_BE_Export.h" - -ACE_RCSID(be, be_produce, "$Id$") +#include "be_visitor_ami_pre_proc.h" +#include "be_visitor_amh_pre_proc.h" +#include "be_visitor_context.h" +#include "be_root.h" +#include "be_extern.h" +#include "global_extern.h" + +ACE_RCSID (be, + be_produce, + "$Id$") // Clean up before exit, whether successful or not. TAO_IDL_BE_Export void diff --git a/TAO/TAO_IDL/be/be_root.cpp b/TAO/TAO_IDL/be/be_root.cpp index 581b218bc87..0e8b89b68fb 100644 --- a/TAO/TAO_IDL/be/be_root.cpp +++ b/TAO/TAO_IDL/be/be_root.cpp @@ -19,11 +19,15 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_root, "$Id$") +#include "be_root.h" +#include "be_visitor.h" +#include "ast_sequence.h" +#include "ast_string.h" +#include "ast_array.h" + +ACE_RCSID (be, + be_root, + "$Id$") // Default Constructor. be_root::be_root (void) diff --git a/TAO/TAO_IDL/be/be_scope.cpp b/TAO/TAO_IDL/be/be_scope.cpp index a02e4a334a9..6cf689f7db5 100644 --- a/TAO/TAO_IDL/be/be_scope.cpp +++ b/TAO/TAO_IDL/be/be_scope.cpp @@ -1,12 +1,21 @@ // // $Id$ // -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_scope, "$Id$") +#include "be_scope.h" +#include "be_interface.h" +#include "be_module.h" +#include "be_exception.h" +#include "be_union.h" +#include "be_structure.h" +#include "be_enum.h" +#include "be_operation.h" +#include "be_factory.h" +#include "be_root.h" +#include "be_visitor.h" +ACE_RCSID (be, + be_scope, + "$Id$") // Default Constructor. be_scope::be_scope (void) diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index a26d1ebd8f8..e1fd6b6131d 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -19,12 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_sequence.h" +#include "be_sequence.h" +#include "be_typedef.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_predefined_type.h" +#include "be_visitor.h" +#include "utl_identifier.h" -ACE_RCSID(be, be_sequence, "$Id$") +ACE_RCSID (be, + be_sequence, + "$Id$") be_sequence::be_sequence (void) @@ -37,24 +42,26 @@ be_sequence::be_sequence (void) be_sequence::be_sequence (AST_Expression *v, AST_Type *t, + UTL_ScopedName *n, idl_bool local, idl_bool abstract) : be_scope (AST_Decl::NT_sequence), be_type (AST_Decl::NT_sequence, - 0), + n), be_decl (AST_Decl::NT_sequence, - 0), + n), UTL_Scope (AST_Decl::NT_sequence), AST_Sequence (v, t, + n, t->is_local () || local, abstract), AST_ConcreteType (AST_Decl::NT_sequence, - 0), + n), AST_Type (AST_Decl::NT_sequence, - 0), + n), AST_Decl (AST_Decl::NT_sequence, - 0, + n, I_TRUE), COMMON_Base (t->is_local () || local, abstract), diff --git a/TAO/TAO_IDL/be/be_stream_factory.cpp b/TAO/TAO_IDL/be/be_stream_factory.cpp index 9a4c6e2317d..ef327ecd30e 100644 --- a/TAO/TAO_IDL/be/be_stream_factory.cpp +++ b/TAO/TAO_IDL/be/be_stream_factory.cpp @@ -1,11 +1,11 @@ // $Id$ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_stream_factory.h" #include "be_sunsoft.h" -ACE_RCSID(be, be_factory, "$Id$") +ACE_RCSID (be, + be_streamfactory, + "$Id$") // Constructor. TAO_OutStream_Factory::TAO_OutStream_Factory (void) diff --git a/TAO/TAO_IDL/be/be_string.cpp b/TAO/TAO_IDL/be/be_string.cpp index 866ec8197f8..214296dbcc7 100644 --- a/TAO/TAO_IDL/be/be_string.cpp +++ b/TAO/TAO_IDL/be/be_string.cpp @@ -19,9 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_string.h" +#include "be_visitor.h" +#include "utl_identifier.h" ACE_RCSID (be, be_string, diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp index 02d193c2380..dd450a8a738 100644 --- a/TAO/TAO_IDL/be/be_structure.cpp +++ b/TAO/TAO_IDL/be/be_structure.cpp @@ -19,11 +19,16 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_structure.h" +#include "be_codegen.h" +#include "be_helper.h" +#include "be_visitor.h" +#include "be_extern.h" +#include "utl_identifier.h" -ACE_RCSID(be, be_structure, "$Id$") +ACE_RCSID (be, + be_structure, + "$Id$") be_structure::be_structure (void) { @@ -44,8 +49,6 @@ be_structure::be_structure (UTL_ScopedName *n, int be_structure::gen_var_defn (char *) { - TAO_OutStream *ch = 0; - TAO_NL be_nl; char namebuf [NAMEBUFSIZE]; ACE_OS::memset (namebuf, @@ -56,7 +59,7 @@ be_structure::gen_var_defn (char *) "%s_var", this->local_name ()->get_string ()); - ch = tao_cg->client_header (); + TAO_OutStream *ch = tao_cg->client_header (); // Generate the var definition (always in the client header). // Depending upon the data type, there are some differences which diff --git a/TAO/TAO_IDL/be/be_sunsoft.cpp b/TAO/TAO_IDL/be/be_sunsoft.cpp index 0364348c8ce..33339fb1bd3 100644 --- a/TAO/TAO_IDL/be/be_sunsoft.cpp +++ b/TAO/TAO_IDL/be/be_sunsoft.cpp @@ -1,11 +1,14 @@ // $Id$ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" #include "be_sunsoft.h" +#include "ast_expression.h" +#include "utl_identifier.h" +#include "utl_idlist.h" +#include "utl_string.h" -ACE_RCSID(be, be_sunsoft, "$Id$") +ACE_RCSID (be, + be_sunsoft, + "$Id$") TAO_SunSoft_OutStream::TAO_SunSoft_OutStream (void) : TAO_OutStream () diff --git a/TAO/TAO_IDL/be/be_tmplinst.cpp b/TAO/TAO_IDL/be/be_tmplinst.cpp index b288ffdb3c6..0cf099bca27 100644 --- a/TAO/TAO_IDL/be/be_tmplinst.cpp +++ b/TAO/TAO_IDL/be/be_tmplinst.cpp @@ -1,16 +1,17 @@ // $Id$ -#include "ace/ACE.h" #include "be_visitor_typecode/typecode_defn.h" #include "be_stream_factory.h" #include "be_visitor_factory.h" +#include "ace/Singleton.h" +#include "ace/Synch.h" +#include "ace/Unbounded_Queue.h" #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Singleton<TAO_CodeGen, ACE_SYNCH_RECURSIVE_MUTEX>; template class ACE_Singleton<TAO_OutStream_Factory, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<TAO_Common_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<TAO_Compiled_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>; +template class ACE_Singleton<TAO_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX>; template class ACE_Node <be_interface *>; template class ACE_Unbounded_Queue <be_interface *>; @@ -28,8 +29,7 @@ template class ACE_Unbounded_Queue_Iterator <be_interface_fwd *>; #pragma instantiate ACE_Singleton<TAO_CodeGen, ACE_SYNCH_RECURSIVE_MUTEX> #pragma instantiate ACE_Singleton<TAO_OutStream_Factory, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<TAO_Common_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<TAO_Compiled_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> +#pragma instantiate ACE_Singleton<TAO_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> #pragma instantiate ACE_Node <be_interface *> #pragma instantiate ACE_Unbounded_Queue <be_interface *> diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp index 13aed0c8f9d..2901fdefae6 100644 --- a/TAO/TAO_IDL/be/be_type.cpp +++ b/TAO/TAO_IDL/be/be_type.cpp @@ -19,11 +19,15 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_type.h" +#include "be_scope.h" +#include "be_visitor.h" +#include "be_codegen.h" +#include "utl_identifier.h" -ACE_RCSID(be, be_type, "$Id$") +ACE_RCSID (be, + be_type, + "$Id$") be_type::be_type (void) : tc_name_ (0), @@ -525,9 +529,6 @@ be_type::destroy (void) delete [] this->nested_type_name_; this->nested_type_name_ = 0; } - - this->AST_Type::destroy (); - this->be_decl::destroy (); } int diff --git a/TAO/TAO_IDL/be/be_typedef.cpp b/TAO/TAO_IDL/be/be_typedef.cpp index a0b2f8d771f..a9fcc4508b2 100644 --- a/TAO/TAO_IDL/be/be_typedef.cpp +++ b/TAO/TAO_IDL/be/be_typedef.cpp @@ -19,9 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_typedef.h" +#include "be_visitor.h" +#include "ace/Log_Msg.h" ACE_RCSID (be, be_typedef, diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp index d9a2d2461b1..fed394ea717 100644 --- a/TAO/TAO_IDL/be/be_union.cpp +++ b/TAO/TAO_IDL/be/be_union.cpp @@ -19,11 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_union.h" +#include "be_visitor.h" +#include "be_codegen.h" +#include "be_helper.h" +#include "be_extern.h" +#include "ast_union_branch.h" +#include "utl_identifier.h" -ACE_RCSID(be, be_union, "$Id$") +ACE_RCSID (be, + be_union, + "$Id$") be_union::be_union (void) @@ -58,8 +64,6 @@ be_union::be_union (AST_ConcreteType *dt, int be_union::gen_var_defn (char *) { - TAO_OutStream *ch = 0; - TAO_NL be_nl; char namebuf [NAMEBUFSIZE]; ACE_OS::memset (namebuf, @@ -70,7 +74,7 @@ be_union::gen_var_defn (char *) "%s_var", this->local_name ()->get_string ()); - ch = tao_cg->client_header (); + TAO_OutStream *ch = tao_cg->client_header (); // Generate the var definition (always in the client header). // Depending upon the data type, there are some differences which we account diff --git a/TAO/TAO_IDL/be/be_union_branch.cpp b/TAO/TAO_IDL/be/be_union_branch.cpp index 71c9cc6e445..8bbcfbc32f9 100644 --- a/TAO/TAO_IDL/be/be_union_branch.cpp +++ b/TAO/TAO_IDL/be/be_union_branch.cpp @@ -19,11 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_union_branch, "$Id$") +#include "be_union_branch.h" +#include "be_union.h" +#include "be_type.h" +#include "be_enum.h" +#include "be_visitor.h" +#include "be_helper.h" +#include "ast_union_label.h" + +ACE_RCSID (be, + be_union_branch, + "$Id$") be_union_branch::be_union_branch (void) { diff --git a/TAO/TAO_IDL/be/be_union_label.cpp b/TAO/TAO_IDL/be/be_union_label.cpp index ff9ee596a3c..a6889166db1 100644 --- a/TAO/TAO_IDL/be/be_union_label.cpp +++ b/TAO/TAO_IDL/be/be_union_label.cpp @@ -1,17 +1,20 @@ // // $Id$ // -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -ACE_RCSID(be, be_union_label, "$Id$") +#include "be_union_label.h" +#include "be_visitor.h" -be_union_label::be_union_label() +ACE_RCSID (be, + be_union_label, + "$Id$") + +be_union_label::be_union_label (void) { } + be_union_label::be_union_label (AST_UnionLabel::UnionLabel ul, - AST_Expression *v) + AST_Expression *v) : AST_UnionLabel (ul, v) { diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp index 279a4c2ae13..153d40a3e6c 100644 --- a/TAO/TAO_IDL/be/be_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_valuetype.cpp @@ -19,11 +19,15 @@ // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_valuetype.h" +#include "be_visitor.h" +#include "be_extern.h" +#include "be_helper.h" +#include "ast_module.h" -ACE_RCSID(be, be_valuetype, "$Id$") +ACE_RCSID (be, + be_valuetype, + "$Id$") // Default constructor. be_valuetype::be_valuetype (void) @@ -136,8 +140,6 @@ be_valuetype::full_obv_skel_name (void) int be_valuetype::gen_var_defn (char *) { - TAO_OutStream *ch = 0; - TAO_NL be_nl; char namebuf [NAMEBUFSIZE]; ACE_OS::memset (namebuf, @@ -148,7 +150,7 @@ be_valuetype::gen_var_defn (char *) "%s_var", this->local_name ()); - ch = tao_cg->client_header (); + TAO_OutStream *ch = tao_cg->client_header (); // Generate the var definition (always in the client header). // Depending upon the data type, there are some differences which we account diff --git a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp index 7a40580c295..eaa95e923fe 100644 --- a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp +++ b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp @@ -21,11 +21,13 @@ // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_valuetype_fwd.h" +#include "be_visitor.h" +#include "ast_interface.h" -ACE_RCSID(be, be_valuetype_fwd, "$Id$") +ACE_RCSID (be, + be_valuetype_fwd, + "$Id$") be_valuetype_fwd::be_valuetype_fwd (void) { diff --git a/TAO/TAO_IDL/be/be_visitor.cpp b/TAO/TAO_IDL/be/be_visitor.cpp index e1683ceecb2..780ae08cde8 100644 --- a/TAO/TAO_IDL/be/be_visitor.cpp +++ b/TAO/TAO_IDL/be/be_visitor.cpp @@ -21,11 +21,12 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" #include "be_visitor.h" +#include "ace/config-all.h" -ACE_RCSID(be, be_visitor, "$Id$") +ACE_RCSID (be, + be_visitor, + "$Id$") be_visitor::be_visitor (void) { diff --git a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp index a4f0fda2ca1..b1d886266d8 100644 --- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp @@ -13,20 +13,26 @@ //============================================================================= #include "be_visitor_amh_pre_proc.h" +#include "be_visitor_context.h" +#include "be_root.h" +#include "be_module.h" +#include "be_interface.h" +#include "be_valuetype.h" +#include "be_attribute.h" +#include "be_operation.h" +#include "be_predefined_type.h" +#include "be_argument.h" +#include "utl_identifier.h" be_visitor_amh_pre_proc::be_visitor_amh_pre_proc (be_visitor_context *ctx) : be_visitor_scope (ctx) { } - - be_visitor_amh_pre_proc::~be_visitor_amh_pre_proc (void) { } - - int be_visitor_amh_pre_proc::visit_root (be_root *node) { @@ -41,8 +47,6 @@ be_visitor_amh_pre_proc::visit_root (be_root *node) return 0; } - - int be_visitor_amh_pre_proc::visit_module (be_module *node) { @@ -57,8 +61,6 @@ be_visitor_amh_pre_proc::visit_module (be_module *node) return 0; } - - int be_visitor_amh_pre_proc::visit_interface (be_interface *node) { @@ -68,7 +70,7 @@ be_visitor_amh_pre_proc::visit_interface (be_interface *node) return 0; } - // don't generate AMH classes for imported or local interfaces + // Don't generate AMH classes for imported or local interfaces // either... // @@ Mayur, maybe we do want to insert the AMH node for imported // interfaces, not because we want to generate code for them, but @@ -131,7 +133,6 @@ be_visitor_amh_pre_proc::visit_interface (be_interface *node) return 0; } - be_interface * be_visitor_amh_pre_proc::create_response_handler ( be_interface *node, @@ -177,7 +178,6 @@ be_visitor_amh_pre_proc::create_response_handler ( return response_handler; } - int be_visitor_amh_pre_proc::add_rh_node_members ( be_interface *node, be_interface *response_handler, @@ -229,7 +229,6 @@ be_visitor_amh_pre_proc::add_rh_node_members ( be_interface *node, return 1; } - int be_visitor_amh_pre_proc::create_response_handler_operation ( be_operation *node, @@ -449,7 +448,6 @@ be_visitor_amh_pre_proc::add_normal_reply (be_operation *node, return 0; } - int be_visitor_amh_pre_proc::visit_operation (be_operation *node) { @@ -479,7 +477,6 @@ be_visitor_amh_pre_proc::visit_operation (be_operation *node) return 0; } - int be_visitor_amh_pre_proc::visit_attribute (be_attribute *node) { @@ -615,69 +612,10 @@ be_visitor_amh_pre_proc::visit_scope (be_scope *node) be_valuetype * be_visitor_amh_pre_proc::create_exception_holder (be_interface *node) { -#if 0 - // Create a virtual module named "Messaging" and a valuetype - // "ExceptionHolder" from which we inherit. - UTL_ScopedName *inherit_name = 0; - ACE_NEW_RETURN (inherit_name, - UTL_ScopedName (id, - 0), - 0); - - ACE_NEW_RETURN (id, - Identifier ("ExceptionHolder"), - 0); - - ACE_NEW_RETURN (sn, - UTL_ScopedName (id, - 0), - 0); - - inherit_name->nconc (sn); - - be_valuetype *inherit_vt = 0; - ACE_NEW_RETURN (inherit_vt, - be_valuetype (inherit_name, - 0, - 0, - 0), - 0); - - inherit_vt->set_name (inherit_name); - inherit_vt->set_imported (I_TRUE); - - ACE_NEW_RETURN (id, - Identifier ("Messaging"), - 0); - - ACE_NEW_RETURN (sn, - UTL_ScopedName (id, - 0), - 0); - - be_module *msg = 0; - ACE_NEW_RETURN (msg, - be_module (sn), - 0); - - // Notice the valuetype "ExceptionHolder" that it is defined in the - // "Messaging" module. - inherit_vt->set_defined_in (msg); - - const int inherit_count = 1; - AST_Interface **p_intf = 0; - ACE_NEW_RETURN (p_intf, - AST_Interface*[1], - 0); - - p_intf[0] = ACE_static_cast (AST_Interface *, - inherit_vt); -#else const int inherit_count = 0; AST_Interface **p_intf = 0; -#endif - UTL_ScopedName *excep_holder_name = + UTL_ScopedName *excep_holder_name = node->compute_name ("AMH_", "ExceptionHolder"); be_valuetype *excep_holder = 0; @@ -845,9 +783,11 @@ be_visitor_amh_pre_proc::create_raise_operation ( // Set the proper strategy. be_operation_ami_exception_holder_raise_strategy *ehrs = 0; - ACE_NEW_RETURN (ehrs, - be_operation_ami_exception_holder_raise_strategy (operation), - -1); + ACE_NEW_RETURN ( + ehrs, + be_operation_ami_exception_holder_raise_strategy (operation), + -1 + ); be_operation_strategy *old_strategy = operation->set_strategy (ehrs); @@ -911,7 +851,9 @@ be_visitor_amh_pre_proc::generate_get_operation (be_attribute *node) be_operation * be_visitor_amh_pre_proc::generate_set_operation (be_attribute *node) { - ACE_CString original_op_name (node->name ()->last_component ()->get_string ()); + ACE_CString original_op_name ( + node->name ()->last_component ()->get_string () + ); ACE_CString new_op_name = ACE_CString ("set_") + original_op_name; UTL_ScopedName *set_name = ACE_static_cast (UTL_ScopedName *, diff --git a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp index 40e284f2af2..a4947efff7c 100644 --- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp @@ -22,11 +22,23 @@ // // ============================================================================ - #include "be_visitor_ami_pre_proc.h" - - -ACE_RCSID(be, be_visitor_ami_pre_proc, "$Id$") +#include "be_visitor_context.h" +#include "be_root.h" +#include "be_module.h" +#include "be_interface.h" +#include "be_interface_strategy.h" +#include "be_valuetype.h" +#include "be_operation.h" +#include "be_operation_strategy.h" +#include "be_attribute.h" +#include "be_predefined_type.h" +#include "be_argument.h" +#include "utl_identifier.h" + +ACE_RCSID (be, + be_visitor_ami_pre_proc, + "$Id$") be_visitor_ami_pre_proc::be_visitor_ami_pre_proc (be_visitor_context *ctx) @@ -35,13 +47,11 @@ be_visitor_ami_pre_proc::be_visitor_ami_pre_proc (be_visitor_context *ctx) } - // constructor is protected be_visitor_ami_pre_proc::~be_visitor_ami_pre_proc (void) { } - int be_visitor_ami_pre_proc::visit_root (be_root *node) { @@ -229,7 +239,6 @@ be_visitor_ami_pre_proc::visit_operation (be_operation *node) return 0; } - int be_visitor_ami_pre_proc::visit_attribute (be_attribute *node) { @@ -281,11 +290,6 @@ be_visitor_ami_pre_proc::visit_attribute (be_attribute *node) return 0; } - - - - - be_valuetype * be_visitor_ami_pre_proc::create_exception_holder (be_interface *node) { @@ -428,7 +432,6 @@ be_visitor_ami_pre_proc::create_exception_holder (be_interface *node) return excep_holder; } - be_interface * be_visitor_ami_pre_proc::create_reply_handler (be_interface *node, be_valuetype *excep_holder) @@ -599,7 +602,6 @@ be_visitor_ami_pre_proc::create_reply_handler (be_interface *node, return reply_handler; } - int be_visitor_ami_pre_proc::create_raise_operation ( be_decl *node, @@ -1120,7 +1122,6 @@ be_visitor_ami_pre_proc::create_excep_operation (be_operation *node, return 0; } - // Visit the scope and its elements. int be_visitor_ami_pre_proc::visit_scope (be_scope *node) @@ -1221,8 +1222,6 @@ be_visitor_ami_pre_proc::generate_name (ACE_CString &destination, return 0; } - - be_operation * be_visitor_ami_pre_proc::generate_get_operation (be_attribute *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument.cpp index 2d436b89bae..1ffec9f5654 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument.cpp @@ -18,11 +18,27 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" #include "be_visitor_argument.h" +#include "be_visitor_context.h" +#include "be_argument.h" +#include "be_type.h" +#include "be_array.h" +#include "be_enum.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_native.h" +#include "be_predefined_type.h" +#include "be_string.h" +#include "be_typedef.h" +#include "be_structure.h" +#include "be_union.h" +#include "be_sequence.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_operation.h" +#include "be_helper.h" +#include "utl_identifier.h" -// include all the individual files #include "be_visitor_argument/arglist.cpp" #include "be_visitor_argument/argument.cpp" #include "be_visitor_argument/marshal_ss.cpp" @@ -40,4 +56,6 @@ #include "be_visitor_argument/request_info_result.cpp" #include "be_visitor_argument/request_info_arglist.cpp" -ACE_RCSID(be, be_visitor_argument, "$Id$") +ACE_RCSID (be, + be_visitor_argument, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp index 8ab31451328..bec48df7cca 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, arglist, "$Id$") +ACE_RCSID (be_visitor_argument, + arglist, + "$Id$") // ************************************************************ @@ -41,10 +39,10 @@ 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 + TAO_OutStream *os = this->ctx_->stream (); + this->ctx_->node (node); - // retrieve the type + // Retrieve the type. be_type *bt = be_type::narrow_from_decl (node->field_type ()); if (!bt) diff --git a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp index c172a002252..82fbad5ac30 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp @@ -18,15 +18,13 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, argument, "$Id$") +ACE_RCSID (be_visitor_argument, + argument, + "$Id$") be_visitor_args::be_visitor_args (be_visitor_context *ctx) - : be_visitor_decl (ctx) - , fixed_direction_ (-1) + : be_visitor_decl (ctx), + fixed_direction_ (-1) { } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp index e24a84e9ce0..5be455812b5 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, invoke_cs, "$Id$") +ACE_RCSID (be_visitor_argument, + invoke_cs, + "$Id$") // **************************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp index 8842e708c3f..bc612c5c232 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp @@ -19,11 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, marshal_ss, "$Id$") +ACE_RCSID (be_visitor_argument, + marshal_ss, + "$Id$") // ************************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp index cc952c4c0f9..7dea1734128 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp @@ -19,10 +19,6 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - ACE_RCSID (be_visitor_argument, paramlist, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_argument/post_invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_invoke_cs.cpp index 865425354cd..a9d8480eed4 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/post_invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/post_invoke_cs.cpp @@ -19,11 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, post_invoke_cs, "$Id$") +ACE_RCSID (be_visitor_argument, + post_invoke_cs, + "$Id$") // ************************************************************************* @@ -33,8 +31,9 @@ ACE_RCSID(be_visitor_argument, post_invoke_cs, "$Id$") // type and vice versa. // ************************************************************************* -be_visitor_args_post_invoke_cs::be_visitor_args_post_invoke_cs -(be_visitor_context *ctx) +be_visitor_args_post_invoke_cs::be_visitor_args_post_invoke_cs ( + be_visitor_context *ctx + ) : be_visitor_args (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp index a532881930a..b097feba99a 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp @@ -19,12 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, post_marshal_ss, "$Id$") - +ACE_RCSID (be_visitor_argument, + post_marshal_ss, + "$Id$") // ************************************************************************ // visitor for doing any post-processing after the marshaling is done diff --git a/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp index 3fa6243b5a0..5617fa0b5dd 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/post_upcall_ss.cpp @@ -19,10 +19,6 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - ACE_RCSID (be_visitor_argument, post_upcall_ss, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_argument/pre_invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/pre_invoke_cs.cpp index e42af34029e..b8544336315 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/pre_invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/pre_invoke_cs.cpp @@ -19,10 +19,6 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - ACE_RCSID (be_visitor_argument, pre_invoke_cs, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_argument/request_info_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/request_info_arglist.cpp index 8ccd92cb024..1f82fb45393 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/request_info_arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/request_info_arglist.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, request_info_arglist, "$Id$") +ACE_RCSID (be_visitor_argument, + request_info_arglist, + "$Id$") // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_argument/request_info_ch.cpp b/TAO/TAO_IDL/be/be_visitor_argument/request_info_ch.cpp index e2e0b7496e7..e1752ecdd2a 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/request_info_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/request_info_ch.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, request_info_ch, "$Id$") +ACE_RCSID (be_visitor_argument, + request_info_ch, + "$Id$") // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_argument/request_info_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/request_info_cs.cpp index 09d7050b34e..07650498daf 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/request_info_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/request_info_cs.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, request_info_cs, "$Id$") +ACE_RCSID (be_visitor_argument, + request_info_cs, + "$Id$") // ************************************************************ @@ -30,7 +28,9 @@ ACE_RCSID(be_visitor_argument, request_info_cs, "$Id$") // definitions // ************************************************************ -be_visitor_args_request_info_cs::be_visitor_args_request_info_cs (be_visitor_context *ctx) +be_visitor_args_request_info_cs::be_visitor_args_request_info_cs ( + be_visitor_context *ctx + ) : be_visitor_args (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/request_info_result.cpp b/TAO/TAO_IDL/be/be_visitor_argument/request_info_result.cpp index 1d1ef00aa91..65488d6d2cc 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/request_info_result.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/request_info_result.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, request_info_result, "$Id$") +ACE_RCSID (be_visitor_argument, + request_info_result, + "$Id$") // ************************************************************ @@ -30,12 +28,16 @@ ACE_RCSID(be_visitor_argument, request_info_result, "$Id$") // stored in the request info for interceptors // ************************************************************ -be_visitor_args_request_info_result::be_visitor_args_request_info_result (be_visitor_context *ctx) +be_visitor_args_request_info_result::be_visitor_args_request_info_result ( + be_visitor_context *ctx + ) : be_visitor_args (ctx) { } -be_visitor_args_request_info_result::~be_visitor_args_request_info_result (void) +be_visitor_args_request_info_result::~be_visitor_args_request_info_result ( + void + ) { } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/request_info_sh.cpp b/TAO/TAO_IDL/be/be_visitor_argument/request_info_sh.cpp index 07ffc2bf17a..222b10d3ef5 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/request_info_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/request_info_sh.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, request_info_sh, "$Id$") +ACE_RCSID (be_visitor_argument, + request_info_sh, + "$Id$") // ************************************************************ @@ -30,7 +28,9 @@ ACE_RCSID(be_visitor_argument, request_info_sh, "$Id$") // definitions // ************************************************************ -be_visitor_args_request_info_sh::be_visitor_args_request_info_sh (be_visitor_context *ctx) +be_visitor_args_request_info_sh::be_visitor_args_request_info_sh ( + be_visitor_context *ctx + ) : be_visitor_args (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/request_info_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/request_info_ss.cpp index e68b5b16c07..024686018c7 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/request_info_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/request_info_ss.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, request_info_ss, "$Id$") +ACE_RCSID (be_visitor_argument, + request_info_ss, + "$Id$") // ************************************************************ @@ -30,7 +28,9 @@ ACE_RCSID(be_visitor_argument, request_info_ss, "$Id$") // definitions // ************************************************************ -be_visitor_args_request_info_ss::be_visitor_args_request_info_ss (be_visitor_context *ctx) +be_visitor_args_request_info_ss::be_visitor_args_request_info_ss ( + be_visitor_context *ctx + ) : be_visitor_args (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp index 857d33a1896..cbd9b2647ff 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp @@ -19,11 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, upcall_ss, "$Id$") +ACE_RCSID (be_visitor_argument, + upcall_ss, + "$Id$") // ************************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp index 6113da06ab4..85af05f93da 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp @@ -19,11 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_argument, vardecl_ss, "$Id$") +ACE_RCSID (be_visitor_argument, + vardecl_ss, + "$Id$") // ************************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_array.cpp b/TAO/TAO_IDL/be/be_visitor_array.cpp index 3e09618fa28..3bbde0a37fa 100644 --- a/TAO/TAO_IDL/be/be_visitor_array.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array.cpp @@ -18,13 +18,24 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_enum.h" +#include "be_type.h" +#include "be_typedef.h" +#include "be_predefined_type.h" +#include "be_array.h" +#include "be_string.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_structure.h" +#include "be_union.h" +#include "be_sequence.h" +#include "be_helper.h" +#include "be_extern.h" +#include "utl_identifier.h" #include "be_visitor_array.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_array/array.cpp" #include "be_visitor_array/array_ch.cpp" #include "be_visitor_array/array_ci.cpp" @@ -35,4 +46,6 @@ #include "be_visitor_array/cdr_op_ci.cpp" #include "be_visitor_array/cdr_op_cs.cpp" -ACE_RCSID(be, be_visitor_array, "$Id$") +ACE_RCSID (be, + be_visitor_array, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp index afd2cf49496..a01944109bd 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/any_op_ch.cpp @@ -19,21 +19,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_array.h" - -ACE_RCSID(be_visitor_array, any_op_ch, "$Id$") +ACE_RCSID (be_visitor_array, + any_op_ch, + "$Id$") // *************************************************************************** // Array visitor for generating Any operator declarations in the client header // *************************************************************************** -be_visitor_array_any_op_ch::be_visitor_array_any_op_ch -(be_visitor_context *ctx) +be_visitor_array_any_op_ch::be_visitor_array_any_op_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp index fe97d26c601..6b9ba49c7ae 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/any_op_cs.cpp @@ -19,13 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_array.h" - -ACE_RCSID(be_visitor_array, any_op_cs, "$Id$") +ACE_RCSID (be_visitor_array, + any_op_cs, + "$Id$") // *************************************************************************** @@ -33,8 +29,9 @@ ACE_RCSID(be_visitor_array, any_op_cs, "$Id$") // stubs file // *************************************************************************** -be_visitor_array_any_op_cs::be_visitor_array_any_op_cs -(be_visitor_context *ctx) +be_visitor_array_any_op_cs::be_visitor_array_any_op_cs ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_array/array.cpp b/TAO/TAO_IDL/be/be_visitor_array/array.cpp index b591c362a4f..9ec78dae4b0 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_array.h" -#include "be_visitor_enum.h" - -ACE_RCSID(be_visitor_array, array, "$Id$") +ACE_RCSID (be_visitor_array, + array, + "$Id$") // ************************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp index c7d0f9b8976..f39e1886924 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_array.h" - -ACE_RCSID(be_visitor_array, array_ch, "$Id$") +ACE_RCSID (be_visitor_array, + array_ch, + "$Id$") // ************************************************************************ @@ -43,17 +39,18 @@ be_visitor_array_ch::~be_visitor_array_ch (void) int be_visitor_array_ch::visit_array (be_array *node) { TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; be_decl *scope = this->ctx_->scope (); // Nothing to do if we are imported or code is already generated. if (node->imported () || (node->cli_hdr_gen ())) - return 0; + { + return 0; + } this->ctx_->node (node); // Retrieve the type. - bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = be_type::narrow_from_decl (node->base_type ()); if (!bt) { diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp index e89dc21302f..ca346dadd7e 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_array.h" - -ACE_RCSID(be_visitor_array, array_ci, "$Id$") +ACE_RCSID (be_visitor_array, + array_ci, + "$Id$") // ************************************************************************ @@ -42,15 +38,17 @@ be_visitor_array_ci::~be_visitor_array_ci (void) int be_visitor_array_ci::visit_array (be_array *node) { - // nothing to do if we are imported or code is already generated + // Nothing to do if we are imported or code is already generated. if (node->imported () || (node->cli_inline_gen ())) - return 0; + { + return 0; + } this->ctx_->node (node); // save the array node // If we contain an anonymous sequence, generate code for it here. - be_type *bt = be_type::narrow_from_decl (node->base_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, @@ -118,16 +116,22 @@ int be_visitor_array_ci::visit_array (be_array *node) int be_visitor_array_ci::gen_var_impl (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // output stream + TAO_OutStream *os = this->ctx_->stream (); + + char nodename [NAMEBUFSIZE]; + char fname [NAMEBUFSIZE]; + char lname [NAMEBUFSIZE]; + + ACE_OS::memset (nodename, + '\0', + NAMEBUFSIZE); + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); + ACE_OS::memset (lname, + '\0', + NAMEBUFSIZE); - char nodename [NAMEBUFSIZE]; // node name - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local names of the var - // save the node's local name and full name in a buffer for quick use later - // on - ACE_OS::memset (nodename, '\0', NAMEBUFSIZE); - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); if (this->ctx_->tdef ()) { // typedefed node @@ -143,7 +147,8 @@ be_visitor_array_ci::gen_var_impl (be_array *node) // our local name. This needs to be inserted after the parents's name if (node->is_nested ()) { - be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); + be_decl *parent = + be_scope::narrow_from_scope (node->defined_in ())->decl (); ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); ACE_OS::sprintf (fname, "%s::_%s_var", parent->full_name (), @@ -370,7 +375,8 @@ be_visitor_array_ci::gen_out_impl (be_array *node) // our local name. This needs to be inserted after the parents's name if (node->is_nested ()) { - be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); + be_decl *parent = + be_scope::narrow_from_scope (node->defined_in ())->decl (); ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); ACE_OS::sprintf (fname, "%s::_%s_out", parent->full_name (), @@ -507,7 +513,8 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) // our local name. This needs to be inserted after the parents's name if (node->is_nested ()) { - be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); + be_decl *parent = + be_scope::narrow_from_scope (node->defined_in ())->decl (); ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); ACE_OS::sprintf (fname, "%s::_%s_forany", parent->full_name (), diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp index 5ba05034856..3bdc5265e17 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_array.h" - -ACE_RCSID(be_visitor_array, array_cs, "$Id$") +ACE_RCSID (be_visitor_array, + array_cs, + "$Id$") // ************************************************************************ @@ -43,7 +39,6 @@ be_visitor_array_cs::~be_visitor_array_cs (void) int be_visitor_array_cs::visit_array (be_array *node) { TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; unsigned long i; // Nothing to do if we are imported or code is already generated. @@ -55,7 +50,7 @@ int be_visitor_array_cs::visit_array (be_array *node) this->ctx_->node (node); // Retrieve the type. - bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = be_type::narrow_from_decl (node->base_type ()); if (!bt) { @@ -293,11 +288,13 @@ int be_visitor_array_cs::visit_array (be_array *node) *os << ";"; } + for (i = 0; i < node->n_dims (); i++) { // Decrement indentation as many times as the number of dimensions. *os << be_uidt; } + *os << be_uidt_nl << "}\n\n"; // If we contain an anonymous sequence, @@ -317,6 +314,5 @@ int be_visitor_array_cs::visit_array (be_array *node) } node->cli_stub_gen (1); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp index 49ae4f7adc0..fd9bbe6f07a 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp @@ -19,22 +19,20 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_visitor_sequence/cdr_op_ch.h" -#include "be_visitor_array.h" -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_array, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_array, + cdr_op_ch, + "$Id$") // *************************************************************************** // Array visitor for generating CDR operator declarations in the client header // *************************************************************************** -be_visitor_array_cdr_op_ch::be_visitor_array_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_array_cdr_op_ch::be_visitor_array_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp index bfc4212b152..2aae6ace5cb 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp @@ -19,22 +19,20 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_array.h" - -ACE_RCSID(be_visitor_array, cdr_op_ci, "$Id$") +ACE_RCSID (be_visitor_array, + cdr_op_ci, + "$Id$") +#include "be_visitor_sequence/cdr_op_ci.h" // *************************************************************************** // Array visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_array_cdr_op_ci::be_visitor_array_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_array_cdr_op_ci::be_visitor_array_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp index 7bccb8e308f..f2ab8557d58 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp @@ -19,18 +19,19 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_array, + cdr_op_cs, + "$Id$") -#include "be_visitor_array.h" // *************************************************************************** // Array visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_array_cdr_op_cs::be_visitor_array_cdr_op_cs (be_visitor_context *ctx) +be_visitor_array_cdr_op_cs::be_visitor_array_cdr_op_cs ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute.cpp index 7b11a6294c2..b85b330d9a0 100644 --- a/TAO/TAO_IDL/be/be_visitor_attribute.cpp +++ b/TAO/TAO_IDL/be/be_visitor_attribute.cpp @@ -18,14 +18,19 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_attribute.h" +#include "be_operation.h" +#include "be_predefined_type.h" +#include "be_argument.h" +#include "utl_identifier.h" #include "be_visitor_attribute.h" +#include "be_visitor_context.h" +#include "be_visitor_operation.h" -// include all the individual files #include "be_visitor_attribute/attribute.cpp" -ACE_RCSID(be, be_visitor_attribute, "$Id$") +ACE_RCSID (be, + be_visitor_attribute, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp index 709f3716673..40101b9fe37 100644 --- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp +++ b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_attribute.h" - -ACE_RCSID(be_visitor_attribute, attribute, "$Id$") +ACE_RCSID (be_visitor_attribute, + attribute, + "$Id$") // Attribute gets mapped to one or possibly two operations based on whether @@ -65,8 +61,8 @@ be_visitor_attribute::~be_visitor_attribute (void) int be_visitor_attribute::visit_attribute (be_attribute *node) { - this->ctx_->node (node); // save the node - this->ctx_->attribute (node); // save this attribute node + this->ctx_->node (node); + this->ctx_->attribute (node); // first the "get" operation @@ -80,15 +76,15 @@ be_visitor_attribute::visit_attribute (be_attribute *node) get_op.set_defined_in (node->defined_in ()); // Get the strategy from the attribute and hand it over - // to the operation + // to the operation. delete get_op.set_strategy (node->get_get_strategy ()); be_visitor_context ctx (*this->ctx_); + int status = 1; - // this switch statement eliminates the need for different classes that have - // exactly the same code except different states. switch (this->ctx_->state ()) { + // These two cases are the only ones that could involved a strategy. case TAO_CodeGen::TAO_ATTRIBUTE_CH: ctx.state (TAO_CodeGen::TAO_OPERATION_CH); break; @@ -96,73 +92,154 @@ be_visitor_attribute::visit_attribute (be_attribute *node) ctx.state (TAO_CodeGen::TAO_OPERATION_CS); break; case TAO_CodeGen::TAO_ATTRIBUTE_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SH); + be_visitor_operation_sh visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_IH: - ctx.state (TAO_CodeGen::TAO_OPERATION_IH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_IH); + be_visitor_operation_ih visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SS); + be_visitor_operation_ss visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_IS: - ctx.state (TAO_CodeGen::TAO_OPERATION_IS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_IS); + be_visitor_operation_is visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH); + be_visitor_operation_thru_poa_collocated_sh visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS); + be_visitor_operation_thru_poa_collocated_ss visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH); + be_visitor_operation_direct_collocated_sh visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); + be_visitor_operation_direct_collocated_ss visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH); + be_visitor_operation_base_proxy_impl_ch visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH: - ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH); + be_visitor_operation_proxy_impl_xh visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS); + be_visitor_operation_remote_proxy_impl_cs visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS); + be_visitor_operation_thru_poa_proxy_impl_ss visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS); + be_visitor_operation_direct_proxy_impl_ss visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH); + be_visitor_operation_smart_proxy_ch visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS); + be_visitor_operation_smart_proxy_cs visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); + be_visitor_operation_interceptors_ch visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); + be_visitor_operation_interceptors_cs visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH); + be_visitor_operation_interceptors_sh visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS); + be_visitor_operation_interceptors_ss visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH); + be_visitor_operation_tie_sh visitor (&ctx); + status = get_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI: - ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI); + be_visitor_operation_tie_si visitor (&ctx); + status = get_op.accept (&visitor); + break; + } default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_attribute::" "visit_attribute - " @@ -170,28 +247,19 @@ be_visitor_attribute::visit_attribute (be_attribute *node) -1); } - // Change the state depending on the kind of node strategy - ctx.state (get_op.next_state (ctx.state ())); - - be_visitor *visitor = tao_cg->make_visitor (&ctx); - - if (!visitor || (get_op.accept (visitor) == -1)) + if (status == -1) { - delete visitor; ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_attribute::" "visit_attribute - " "codegen for get_attribute failed\n"), -1); } - - delete visitor; - visitor = 0; - - if (get_op.has_extra_code_generation (ctx.state ())) + else if (status == 1) { - // Change the state depending on the kind of node strategy - ctx.state (get_op.next_state (ctx.state (), 1)); + // Change the state depending on the kind of node strategy. + ctx.state (get_op.next_state (ctx.state ())); + be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor || (get_op.accept (visitor) == -1)) @@ -206,6 +274,26 @@ be_visitor_attribute::visit_attribute (be_attribute *node) delete visitor; visitor = 0; + + if (get_op.has_extra_code_generation (ctx.state ())) + { + // Change the state depending on the kind of node strategy. + ctx.state (get_op.next_state (ctx.state (), 1)); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + + if (!visitor || (get_op.accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_attribute::" + "visit_attribute - " + "codegen for get_attribute failed\n"), + -1); + } + + delete visitor; + visitor = 0; + } } // Do nothing for readonly attributes. @@ -214,28 +302,22 @@ be_visitor_attribute::visit_attribute (be_attribute *node) return 0; } - // Create the set method. - Identifier *id = 0; - UTL_ScopedName *sn = 0; - - ACE_NEW_RETURN (id, - Identifier ("void"), - -1); + status = 1; - ACE_NEW_RETURN (sn, - UTL_ScopedName (id, - 0), - -1); + // Create the set method. + Identifier id ("void"); + UTL_ScopedName sn (&id, + 0); - // the return type is "void" + // The return type is "void". be_predefined_type rt (AST_PredefinedType::PT_void, - sn); - // argument type is the same as the attribute type + &sn); + // Argument type is the same as the attribute type. be_argument arg (AST_Argument::dir_IN, node->field_type (), node->name ()); arg.set_name ((UTL_IdList *) node->name ()->copy ()); - // create the operation + // Create the operation. be_operation set_op (&rt, AST_Operation::OP_noflags, node->name (), @@ -250,10 +332,11 @@ be_visitor_attribute::visit_attribute (be_attribute *node) delete set_op.set_strategy (node->get_set_strategy ()); ctx = *this->ctx_; - // this switch statement eliminates the need for different classes that have - // exactly the same code except different states. + status = 1; + switch (this->ctx_->state ()) { + // These two cases are the only ones that could involved a strategy. case TAO_CodeGen::TAO_ATTRIBUTE_CH: ctx.state (TAO_CodeGen::TAO_OPERATION_CH); break; @@ -261,72 +344,154 @@ be_visitor_attribute::visit_attribute (be_attribute *node) ctx.state (TAO_CodeGen::TAO_OPERATION_CS); break; case TAO_CodeGen::TAO_ATTRIBUTE_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SH); + be_visitor_operation_sh visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_IH: - ctx.state (TAO_CodeGen::TAO_OPERATION_IH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_IH); + be_visitor_operation_ih visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SS); + be_visitor_operation_ss visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_IS: - ctx.state (TAO_CodeGen::TAO_OPERATION_IS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_IS); + be_visitor_operation_is visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH); + be_visitor_operation_thru_poa_collocated_sh visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS); + be_visitor_operation_thru_poa_collocated_ss visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH); + be_visitor_operation_direct_collocated_sh visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); + be_visitor_operation_direct_collocated_ss visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH); + be_visitor_operation_base_proxy_impl_ch visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH: - ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH); + be_visitor_operation_proxy_impl_xh visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS); + be_visitor_operation_remote_proxy_impl_cs visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS); + be_visitor_operation_thru_poa_proxy_impl_ss visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS); - break; - case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH); - break; - case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI: - ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS); + be_visitor_operation_direct_proxy_impl_ss visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH); + be_visitor_operation_smart_proxy_ch visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS); + be_visitor_operation_smart_proxy_cs visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); + be_visitor_operation_interceptors_ch visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); + be_visitor_operation_interceptors_cs visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH); + be_visitor_operation_interceptors_sh visitor (&ctx); + status = set_op.accept (&visitor); + break; + } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS); + be_visitor_operation_interceptors_ss visitor (&ctx); + status = set_op.accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH: + { + ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH); + be_visitor_operation_tie_sh visitor (&ctx); + status = set_op.accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI: + { + ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI); + be_visitor_operation_tie_si visitor (&ctx); + status = set_op.accept (&visitor); + break; + } default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_attribute::" "visit_attribute - " @@ -334,10 +499,22 @@ be_visitor_attribute::visit_attribute (be_attribute *node) -1); } + if (status == 0) + { + return 0; + } + else if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_attribute::" + "visit_attribute - " + "codegen for get_attribute failed\n"), + -1); + } // Change the state depending on the kind of node strategy ctx.state (set_op.next_state (ctx.state ())); - visitor = tao_cg->make_visitor (&ctx); + be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor || (set_op.accept (visitor) == -1)) { diff --git a/TAO/TAO_IDL/be/be_visitor_constant.cpp b/TAO/TAO_IDL/be/be_visitor_constant.cpp index 0281cbccf4d..a93bbf6a987 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant.cpp @@ -18,15 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_constant.h" +#include "be_module.h" +#include "be_helper.h" +#include "utl_identifier.h" #include "be_visitor_constant.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_constant/constant_ch.cpp" #include "be_visitor_constant/constant_cs.cpp" -ACE_RCSID(be, be_visitor_constant, "$Id$") +ACE_RCSID (be, + be_visitor_constant, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp index 89879fdbb8c..67546a64bb7 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_constant.h" - -ACE_RCSID(be_visitor_constant, constant_ch, "$Id$") +ACE_RCSID (be_visitor_constant, + constant_ch, + "$Id$") // ******************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp b/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp index 90f67a8af36..2fbe7c355f9 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_constant.h" - -ACE_RCSID(be_visitor_constant, constant_cs, "$Id$") +ACE_RCSID (be_visitor_constant, + constant_cs, + "$Id$") // ******************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_context.cpp b/TAO/TAO_IDL/be/be_visitor_context.cpp index 8102f332f78..42b0791edc4 100644 --- a/TAO/TAO_IDL/be/be_visitor_context.cpp +++ b/TAO/TAO_IDL/be/be_visitor_context.cpp @@ -18,11 +18,32 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -ACE_RCSID(be, be_visitor_context, "$Id$") +#include "be_argument.h" +#include "be_array.h" +#include "be_attribute.h" +#include "be_constant.h" +#include "be_enum.h" +#include "be_enum_val.h" +#include "be_exception.h" +#include "be_field.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_module.h" +#include "be_operation.h" +#include "be_predefined_type.h" +#include "be_root.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_union_branch.h" + +#include "be_visitor_context.h" + +ACE_RCSID (be, + be_visitor_context, + "$Id$") // constructor @@ -231,284 +252,368 @@ be_visitor_context::interface (void) const // **************************************************************** -// return the node as argument if possible be_argument * be_visitor_context::be_node_as_argument (void) { - if (this->node_) - return be_argument::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_argument::narrow_from_decl (this->node_); + } else - return (be_argument *)0; + { + return 0; + } } -// return the node as array if possible be_array * be_visitor_context::be_node_as_array (void) { - if (this->node_) - return be_array::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_array::narrow_from_decl (this->node_); + } else - return (be_array *)0; + { + return 0; + } } -// return the node as attribute if possible be_attribute * be_visitor_context::be_node_as_attribute (void) { - if (this->node_) - return be_attribute::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_attribute::narrow_from_decl (this->node_); + } else - return (be_attribute *)0; + { + return 0; + } } -// return the node as constant if possible be_constant * be_visitor_context::be_node_as_constant (void) { - if (this->node_) - return be_constant::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_constant::narrow_from_decl (this->node_); + } else - return (be_constant *)0; + { + return 0; + } } -// return the node as enum if possible be_enum * be_visitor_context::be_node_as_enum (void) { - if (this->node_) - return be_enum::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_enum::narrow_from_decl (this->node_); + } else - return (be_enum *)0; + { + return 0; + } } -// return the node as enum_val if possible be_enum_val * be_visitor_context::be_node_as_enum_val (void) { - if (this->node_) - return be_enum_val::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_enum_val::narrow_from_decl (this->node_); + } else + { + return 0; + } return (be_enum_val *)0; } -// return the node as exception if possible be_exception * be_visitor_context::be_node_as_exception (void) { - if (this->node_) - return be_exception::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_exception::narrow_from_decl (this->node_); + } else - return (be_exception *)0; + { + return 0; + } } -// return the node as field if possible be_field * be_visitor_context::be_node_as_field (void) { - if (this->node_) - return be_field::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_field::narrow_from_decl (this->node_); + } else - return (be_field *)0; + { + return 0; + } } -// return the node as interface if possible be_interface * be_visitor_context::be_node_as_interface (void) { - if (this->node_) - return be_interface::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_interface::narrow_from_decl (this->node_); + } else - return (be_interface *)0; + { + return 0; + } } -// return the node as interface_fwd if possible be_interface_fwd * be_visitor_context::be_node_as_interface_fwd (void) { - if (this->node_) - return be_interface_fwd::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_interface_fwd::narrow_from_decl (this->node_); + } else - return (be_interface_fwd *)0; + { + return 0; + } } -// return the node as module if possible be_module * be_visitor_context::be_node_as_module (void) { - if (this->node_) - return be_module::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_module::narrow_from_decl (this->node_); + } else - return (be_module *)0; + { + return 0; + } } -// return the node as operation if possible be_operation * be_visitor_context::be_node_as_operation (void) { - if (this->node_) - return be_operation::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_operation::narrow_from_decl (this->node_); + } else - return (be_operation *)0; + { + return 0; + } } -// return the node as predefined_type if possible be_predefined_type * be_visitor_context::be_node_as_predefined_type (void) { - if (this->node_) - return be_predefined_type::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_predefined_type::narrow_from_decl (this->node_); + } else - return (be_predefined_type *)0; + { + return 0; + } } -// return the node as root if possible be_root * be_visitor_context::be_node_as_root (void) { - if (this->node_) - return be_root::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_root::narrow_from_decl (this->node_); + } else - return (be_root *)0; + { + return 0; + } } -// return the node as sequence if possible be_sequence * be_visitor_context::be_node_as_sequence (void) { - if (this->node_) - return be_sequence::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_sequence::narrow_from_decl (this->node_); + } else - return (be_sequence *)0; + { + return 0; + } } -// return the node as string if possible be_string * be_visitor_context::be_node_as_string (void) { - if (this->node_) - return be_string::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_string::narrow_from_decl (this->node_); + } else - return (be_string *)0; + { + return 0; + } } -// return the node as structure if possible be_structure * be_visitor_context::be_node_as_structure (void) { - if (this->node_) - return be_structure::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_structure::narrow_from_decl (this->node_); + } else - return (be_structure *)0; + { + return 0; + } } -// return the node as typedef if possible be_typedef * be_visitor_context::be_node_as_typedef (void) { - if (this->node_) - return be_typedef::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_typedef::narrow_from_decl (this->node_); + } else - return (be_typedef *)0; + { + return 0; + } } -// return the node as union if possible be_union * be_visitor_context::be_node_as_union (void) { - if (this->node_) - return be_union::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_union::narrow_from_decl (this->node_); + } else - return (be_union *)0; + { + return 0; + } } -// return the node as union_branch if possible be_union_branch * be_visitor_context::be_node_as_union_branch (void) { - if (this->node_) - return be_union_branch::narrow_from_decl (this->node_); + if (this->node_ != 0) + { + return be_union_branch::narrow_from_decl (this->node_); + } else - return (be_union_branch *)0; + { + return 0; + } } -// for scope - -// return the scope as enum if possible be_enum * be_visitor_context::be_scope_as_enum (void) { - if (this->scope_) - return be_enum::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_enum::narrow_from_decl (this->scope_); + } else - return (be_enum *)0; + { + return 0; + } } -// return the scope as exception if possible be_exception * be_visitor_context::be_scope_as_exception (void) { - if (this->scope_) - return be_exception::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_exception::narrow_from_decl (this->scope_); + } else - return (be_exception *)0; + { + return 0; + } } -// return the scope as interface if possible be_interface * be_visitor_context::be_scope_as_interface (void) { - if (this->scope_) - return be_interface::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_interface::narrow_from_decl (this->scope_); + } else + { + return 0; + } return (be_interface *)0; } -// return the scope as module if possible be_module * be_visitor_context::be_scope_as_module (void) { - if (this->scope_) - return be_module::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_module::narrow_from_decl (this->scope_); + } else - return (be_module *)0; + { + return 0; + } } -// return the scope as operation if possible be_operation * be_visitor_context::be_scope_as_operation (void) { - if (this->scope_) - return be_operation::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_operation::narrow_from_decl (this->scope_); + } else - return (be_operation *)0; + { + return 0; + } } -// return the scope as root if possible be_root * be_visitor_context::be_scope_as_root (void) { - if (this->scope_) - return be_root::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_root::narrow_from_decl (this->scope_); + } else - return (be_root *)0; + { + return 0; + } } -// return the scope as structure if possible be_structure * be_visitor_context::be_scope_as_structure (void) { - if (this->scope_) - return be_structure::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_structure::narrow_from_decl (this->scope_); + } else - return (be_structure *)0; + { + return 0; + } } -// return the scope as union if possible be_union * be_visitor_context::be_scope_as_union (void) { - if (this->scope_) - return be_union::narrow_from_decl (this->scope_); + if (this->scope_ != 0) + { + return be_union::narrow_from_decl (this->scope_); + } else - return (be_union *)0; + { + return 0; + } } diff --git a/TAO/TAO_IDL/be/be_visitor_decl.cpp b/TAO/TAO_IDL/be/be_visitor_decl.cpp index d2c25510d90..10e1ba650be 100644 --- a/TAO/TAO_IDL/be/be_visitor_decl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_decl.cpp @@ -19,13 +19,14 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - #include "be_visitor_decl.h" +#include "be_visitor_context.h" +#include "be_typedef.h" +#include "be_type.h" -ACE_RCSID(be, be_visitor_decl, "$Id$") +ACE_RCSID (be, + be_visitor_decl, + "$Id$") // Root visitor for client header diff --git a/TAO/TAO_IDL/be/be_visitor_enum.cpp b/TAO/TAO_IDL/be/be_visitor_enum.cpp index aaef1a06f60..152bd0f7d54 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum.cpp @@ -18,13 +18,14 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_enum.h" +#include "be_enum_val.h" +#include "be_helper.h" +#include "be_extern.h" #include "be_visitor_enum.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_enum/enum_ch.cpp" #include "be_visitor_enum/enum_cs.cpp" #include "be_visitor_enum/any_op_ch.cpp" @@ -32,4 +33,6 @@ #include "be_visitor_enum/cdr_op_ch.cpp" #include "be_visitor_enum/cdr_op_ci.cpp" -ACE_RCSID(be, be_visitor_enum, "$Id$") +ACE_RCSID (be, + be_visitor_enum, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp index e22fa6ca3bf..dc29bb742c3 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/any_op_ch.cpp @@ -18,21 +18,16 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_enum.h" - -ACE_RCSID(be_visitor_enum, any_op_ch, "$Id$") +ACE_RCSID (be_visitor_enum, + any_op_ch, + "$Id$") // *************************************************************************** // Enum visitor for generating Any operator declarations in the client header // *************************************************************************** -be_visitor_enum_any_op_ch::be_visitor_enum_any_op_ch -(be_visitor_context *ctx) +be_visitor_enum_any_op_ch::be_visitor_enum_any_op_ch (be_visitor_context *ctx) : be_visitor_scope (ctx) { } @@ -45,11 +40,13 @@ int be_visitor_enum_any_op_ch::visit_enum (be_enum *node) { if (node->cli_hdr_any_op_gen () || node->imported ()) - return 0; + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the Any <<= and >>= operators + // Generate the Any <<= and >>= operators. os->indent (); *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, " << node->name () diff --git a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp index 5e882bea301..39dace2b8b6 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/any_op_cs.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_enum.h" - -ACE_RCSID(be_visitor_enum, any_op_cs, "$Id$") +ACE_RCSID (be_visitor_enum, + any_op_cs, + "$Id$") // *************************************************************************** @@ -32,8 +28,7 @@ ACE_RCSID(be_visitor_enum, any_op_cs, "$Id$") // stubs file // *************************************************************************** -be_visitor_enum_any_op_cs::be_visitor_enum_any_op_cs -(be_visitor_context *ctx) +be_visitor_enum_any_op_cs::be_visitor_enum_any_op_cs (be_visitor_context *ctx) : be_visitor_scope (ctx) { } @@ -46,12 +41,14 @@ int be_visitor_enum_any_op_cs::visit_enum (be_enum *node) { if (node->cli_stub_any_op_gen () || node->imported ()) - return 0; + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the Any <<= and >>= operator declarations - // Any <<= and >>= operators + // Generate the Any <<= and >>= operator declarations + // Any <<= and >>= operators. os->indent (); *os << "void operator<<= (CORBA::Any &_tao_any, " << node->name () << " _tao_elem)" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp index c0c2e045d92..fd061e87e90 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ch.cpp @@ -18,21 +18,16 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_enum.h" - -ACE_RCSID(be_visitor_enum, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_enum, + cdr_op_ch, + "$Id$") // *************************************************************************** // Enum visitor for generating Cdr operator declarations in the client header // *************************************************************************** -be_visitor_enum_cdr_op_ch::be_visitor_enum_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_enum_cdr_op_ch::be_visitor_enum_cdr_op_ch (be_visitor_context *ctx) : be_visitor_scope (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp index e8c9f0c5bc8..bba973773c4 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp @@ -18,12 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_enum.h" - -ACE_RCSID(be_visitor_enum, cdr_op_ci, "$Id$") +ACE_RCSID (be_visitor_enum, + cdr_op_ci, + "$Id$") // *************************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp b/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp index de697ab6a68..3d850057bbd 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp @@ -18,13 +18,11 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_enum.h" #include "be_visitor_typecode/typecode_decl.h" -ACE_RCSID(be_visitor_enum, enum_ch, "$Id$") +ACE_RCSID (be_visitor_enum, + enum_ch, + "$Id$") // ******************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp b/TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp index dd388d32179..72ef3b80356 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/enum_cs.cpp @@ -18,13 +18,11 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_enum.h" #include "be_visitor_typecode/typecode_defn.h" -ACE_RCSID(be_visitor_enum, enum_cs, "$Id$") +ACE_RCSID (be_visitor_enum, + enum_cs, + "$Id$") // ******************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception.cpp index 953fae623d1..45f5377a01e 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception.cpp @@ -18,13 +18,25 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_field.h" +#include "be_exception.h" +#include "be_typedef.h" +#include "be_enum.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_array.h" +#include "be_predefined_type.h" +#include "be_string.h" +#include "be_sequence.h" +#include "be_structure.h" +#include "be_union.h" +#include "be_helper.h" +#include "be_extern.h" #include "be_visitor_exception.h" +#include "be_visitor_context.h" +#include "be_visitor_field.h" -// include all the individual files #include "be_visitor_exception/exception.cpp" #include "be_visitor_exception/exception_ch.cpp" #include "be_visitor_exception/exception_ci.cpp" @@ -37,4 +49,6 @@ #include "be_visitor_exception/cdr_op_ci.cpp" #include "be_visitor_exception/cdr_op_cs.cpp" -ACE_RCSID(be, be_visitor_exception, "$Id$") +ACE_RCSID (be, + be_visitor_exception, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp index b2fb66569ab..bd04e392890 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/any_op_ch.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_exception.h" - -ACE_RCSID(be_visitor_exception, any_op_ch, "$Id$") +ACE_RCSID (be_visitor_exception, + any_op_ch, + "$Id$") // *************************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp index e29be94d778..4116997ba8e 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/any_op_cs.cpp @@ -18,13 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_exception.h" - -ACE_RCSID(be_visitor_exception, any_op_cs, "$Id$") +ACE_RCSID (be_visitor_exception, + any_op_cs, + "$Id$") // *************************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp index 342fcc6a103..5cb6bd85a6b 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ch.cpp @@ -19,20 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_exception.h" - -ACE_RCSID(be_visitor_exception, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_exception, + cdr_op_ch, + "$Id$") // *************************************************************************** // Exception visitor for generating CDR operator declarations in the client header // *************************************************************************** -be_visitor_exception_cdr_op_ch::be_visitor_exception_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_exception_cdr_op_ch::be_visitor_exception_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_exception (ctx) { } @@ -44,15 +41,16 @@ be_visitor_exception_cdr_op_ch::~be_visitor_exception_cdr_op_ch (void) int be_visitor_exception_cdr_op_ch::visit_exception (be_exception *node) { - if (node->cli_hdr_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_hdr_cdr_op_gen () || node->imported () || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator declarations + // Generate the CDR << and >> operator declarations. os->indent (); + *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const " << node->name () << " &);" << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp index 417f919bcd1..e123054e480 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_ci.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_exception.h" -#include "be_visitor_field.h" - -ACE_RCSID(be_visitor_exception, cdr_op_ci, "$Id$") +ACE_RCSID (be_visitor_exception, + cdr_op_ci, + "$Id$") // *************************************************************************** // Exception visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_exception_cdr_op_ci::be_visitor_exception_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_exception_cdr_op_ci::be_visitor_exception_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_exception (ctx) { } @@ -46,10 +42,12 @@ int be_visitor_exception_cdr_op_ci::visit_exception (be_exception *node) { // already generated and/or we are imported. Don't do anything. - if (node->cli_inline_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_inline_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp index fe2f0d85230..dee2cc2c137 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/cdr_op_cs.cpp @@ -18,16 +18,13 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_exception, + cdr_op_cs, + "$Id$") -#include "be_visitor_exception.h" -#include "be_visitor_field.h" - -ACE_RCSID(be_visitor_exception, cdr_op_cs, "$Id$") - -be_visitor_exception_cdr_op_cs::be_visitor_exception_cdr_op_cs (be_visitor_context *ctx) +be_visitor_exception_cdr_op_cs::be_visitor_exception_cdr_op_cs ( + be_visitor_context *ctx + ) : be_visitor_exception (ctx) { } @@ -39,21 +36,22 @@ be_visitor_exception_cdr_op_cs::~be_visitor_exception_cdr_op_cs (void) int be_visitor_exception_cdr_op_cs::visit_exception (be_exception *node) { - if (node->cli_stub_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_stub_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } - // set the substate as generating code for the types defined in our - // scope this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_exception_cdr_op_cs::" "visit_exception - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } diff --git a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp index 78725dac850..972f0f96a1b 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp @@ -19,13 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_exception.h" - -ACE_RCSID(be_visitor_exception, ctor_assign, "$Id$") - +ACE_RCSID (be_visitor_exception, + ctor_assign, + "$Id$") // ************************************************************************ // Used for the body of the assignment operator and the copy constructor. diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp index 8cc93857ca1..47d295c7a0f 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception.cpp @@ -18,12 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_exception.h" -#include "be_visitor_field.h" - ACE_RCSID (be_visitor_exception, exception, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp index ffeb80ca1ad..dc391fb8607 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp @@ -18,8 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_exception.h" #include "be_visitor_typecode/typecode_decl.h" ACE_RCSID (be_visitor_exception, diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp index 7f7a34758b1..c2c00f93335 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_exception.h" - -ACE_RCSID(be_visitor_exception, exception_ci, "$Id$") +ACE_RCSID (be_visitor_exception, + exception_ci, + "$Id$") // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp index 6e9cc86b544..39ed433879f 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp @@ -18,8 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_exception.h" #include "be_visitor_typecode/typecode_defn.h" ACE_RCSID (be_visitor_exception, diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp index db7cb836e3a..22b1331222f 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp @@ -18,21 +18,16 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_exception.h" - -ACE_RCSID(be_visitor_exception, exception_ctor, "$Id$") +ACE_RCSID (be_visitor_exception, + exception_ctor, + "$Id$") // ************************************************************************ // code to generate the special ctor // ************************************************************************ -be_visitor_exception_ctor::be_visitor_exception_ctor -(be_visitor_context *ctx) +be_visitor_exception_ctor::be_visitor_exception_ctor (be_visitor_context *ctx) : be_visitor_scope (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp index 1f6b4da4c00..ebcf725f544 100644 --- a/TAO/TAO_IDL/be/be_visitor_factory.cpp +++ b/TAO/TAO_IDL/be/be_visitor_factory.cpp @@ -10,786 +10,135 @@ // // = DESCRIPTION // Defines a factory that returns a specialized visitor object based on the -// code generation state. This factory creates all the commonly used -// visitors that are not affected by decisions such as whether we use -// compiled marshaling or interpretive marshaling. +// code generation state. This factory creates visitors associated with +// Asynchronous Messaging Invocations (AMI) since, because of implied IDL, +// state is not locally known at visitor creation time. // // = AUTHOR // Aniruddha Gokhale // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "ast_argument.h" #include "be_visitor_factory.h" - -#include "be_visitor_argument.h" -#include "be_visitor_array.h" -#include "be_visitor_attribute.h" -#include "be_visitor_constant.h" -#include "be_visitor_enum.h" -#include "be_visitor_exception.h" -#include "be_visitor_field.h" -#include "be_visitor_interface.h" -#include "be_visitor_interface_fwd.h" -#include "be_visitor_valuetype.h" -#include "be_visitor_valuetype_fwd.h" -#include "be_visitor_module.h" -#include "be_visitor_operation.h" -#include "be_visitor_root.h" -#include "be_visitor_sequence.h" -#include "be_visitor_structure.h" -#include "be_visitor_typecode.h" -#include "be_visitor_typedef.h" -#include "be_visitor_union.h" -#include "be_visitor_union_branch.h" - -ACE_RCSID(be, be_visitor_factory, "$Id$") - - - // The BASE abstract visitor factory - TAO_Visitor_Factory::TAO_Visitor_Factory (void) +#include "be_visitor_context.h" + +#include "be_visitor_decl.h" +#include "be_visitor_scope.h" +#include "be_visitor_interface/interface.h" +#include "be_visitor_interface/interface_ch.h" +#include "be_visitor_interface/ami_interface_ch.h" +#include "be_visitor_valuetype/valuetype.h" +#include "be_visitor_valuetype/valuetype_obv_ch.h" +#include "be_visitor_valuetype/valuetype_obv_cs.h" +#include "be_visitor_valuetype/ami_exception_holder_ch.h" +#include "be_visitor_valuetype/ami_exception_holder_cs.h" +#include "be_visitor_operation/operation.h" +#include "be_visitor_operation/operation_ch.h" +#include "be_visitor_operation/operation_cs.h" +#include "be_visitor_operation/ami_ch.h" +#include "be_visitor_operation/ami_cs.h" +#include "be_visitor_operation/ami_handler_reply_stub_operation_ch.h" +#include "be_visitor_operation/ami_handler_reply_stub_operation_cs.h" +#include "be_visitor_operation/ami_exception_holder_operation_cs.h" + +ACE_RCSID (be, + be_visitor_factory, + "$Id$") + + +TAO_Visitor_Factory::TAO_Visitor_Factory (void) { } -// destructor TAO_Visitor_Factory::~TAO_Visitor_Factory (void) { } -// The concrete visitor factory for visitors irrespective of the the marshaling -// approaches used. -// -// This common visitor factory also deals with a 2nd level of code-generation -// choices that the user has requested. This involves enabling/disabling -// support for specific type of kind, e.g., generation of TypeCodes or Any -// operators or Real C++ exception suport. -TAO_Common_Visitor_Factory::TAO_Common_Visitor_Factory (void) -{ -} - -// destructor -TAO_Common_Visitor_Factory::~TAO_Common_Visitor_Factory (void) -{ -} - be_visitor * -TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx) +TAO_Visitor_Factory::make_visitor (be_visitor_context *ctx) { - TAO_CodeGen::CG_STATE st = ctx->state (); - // create a new context so that ownership issues are not confused. This newly - // created context is a copy of what was sent by the caller. The newly - // created visitor will own this new copy. - be_visitor_context *new_ctx = ctx; - switch (st) - { - case TAO_CodeGen::TAO_ROOT_CH: - return new be_visitor_root_ch (new_ctx); - case TAO_CodeGen::TAO_ROOT_CI: - return new be_visitor_root_ci (new_ctx); - case TAO_CodeGen::TAO_ROOT_CS: - return new be_visitor_root_cs (new_ctx); - case TAO_CodeGen::TAO_ROOT_SH: - return new be_visitor_root_sh (new_ctx); - case TAO_CodeGen::TAO_ROOT_SI: - return new be_visitor_root_si (new_ctx); - case TAO_CodeGen::TAO_ROOT_SS: - return new be_visitor_root_ss (new_ctx); - case TAO_CodeGen::TAO_ROOT_IH: - return new be_visitor_root_ih (new_ctx); - case TAO_CodeGen::TAO_ROOT_IS: - return new be_visitor_root_is (new_ctx); - case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: - case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: - // this is the starting point for generation of all Any operators. If we - // have the any support enabled, then go ahead - if (be_global->any_support ()) - return new be_visitor_root_any_op (new_ctx); - else - // return a NO_OP visitor - return new be_visitor_decl (new_ctx); - - case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: - case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: - case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: - return new be_visitor_root_cdr_op (new_ctx); - - case TAO_CodeGen::TAO_MODULE_CH: - return new be_visitor_module_ch (new_ctx); - - case TAO_CodeGen::TAO_MODULE_SH: - return new be_visitor_module_sh (new_ctx); - - case TAO_CodeGen::TAO_MODULE_IH: - return new be_visitor_module_ih (new_ctx); - - case TAO_CodeGen::TAO_MODULE_CI: - case TAO_CodeGen::TAO_MODULE_CS: - case TAO_CodeGen::TAO_MODULE_SI: - case TAO_CodeGen::TAO_MODULE_SS: - case TAO_CodeGen::TAO_MODULE_IS: - return new be_visitor_module (new_ctx); - - case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: - case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: - return new be_visitor_module_any_op (new_ctx); - - case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: - case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: - case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: - return new be_visitor_module_cdr_op (new_ctx); + be_visitor *retval = 0; + switch (ctx->state ()) + { case TAO_CodeGen::TAO_INTERFACE_CH: - return new be_visitor_interface_ch (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_CI: - return new be_visitor_interface_ci (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_CS: - return new be_visitor_interface_cs (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_SH: - return new be_visitor_interface_sh (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_IH: - return new be_visitor_interface_ih (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_SI: - return new be_visitor_interface_si (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_SS: - return new be_visitor_interface_ss (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_IS: - return new be_visitor_interface_is (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: - return new be_visitor_interface_proxy_brokers_ch (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: - return new be_visitor_interface_base_proxy_broker_ch (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: - return new be_visitor_interface_remote_proxy_broker_ch (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: - return new be_visitor_interface_remote_proxy_broker_cs (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: - return new be_visitor_interface_strategized_proxy_broker_sh (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: - return new be_visitor_interface_strategized_proxy_broker_ss (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: - return new be_visitor_interface_proxy_impls_ch (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: - return new be_visitor_interface_base_proxy_impl_ch (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: - return new be_visitor_interface_remote_proxy_impl_ch (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: - return new be_visitor_interface_remote_proxy_impl_cs (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: - return new be_visitor_interface_thru_poa_proxy_impl_sh (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: - return new be_visitor_interface_thru_poa_proxy_impl_ss (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: - return new be_visitor_interface_direct_proxy_impl_sh (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: - return new be_visitor_interface_direct_proxy_impl_ss (new_ctx); - - // Old Collocation Stuff. - - case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: - return new be_visitor_interface_thru_poa_collocated_sh (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: - return new be_visitor_interface_thru_poa_collocated_ss (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: - return new be_visitor_interface_direct_collocated_sh (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: - return new be_visitor_interface_direct_collocated_ss (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: - return new be_visitor_interface_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: - return new be_visitor_interface_any_op_cs (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_TIE_SH: - return new be_visitor_interface_tie_sh (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_TIE_SI: - return new be_visitor_interface_tie_si (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: - return new be_visitor_interface_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: - return new be_visitor_interface_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: - return new be_visitor_interface_cdr_op_cs (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: - return new be_visitor_interface_smart_proxy_ch (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - return new be_visitor_interface_smart_proxy_cs (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: - return new be_visitor_interface_interceptors_ch (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: - return new be_visitor_interface_interceptors_cs (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: - return new be_visitor_interface_interceptors_sh (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: - return new be_visitor_interface_interceptors_ss (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_FWD_CH: - return new be_visitor_interface_fwd_ch (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_FWD_CI: - return new be_visitor_interface_fwd_ci (new_ctx); - - case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CH: - return new be_visitor_interface_fwd_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI: - return new be_visitor_interface_fwd_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CS: - return new be_visitor_decl (new_ctx); // noop - case TAO_CodeGen::TAO_INTERFACE_FWD_ANY_OP_CH: - return new be_visitor_interface_fwd_any_op_ch (new_ctx); - - // Valuetype-related visitors - - case TAO_CodeGen::TAO_VALUETYPE_CH: - return new be_visitor_valuetype_ch (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_CS: - return new be_visitor_valuetype_cs (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_CI: - return new be_visitor_valuetype_ci (new_ctx); - - case TAO_CodeGen::TAO_VALUETYPE_FWD_CH: - return new be_visitor_valuetype_fwd_ch (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_FWD_CI: - return new be_visitor_valuetype_fwd_ci (new_ctx); - - case TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CH: - return new be_visitor_valuetype_fwd_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CI: - return new be_visitor_valuetype_fwd_cdr_op_ci (new_ctx); - + ACE_NEW_RETURN (retval, + be_visitor_interface_ch (ctx), + 0); + break; case TAO_CodeGen::TAO_VALUETYPE_OBV_CH: - return new be_visitor_valuetype_obv_ch (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_OBV_CI: - return new be_visitor_valuetype_obv_ci (new_ctx); + ACE_NEW_RETURN (retval, + be_visitor_valuetype_obv_ch (ctx), + 0); + break; case TAO_CodeGen::TAO_VALUETYPE_OBV_CS: - return new be_visitor_valuetype_obv_cs (new_ctx); - - case TAO_CodeGen::TAO_FIELD_OBV_CH: - return new be_visitor_valuetype_field_ch (new_ctx); - - case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IMPL_CH: - case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IMPL_CS: - case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH: - case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_OBV_CH: - return new be_visitor_obv_operation_arglist (new_ctx); - - case TAO_CodeGen::TAO_MODULE_OBV_CH: - case TAO_CodeGen::TAO_MODULE_OBV_CI: - case TAO_CodeGen::TAO_MODULE_OBV_CS: - return new be_visitor_obv_module (new_ctx); - - case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH: - return new be_visitor_valuetype_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI: - return new be_visitor_valuetype_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS: - return new be_visitor_valuetype_cdr_op_cs (new_ctx); - - case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH: - return new be_visitor_valuetype_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS: - return new be_visitor_valuetype_any_op_cs (new_ctx); - - case TAO_CodeGen::TAO_VALUETYPE_INIT_CH: - return new be_visitor_valuetype_init_ch (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_INIT_CI: - return new be_visitor_valuetype_init_ci (new_ctx); - case TAO_CodeGen::TAO_VALUETYPE_INIT_CS: - return new be_visitor_valuetype_init_cs (new_ctx); - - case TAO_CodeGen::TAO_VALUETYPE_INIT_ARGLIST_CH: - return new be_visitor_valuetype_init_arglist_ch (new_ctx); - - case TAO_CodeGen::TAO_STRUCT_CH: - return new be_visitor_structure_ch (new_ctx); - case TAO_CodeGen::TAO_STRUCT_CS: - return new be_visitor_structure_cs (new_ctx); - case TAO_CodeGen::TAO_STRUCT_CI: - return new be_visitor_structure_ci (new_ctx); - case TAO_CodeGen::TAO_STRUCT_ANY_OP_CH: - return new be_visitor_structure_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_STRUCT_ANY_OP_CS: - return new be_visitor_structure_any_op_cs (new_ctx); - case TAO_CodeGen::TAO_STRUCT_CDR_OP_CH: - return new be_visitor_structure_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_STRUCT_CDR_OP_CI: - return new be_visitor_structure_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_STRUCT_CDR_OP_CS: - return new be_visitor_structure_cdr_op_cs (new_ctx); - - case TAO_CodeGen::TAO_CONSTANT_CH: - return new be_visitor_constant_ch (new_ctx); - case TAO_CodeGen::TAO_CONSTANT_CS: - return new be_visitor_constant_cs (new_ctx); - - case TAO_CodeGen::TAO_ENUM_CH: - return new be_visitor_enum_ch (new_ctx); - case TAO_CodeGen::TAO_ENUM_CS: - return new be_visitor_enum_cs (new_ctx); - case TAO_CodeGen::TAO_ENUM_ANY_OP_CH: - return new be_visitor_enum_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_ENUM_ANY_OP_CS: - return new be_visitor_enum_any_op_cs (new_ctx); - case TAO_CodeGen::TAO_ENUM_CDR_OP_CH: - return new be_visitor_enum_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_ENUM_CDR_OP_CI: - return new be_visitor_enum_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_ENUM_CDR_OP_CS: - return new be_visitor_decl (new_ctx); - - case TAO_CodeGen::TAO_FIELD_CH: - return new be_visitor_field_ch (new_ctx); - case TAO_CodeGen::TAO_FIELD_CS: - return new be_visitor_field_cs (new_ctx); - case TAO_CodeGen::TAO_FIELD_CI: - return new be_visitor_field_ci (new_ctx); - case TAO_CodeGen::TAO_FIELD_CDR_OP_CH: - return new be_visitor_field_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_FIELD_CDR_OP_CI: - return new be_visitor_field_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_FIELD_CDR_OP_CS: - return new be_visitor_field_cdr_op_cs (new_ctx); - - case TAO_CodeGen::TAO_UNION_CH: - return new be_visitor_union_ch (new_ctx); - case TAO_CodeGen::TAO_UNION_CI: - return new be_visitor_union_ci (new_ctx); - case TAO_CodeGen::TAO_UNION_CS: - return new be_visitor_union_cs (new_ctx); - case TAO_CodeGen::TAO_UNION_PUBLIC_CH: - return new be_visitor_union_branch_public_ch (new_ctx); - case TAO_CodeGen::TAO_UNION_PUBLIC_CI: - return new be_visitor_union_branch_public_ci (new_ctx); - case TAO_CodeGen::TAO_UNION_PUBLIC_CS: - return new be_visitor_union_branch_public_cs (new_ctx); - case TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS: - return new be_visitor_union_branch_public_assign_cs (new_ctx); - case TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS: - return new be_visitor_union_branch_public_reset_cs (new_ctx); - case TAO_CodeGen::TAO_UNION_PUBLIC_ACCESS_CS: - return new be_visitor_union_branch_public_access_cs (new_ctx); - case TAO_CodeGen::TAO_UNION_PRIVATE_CH: - return new be_visitor_union_branch_private_ch (new_ctx); - case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CH: - return new be_visitor_union_discriminant_ch (new_ctx); - case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CI: - return new be_visitor_union_discriminant_ci (new_ctx); - case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CS: - return new be_visitor_union_discriminant_cs (new_ctx); - case TAO_CodeGen::TAO_UNION_ANY_OP_CH: - return new be_visitor_union_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_UNION_ANY_OP_CS: + ACE_NEW_RETURN (retval, + be_visitor_valuetype_obv_cs (ctx), + 0); break; - case TAO_CodeGen::TAO_UNION_CDR_OP_CH: - return new be_visitor_union_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_UNION_CDR_OP_CI: - return new be_visitor_union_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_UNION_CDR_OP_CS: - return new be_visitor_union_cdr_op_cs (new_ctx); - case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CH: - return new be_visitor_union_branch_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CI: - return new be_visitor_union_branch_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CS: - return new be_visitor_union_branch_cdr_op_cs (new_ctx); - - case TAO_CodeGen::TAO_SEQUENCE_CH: - return new be_visitor_sequence_ch (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_CI: - return new be_visitor_sequence_ci (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_CS: - return new be_visitor_sequence_cs (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - return new be_visitor_sequence_base (new_ctx); - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: - return new be_visitor_sequence_elemtype (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH: - case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CI: - case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CS: - return new be_visitor_sequence_buffer_type (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CH: - return new be_visitor_sequence_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CS: - return new be_visitor_sequence_any_op_cs (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CH: - return new be_visitor_sequence_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI: - return new be_visitor_sequence_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS: - return new be_visitor_sequence_cdr_op_cs (new_ctx); - - case TAO_CodeGen::TAO_TYPEDEF_CH: - return new be_visitor_typedef_ch (new_ctx); - case TAO_CodeGen::TAO_TYPEDEF_CS: - return new be_visitor_typedef_cs (new_ctx); - case TAO_CodeGen::TAO_TYPEDEF_CI: - return new be_visitor_typedef_ci (new_ctx); - case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH: - return new be_visitor_typedef_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS: - return new be_visitor_typedef_any_op_cs (new_ctx); - case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH: - return new be_visitor_typedef_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI: - return new be_visitor_typedef_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS: - return new be_visitor_typedef_cdr_op_cs (new_ctx); - - case TAO_CodeGen::TAO_TYPECODE_DECL: - // Do we need TypeCode Support? - if (be_global->tc_support ()) - return new be_visitor_typecode_decl (new_ctx); - else - // return a NO_OP visitor - return new be_visitor_decl (new_ctx); - - case TAO_CodeGen::TAO_TYPECODE_DEFN: - // Do we need TypeCode Support? - if (be_global->tc_support ()) - return new be_visitor_typecode_defn (new_ctx); - else - // return a NO_OP visitor - return new be_visitor_decl (new_ctx); - - case TAO_CodeGen::TAO_ATTRIBUTE_CH: - case TAO_CodeGen::TAO_ATTRIBUTE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_SH: - case TAO_CodeGen::TAO_ATTRIBUTE_IH: - case TAO_CodeGen::TAO_ATTRIBUTE_SS: - case TAO_CodeGen::TAO_ATTRIBUTE_IS: - - case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH: - case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI: - - case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH: - case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS: - - case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH: - case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS: - - case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CH: - case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CS: - - case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH: - case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SH: - case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SS: - - case TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH: - case TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH: - case TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS: - case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS: - return new be_visitor_attribute (new_ctx); - - case TAO_CodeGen::TAO_EXCEPTION_CH: - return new be_visitor_exception_ch (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_CI: - return new be_visitor_exception_ci (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_CS: - return new be_visitor_exception_cs (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH: - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS: - return new be_visitor_exception_ctor (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS: - return new be_visitor_exception_ctor_assign (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH: - return new be_visitor_exception_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS: - return new be_visitor_exception_any_op_cs (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH: - return new be_visitor_exception_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI: - return new be_visitor_exception_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS: - return new be_visitor_exception_cdr_op_cs (new_ctx); - - case TAO_CodeGen::TAO_ARRAY_CH: - return new be_visitor_array_ch (new_ctx); - case TAO_CodeGen::TAO_ARRAY_CI: - return new be_visitor_array_ci (new_ctx); - case TAO_CodeGen::TAO_ARRAY_CS: - return new be_visitor_array_cs (new_ctx); - case TAO_CodeGen::TAO_ARRAY_ANY_OP_CH: - return new be_visitor_array_any_op_ch (new_ctx); - case TAO_CodeGen::TAO_ARRAY_ANY_OP_CS: - return new be_visitor_array_any_op_cs (new_ctx); - case TAO_CodeGen::TAO_ARRAY_CDR_OP_CH: - return new be_visitor_array_cdr_op_ch (new_ctx); - case TAO_CodeGen::TAO_ARRAY_CDR_OP_CI: - return new be_visitor_array_cdr_op_ci (new_ctx); - case TAO_CodeGen::TAO_ARRAY_CDR_OP_CS: - return new be_visitor_array_cdr_op_cs (new_ctx); - default: - // an error - return 0; - } - return 0; -} - -// The concrete visitor factory for operation visitors generating compiled -// stubs and skeletons - -TAO_Compiled_Visitor_Factory::TAO_Compiled_Visitor_Factory (void) -{ -} - -// destructor -TAO_Compiled_Visitor_Factory::~TAO_Compiled_Visitor_Factory (void) -{ -} - -be_visitor * -TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) -{ - TAO_CodeGen::CG_STATE st = ctx->state (); - // create a new context so that ownership issues are not confused. This newly - // created context is a copy of what was sent by the caller. The newly - // created visitor will own this new copy. - be_visitor_context *new_ctx = ctx; - - switch (st) - { - case TAO_CodeGen::TAO_UNION_ANY_OP_CS: - return new be_visitor_union_any_op_cs (new_ctx); case TAO_CodeGen::TAO_OPERATION_CH: - return new be_visitor_operation_ch (new_ctx); + ACE_NEW_RETURN (retval, + be_visitor_operation_ch (ctx), + 0); + break; case TAO_CodeGen::TAO_OPERATION_CS: - return new be_visitor_operation_cs (new_ctx); - case TAO_CodeGen::TAO_OPERATION_SH: - return new be_visitor_operation_sh (new_ctx); - case TAO_CodeGen::TAO_OPERATION_SS: - return new be_visitor_operation_ss (new_ctx); - case TAO_CodeGen::TAO_OPERATION_IS: - return new be_visitor_operation_is (new_ctx); - case TAO_CodeGen::TAO_OPERATION_IH: - return new be_visitor_operation_ih (new_ctx); - case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH: - return new be_visitor_operation_thru_poa_collocated_sh (new_ctx); - case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS: - return new be_visitor_operation_thru_poa_collocated_ss (new_ctx); - case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH: - return new be_visitor_operation_direct_collocated_sh (new_ctx); - case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS: - return new be_visitor_operation_direct_collocated_ss (new_ctx); - case TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH: - return new be_visitor_operation_smart_proxy_ch (new_ctx); - case TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS: - return new be_visitor_operation_smart_proxy_cs (new_ctx); - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH: - return new be_visitor_operation_interceptors_ch (new_ctx); - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS: - return new be_visitor_operation_interceptors_cs (new_ctx); - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH: - return new be_visitor_operation_interceptors_sh (new_ctx); - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS: - return new be_visitor_operation_interceptors_ss (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH: - return new be_visitor_operation_base_proxy_impl_ch (new_ctx); - case TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH: - return new be_visitor_operation_proxy_impl_xh (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS: - return new be_visitor_operation_remote_proxy_impl_cs (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS: - return new be_visitor_operation_thru_poa_proxy_impl_ss (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS: - return new be_visitor_operation_direct_proxy_impl_ss (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH: - case TAO_CodeGen::TAO_OPERATION_RETTYPE_SH: - case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS: - return new be_visitor_operation_rettype (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_RETTYPE_CH: - return new be_visitor_operation_interceptors_info_rettype (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - return new be_visitor_operation_rettype_vardecl_cs (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS: - return new be_visitor_operation_rettype_pre_invoke_cs (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS: - return new be_visitor_operation_rettype_marshal_ss (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - return new be_visitor_operation_rettype_return_cs (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS: - return new be_visitor_operation_exceptlist_cs (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_EXCEPTLIST: - return new be_visitor_operation_interceptors_exceptlist (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - return new be_visitor_operation_rettype_vardecl_ss (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS: - return new be_visitor_operation_rettype_marshal_ss (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - return new be_visitor_operation_rettype_assign_ss (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH: - case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH: - case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH: - case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS: - case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH: - case TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS: - - case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH: - case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH: - case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS: - return new be_visitor_operation_arglist (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CH: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CS: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CH: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CS: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_CS: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SH: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SS: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SH: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SS: - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_SS: - return new be_visitor_operation_interceptors_arglist (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT: - return new be_visitor_operation_interceptors_result (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS: - case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS: - case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: - case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS: - case TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS: - case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS: - return new be_visitor_operation_argument (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS: - case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: - return new be_visitor_operation_argument_marshal (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_TIE_SH: - return new be_visitor_operation_tie_sh (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_TIE_SI: - return new be_visitor_operation_tie_si (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS: - return new be_visitor_operation_argument_invoke (new_ctx); - - case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH: - case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_SH: - case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS: - return new be_visitor_args_arglist (new_ctx); - - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CH: - return new be_visitor_args_request_info_ch (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_CH: - return new be_visitor_args_request_info_arglist (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CS: - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_CS: - return new be_visitor_args_request_info_cs (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_PARAMLIST: - return new be_visitor_args_paramlist (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_RESULT: - return new be_visitor_args_request_info_result (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_SH: - return new be_visitor_args_request_info_sh (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_SS: - case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_SS: - return new be_visitor_args_request_info_ss (new_ctx); - - case TAO_CodeGen::TAO_ARGUMENT_PRE_INVOKE_CS: - return new be_visitor_args_pre_invoke_cs (new_ctx); - - case TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS: - return new be_visitor_args_invoke_cs (new_ctx); - - case TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS: - return new be_visitor_args_post_invoke_cs (new_ctx); - - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - return new be_visitor_args_vardecl_ss (new_ctx); - - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - case TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS: - return new be_visitor_args_upcall_ss (new_ctx); - - case TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS: - case TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS: - return new be_visitor_args_marshal_ss (new_ctx); - - // AMI next generation visitors. + ACE_NEW_RETURN (retval, + be_visitor_operation_cs (ctx), + 0); + break; case TAO_CodeGen::TAO_AMI_INTERFACE_CH: - return new be_visitor_ami_interface_ch (new_ctx); - + ACE_NEW_RETURN (retval, + be_visitor_ami_interface_ch (ctx), + 0); + break; case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH: - return new be_visitor_operation_ami_handler_reply_stub_operation_ch (new_ctx); - + ACE_NEW_RETURN ( + retval, + be_visitor_operation_ami_handler_reply_stub_operation_ch (ctx), + 0 + ); + break; case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS: - return new be_visitor_operation_ami_handler_reply_stub_operation_cs (new_ctx); - + ACE_NEW_RETURN ( + retval, + be_visitor_operation_ami_handler_reply_stub_operation_cs (ctx), + 0 + ); + break; case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH: - return new be_visitor_operation_ami_ch (new_ctx); - + ACE_NEW_RETURN (retval, + be_visitor_operation_ami_ch (ctx), + 0); + break; case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS: - return new be_visitor_operation_ami_cs (new_ctx); - + ACE_NEW_RETURN (retval, + be_visitor_operation_ami_cs (ctx), + 0); + break; case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS: - return new be_visitor_operation_ami_exception_holder_operation_cs (new_ctx); - + ACE_NEW_RETURN ( + retval, + be_visitor_operation_ami_exception_holder_operation_cs (ctx), + 0 + ); + break; case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH: - return new be_visitor_valuetype_ami_exception_holder_ch (new_ctx); - + ACE_NEW_RETURN (retval, + be_visitor_valuetype_ami_exception_holder_ch (ctx), + 0); + break; case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS: - return new be_visitor_valuetype_ami_exception_holder_cs (new_ctx); - - // AMH ResponseHandler class visitors - case TAO_CodeGen::TAO_INTERFACE_AMH_RH_CH: - return new be_visitor_amh_rh_interface_sh (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SH: - return new be_visitor_amh_rh_interface_sh (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SS: - return new be_visitor_amh_rh_interface_ss (new_ctx); - case TAO_CodeGen::TAO_OPERATION_AMH_RH_SH: - return new be_visitor_amh_rh_operation_sh (new_ctx); - case TAO_CodeGen::TAO_OPERATION_AMH_RH_SS: - return new be_visitor_amh_rh_operation_ss (new_ctx); - + ACE_NEW_RETURN (retval, + be_visitor_valuetype_ami_exception_holder_cs (ctx), + 0); + break; default: - // cannot handle it; delegate it to the common visitor factory - return TAO_COMMON_VISITOR_FACTORY::instance ()->make_visitor (ctx); + // An error. + return 0; } + + return retval; } + diff --git a/TAO/TAO_IDL/be/be_visitor_field.cpp b/TAO/TAO_IDL/be/be_visitor_field.cpp index b219838d510..4e7c67ef3c0 100644 --- a/TAO/TAO_IDL/be/be_visitor_field.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field.cpp @@ -17,13 +17,29 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_type.h" +#include "be_field.h" +#include "be_array.h" +#include "be_typedef.h" +#include "be_enum.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_predefined_type.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_union.h" +#include "be_helper.h" +#include "utl_identifier.h" #include "be_visitor_field.h" +#include "be_visitor_array.h" +#include "be_visitor_structure.h" +#include "be_visitor_union.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_field/field_ch.cpp" #include "be_visitor_field/field_ci.cpp" #include "be_visitor_field/field_cs.cpp" @@ -31,4 +47,6 @@ #include "be_visitor_field/cdr_op_ci.cpp" #include "be_visitor_field/cdr_op_cs.cpp" -ACE_RCSID(be, be_visitor_field, "$Id$") +ACE_RCSID (be, + be_visitor_field, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp index 80be47544f2..39808029877 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ch.cpp @@ -18,10 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_field.h" #include "be_visitor_array/cdr_op_ch.h" #include "be_visitor_enum/cdr_op_ch.h" #include "be_visitor_sequence/cdr_op_ch.h" @@ -30,7 +26,9 @@ #include "be_visitor_union/union.h" #include "be_visitor_union/cdr_op_ch.h" -ACE_RCSID(be_visitor_field, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_field, + cdr_op_ch, + "$Id$") // ********************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp index 1c661538b90..6f98b8d346f 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp @@ -18,10 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_field.h" #include "be_visitor_array/cdr_op_ci.h" #include "be_visitor_enum/cdr_op_ci.h" #include "be_visitor_sequence/cdr_op_ci.h" diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp index d0b4c202d7c..a5f4f2f35da 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp @@ -18,10 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_field.h" #include "be_visitor_array/cdr_op_cs.h" #include "be_visitor_sequence/cdr_op_cs.h" #include "be_visitor_structure/cdr_op_cs.h" diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp index b78a2221f4a..ff4ba91daa7 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp @@ -18,15 +18,8 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_field.h" -#include "be_visitor_array.h" #include "be_visitor_enum/enum_ch.h" #include "be_visitor_sequence/sequence_ch.h" -#include "be_visitor_structure.h" -#include "be_visitor_union.h" ACE_RCSID (be_visitor_field, field_ch, diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp index a05860634cf..027f32549d7 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ci.cpp @@ -18,10 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_field.h" #include "be_visitor_array/array_ci.h" #include "be_visitor_sequence/sequence_ci.h" #include "be_visitor_structure/structure_ci.h" diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp index da377a69e0a..a0ba3f62432 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_cs.cpp @@ -18,10 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_field.h" #include "be_visitor_array/array_cs.h" #include "be_visitor_enum/enum_cs.h" #include "be_visitor_sequence/sequence_cs.h" diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp index ce1cfefe2a5..114bd739a14 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp @@ -16,13 +16,33 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_interface.h" +#include "be_attribute.h" +#include "be_constant.h" +#include "be_enum.h" +#include "be_exception.h" +#include "be_operation.h" +#include "be_structure.h" +#include "be_union.h" +#include "be_typedef.h" +#include "be_predefined_type.h" +#include "be_helper.h" +#include "be_extern.h" +#include "be_argument.h" +#include "utl_identifier.h" #include "be_visitor_interface.h" +#include "be_visitor_interface.h" +#include "be_visitor_attribute.h" +#include "be_visitor_constant.h" +#include "be_visitor_enum.h" +#include "be_visitor_exception.h" +#include "be_visitor_structure.h" +#include "be_visitor_typedef.h" +#include "be_visitor_union.h" +#include "be_visitor_operation.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_interface/interface.cpp" #include "be_visitor_interface/interface_ch.cpp" #include "be_visitor_interface/interface_ci.cpp" @@ -76,4 +96,6 @@ #include "be_visitor_interface/amh_rh_ss.cpp" #include "be_visitor_interface/amh_rh_sh.cpp" -ACE_RCSID(be, be_visitor_interface, "$Id$") +ACE_RCSID (be, + be_visitor_interface, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp index cc633dc5b03..9fd8308f80d 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp @@ -11,14 +11,13 @@ */ //============================================================================= -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + amh_ch, + "$Id$") -ACE_RCSID(be_visitor_amh_interface, interface, "$Id$") - -be_visitor_amh_interface_ch::be_visitor_amh_interface_ch (be_visitor_context *ctx) +be_visitor_amh_interface_ch::be_visitor_amh_interface_ch ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_sh.cpp index f7c3359823c..edd83a64f1c 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_sh.cpp @@ -11,15 +11,14 @@ */ //============================================================================= -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - -#include "be_visitor_operation/amh_rh_sh.h" - -be_visitor_amh_rh_interface_sh::be_visitor_amh_rh_interface_sh -(be_visitor_context *ctx): be_visitor_interface_sh (ctx) +ACE_RCSID (be_visitor_interface, + amh_rh_ss, + "$Id$") + +be_visitor_amh_rh_interface_sh::be_visitor_amh_rh_interface_sh ( + be_visitor_context *ctx + ) + : be_visitor_interface_sh (ctx) { } @@ -46,12 +45,14 @@ be_visitor_amh_rh_interface_sh::visit_interface (be_interface *node) ACE_CString rh_base_class_name = node->local_name (); // ...and prepend either the "TAO_" prefix... ACE_CString rh_skel_class_name = "TAO_"; + if (!node->is_nested ()) { // ...or the "POA_TAO_" prefix if we are in the global // namespace.... rh_skel_class_name = "POA_TAO_"; } + rh_skel_class_name += rh_base_class_name.c_str (); *os << "class " << rh_skel_class_name.c_str () << ";" << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp index b5840ed3f26..a2b2d5a8c4c 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_rh_ss.cpp @@ -11,14 +11,13 @@ */ //============================================================================= -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_interface, + amh_rh_ss, + "$Id$") -#include "be_visitor_interface.h" -#include "be_visitor_operation/amh_rh_ss.h" - -be_visitor_amh_rh_interface_ss::be_visitor_amh_rh_interface_ss (be_visitor_context *ctx) +be_visitor_amh_rh_interface_ss::be_visitor_amh_rh_interface_ss ( + be_visitor_context *ctx + ) : be_visitor_interface_ss (ctx) { } @@ -38,7 +37,9 @@ int be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node) { if (node->srv_skel_gen () || node->imported ()) - return 0; + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); @@ -52,7 +53,7 @@ be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node) node->compute_full_name (rh_skel_prefix.c_str(), "", buf); ACE_CString rh_skel_full_scope_name ("POA_"); rh_skel_full_scope_name += buf; - delete[] buf; + delete [] buf; ACE_CString rh_skel_class_name_prefix (rh_skel_prefix.c_str ()); if (!node->is_nested ()) diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp index 5b7ff0cf05b..375e648e774 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp @@ -11,12 +11,9 @@ */ //============================================================================= -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" -#include "be_visitor_operation.h" +ACE_RCSID (be_visitor_interface, + amh_sh, + "$Id$") be_visitor_amh_interface_sh::be_visitor_amh_interface_sh ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp index a8a079ffe3e..8f33e20956a 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp @@ -10,14 +10,13 @@ */ //============================================================================= -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_interface, + amh_ss, + "$Id$") -#include "be_visitor_interface.h" -#include "be_visitor_operation.h" - -be_visitor_amh_interface_ss::be_visitor_amh_interface_ss (be_visitor_context *ctx) +be_visitor_amh_interface_ss::be_visitor_amh_interface_ss ( + be_visitor_context *ctx + ) : be_visitor_interface_ss (ctx) { } @@ -45,7 +44,9 @@ be_visitor_amh_interface_ss::visit_interface (be_interface *node) { // Do not generate AMH classes for any sort of implied IDL. if (node->original_interface () != 0) - return 0; + { + return 0; + } return be_visitor_interface_ss::visit_interface (node); } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp index ba0bc444b7e..a82c25a2dae 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_interface_ch.cpp @@ -19,20 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, ami_interface_ch, "$Id$") - +ACE_RCSID (be_visitor_interface, + ami_interface_ch, + "$Id$") // ****************************************************** // Interface visitor for client header // ****************************************************** -be_visitor_ami_interface_ch::be_visitor_ami_interface_ch (be_visitor_context *ctx) +be_visitor_ami_interface_ch::be_visitor_ami_interface_ch ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } @@ -55,7 +52,6 @@ be_visitor_ami_interface_ch::visit_interface (be_interface *node) // Grab the stream. TAO_OutStream *os = this->ctx_->stream (); - os->gen_ifdef_macro (node->replacement ()->flat_name (), "_ptr"); // Forward declaration. diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp index 4553825bd74..cb532488e1e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp @@ -19,13 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, any_op_ch, "$Id$") +ACE_RCSID (be_visitor_interface, + any_op_ch, + "$Id$") // *************************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp index 0791620c497..677050637b0 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp @@ -17,13 +17,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, any_op_cs, "$Id$") +ACE_RCSID (be_visitor_interface, + any_op_cs, + "$Id$") // *************************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp index 67068688a0d..dd31ed71f79 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_broker_ch.cpp @@ -1,37 +1,39 @@ //$Id$ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_interface, + base_proxy_broker_ch, + "$Id$") -#include "be_visitor_interface.h" - -ACE_RCSID (be_visitor_interface, base_proxy_broker_ch, "$Id$") - -be_visitor_interface_base_proxy_broker_ch::be_visitor_interface_base_proxy_broker_ch (be_visitor_context *ctx) +be_visitor_interface_base_proxy_broker_ch:: +be_visitor_interface_base_proxy_broker_ch (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_base_proxy_broker_ch::~be_visitor_interface_base_proxy_broker_ch (void) +be_visitor_interface_base_proxy_broker_ch:: +~be_visitor_interface_base_proxy_broker_ch (void) { // No-Op. } int -be_visitor_interface_base_proxy_broker_ch::visit_interface (be_interface *node) +be_visitor_interface_base_proxy_broker_ch::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Base Proxy Broker Declaration " << be_nl << "//" << be_nl << be_nl; // Generate the class declaration. os->indent (); + *os << "class " << be_global->stub_export_macro () << " " << node->base_proxy_broker_name () << be_nl << "{" << be_nl << "public:" diff --git a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp index 3fab08b2919..21ed2aa4263 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp @@ -1,21 +1,21 @@ -//$Id$ +// +// $Id$ +// -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_interface, + base_proxy_impl_ch, + "$Id$") -#include "be_visitor_interface.h" - -ACE_RCSID (be_visitor_interface, base_proxy_impl_ch, "$Id$") - -be_visitor_interface_base_proxy_impl_ch::be_visitor_interface_base_proxy_impl_ch (be_visitor_context *ctx) +be_visitor_interface_base_proxy_impl_ch:: +be_visitor_interface_base_proxy_impl_ch (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_base_proxy_impl_ch::~be_visitor_interface_base_proxy_impl_ch (void) +be_visitor_interface_base_proxy_impl_ch:: +~be_visitor_interface_base_proxy_impl_ch (void) { // No-Op. } @@ -28,7 +28,8 @@ be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node) // os->indent (); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Base Proxy Impl. Declaration" << be_nl << "//" << be_nl << be_nl; @@ -76,7 +77,8 @@ be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_base_proxy_impl_ch::" "visit_interface - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << be_uidt_nl; @@ -91,5 +93,6 @@ be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node) << "// End Base Proxy Impl. Declaration" << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << be_nl; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp index 5c1b9c100c6..75bc62dab06 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ch.cpp @@ -19,20 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_interface, + cdr_op_ch, + "$Id$") // *************************************************************************** // Interface visitor for generating CDR operator declarations in the client header // *************************************************************************** -be_visitor_interface_cdr_op_ch::be_visitor_interface_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_interface_cdr_op_ch::be_visitor_interface_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } @@ -45,15 +42,16 @@ int be_visitor_interface_cdr_op_ch::visit_interface (be_interface *node) { // No CDR operations for locality constraint interfaces. - if (node->cli_hdr_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_hdr_cdr_op_gen () || node->imported () || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator declarations + // Generate the CDR << and >> operator declarations. os->indent (); + *os << be_global->stub_export_macro () << " CORBA::Boolean " << "operator<< (TAO_OutputCDR &, const " << node->full_name () << "_ptr );" << be_nl; @@ -61,20 +59,18 @@ be_visitor_interface_cdr_op_ch::visit_interface (be_interface *node) << "operator>> (TAO_InputCDR &, " << node->full_name () << "_ptr &);\n"; - - // set the substate as generating code for the types defined in our scope + // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_cdr_op_ch::" "visit_interface - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } - node->cli_hdr_cdr_op_gen (1); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp index ac2d4b52d17..da9d79e98d0 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_ci.cpp @@ -18,21 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, cdr_op_ci, "$Id$") +ACE_RCSID (be_visitor_interface, + cdr_op_ci, + "$Id$") // *************************************************************************** // Interface visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_interface_cdr_op_ci::be_visitor_interface_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_interface_cdr_op_ci::be_visitor_interface_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp index f3c743a6dfa..f1dc99bcad1 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/cdr_op_cs.cpp @@ -18,16 +18,13 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_interface, + cdr_op_cs, + "$Id$") -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, cdr_op_cs, "$Id$") - -be_visitor_interface_cdr_op_cs::be_visitor_interface_cdr_op_cs -(be_visitor_context *ctx) +be_visitor_interface_cdr_op_cs::be_visitor_interface_cdr_op_cs ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } @@ -50,6 +47,7 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); + // Visit the scope and generate code. if (this->visit_scope (node) == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp index fa2aebe35da..cc3a5b0470e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp @@ -19,37 +19,38 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, direct_collocated_sh, "$Id$") +ACE_RCSID (be_visitor_interface, + direct_collocated_sh, + "$Id$") // ************************************************************ // direct_collocated class in header // ************************************************************ -be_visitor_interface_direct_collocated_sh::be_visitor_interface_direct_collocated_sh -(be_visitor_context *ctx) +be_visitor_interface_direct_collocated_sh:: +be_visitor_interface_direct_collocated_sh (be_visitor_context *ctx) : be_visitor_interface (ctx) { } -be_visitor_interface_direct_collocated_sh::~be_visitor_interface_direct_collocated_sh (void) +be_visitor_interface_direct_collocated_sh:: +~be_visitor_interface_direct_collocated_sh (void) { } -int be_visitor_interface_direct_collocated_sh::visit_interface (be_interface *node) +int be_visitor_interface_direct_collocated_sh::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); - os->gen_ifdef_macro (node->flat_name (), "_direct_collocated"); + os->gen_ifdef_macro (node->flat_name (), + "_direct_collocated"); - // output the class defn + // Output the class definition. os->indent (); + *os << "class " << be_global->skel_export_macro () << " " << node->local_coll_name (be_interface::DIRECT); @@ -65,13 +66,17 @@ int be_visitor_interface_direct_collocated_sh::visit_interface (be_interface *no be_interface* parent = be_interface::narrow_from_decl (node->inherits()[i]); *os << be_nl << ", public virtual " - << be_interface::relative_name (parent->full_coll_name (be_interface::DIRECT), - node->full_coll_name (be_interface::DIRECT)); + << be_interface::relative_name ( + parent->full_coll_name (be_interface::DIRECT), + node->full_coll_name (be_interface::DIRECT) + ); } } + *os << be_uidt << be_uidt_nl << "{" << be_nl << "public:\n"; + os->incr_indent (); *os << node->local_coll_name (be_interface::DIRECT) << " (\n"; @@ -91,10 +96,12 @@ int be_visitor_interface_direct_collocated_sh::visit_interface (be_interface *no << " servant," << be_nl; *os << "TAO_Stub *stub\n"; + os->decr_indent (); + *os << ");\n"; - os->decr_indent (0); + os->decr_indent (0); os->indent (); *os << "virtual CORBA::Boolean _is_a" << be_idt @@ -133,18 +140,22 @@ int be_visitor_interface_direct_collocated_sh::visit_interface (be_interface *no os->decr_indent (); *os << be_nl << "private:\n"; + os->incr_indent (); + if (!node->is_nested ()) { // The skeleton name is the outermost, we need to printout the // POA_ prefix that goes with it. *os << "POA_"; } + *os << node->local_name () << "_ptr servant_;\n"; + os->decr_indent (); + *os << "};\n\n"; os->gen_endif (); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp index 1d9bb2bb34f..8f93aac56e1 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp @@ -19,36 +19,36 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, direct_collocated_ss, "$Id$") +ACE_RCSID (be_visitor_interface, + direct_collocated_ss, + "$Id$") // ************************************************************ // be_visitor_interface_collacted_ss // ************************************************************ -be_visitor_interface_direct_collocated_ss::be_visitor_interface_direct_collocated_ss -(be_visitor_context *ctx) +be_visitor_interface_direct_collocated_ss:: +be_visitor_interface_direct_collocated_ss (be_visitor_context *ctx) : be_visitor_interface (ctx) { } -be_visitor_interface_direct_collocated_ss::~be_visitor_interface_direct_collocated_ss (void) +be_visitor_interface_direct_collocated_ss:: +~be_visitor_interface_direct_collocated_ss (void) { } -int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *node) +int be_visitor_interface_direct_collocated_ss::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); os->indent (); + *os << node->full_coll_name (be_interface::DIRECT) << "::" << node->local_coll_name (be_interface::DIRECT) << " (\n"; @@ -66,12 +66,13 @@ int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *no if (node->is_nested ()) { - be_decl* scope = be_scope::narrow_from_scope (node->defined_in ())->decl (); + be_decl* scope = + be_scope::narrow_from_scope (node->defined_in ())->decl (); *os << ": ACE_NESTED_CLASS (" - << scope->name () << "," - << node->local_name () - << ") ()" << be_nl; + << scope->name () << "," + << node->local_name () + << ") ()" << be_nl; } else { @@ -81,7 +82,10 @@ int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *no // @@ We should call the constructor for all base classes, since we // are using multiple inheritance. - if (node->traverse_inheritance_graph (be_visitor_interface_direct_collocated_ss::collocated_ctor_helper, os) + if (node->traverse_inheritance_graph ( + be_visitor_interface_direct_collocated_ss::collocated_ctor_helper, + os + ) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -101,14 +105,16 @@ int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *no os->indent (); // Generate _is_a implementation. - *os << "CORBA::Boolean " << node->full_coll_name (be_interface::DIRECT) << "::" + *os << "CORBA::Boolean " << node->full_coll_name (be_interface::DIRECT) + << "::" << "_is_a" << be_idt << "(" << be_idt_nl << "const CORBA::Char *logical_type_id" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl << ")" << be_uidt_nl << be_nl; *os << "{" << be_idt_nl - << "return this->servant_->_is_a (logical_type_id ACE_ENV_ARG_PARAMETER);" + << "return this->servant_->_is_a (" + << "logical_type_id ACE_ENV_ARG_PARAMETER);" << be_uidt_nl << "}\n\n" << be_uidt_nl; @@ -123,6 +129,7 @@ int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *no << "if (result != 0)" << be_nl << " return result;" << be_nl; *os << "return this->"; + if (!node->is_nested ()) { *os << node->name (); @@ -136,6 +143,7 @@ int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *no << node->local_name () << ")"; } + *os << "::_tao_QueryInterface (type);" << be_uidt_nl << "}\n" << be_nl; @@ -144,21 +152,27 @@ int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *no << node->full_coll_name (be_interface::DIRECT) << "::" << "_get_servant (void) const\n" << "{\n"; + os->incr_indent (); + *os << "return this->servant_;\n"; + os->decr_indent (); + *os << "}\n\n"; os->indent (); // Generate _non_existent implementation. - *os << "CORBA::Boolean " << node->full_coll_name (be_interface::DIRECT) << "::" + *os << "CORBA::Boolean " << node->full_coll_name (be_interface::DIRECT) + << "::" << "_non_existent" << be_idt << "(" << be_idt_nl << "ACE_ENV_SINGLE_ARG_DECL" << be_uidt_nl << ")" << be_uidt_nl << be_nl; *os << "{" << be_idt_nl - << "return this->servant_->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);" + << "return this->servant_->_non_existent (" + << "ACE_ENV_SINGLE_ARG_PARAMETER);" << be_uidt_nl << "}\n\n" << be_uidt_nl; @@ -175,19 +189,24 @@ int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *no } int -be_visitor_interface_direct_collocated_ss::collocated_ctor_helper (be_interface *derived, - be_interface *base, - TAO_OutStream *os) +be_visitor_interface_direct_collocated_ss::collocated_ctor_helper ( + be_interface *derived, + be_interface *base, + TAO_OutStream *os + ) { if (derived == base) - // we are the same. Don't do anything, otherwise we will end up calling - // ourself - return 0; + { + // We are the same. Don't do anything, otherwise we will end up calling + // ourself. + return 0; + } if (base->is_nested ()) { be_decl *scope; scope = be_scope::narrow_from_scope (base->defined_in ())->decl (); + *os << be_nl << ", " << "ACE_NESTED_CLASS (POA_" << scope->name () << "," diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp index 877a0abbf10..81a1c0b8f5f 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_sh.cpp @@ -1,44 +1,49 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +// +// $Id$ +// -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + direct_proxy_impl_sh, + "$Id$") -ACE_RCSID (be_visitor_interface, direct_proxy_broker_impl_sh, "$Id$") - -be_visitor_interface_direct_proxy_impl_sh::be_visitor_interface_direct_proxy_impl_sh (be_visitor_context *ctx) +be_visitor_interface_direct_proxy_impl_sh:: +be_visitor_interface_direct_proxy_impl_sh (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } - -be_visitor_interface_direct_proxy_impl_sh::~be_visitor_interface_direct_proxy_impl_sh (void) +be_visitor_interface_direct_proxy_impl_sh:: +~be_visitor_interface_direct_proxy_impl_sh (void) { // No-Op. } int -be_visitor_interface_direct_proxy_impl_sh::visit_interface (be_interface *node) +be_visitor_interface_direct_proxy_impl_sh::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); - // os->gen_ifdef_macro (node->flat_name (), "DIRECT_PROXY_IMPL_"); os->decr_indent (0); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Direct Impl. Declaration" << be_nl << "//" << be_nl << be_nl; // Generate Class Declaration. *os << "class " << be_global->skel_export_macro () << " " << node->direct_proxy_impl_name (); - *os << " : " << be_idt_nl << "public virtual " << node->full_base_proxy_impl_name () + *os << " : " << be_idt_nl << "public virtual " + << node->full_base_proxy_impl_name () << "," << be_nl << "public virtual " << "TAO_Direct_Object_Proxy_Impl"; if (node->n_inherits () > 0) { *os << "," << be_nl; + for (int i = 0; i < node->n_inherits (); i++) { be_interface *inherited = @@ -46,13 +51,14 @@ be_visitor_interface_direct_proxy_impl_sh::visit_interface (be_interface *node) *os << "public virtual "; *os << inherited->full_direct_proxy_impl_name (); - if (i < node->n_inherits () - 1) // node is the case of multiple - // inheritance, so put a comma + + if (i < node->n_inherits () - 1) { *os << ", "; } + *os << be_nl; - } // end of for loop + } } *os << be_uidt_nl; @@ -69,7 +75,8 @@ be_visitor_interface_direct_proxy_impl_sh::visit_interface (be_interface *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) direct_proxy_impl_sh::" "visit_interface - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << "};" << be_uidt << be_nl << be_nl; @@ -78,7 +85,6 @@ be_visitor_interface_direct_proxy_impl_sh::visit_interface (be_interface *node) << "// Direct Proxy Impl. Declaration" << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << be_nl; - // os->gen_endif (); - return 0; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp index 1572fc0390b..0543958e25e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_proxy_impl_ss.cpp @@ -1,47 +1,45 @@ +// //$Id$ +// -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_interface, + direct_proxy_impl_ss, + "$Id$") -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, direct_proxy_impl_ss, "$Id$") - -be_visitor_interface_direct_proxy_impl_ss::be_visitor_interface_direct_proxy_impl_ss (be_visitor_context *ctx) +be_visitor_interface_direct_proxy_impl_ss:: +be_visitor_interface_direct_proxy_impl_ss (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_direct_proxy_impl_ss::~be_visitor_interface_direct_proxy_impl_ss (void) +be_visitor_interface_direct_proxy_impl_ss:: +~be_visitor_interface_direct_proxy_impl_ss (void) { // No-Op. } int -be_visitor_interface_direct_proxy_impl_ss::visit_interface (be_interface *node) +be_visitor_interface_direct_proxy_impl_ss::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); os->indent (); + *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Direct Proxy Implementation" << be_nl << "//" << be_nl << be_nl; - // Ctor Implementation *os << node->full_direct_proxy_impl_name () << "::" << node->direct_proxy_impl_name () << " (void)" << be_nl << "{}" << be_nl << be_nl; - /* - // Dtor Implementation - *os << node->full_direct_proxy_impl_name () << "::" - << "~" << node->direct_proxy_impl_name () << " (void)" - << be_nl << "{}" << be_nl << be_nl; - */ + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -56,5 +54,6 @@ be_visitor_interface_direct_proxy_impl_ss::visit_interface (be_interface *node) << "// End Direct Proxy Implementation" << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ch.cpp index 1976a1499ab..1c62595a748 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ch.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, interceptors_ch, "$Id$") +ACE_RCSID (be_visitor_interface, + interceptors_ch, + "$Id$") // ************************************************************ @@ -32,13 +28,16 @@ ACE_RCSID(be_visitor_interface, interceptors_ch, "$Id$") // ************************************************************ -be_visitor_interface_interceptors_ch::be_visitor_interface_interceptors_ch -(be_visitor_context *ctx) +be_visitor_interface_interceptors_ch::be_visitor_interface_interceptors_ch ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } -be_visitor_interface_interceptors_ch::~be_visitor_interface_interceptors_ch (void) +be_visitor_interface_interceptors_ch::~be_visitor_interface_interceptors_ch ( + void + ) { } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_cs.cpp index b5cc2b9adc7..38632e5f43d 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_cs.cpp @@ -18,34 +18,33 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, interceptors_cs, "$Id$") - +ACE_RCSID (be_visitor_interface, + interceptors_cs, + "$Id$") // ************************************************************ // interceptor class in header // ************************************************************ - -be_visitor_interface_interceptors_cs::be_visitor_interface_interceptors_cs -(be_visitor_context *ctx) +be_visitor_interface_interceptors_cs::be_visitor_interface_interceptors_cs ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } -be_visitor_interface_interceptors_cs::~be_visitor_interface_interceptors_cs (void) +be_visitor_interface_interceptors_cs::~be_visitor_interface_interceptors_cs ( + void + ) { } int be_visitor_interface_interceptors_cs::visit_interface (be_interface *node) { if (node->is_local ()) - return 0; + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); @@ -54,6 +53,7 @@ int be_visitor_interface_interceptors_cs::visit_interface (be_interface *node) // that only legal syntactic elements appear in our scope. os->indent (); + *os << "\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl; // Generate code for the interface definition by traversing thru the @@ -67,7 +67,8 @@ int be_visitor_interface_interceptors_cs::visit_interface (be_interface *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_ch::" "visit_interface - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << "#endif /* TAO_HAS_INTERCEPTORS */\n"; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_sh.cpp index 4177f137a55..9171ffc89b7 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_sh.cpp @@ -18,27 +18,25 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, interceptors_sh, "$Id$") - +ACE_RCSID (be_visitor_interface, + interceptors_sh, + "$Id$") // ************************************************************ // interceptor class in header // ************************************************************ -be_visitor_interface_interceptors_sh::be_visitor_interface_interceptors_sh -(be_visitor_context *ctx) +be_visitor_interface_interceptors_sh::be_visitor_interface_interceptors_sh ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } -be_visitor_interface_interceptors_sh::~be_visitor_interface_interceptors_sh (void) +be_visitor_interface_interceptors_sh::~be_visitor_interface_interceptors_sh ( + void + ) { } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ss.cpp index 2ff6cc66b4d..b3735ec3360 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ss.cpp @@ -18,27 +18,24 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, interceptors_ss, "$Id$") - +ACE_RCSID (be_visitor_interface, + interceptors_ss, + "$Id$") // ************************************************************ // interceptor class in header // ************************************************************ - -be_visitor_interface_interceptors_ss::be_visitor_interface_interceptors_ss -(be_visitor_context *ctx) +be_visitor_interface_interceptors_ss::be_visitor_interface_interceptors_ss ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } -be_visitor_interface_interceptors_ss::~be_visitor_interface_interceptors_ss (void) +be_visitor_interface_interceptors_ss::~be_visitor_interface_interceptors_ss ( + void + ) { } @@ -66,7 +63,8 @@ int be_visitor_interface_interceptors_ss::visit_interface (be_interface *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_ch::" "visit_interface - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << "#endif /* TAO_HAS_INTERCEPTORS */\n"; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp index 152c05578c5..9995568c4f5 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp @@ -18,18 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" -#include "be_visitor_attribute.h" -#include "be_visitor_constant.h" -#include "be_visitor_enum.h" -#include "be_visitor_exception.h" -#include "be_visitor_structure.h" -#include "be_visitor_typedef.h" -#include "be_visitor_union.h" - ACE_RCSID (be_visitor_interface, interface, "$Id$") @@ -574,9 +562,12 @@ be_visitor_interface::visit_operation (be_operation *node) // will be modified ased on what type of node we are visiting be_visitor_context ctx (*this->ctx_); ctx.node (node); + int status = 1; switch (this->ctx_->state ()) { + // These first two cases may have the context state changed + // by a strategy, so we use the visitor factory below. case TAO_CodeGen::TAO_INTERFACE_CH: ctx.state (TAO_CodeGen::TAO_OPERATION_CH); break; @@ -584,82 +575,168 @@ be_visitor_interface::visit_operation (be_operation *node) ctx.state (TAO_CodeGen::TAO_OPERATION_CS); break; case TAO_CodeGen::TAO_INTERFACE_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SH); + be_visitor_operation_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_IH: - ctx.state (TAO_CodeGen::TAO_OPERATION_IH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_IH); + be_visitor_operation_ih visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SS); + be_visitor_operation_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_IS: - ctx.state (TAO_CodeGen::TAO_OPERATION_IS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_IS); + be_visitor_operation_is visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_TIE_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH); + be_visitor_operation_tie_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_TIE_SI: - ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI); + be_visitor_operation_tie_si visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH); + be_visitor_operation_thru_poa_collocated_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS); + be_visitor_operation_thru_poa_collocated_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH); + be_visitor_operation_direct_collocated_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); + be_visitor_operation_direct_collocated_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH); + be_visitor_operation_smart_proxy_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS); + be_visitor_operation_smart_proxy_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); + be_visitor_operation_interceptors_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); + be_visitor_operation_interceptors_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH); + be_visitor_operation_interceptors_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS); + be_visitor_operation_interceptors_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: - ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH); + be_visitor_operation_base_proxy_impl_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH); - break; - - // AMH stuff + { + ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH); + be_visitor_operation_proxy_impl_xh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SH: - ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_RH_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_RH_SH); + be_visitor_amh_rh_operation_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_RH_SS); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_RH_SS); + be_visitor_amh_rh_operation_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: - ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS); + be_visitor_operation_remote_proxy_impl_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS); + be_visitor_operation_thru_poa_proxy_impl_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: - ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS); - break; - + { + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS); + be_visitor_operation_direct_proxy_impl_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: @@ -678,11 +755,24 @@ be_visitor_interface::visit_operation (be_operation *node) } } + if (status == 0) + { + return 0; + } + else if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_operation - " + "failed to accept visitor\n"), + -1); + } + // Change the state depending on the kind of node strategy. ctx.state (node->next_state (ctx.state ())); - // grab the appropriate visitor + // Grab the appropriate visitor. be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor) diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp index d1011060a97..aa2ec989ed8 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp @@ -18,14 +18,11 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" #include "be_visitor_typecode/typecode_decl.h" -ACE_RCSID(be_visitor_interface, interface_ch, "$Id$") - +ACE_RCSID (be_visitor_interface, + interface_ch, + "$Id$") // ****************************************************** // Interface visitor for client header diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp index 2c44fb86a4e..8df081761e1 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp @@ -18,18 +18,15 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, interface_ci, "$Id$") +ACE_RCSID (be_visitor_interface, + interface_ci, + "$Id$") // ************************************************** // Interface visitor for client inline // ************************************************** + be_visitor_interface_ci::be_visitor_interface_ci (be_visitor_context *ctx) : be_visitor_interface (ctx) { diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp index a93def0789f..b6af6ab2270 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -18,17 +18,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" #include "be_visitor_typecode/typecode_defn.h" ACE_RCSID (be_visitor_interface, interface_cs, "$Id$") - // ************************************************************ // Interface visitor for client stubs // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp index 7b82220171b..1727937833f 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp @@ -16,11 +16,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - ACE_RCSID (be_visitor_interface, interface_ih, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp index fdf98c91504..a00bdf831db 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp @@ -16,12 +16,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - - // ************************************************************ // Interface visitor for implementation skeletons. // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp index b54806bcef5..ae6190babf9 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -18,11 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - ACE_RCSID (be_visitor_interface, interface_sh, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp index 000c39ce2ce..059eb0e52dc 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp @@ -18,11 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - ACE_RCSID (be_visitor_interface, interface_si, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index f1ae6c99cea..3bed48dda8d 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -18,12 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" -#include "ace/SString.h" - ACE_RCSID (be_visitor_interface, interface_ss, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp index db1c6aaa9ac..538a39cf926 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/proxy_brokers_ch.cpp @@ -2,11 +2,6 @@ // $Id$ // -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - ACE_RCSID (be_visitor_interface, proxy_brokers_ch, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp index 6229e7c04dc..c077c5d1de3 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/proxy_impls_ch.cpp @@ -2,11 +2,6 @@ // $Id$ // -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - ACE_RCSID (be_visitor_interface, base_proxy_broker_impl_ch, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp index 273530debd1..4f753277315 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_ch.cpp @@ -1,27 +1,29 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" +// +// $Id$ +// ACE_RCSID (be_visitor_interface, be_visitor_interface_remote_proxy_broker_ch, "$Id$") -be_visitor_interface_remote_proxy_broker_ch::be_visitor_interface_remote_proxy_broker_ch (be_visitor_context *ctx) +be_visitor_interface_remote_proxy_broker_ch:: +be_visitor_interface_remote_proxy_broker_ch (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_remote_proxy_broker_ch::~be_visitor_interface_remote_proxy_broker_ch (void) +be_visitor_interface_remote_proxy_broker_ch:: +~be_visitor_interface_remote_proxy_broker_ch (void) { // No-Op. } int -be_visitor_interface_remote_proxy_broker_ch::visit_interface (be_interface *node) +be_visitor_interface_remote_proxy_broker_ch::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); @@ -29,7 +31,8 @@ be_visitor_interface_remote_proxy_broker_ch::visit_interface (be_interface *node os->indent (); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Remote Proxy Broker Declaration " << be_nl << "//" << be_nl << be_nl; @@ -48,7 +51,8 @@ be_visitor_interface_remote_proxy_broker_ch::visit_interface (be_interface *node << be_nl << be_nl; // Accessor Method - *os << "virtual " << node->base_proxy_impl_name () << " &" << "select_proxy (" + *os << "virtual " << node->base_proxy_impl_name () << " &" + << "select_proxy (" << be_idt << be_idt_nl; *os << node->local_name () << " *object" << be_nl @@ -62,8 +66,10 @@ be_visitor_interface_remote_proxy_broker_ch::visit_interface (be_interface *node *os << "public:" << be_idt_nl; // Factory Member Function declaration. - *os << "// This member function is used to get an handle to the unique instance" << be_nl - << "// of the Remote Proxy Broker that is available for a given" << be_nl + *os << "// This member function is used to get an handle to the " + << "unique instance" << be_nl + << "// of the Remote Proxy Broker that is available for a given" + << be_nl << "// interface." << be_nl << "static " << node->remote_proxy_broker_name () << " *the" << node->remote_proxy_broker_name () diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp index 93fa5e34089..fdde98f011c 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_broker_cs.cpp @@ -1,25 +1,29 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +// +// $Id$ +// -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + remote_proxy_broker_cs, + "$Id$") -ACE_RCSID (be_visitor_interface, base_proxy_broker_cs, "$Id$") - -be_visitor_interface_remote_proxy_broker_cs::be_visitor_interface_remote_proxy_broker_cs (be_visitor_context *ctx) +be_visitor_interface_remote_proxy_broker_cs:: +be_visitor_interface_remote_proxy_broker_cs (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_remote_proxy_broker_cs::~be_visitor_interface_remote_proxy_broker_cs (void) +be_visitor_interface_remote_proxy_broker_cs:: +~be_visitor_interface_remote_proxy_broker_cs (void) { // No-Op. } int -be_visitor_interface_remote_proxy_broker_cs::visit_interface (be_interface *node) +be_visitor_interface_remote_proxy_broker_cs::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); @@ -27,7 +31,8 @@ be_visitor_interface_remote_proxy_broker_cs::visit_interface (be_interface *node os->indent (); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Remote & Base Proxy Broker Implementation" << be_nl << "//" << be_nl << be_nl; @@ -82,11 +87,11 @@ be_visitor_interface_remote_proxy_broker_cs::visit_interface (be_interface *node << "return this->remote_proxy_impl_;" << be_uidt_nl << "}" << be_nl << be_nl; - *os << be_nl << "//" << be_nl << "// End Remote & Base Proxy Broker Implementation" << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << be_nl; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp index ebdd838fd64..abc77d0d014 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_ch.cpp @@ -1,25 +1,29 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +// +// $Id$ +// -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + remote_proxy_impl_ch, + "$Id$") -ACE_RCSID (be_visitor_interface, remote_proxy_broker_impl_ch, "$Id$") - -be_visitor_interface_remote_proxy_impl_ch::be_visitor_interface_remote_proxy_impl_ch (be_visitor_context *ctx) +be_visitor_interface_remote_proxy_impl_ch:: +be_visitor_interface_remote_proxy_impl_ch (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_remote_proxy_impl_ch::~be_visitor_interface_remote_proxy_impl_ch (void) +be_visitor_interface_remote_proxy_impl_ch:: +~be_visitor_interface_remote_proxy_impl_ch (void) { // No-Op. } int -be_visitor_interface_remote_proxy_impl_ch::visit_interface (be_interface *node) +be_visitor_interface_remote_proxy_impl_ch::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); @@ -33,7 +37,8 @@ be_visitor_interface_remote_proxy_impl_ch::visit_interface (be_interface *node) *os << "class " << be_global->stub_export_macro () << " " << node->remote_proxy_impl_name () << be_idt_nl; *os << ": " << "public virtual " << node->base_proxy_impl_name () - << "," << be_idt_nl << "public virtual " << "TAO_Remote_Object_Proxy_Impl"; + << "," << be_idt_nl << "public virtual " + << "TAO_Remote_Object_Proxy_Impl"; if (node->n_inherits () > 0) { diff --git a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_cs.cpp index 3bca271e829..47c8bb227c3 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/remote_proxy_impl_cs.cpp @@ -1,31 +1,36 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +// +// $Id$ +// -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + remote_proxy_impl_cs, + "$Id$") -ACE_RCSID (be_visitor_interface, remote_proxy_broker_impl_cs, "$Id$") - -be_visitor_interface_remote_proxy_impl_cs::be_visitor_interface_remote_proxy_impl_cs (be_visitor_context *ctx) +be_visitor_interface_remote_proxy_impl_cs:: +be_visitor_interface_remote_proxy_impl_cs (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_remote_proxy_impl_cs::~be_visitor_interface_remote_proxy_impl_cs (void) +be_visitor_interface_remote_proxy_impl_cs:: +~be_visitor_interface_remote_proxy_impl_cs (void) { // No-Op. } int -be_visitor_interface_remote_proxy_impl_cs::visit_interface (be_interface *node) +be_visitor_interface_remote_proxy_impl_cs::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); os->decr_indent (0); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Base & Remote Proxy Implementation. " << be_nl << "//" << be_nl << be_nl; // Create the destructor implementation for the base @@ -75,6 +80,7 @@ be_visitor_interface_remote_proxy_impl_cs::visit_interface (be_interface *node) << "// End Base & Remote Proxy Implemeentation. " << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << be_nl; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp index fd4fd4987e8..382d0bc065f 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, smart_proxy_ch, "$Id$") +ACE_RCSID (be_visitor_interface, + smart_proxy_ch, + "$Id$") // ************************************************************ // smart proxy class in header // ************************************************************ - -be_visitor_interface_smart_proxy_ch::be_visitor_interface_smart_proxy_ch -(be_visitor_context *ctx) +be_visitor_interface_smart_proxy_ch::be_visitor_interface_smart_proxy_ch ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } @@ -52,12 +48,14 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) be_type *bt; - // set the right type; if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; - // output the class defn + { + bt = node; + } *os << "class " << be_global->stub_export_macro ()<< " " << "TAO_" << node->flat_name () @@ -122,6 +120,7 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) << "};\n\n"; os->indent (); + *os << "typedef TAO_Singleton<TAO_"<<node->flat_name () << "_Proxy_Factory_Adapter, TAO_SYNCH_RECURSIVE_MUTEX> TAO_" << node->flat_name ()<< "_PROXY_FACTORY_ADAPTER;"<<be_nl << be_nl; @@ -133,55 +132,61 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) << bt->nested_type_name (this->ctx_->scope ()); - if (node->n_inherits () > 0) // node interface inherits from other - // interfaces + if (node->n_inherits () > 0) { long i; + for (i = 0; i < node->n_inherits (); i++) { be_interface *inherited = be_interface::narrow_from_decl (node->inherits ()[i]); be_decl *scope = 0; + if (inherited->is_nested ()) { - // inherited node is used in the scope of "node" node + // Inherited node is used in the scope of "node" node. scope = be_scope::narrow_from_scope (node->defined_in ())->decl (); } *os << "," << be_nl << " public virtual "; - *os << inherited->nested_sp_type_name (scope,"_Smart_Proxy_Base"); // dump the scoped name - } // end of for loop + *os << inherited->nested_sp_type_name (scope, + "_Smart_Proxy_Base"); + } } else { *os << "," << be_nl << " public virtual TAO_Smart_Proxy_Base"; } + *os << be_uidt_nl; *os << "{" << be_nl << "public:" << be_idt_nl - << "TAO_"<< node->flat_name () << "_Smart_Proxy_Base (void);" << be_nl - // Just to keep Old g++ complier (version: 2.7.2.3) happy its necessary - // to declare and define the destructor explicitly. - << "~TAO_"<< node->flat_name () << "_Smart_Proxy_Base (void);"<<be_nl - // This method will delegate this method to the <base_proxy_> - // member of the smart proxy and so the smart proxy's (nil) - // stubobj will not be returned. + << "TAO_"<< node->flat_name () << "_Smart_Proxy_Base (void);" + << be_nl + // Just to keep Old g++ complier (version: 2.7.2.3) happy it's + // necesssary to declare and define the destructor explicitly. + << "~TAO_"<< node->flat_name () << "_Smart_Proxy_Base (void);" + << be_nl + // This method will delegate this method to the <base_proxy_> + // member of the smart proxy and so the smart proxy's (nil) + // stubobj will not be returned. << "virtual TAO_Stub *_stubobj (void) const;" << be_uidt_nl; - // generate code for the interface definition by traversing thru the + // Generate code for the interface definition by traversing thru the // elements of its scope. We depend on the front-end to have made sure // that only legal syntactic elements appear in our scope. - os->indent (); + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_ch::" "visit_interface - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << "protected:" << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp index aed69607090..d1b68ce5b93 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_cs.cpp @@ -19,26 +19,24 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, smart_proxy_cs, "$Id$") - +ACE_RCSID (be_visitor_interface, + smart_proxy_cs, + "$Id$") // ************************************************************ // be_visitor_interface_smart_proxy_cs // ************************************************************ -be_visitor_interface_smart_proxy_cs::be_visitor_interface_smart_proxy_cs -(be_visitor_context *ctx) +be_visitor_interface_smart_proxy_cs::be_visitor_interface_smart_proxy_cs ( + be_visitor_context *ctx + ) : be_visitor_interface (ctx) { } -be_visitor_interface_smart_proxy_cs::~be_visitor_interface_smart_proxy_cs (void) +be_visitor_interface_smart_proxy_cs::~be_visitor_interface_smart_proxy_cs ( + void + ) { } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp index 2b78387f443..1043c0da448 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_sh.cpp @@ -1,51 +1,56 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +// +// $Id$ +// -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + base_proxy_broker_sh, + "$Id$") -ACE_RCSID (be_visitor_interface, base_proxy_broker_sh, "$Id$") - -be_visitor_interface_strategized_proxy_broker_sh::be_visitor_interface_strategized_proxy_broker_sh (be_visitor_context *ctx) +be_visitor_interface_strategized_proxy_broker_sh:: +be_visitor_interface_strategized_proxy_broker_sh (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } - -be_visitor_interface_strategized_proxy_broker_sh::~be_visitor_interface_strategized_proxy_broker_sh (void) +be_visitor_interface_strategized_proxy_broker_sh:: +~be_visitor_interface_strategized_proxy_broker_sh (void) { // No-Op. } int -be_visitor_interface_strategized_proxy_broker_sh::visit_interface (be_interface *node) +be_visitor_interface_strategized_proxy_broker_sh::visit_interface ( + be_interface *node + ) { - TAO_OutStream *os = this->ctx_->stream (); - - // os->gen_ifdef_macro (node->local_name (), "STRATEGIZED_PROXY_BROKER_"); + TAO_OutStream *os = this->ctx_->stream (); // Generate the class declaration. os->indent (); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Strategized Proxy Broker Declaration " << be_nl << "//" << be_nl << be_nl; *os << "class " << be_global->skel_export_macro () << " " << node->strategized_proxy_broker_name () << " : public virtual " - << "::" << node->full_base_proxy_broker_name () << be_nl << "{" << be_nl + << "::" << node->full_base_proxy_broker_name () << be_nl << "{" + << be_nl << "public: " << be_idt_nl; // Constructor *os << node->strategized_proxy_broker_name () << " (void);" << be_nl << be_nl; // Destructor - *os << "virtual ~" << node->strategized_proxy_broker_name () << " (void);" << be_nl << be_nl; + *os << "virtual ~" << node->strategized_proxy_broker_name () << " (void);" + << be_nl << be_nl; // Accessor Method - *os << "virtual " << "::" << node->full_base_proxy_impl_name () << " &" << "select_proxy (" << be_idt_nl; + *os << "virtual " << "::" << node->full_base_proxy_impl_name () << " &" + << "select_proxy (" << be_idt_nl; *os << "::" << node->full_name () << " *object" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl @@ -59,8 +64,10 @@ be_visitor_interface_strategized_proxy_broker_sh::visit_interface (be_interface << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl << ");" << be_nl << be_nl - << "// Caches the proxy implementations. The proxy implementation" << be_nl - << "// are totally stateless, and those can be shared by all the" << be_nl + << "// Caches the proxy implementations. The proxy implementation" + << be_nl + << "// are totally stateless, and those can be shared by all the" + << be_nl << "// instances of a given IDL interface type." << be_nl << "::" << node->full_base_proxy_impl_name () << be_nl << "*proxy_cache_[TAO_Collocation_Strategies::CS_LAST];" @@ -68,8 +75,10 @@ be_visitor_interface_strategized_proxy_broker_sh::visit_interface (be_interface << "TAO_SYNCH_MUTEX mutex_;" << be_nl; // Factory Function declaration. - *os << "// This funxtion is used to get an handle to the unique instance" << be_nl - << "// of the Strategized Proxy Broker that is available for a given" << be_nl + *os << "// This funxtion is used to get an handle to the unique instance" + << be_nl + << "// of the Strategized Proxy Broker that is available for a given" + << be_nl << "// interface." << be_uidt_nl << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp index f67d173214d..a01027c80f7 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/strategized_proxy_broker_ss.cpp @@ -1,25 +1,29 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +// +// $Id$ +// -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + strategized_proxy_broker_ss, + "$Id$") -ACE_RCSID (be_visitor_interface, base_proxy_broker_ss, "$Id$") - -be_visitor_interface_strategized_proxy_broker_ss::be_visitor_interface_strategized_proxy_broker_ss (be_visitor_context *ctx) +be_visitor_interface_strategized_proxy_broker_ss:: +be_visitor_interface_strategized_proxy_broker_ss (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_strategized_proxy_broker_ss::~be_visitor_interface_strategized_proxy_broker_ss (void) +be_visitor_interface_strategized_proxy_broker_ss:: +~be_visitor_interface_strategized_proxy_broker_ss (void) { // No-Op. } int -be_visitor_interface_strategized_proxy_broker_ss::visit_interface (be_interface *node) +be_visitor_interface_strategized_proxy_broker_ss::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); @@ -27,7 +31,8 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface (be_interface os->indent (); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// Strategized Proxy Broker Implementation" << be_nl << "//" << be_nl << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp index 7193ad36241..032d9ed67ee 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp @@ -19,40 +19,42 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, thru_poa_collocated_sh, "$Id$") - +ACE_RCSID (be_visitor_interface, + thru_poa_collocated_sh, + "$Id$") // ************************************************************ // thru_poa_collocated class in header // ************************************************************ -be_visitor_interface_thru_poa_collocated_sh::be_visitor_interface_thru_poa_collocated_sh -(be_visitor_context *ctx) +be_visitor_interface_thru_poa_collocated_sh:: +be_visitor_interface_thru_poa_collocated_sh (be_visitor_context *ctx) : be_visitor_interface (ctx) { } -be_visitor_interface_thru_poa_collocated_sh::~be_visitor_interface_thru_poa_collocated_sh (void) +be_visitor_interface_thru_poa_collocated_sh:: +~be_visitor_interface_thru_poa_collocated_sh (void) { } -int be_visitor_interface_thru_poa_collocated_sh::visit_interface (be_interface *node) +int be_visitor_interface_thru_poa_collocated_sh::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); - os->gen_ifdef_macro (node->flat_name (), "_thru_poa_collocated"); + os->gen_ifdef_macro (node->flat_name (), + "_thru_poa_collocated"); // output the class defn os->indent (); + *os << "class " << be_global->skel_export_macro () << " " << node->local_coll_name (be_interface::THRU_POA); + os->incr_indent (); + *os << " : public virtual ::" << node->full_name (); // generate base classes if any @@ -64,14 +66,20 @@ int be_visitor_interface_thru_poa_collocated_sh::visit_interface (be_interface * be_interface* parent = be_interface::narrow_from_decl (node->inherits()[i]); *os << " public virtual " - << be_interface::relative_name (parent->full_coll_name (be_interface::THRU_POA), - node->full_coll_name (be_interface::THRU_POA)); + << be_interface::relative_name ( + parent->full_coll_name (be_interface::THRU_POA), + node->full_coll_name (be_interface::THRU_POA) + ); } } + *os << "\n"; + os->decr_indent (); + *os << "{" << be_nl; *os << "public:\n"; + os->incr_indent (); *os << node->local_coll_name (be_interface::THRU_POA) << " (\n"; @@ -80,8 +88,11 @@ int be_visitor_interface_thru_poa_collocated_sh::visit_interface (be_interface * os->incr_indent (); *os << "TAO_Stub *stub\n"; + os->decr_indent (); + *os << ");\n"; + os->decr_indent (0); os->indent (); @@ -111,6 +122,5 @@ int be_visitor_interface_thru_poa_collocated_sh::visit_interface (be_interface * *os << "};\n\n"; os->gen_endif (); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp index 4a4c59bc34e..61d34764399 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp @@ -19,30 +19,29 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_interface, thru_poa_collocated_ss, "$Id$") +ACE_RCSID (be_visitor_interface, + thru_poa_collocated_ss, + "$Id$") // ************************************************************ // be_visitor_interface_collacted_ss // ************************************************************ -be_visitor_interface_thru_poa_collocated_ss::be_visitor_interface_thru_poa_collocated_ss -(be_visitor_context *ctx) +be_visitor_interface_thru_poa_collocated_ss:: +be_visitor_interface_thru_poa_collocated_ss (be_visitor_context *ctx) : be_visitor_interface (ctx) { } -be_visitor_interface_thru_poa_collocated_ss::~be_visitor_interface_thru_poa_collocated_ss (void) +be_visitor_interface_thru_poa_collocated_ss:: +~be_visitor_interface_thru_poa_collocated_ss (void) { } -int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface *node) +int be_visitor_interface_thru_poa_collocated_ss::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); @@ -59,7 +58,10 @@ int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface * // @@ We should call the constructor for all base classes, since we // are using multiple inheritance. - if (node->traverse_inheritance_graph (be_visitor_interface_thru_poa_collocated_ss::collocated_ctor_helper, os) + if (node->traverse_inheritance_graph ( + be_visitor_interface_thru_poa_collocated_ss::collocated_ctor_helper, + os + ) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -75,7 +77,8 @@ int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface * *os << "}" << be_nl << be_nl; // Generate _is_a implementation. - *os << "CORBA::Boolean " << node->full_coll_name (be_interface::THRU_POA) << "::" + *os << "CORBA::Boolean " + << node->full_coll_name (be_interface::THRU_POA) << "::" << "_is_a" << be_idt << "(" << be_idt_nl << "const CORBA::Char *logical_type_id" << be_nl @@ -101,11 +104,13 @@ int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface * << "servant_upcall.servant ()->_downcast (" << be_idt << be_idt_nl << "\"" << node->repoID () << "\"" << be_uidt_nl << ")" << be_uidt << be_uidt_nl - << ")->_is_a (logical_type_id ACE_ENV_ARG_PARAMETER);" << be_uidt << be_uidt_nl + << ")->_is_a (logical_type_id ACE_ENV_ARG_PARAMETER);" + << be_uidt << be_uidt_nl << "}" << be_uidt_nl << be_nl << be_nl; // Generate _non_existent implementation. - *os << "CORBA::Boolean " << node->full_coll_name (be_interface::THRU_POA) << "::" + *os << "CORBA::Boolean " + << node->full_coll_name (be_interface::THRU_POA) << "::" << "_non_existent" << be_idt << "(" << be_idt_nl << "ACE_ENV_SINGLE_ARG_DECL" << be_uidt_nl @@ -130,7 +135,8 @@ int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface * << "servant_upcall.servant ()->_downcast (" << be_idt << be_idt_nl << "\"" << node->repoID () << "\"" << be_uidt_nl << ")" << be_uidt << be_uidt_nl - << ")->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);" << be_uidt << be_uidt_nl + << ")->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER);" + << be_uidt << be_uidt_nl << "}" << be_uidt_nl << be_nl << be_nl; if (this->visit_scope (node) == -1) @@ -146,25 +152,32 @@ int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface * } int -be_visitor_interface_thru_poa_collocated_ss::collocated_ctor_helper (be_interface *derived, - be_interface *base, - TAO_OutStream *os) +be_visitor_interface_thru_poa_collocated_ss::collocated_ctor_helper ( + be_interface *derived, + be_interface *base, + TAO_OutStream *os + ) { if (derived == base) - // we are the same. Don't do anything, otherwise we will end up calling - // ourself - return 0; + { + // We are the same. Don't do anything, otherwise we will end up calling + // ourself. + return 0; + } if (base->is_nested ()) { be_decl *scope; scope = be_scope::narrow_from_scope (base->defined_in ())->decl (); + *os << " ACE_NESTED_CLASS (POA_" << scope->full_name () << "," - << base->local_coll_name (be_interface::THRU_POA) << ") (stub)," << be_nl; + << base->local_coll_name (be_interface::THRU_POA) << ") (stub)," + << be_nl; } else { - *os << " " << base->full_coll_name (be_interface::THRU_POA) << " (stub)," << be_nl; + *os << " " << base->full_coll_name (be_interface::THRU_POA) + << " (stub)," << be_nl; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp index b638b69469a..b777b8bc5ec 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_sh.cpp @@ -1,41 +1,48 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +// +// $Id$ +// -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + thru_poa_proxy_impl_sh, + "$Id$") -ACE_RCSID (be_visitor_interface, thru_poa_proxy_broker_impl_sh, "$Id$") - -be_visitor_interface_thru_poa_proxy_impl_sh::be_visitor_interface_thru_poa_proxy_impl_sh (be_visitor_context *ctx) +be_visitor_interface_thru_poa_proxy_impl_sh:: +be_visitor_interface_thru_poa_proxy_impl_sh (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_thru_poa_proxy_impl_sh::~be_visitor_interface_thru_poa_proxy_impl_sh (void) +be_visitor_interface_thru_poa_proxy_impl_sh:: +~be_visitor_interface_thru_poa_proxy_impl_sh (void) { // No-Op. } int -be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface (be_interface *node) +be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); *os << be_nl - << "///////////////////////////////////////////////////////////////////////" << be_nl + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// ThruPOA Impl. Declaration" << be_nl << "//" << be_nl << be_nl; // Generate Class Declaration. *os << "class " << be_global->skel_export_macro () << " " << node->thru_poa_proxy_impl_name (); - *os << " : " << be_idt_nl << "public virtual " << "::" << node->full_base_proxy_impl_name () + *os << " : " << be_idt_nl << "public virtual " + << "::" << node->full_base_proxy_impl_name () << "," << be_nl << "public virtual " << "TAO_ThruPOA_Object_Proxy_Impl"; if (node->n_inherits () > 0) { *os << "," << be_nl; + for (int i = 0; i < node->n_inherits (); i++) { be_interface *inherited = @@ -43,31 +50,33 @@ be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface (be_interface *node *os << "public virtual "; *os << "::" << inherited->full_thru_poa_proxy_impl_name (); - if (i < node->n_inherits () - 1) // node is the case of multiple - // inheritance, so put a comma + + if (i < node->n_inherits () - 1) { *os << ", "; } + *os << be_nl; - } // end of for loop + } } *os << be_uidt_nl; - *os << "{" << be_nl << "public:" << be_idt_nl; + *os << "{" << be_nl << "public:" << be_idt_nl; - // Ctor - *os << node->thru_poa_proxy_impl_name () << " (void);" << be_nl << be_nl; + // Ctor + *os << node->thru_poa_proxy_impl_name () << " (void);" << be_nl << be_nl; - // Dtor - *os << "virtual ~" << node->thru_poa_proxy_impl_name () - << " (void) { }" << be_nl << be_nl; + // Dtor + *os << "virtual ~" << node->thru_poa_proxy_impl_name () + << " (void) { }" << be_nl << be_nl; if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) thru_poa_proxy_impl_sh::" "visit_interface - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << be_uidt_nl << "};" << be_nl; @@ -76,7 +85,7 @@ be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface (be_interface *node << "// ThruPOA Proxy Impl. Declaration" << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << be_nl; - // os->gen_endif (); + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_ss.cpp index 8e7105a8c03..3c1853c0ac6 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_proxy_impl_ss.cpp @@ -1,30 +1,35 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +// +// $Id$ +// -#include "be_visitor_interface.h" +ACE_RCSID (be_visitor_interface, + thru_poa_proxy_impl_ss, + "$Id$") -ACE_RCSID (be_visitor_interface, thru_poa_proxy_broker_impl_ss, "$Id$") - -be_visitor_interface_thru_poa_proxy_impl_ss::be_visitor_interface_thru_poa_proxy_impl_ss (be_visitor_context *ctx) +be_visitor_interface_thru_poa_proxy_impl_ss:: +be_visitor_interface_thru_poa_proxy_impl_ss (be_visitor_context *ctx) : be_visitor_interface (ctx) { // No-Op. } -be_visitor_interface_thru_poa_proxy_impl_ss::~be_visitor_interface_thru_poa_proxy_impl_ss (void) +be_visitor_interface_thru_poa_proxy_impl_ss:: +~be_visitor_interface_thru_poa_proxy_impl_ss (void) { // No-Op. } int -be_visitor_interface_thru_poa_proxy_impl_ss::visit_interface (be_interface *node) +be_visitor_interface_thru_poa_proxy_impl_ss::visit_interface ( + be_interface *node + ) { TAO_OutStream *os = this->ctx_->stream (); *os << be_nl - << "///////////////////////////////////////////////////////////////////////\n" + << "///////////////////////////////////////////////////////////////////////" + << be_nl << "// ThruPOA Proxy Implementation\n" << "//\n\n"; @@ -32,12 +37,6 @@ be_visitor_interface_thru_poa_proxy_impl_ss::visit_interface (be_interface *node *os << node->full_thru_poa_proxy_impl_name () << "::" << node->thru_poa_proxy_impl_name () << " (void)" << be_nl << "{}" << be_nl << be_nl; - /* - // Dtor Implementation - *os << node->full_thru_poa_proxy_impl_name () << "::~" - << node->thru_poa_proxy_impl_name () << " (void)" << be_nl - << "{}" << be_nl << be_nl; - */ // Generate the code for the ThruPOA Proxy Impl. // operations diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp index b7270105156..f341f2f2c55 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp @@ -19,11 +19,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - ACE_RCSID (be_visitor_interface, tie_sh, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp index 9b8ae77ca5e..5fede5e61c4 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp @@ -19,11 +19,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_interface.h" - ACE_RCSID (be_visitor_interface, tie_si, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp index 0796b99e556..a042bdc1498 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp @@ -18,17 +18,20 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_interface_fwd.h" +#include "be_interface.h" #include "be_visitor_interface_fwd.h" +#include "be_visitor_context.h" +#include "be_helper.h" +#include "be_extern.h" -// include all the individual files #include "be_visitor_interface_fwd/interface_fwd_ch.cpp" #include "be_visitor_interface_fwd/interface_fwd_ci.cpp" #include "be_visitor_interface_fwd/cdr_op_ch.cpp" #include "be_visitor_interface_fwd/cdr_op_ci.cpp" #include "be_visitor_interface_fwd/any_op_ch.cpp" -ACE_RCSID(be, be_visitor_interface_fwd, "$Id$") +ACE_RCSID (be, + be_visitor_interface_fwd, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp index f2d10e97d1c..983061d9365 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/any_op_ch.cpp @@ -19,21 +19,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface_fwd.h" - -ACE_RCSID(be_visitor_interface_fwd, any_op_ch, "$Id$") +ACE_RCSID (be_visitor_interface_fwd, + any_op_ch, + "$Id$") // *************************************************************************** // Generates Any operator declarations in the client header // *************************************************************************** -be_visitor_interface_fwd_any_op_ch::be_visitor_interface_fwd_any_op_ch -(be_visitor_context *ctx) +be_visitor_interface_fwd_any_op_ch::be_visitor_interface_fwd_any_op_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -43,7 +40,9 @@ be_visitor_interface_fwd_any_op_ch::~be_visitor_interface_fwd_any_op_ch (void) } int -be_visitor_interface_fwd_any_op_ch::visit_interface_fwd (be_interface_fwd *node) +be_visitor_interface_fwd_any_op_ch::visit_interface_fwd ( + be_interface_fwd *node + ) { AST_Interface *fd = node->full_definition (); @@ -75,6 +74,5 @@ be_visitor_interface_fwd_any_op_ch::visit_interface_fwd (be_interface_fwd *node) << node->name () << " *&);\n"; node->cli_hdr_any_op_gen (1); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp index 51806a8387b..be788d61101 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp @@ -19,21 +19,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface_fwd.h" - -ACE_RCSID(be_visitor_interface_fwd, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_interface_fwd, + cdr_op_ch, + "$Id$") // *************************************************************************** // Forward declared interface visitor for generating CDR operator declarations // in the client header. Called if this node is not later defined in the file. // *************************************************************************** -be_visitor_interface_fwd_cdr_op_ch::be_visitor_interface_fwd_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_interface_fwd_cdr_op_ch::be_visitor_interface_fwd_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -68,6 +65,7 @@ be_visitor_interface_fwd_cdr_op_ch::visit_interface_fwd (be_interface_fwd *node) // Generate the CDR << and >> operator declarations. os->indent (); + *os << be_global->stub_export_macro () << " CORBA::Boolean " << "operator<< (TAO_OutputCDR &, const " << node->full_name () << "_ptr );" << be_nl; @@ -76,6 +74,5 @@ be_visitor_interface_fwd_cdr_op_ch::visit_interface_fwd (be_interface_fwd *node) << node->full_name () << "_ptr &);\n"; node->cli_hdr_cdr_op_gen (1); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ci.cpp index d6018d72cd6..e52a310c5a5 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ci.cpp @@ -19,13 +19,9 @@ // // ================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface_fwd.h" - -ACE_RCSID(be_visitor_interface_fwd, cdr_op_ci, "$Id$") +ACE_RCSID (be_visitor_interface_fwd, + cdr_op_ci, + "$Id$") // **************************************************************** // Interface visitor for generating CDR operator declarations in the diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp index feb767c831c..e7c2bb750ef 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp @@ -18,21 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface_fwd.h" - -ACE_RCSID(be_visitor_interface_fwd, interface_fwd_ch, "$Id$") - +ACE_RCSID (be_visitor_interface_fwd, + interface_fwd_ch, + "$Id$") // ******************************************************************** // Visitor implementation for the Interface_Fwd type // This one for the client header file // ******************************************************************** -be_visitor_interface_fwd_ch::be_visitor_interface_fwd_ch (be_visitor_context *ctx) +be_visitor_interface_fwd_ch::be_visitor_interface_fwd_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp index 70c08b598d5..8fa023edc4b 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp @@ -18,21 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_interface_fwd.h" - -ACE_RCSID(be_visitor_interface_fwd, interface_fwd_ci, "$Id$") - +ACE_RCSID (be_visitor_interface_fwd, + interface_fwd_ci, + "$Id$") // ******************************************************************** // Visitor implementation for the Interface_Fwd type // This one for the client inline file // ******************************************************************** -be_visitor_interface_fwd_ci::be_visitor_interface_fwd_ci (be_visitor_context *ctx) +be_visitor_interface_fwd_ci::be_visitor_interface_fwd_ci ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_module.cpp b/TAO/TAO_IDL/be/be_visitor_module.cpp index 1bd1b4ffe36..48a37c91fd6 100644 --- a/TAO/TAO_IDL/be/be_visitor_module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module.cpp @@ -18,13 +18,33 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_module.h" +#include "be_constant.h" +#include "be_enum.h" +#include "be_exception.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_structure.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_extern.h" +#include "be_helper.h" +#include "utl_err.h" #include "be_visitor_module.h" +#include "be_visitor_constant.h" +#include "be_visitor_enum.h" +#include "be_visitor_exception.h" +#include "be_visitor_interface.h" +#include "be_visitor_interface_fwd.h" +#include "be_visitor_structure.h" +#include "be_visitor_typedef.h" +#include "be_visitor_union.h" +#include "be_visitor_valuetype_fwd.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_module/module.cpp" #include "be_visitor_module/module_ch.cpp" #include "be_visitor_module/module_sh.cpp" @@ -32,5 +52,7 @@ #include "be_visitor_module/any_op.cpp" #include "be_visitor_module/cdr_op.cpp" -ACE_RCSID(be, be_visitor_module, "$Id$") +ACE_RCSID (be, + be_visitor_module, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_module/any_op.cpp b/TAO/TAO_IDL/be/be_visitor_module/any_op.cpp index 2d50f3b54d0..5819d998f17 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/any_op.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/any_op.cpp @@ -19,14 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_module.h" - -ACE_RCSID(be_visitor_module, any_op, "$Id$") - +ACE_RCSID (be_visitor_module, + any_op, + "$Id$") // *************************************************************************** // Module visitor for generating Any operator declarations in the client header @@ -45,12 +40,13 @@ be_visitor_module_any_op::~be_visitor_module_any_op (void) int be_visitor_module_any_op::visit_module (be_module *node) { - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_module::visit_module - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp b/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp index 9f3fd486ddf..540057da455 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/cdr_op.cpp @@ -19,14 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_module.h" - -ACE_RCSID(be_visitor_module, cdr_op, "$Id") - +ACE_RCSID (be_visitor_module, + cdr_op, + "$Id: cdr_op.cpp,v 1.2 1999/05/28 02:16:43 coryan Exp ") // *************************************************************************** // Module visitor for generating CDR operator declarations in the client header @@ -45,12 +40,13 @@ be_visitor_module_cdr_op::~be_visitor_module_cdr_op (void) int be_visitor_module_cdr_op::visit_module (be_module *node) { - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_module_cdr_op::visit_module - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_module/module.cpp b/TAO/TAO_IDL/be/be_visitor_module/module.cpp index 4290e432108..f81d93231e3 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module.cpp @@ -18,19 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_module.h" -#include "be_visitor_constant.h" -#include "be_visitor_enum.h" -#include "be_visitor_exception.h" -#include "be_visitor_interface_fwd.h" -#include "be_visitor_structure.h" -#include "be_visitor_typedef.h" -#include "be_visitor_union.h" -#include "be_visitor_valuetype_fwd.h" - ACE_RCSID (be_visitor_module, module, "$Id$") @@ -309,66 +296,123 @@ be_visitor_module::visit_exception (be_exception *node) int be_visitor_module::visit_interface (be_interface *node) { - // instantiate a visitor context with a copy of our context. This info - // will be modified based on what type of node we are visiting be_visitor_context ctx (*this->ctx_); - ctx.node (node); // set the node to be the node being visited. The scope is - // still the same - - // this switch is acceptable rather than having derived visitors overriding - // this method and differing only in what state they set + ctx.node (node); + int status = 1; switch (this->ctx_->state ()) { case TAO_CodeGen::TAO_MODULE_CH: + // This is the only context state involved in strategies. ctx.state (TAO_CodeGen::TAO_INTERFACE_CH); break; case TAO_CodeGen::TAO_MODULE_CI: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CI); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CI); + be_visitor_interface_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_CS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CS); + be_visitor_interface_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_SH: - ctx.state (TAO_CodeGen::TAO_INTERFACE_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_SH); + be_visitor_interface_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_IH: - ctx.state (TAO_CodeGen::TAO_INTERFACE_IH); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_IH); + be_visitor_interface_ih visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_SI: - ctx.state (TAO_CodeGen::TAO_INTERFACE_SI); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_SI); + be_visitor_interface_si visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_SS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_SS); + be_visitor_interface_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_IS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_IS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_IS); + be_visitor_interface_is visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: - ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH); + be_visitor_interface_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS); + be_visitor_interface_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH); + be_visitor_interface_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI); + be_visitor_interface_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS); + be_visitor_interface_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } default: { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_module::" "visit_interface - " - "Bad context state\n" - ), -1); + "Bad context state\n"), + -1); } } + if (status == 0) + { + return 0; + } + else if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_interface - " + "failed to accept visitor\n"), + -1); + } + // Change the state depending on the kind of node strategy ctx.state (node->next_state (ctx.state ())); diff --git a/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp b/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp index 8f6ec45705d..835618eb26a 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp @@ -17,14 +17,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_module.h" - -ACE_RCSID(be_visitor_module, module_ch, "$Id$") - +ACE_RCSID (be_visitor_module, + module_ch, + "$Id$") // ****************************************************** // Module visitor for client header @@ -42,13 +37,11 @@ be_visitor_module_ch::~be_visitor_module_ch (void) int be_visitor_module_ch::visit_module (be_module *node) { - TAO_OutStream *os; // output stream - if (!node->cli_hdr_gen () && !node->imported ()) { - os = this->ctx_->stream (); - + TAO_OutStream *os = this->ctx_->stream (); os->indent (); + *os << "TAO_NAMESPACE " << " " << node->local_name () << be_nl << "{" << be_idt_nl; @@ -61,7 +54,8 @@ be_visitor_module_ch::visit_module (be_module *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_module_ch::" "visit_module - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp b/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp index 4c715342240..5d4c6755852 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module_ih.cpp @@ -16,13 +16,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_module.h" - -ACE_RCSID(be_visitor_module, module_ih, "$Id$") +ACE_RCSID (be_visitor_module, + module_ih, + "$Id$") // ************************************************************ // Module visitor for server header @@ -40,17 +36,17 @@ be_visitor_module_ih::~be_visitor_module_ih (void) int be_visitor_module_ih::visit_module (be_module *node) { - if (!node->impl_hdr_gen () && !node->imported ()) // not generated and not imported + if (!node->impl_hdr_gen () && !node->imported ()) { - if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_module_sh::" "visit_module - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } - } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp b/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp index f6173c11bf2..9fcc61d3d86 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp @@ -17,14 +17,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_module.h" - -ACE_RCSID(be_visitor_module, module_sh, "$Id$") - +ACE_RCSID (be_visitor_module, + module_sh, + "$Id$") // ************************************************************ // Module visitor for server header @@ -42,12 +37,10 @@ be_visitor_module_sh::~be_visitor_module_sh (void) int be_visitor_module_sh::visit_module (be_module *node) { - TAO_OutStream *os; - // Not generated and not imported. if (!node->srv_hdr_gen () && !node->imported ()) { - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); // Generate the skeleton class name. @@ -75,10 +68,12 @@ be_visitor_module_sh::visit_module (be_module *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_module_sh::" "visit_module - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } os->decr_indent (); + *os << "}" << be_nl << "TAO_NAMESPACE_CLOSE // module " << node->name () << "\n\n"; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index 5f5e9121204..501711b8731 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -18,13 +18,32 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_argument.h" +#include "be_array.h" +#include "be_attribute.h" +#include "be_enum.h" +#include "be_exception.h" +#include "be_interface_fwd.h" +#include "be_native.h" +#include "be_operation.h" +#include "be_predefined_type.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_type.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_extern.h" +#include "be_helper.h" +#include "utl_identifier.h" +#include "utl_exceptlist.h" #include "be_visitor_operation.h" +#include "be_visitor_argument.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_operation/operation.cpp" #include "be_visitor_operation/arglist.cpp" #include "be_visitor_operation/argument.cpp" @@ -54,13 +73,18 @@ #include "be_visitor_operation/tie_si.cpp" #include "be_visitor_operation/rettype_pre_invoke_cs.cpp" +// AMI #include "be_visitor_operation/ami_ch.cpp" #include "be_visitor_operation/ami_cs.cpp" #include "be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp" #include "be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp" #include "be_visitor_operation/ami_exception_holder_operation_cs.cpp" + +// Smart proxy #include "be_visitor_operation/smart_proxy_ch.cpp" #include "be_visitor_operation/smart_proxy_cs.cpp" + +// Interceptors #include "be_visitor_operation/interceptors_ch.cpp" #include "be_visitor_operation/interceptors_cs.cpp" #include "be_visitor_operation/interceptors_arglist.cpp" @@ -69,6 +93,8 @@ #include "be_visitor_operation/interceptors_exceptlist.cpp" #include "be_visitor_operation/interceptors_info_rettype.cpp" #include "be_visitor_operation/interceptors_result.cpp" + +// Collocation #include "be_visitor_operation/base_proxy_impl_ch.cpp" #include "be_visitor_operation/proxy_impl_xh.cpp" #include "be_visitor_operation/remote_proxy_impl_cs.cpp" diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp index c5799ed4af7..2296a5d4c65 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_sh.cpp @@ -19,16 +19,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_amh_rh_sh, "$Id$") - // ****************************************************** // Visitor for generating AMH-RH skeleton for "operation" // in skeleton header. diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp index fcd04df16b8..ab7680e1c9f 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp @@ -10,11 +10,9 @@ */ //============================================================================= -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" +ACE_RCSID (be_visitor_operation, + amh_rh_ss, + "$Id$") be_visitor_amh_rh_operation_ss::be_visitor_amh_rh_operation_ss ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp index 4d5d252ab47..c8deda21f4d 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp @@ -19,16 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "ast_decl.h" -#include "be_visitor_operation.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_operation, amh_sh, "$Id$") - +ACE_RCSID (be_visitor_operation, + amh_sh, + "$Id$") // ****************************************************** // Visitor for generating AMH skeleton for "operation" in skeleton header. diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp index 3bd283bfd2d..10e8da9bfac 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp @@ -10,11 +10,9 @@ */ //============================================================================= -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" +ACE_RCSID (be_visitor_operation, + amh_ss, + "$Id$") be_visitor_amh_operation_ss::be_visitor_amh_operation_ss ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp index 31bf0e1d809..a5966a04455 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp @@ -19,16 +19,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_ami_ch, "$Id$") - // ****************************************************** // Visitor for generating AMI stub for "operation" in client header. // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp index d4d7a4ff3aa..37e52f8374d 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp @@ -20,16 +20,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_ami_cs, "$Id$") - // ************************************************************ // Operation visitor for client stubs // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp index ed5ef268658..aa800265c20 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_exception_holder_operation_cs.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, ami_exception_holder_operation_cs, "$Id$") - +ACE_RCSID (be_visitor_operation, + ami_exception_holder_operation_cs, + "$Id$") // ************************************************************ // Operation visitor for client stubs diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp index 64ed89f8ce9..9b0eb3d35b6 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_ch.cpp @@ -20,42 +20,37 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, ami_handler_reply_stub_operation_ch, "$Id$") - +ACE_RCSID (be_visitor_operation, + ami_handler_reply_stub_operation_ch, + "$Id$") // ************************************************************ // Operation visitor for server header // ************************************************************ -be_visitor_operation_ami_handler_reply_stub_operation_ch::be_visitor_operation_ami_handler_reply_stub_operation_ch (be_visitor_context *ctx) +be_visitor_operation_ami_handler_reply_stub_operation_ch:: +be_visitor_operation_ami_handler_reply_stub_operation_ch (be_visitor_context *ctx) : be_visitor_operation (ctx) { } -be_visitor_operation_ami_handler_reply_stub_operation_ch::~be_visitor_operation_ami_handler_reply_stub_operation_ch (void) +be_visitor_operation_ami_handler_reply_stub_operation_ch:: +~be_visitor_operation_ami_handler_reply_stub_operation_ch (void) { } int -be_visitor_operation_ami_handler_reply_stub_operation_ch::visit_operation (be_operation *node) +be_visitor_operation_ami_handler_reply_stub_operation_ch::visit_operation ( + be_operation *node + ) { - TAO_OutStream *os; // output stream - - os = this->ctx_->stream (); - this->ctx_->node (node); // save the node - + TAO_OutStream *os = this->ctx_->stream (); + this->ctx_->node (node); // Generate the corresponding static skeleton method for this // operation only if there was no "native" type. if (!node->has_native ()) { - // Next line. *os << "static void "; @@ -72,6 +67,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_ch::visit_operation (be_op *os << "_get_"; } } + *os << node->local_name () << "_reply_stub (" << be_idt << be_idt_nl; @@ -83,5 +79,6 @@ be_visitor_operation_ami_handler_reply_stub_operation_ch::visit_operation (be_op << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl << ");" << be_uidt_nl << be_nl; } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp index 71597734ad0..f3f61b23101 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_reply_stub_operation_cs.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, ami_handler_reply_stub_operation_cs, "$Id$") - // ************************************************************ // Operation visitor for client stubs. // ************************************************************ be_visitor_operation_ami_handler_reply_stub_operation_cs:: -be_visitor_operation_ami_handler_reply_stub_operation_cs (be_visitor_context *ctx) +be_visitor_operation_ami_handler_reply_stub_operation_cs ( + be_visitor_context *ctx + ) : be_visitor_operation (ctx) { } @@ -45,7 +41,9 @@ be_visitor_operation_ami_handler_reply_stub_operation_cs:: // Processing to be done after every element in the scope is processed int -be_visitor_operation_ami_handler_reply_stub_operation_cs::post_process (be_decl *bd) +be_visitor_operation_ami_handler_reply_stub_operation_cs::post_process ( + be_decl *bd + ) { // All we do here is to insert a comma and a newline. TAO_OutStream *os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp index f112884f12e..fad8b320eed 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" -#include "be_visitor_argument.h" - -ACE_RCSID(be_visitor_operation, arglist, "$Id$") - +ACE_RCSID (be_visitor_operation, + arglist, + "$Id$") // ************************************************************ // operation visitor to generate the argument list. diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp index 85fbb834eaf..3a8ff384e61 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, argument, "$Id$") - // ************************************************************ // Generic operation visitor to handle the pre/post // do_static_call/upcall stuff with arguments. diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp index 40b4c35b9c4..f8eacca5521 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp @@ -20,14 +20,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, argument_invoke, "$Id$") - +ACE_RCSID (be_visitor_operation, + argument_invoke, + "$Id$") // ************************************************************ // operation visitor to handle the passing of arguments to the CDR operators diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp index 4c3e9ae195c..d5554155600 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp @@ -20,14 +20,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, argument_marshal, "$Id$") - +ACE_RCSID (be_visitor_operation, + argument_marshal, + "$Id$") // ************************************************************ // operation visitor to handle the passing of arguments to the CDR operators diff --git a/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp index bc13f93457b..5d02b51fea8 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/base_proxy_impl_ch.cpp @@ -1,22 +1,17 @@ // $Id$ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, x_proxy_impl_xh, "$Id$") - be_visitor_operation_base_proxy_impl_ch:: be_visitor_operation_base_proxy_impl_ch (be_visitor_context *ctx) : be_visitor_scope (ctx) { } -be_visitor_operation_base_proxy_impl_ch::~be_visitor_operation_base_proxy_impl_ch (void) +be_visitor_operation_base_proxy_impl_ch:: +~be_visitor_operation_base_proxy_impl_ch (void) { } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_sh.cpp index 191a54fd26c..b1d007b6f14 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_sh.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, direct_collocated_sh, "$Id$") - // ************************************************************************* // This visitor generates code for the direct_collocated operation signature in a // server header file. diff --git a/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_ss.cpp index 5324bc7090c..7998e28adec 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/direct_collocated_ss.cpp @@ -18,23 +18,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, direct_collocated_ss, "$Id$") - // ************************************************************************* // This visitor generates code for the direct_collocated operation signature in a // server skeletons file. // ************************************************************************* be_visitor_operation_direct_collocated_ss:: -be_visitor_operation_direct_collocated_ss(be_visitor_context *ctx) +be_visitor_operation_direct_collocated_ss (be_visitor_context *ctx) : be_visitor_operation (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp index ab5c8bd8b99..3906b4e89eb 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/direct_proxy_impl_ss.cpp @@ -1,10 +1,5 @@ // $Id$ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, direct_proxy_impl_ss, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp index f957bcb3397..0a8a34ad455 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp @@ -19,14 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, exceptlist_cs, "$Id$") - +ACE_RCSID (be_visitor_operation, + exceptlist_cs, + "$Id$") // **************************************************************************** // visitor to generate the exception list for operations @@ -52,6 +47,7 @@ be_visitor_operation_exceptlist_cs::visit_operation (be_operation *node) if (node->exceptions ()) { os->indent (); + *os << "static TAO_Exception_Data " << "_tao_" << node->flat_name () << "_exceptiondata [] = " << be_nl; *os << "{" << be_idt_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp index 8070b6abaa9..b5eeb05802b 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, interceptors_arglist, "$Id$") - // ************************************************************ // Operation visitor to generate the argument list. // We have separated code generation for this from the 4 main diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp index aedee6e66f5..d0632d128ac 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ch.cpp @@ -18,18 +18,13 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_operation, + operation_interceptors_ch, + "$Id$") -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, operation_interceptors_ch, "$Id$") - - - // ****************************************************** - // primary visitor for "operation" in client header - // ****************************************************** +// ****************************************************** +// primary visitor for "operation" in client header +// ****************************************************** be_visitor_operation_interceptors_ch::be_visitor_operation_interceptors_ch ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp index a83becaa1ab..1ddb56dbe60 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_interceptors_cs, "$Id$") - // ****************************************************** // Primary visitor for "operation" in client header // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_exceptlist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_exceptlist.cpp index 483f72c2553..f60dd96d77d 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_exceptlist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_exceptlist.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, interceptors_exceptlist, "$Id$") - +ACE_RCSID (be_visitor_operation, + interceptors_exceptlist, + "$Id$") // ************************************************************ // Operation visitor for exception list diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_info_rettype.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_info_rettype.cpp index a119d621f85..78c2937678b 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_info_rettype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_info_rettype.cpp @@ -19,40 +19,40 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, interceptors_info_rettype, "$Id$") - +ACE_RCSID (be_visitor_operation, + interceptors_info_rettype, + "$Id$") // **************************************************************************** // Operation visitor for return types. This generates the mapping for a return // type in an operation signature // **************************************************************************** -be_visitor_operation_interceptors_info_rettype::be_visitor_operation_interceptors_info_rettype (be_visitor_context - *ctx) +be_visitor_operation_interceptors_info_rettype:: +be_visitor_operation_interceptors_info_rettype (be_visitor_context *ctx) : be_visitor_decl (ctx) { } -be_visitor_operation_interceptors_info_rettype::~be_visitor_operation_interceptors_info_rettype (void) +be_visitor_operation_interceptors_info_rettype:: +~be_visitor_operation_interceptors_info_rettype (void) { } int be_visitor_operation_interceptors_info_rettype::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name () << "_slice *"; @@ -62,14 +62,17 @@ be_visitor_operation_interceptors_info_rettype::visit_array (be_array *node) int be_visitor_operation_interceptors_info_rettype::visit_enum (be_enum *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name (); @@ -79,14 +82,17 @@ be_visitor_operation_interceptors_info_rettype::visit_enum (be_enum *node) int be_visitor_operation_interceptors_info_rettype::visit_interface (be_interface *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name () << "_ptr"; @@ -96,14 +102,17 @@ be_visitor_operation_interceptors_info_rettype::visit_interface (be_interface *n int be_visitor_operation_interceptors_info_rettype::visit_interface_fwd (be_interface_fwd *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name () << "_ptr"; @@ -113,14 +122,17 @@ be_visitor_operation_interceptors_info_rettype::visit_interface_fwd (be_interfac int be_visitor_operation_interceptors_info_rettype::visit_native (be_native *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name (); @@ -130,14 +142,17 @@ be_visitor_operation_interceptors_info_rettype::visit_native (be_native *node) int be_visitor_operation_interceptors_info_rettype::visit_predefined_type (be_predefined_type *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } switch (node->pt ()) { @@ -164,16 +179,19 @@ be_visitor_operation_interceptors_info_rettype::visit_predefined_type (be_predef int be_visitor_operation_interceptors_info_rettype::visit_sequence (be_sequence *node) { - - // we should never directly be here because anonymous sequence return types + // We should never directly be here because anonymous sequence return types // are not allowed - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name () << " *"; @@ -183,8 +201,7 @@ be_visitor_operation_interceptors_info_rettype::visit_sequence (be_sequence *nod int be_visitor_operation_interceptors_info_rettype::visit_string (be_string *node) { - - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); if (node->width () == (long) sizeof (char)) { @@ -201,14 +218,17 @@ be_visitor_operation_interceptors_info_rettype::visit_string (be_string *node) int be_visitor_operation_interceptors_info_rettype::visit_structure (be_structure *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name (); @@ -244,14 +264,17 @@ be_visitor_operation_interceptors_info_rettype::visit_typedef (be_typedef *node) int be_visitor_operation_interceptors_info_rettype::visit_union (be_union *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name (); @@ -268,14 +291,17 @@ be_visitor_operation_interceptors_info_rettype::visit_union (be_union *node) int be_visitor_operation_interceptors_info_rettype::visit_valuetype (be_valuetype *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name () << " *"; @@ -285,14 +311,17 @@ be_visitor_operation_interceptors_info_rettype::visit_valuetype (be_valuetype *n int be_visitor_operation_interceptors_info_rettype::visit_valuetype_fwd (be_valuetype_fwd *node) { + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type - - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } *os << bt->name () << " *"; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp index f7f400d7de3..21c75df5801 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp @@ -18,33 +18,30 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_argument, interceptors_result, "$Id$") - +ACE_RCSID (be_visitor_argument, + interceptors_result, + "$Id$") // ************************************************************ // be_visitor_operation_interceptors_result for generating the result as // stored in the request info for interceptors // ************************************************************ -be_visitor_operation_interceptors_result::be_visitor_operation_interceptors_result (be_visitor_context *ctx) +be_visitor_operation_interceptors_result:: +be_visitor_operation_interceptors_result (be_visitor_context *ctx) : be_visitor_decl (ctx) { } -be_visitor_operation_interceptors_result::~be_visitor_operation_interceptors_result (void) +be_visitor_operation_interceptors_result:: +~be_visitor_operation_interceptors_result (void) { } int be_visitor_operation_interceptors_result::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - - // if the current type is an alias, use that + TAO_OutStream *os = this->ctx_->stream (); be_type *bt; if (this->ctx_->alias ()) @@ -66,7 +63,7 @@ be_visitor_operation_interceptors_result::visit_array (be_array *node) int be_visitor_operation_interceptors_result::visit_enum (be_enum *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); *os << "(*result_any) <<= this->_result;" << be_nl; @@ -76,7 +73,7 @@ be_visitor_operation_interceptors_result::visit_enum (be_enum *) int be_visitor_operation_interceptors_result::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); *os << "(*result_any) <<= this->_result;" << be_nl; @@ -86,7 +83,7 @@ be_visitor_operation_interceptors_result::visit_interface (be_interface *) int be_visitor_operation_interceptors_result::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); *os << "(*result_any) <<= this->_result;" << be_nl; @@ -121,7 +118,7 @@ be_visitor_operation_interceptors_result::visit_valuetype_fwd (be_valuetype_fwd int be_visitor_operation_interceptors_result::visit_predefined_type (be_predefined_type *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); *os << "(*result_any) <<= "; @@ -167,7 +164,7 @@ be_visitor_operation_interceptors_result::visit_predefined_type (be_predefined_t int be_visitor_operation_interceptors_result::visit_sequence (be_sequence *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); *os << "(*result_any) <<= this->_result;" << be_nl; @@ -177,14 +174,14 @@ be_visitor_operation_interceptors_result::visit_sequence (be_sequence *) int be_visitor_operation_interceptors_result::visit_string (be_string *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); *os << "(*result_any) <<= "; - // we need to make a distinction between bounded and unbounded strings + // We need to make a distinction between bounded and unbounded strings. if (node->max_size ()->ev ()->u.ulval != 0) { - // bounded strings + // Bounded strings. if (node->width () == (long) sizeof (char)) { *os << "CORBA::Any::from_string ((char *)"; @@ -209,7 +206,7 @@ return 0; int be_visitor_operation_interceptors_result::visit_structure (be_structure *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); *os << "(*result_any) <<= this->_result;" << be_nl; @@ -220,7 +217,7 @@ be_visitor_operation_interceptors_result::visit_structure (be_structure *) int be_visitor_operation_interceptors_result::visit_union (be_union *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); *os << "(*result_any) <<= this->_result;" << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp index 0df38e65f67..d82171570fc 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_sh.cpp @@ -18,25 +18,24 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, operation_interceptors_sh, "$Id$") - - - // ****************************************************** - // primary visitor for "operation" in server header - // ****************************************************** - - be_visitor_operation_interceptors_sh::be_visitor_operation_interceptors_sh (be_visitor_context *ctx) - : be_visitor_operation (ctx) +ACE_RCSID (be_visitor_operation, + operation_interceptors_sh, + "$Id$") + +// ****************************************************** +// primary visitor for "operation" in server header +// ****************************************************** + +be_visitor_operation_interceptors_sh::be_visitor_operation_interceptors_sh ( + be_visitor_context *ctx + ) + : be_visitor_operation (ctx) { } -be_visitor_operation_interceptors_sh::~be_visitor_operation_interceptors_sh (void) +be_visitor_operation_interceptors_sh::~be_visitor_operation_interceptors_sh ( + void + ) { } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp index 06dffe1deca..e85a9229a9c 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp @@ -19,18 +19,13 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_operation, + operation_interceptors_ss, + "$Id$") -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, operation_interceptors_ss, "$Id$") - - - // ****************************************************** - // primary visitor for "operation" in server header - // ****************************************************** +// ****************************************************** +// primary visitor for "operation" in server header +// ****************************************************** be_visitor_operation_interceptors_ss::be_visitor_operation_interceptors_ss ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp index adb5ebac7dd..e9558a59220 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, operation, "$Id$") - +ACE_RCSID (be_visitor_operation, + operation, + "$Id$") // ************************************************************ // Generic Operation visitor diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp index 6d9393db5bb..797c69fe67e 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_ch, "$Id$") - // ****************************************************** // Primary visitor for "operation" in client header. // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp index a02cdaa5c9b..4cb909735b3 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, operation_cs, "$Id$") - +ACE_RCSID (be_visitor_operation, + operation_cs, + "$Id$") // ************************************************************ // Operation visitor for client stubs diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp index 4bd6682e582..be08e30a904 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp @@ -16,11 +16,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_ih, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp index 74afad31713..63d045dfad5 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp @@ -16,12 +16,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "ace/SString.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_is, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp index 2d93a16b1c5..9a21bc6a12a 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_sh, "$Id$") - // ************************************************************ // Operation visitor for server header // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp index a0f71048bda..fe69d082c97 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp @@ -18,17 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" -#include "be_visitor_argument.h" - ACE_RCSID (be_visitor_operation, operation_ss, "$Id$") - // ************************************************************ // Operation visitor for server skeletons // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp index 93f29885bb4..6d2e814446b 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/proxy_impl_xh.cpp @@ -1,15 +1,9 @@ // $Id$ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, proxy_impl_xh, "$Id$") - be_visitor_operation_proxy_impl_xh::be_visitor_operation_proxy_impl_xh ( be_visitor_context *ctx ) diff --git a/TAO/TAO_IDL/be/be_visitor_operation/remote_proxy_impl_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/remote_proxy_impl_cs.cpp index 0d81e8e24ff..9771831fe2c 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/remote_proxy_impl_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/remote_proxy_impl_cs.cpp @@ -1,15 +1,9 @@ // $Id$ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, be_visitor_operation_remote_proxy_impl_cs, "$Id$") - // ************************************************************ // Operation visitor for client stubs // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp index 973012c93b6..306f412d127 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype, "$Id$") +ACE_RCSID (be_visitor_operation, + rettype, + "$Id$") // **************************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_assign_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_assign_ss.cpp index 65f263d1a45..c97bc35ab76 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_assign_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_assign_ss.cpp @@ -19,14 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_assign_ss, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_assign_ss, + "$Id$") // **************************************************************************** // visitor for assignment to a return value variable from the upcall diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp index 9578bd33269..8ce8cf18421 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp @@ -16,22 +16,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_is, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_is, + "$Id$") // **************************************************************************** // Operation visitor for return types. This generates the mapping for a return // type in an operation signature // **************************************************************************** -be_visitor_operation_rettype_is::be_visitor_operation_rettype_is (be_visitor_context - *ctx) +be_visitor_operation_rettype_is::be_visitor_operation_rettype_is ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -43,64 +39,65 @@ be_visitor_operation_rettype_is::~be_visitor_operation_rettype_is (void) int be_visitor_operation_rettype_is::visit_array (be_array *) { - - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - *os << "return 0;" <<be_nl; + *os << "return 0;" << be_nl; return 0; } int be_visitor_operation_rettype_is::visit_enum (be_enum *) { + TAO_OutStream *os = this->ctx_->stream (); + + *os << "return 0;" << be_nl; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - *os << "return 0;" <<be_nl; return 0; } int be_visitor_operation_rettype_is::visit_interface (be_interface *) { + TAO_OutStream *os = this->ctx_->stream (); + + *os << "return 0;" << be_nl; - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - *os << "return 0;" <<be_nl; return 0; } int be_visitor_operation_rettype_is::visit_interface_fwd (be_interface_fwd *) { + TAO_OutStream *os = this->ctx_->stream (); - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + *os << "return 0;" << be_nl; - *os << "return 0;" <<be_nl; return 0; } int be_visitor_operation_rettype_is::visit_native (be_native *) { + TAO_OutStream *os = this->ctx_->stream (); - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + *os << "return 0;" << be_nl; - *os << "return 0;" <<be_nl; return 0; } int be_visitor_operation_rettype_is::visit_predefined_type (be_predefined_type *node) { - - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); switch (node->pt ()) { case AST_PredefinedType::PT_void: - *os << "return;" <<be_nl; - break; + *os << "return;" << be_nl; + + break; default: - *os << "return 0;" <<be_nl; + *os << "return 0;" << be_nl; + break; } @@ -110,42 +107,40 @@ be_visitor_operation_rettype_is::visit_predefined_type (be_predefined_type *node int be_visitor_operation_rettype_is::visit_sequence (be_sequence *) { + // We should never directly be here because anonymous sequence return types + // are not allowed. + TAO_OutStream *os = this->ctx_->stream (); + *os << "return 0;" << be_nl; - // we should never directly be here because anonymous sequence return types - // are not allowed - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - - *os << "return 0;" <<be_nl; return 0; } int be_visitor_operation_rettype_is::visit_string (be_string *) { + TAO_OutStream *os = this->ctx_->stream (); - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - + *os << "return 0;" << be_nl; - *os << "return 0;" <<be_nl; return 0; } int be_visitor_operation_rettype_is::visit_structure (be_structure *) { - - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); *os << "return 0;" <<be_nl; + return 0; } int be_visitor_operation_rettype_is::visit_typedef (be_typedef *node) { + this->ctx_->alias (node); - this->ctx_->alias (node); // set the alias node if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -154,6 +149,7 @@ be_visitor_operation_rettype_is::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } @@ -161,10 +157,9 @@ be_visitor_operation_rettype_is::visit_typedef (be_typedef *node) int be_visitor_operation_rettype_is::visit_union (be_union *) { + TAO_OutStream *os = this->ctx_->stream (); - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - - *os << "return 0;" <<be_nl; + *os << "return 0;" << be_nl; return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_marshal_ss.cpp index 6abd8fdaf79..6199e6e1e45 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_marshal_ss.cpp @@ -23,12 +23,9 @@ // // ============================================================================ -#include "idl.h" -#include "be.h" -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_marshal_ss, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_marshal_ss, + "$Id$") // **************************************************************************** // visitor for arguments passing to the CDR operators. @@ -45,13 +42,14 @@ be_visitor_operation_rettype_marshal_ss:: { } -int be_visitor_operation_rettype_marshal_ss:: -visit_operation (be_operation *node) +int be_visitor_operation_rettype_marshal_ss::visit_operation ( + be_operation *node + ) { - this->ctx_->node (node); // save the argument node + this->ctx_->node (node); - // retrieve the type of the argument be_type *bt = be_type::narrow_from_decl (node->return_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_invoke_cs.cpp index 07274f66d0f..c8409801afd 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_invoke_cs.cpp @@ -19,38 +19,36 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_post_invoke_cs, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_post_invoke_cs, + "$Id$") // ******************************************************************************* // be_visitor_operation_rettype_post_invoke_cs // ******************************************************************************** be_visitor_operation_rettype_post_invoke_cs:: - be_visitor_operation_rettype_post_invoke_cs (be_visitor_context *ctx) - : be_visitor_decl (ctx) +be_visitor_operation_rettype_post_invoke_cs (be_visitor_context *ctx) + : be_visitor_decl (ctx) { } int be_visitor_operation_rettype_post_invoke_cs::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); be_type *bt = node; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } *os << bt->name () << "_forany _tao_retval_forany (" << be_idt << be_idt_nl << "_tao_retval.inout ()" << be_uidt_nl << ");\n" << be_uidt; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_upcall_ss.cpp index 8e547ffee36..90b7d6af6fb 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_upcall_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_post_upcall_ss.cpp @@ -19,38 +19,36 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_post_upcall_ss, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_post_upcall_ss, + "$Id$") // **************************************************************************** // visitor to do any post processing for return type after an upcall // **************************************************************************** be_visitor_operation_rettype_post_upcall_ss:: - be_visitor_operation_rettype_post_upcall_ss (be_visitor_context *ctx) - : be_visitor_decl (ctx) +be_visitor_operation_rettype_post_upcall_ss (be_visitor_context *ctx) + : be_visitor_decl (ctx) { } int be_visitor_operation_rettype_post_upcall_ss::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); be_type *bt = node; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } *os << bt->name () << "_forany _tao_retval_forany (" << be_idt << be_idt_nl << "_tao_retval.inout ()" << be_uidt_nl << ");\n" << be_uidt; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp index d3eb147723f..10b1afe61a6 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp @@ -19,14 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_pre_invoke_cs, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_pre_invoke_cs, + "$Id$") // ***************************************************************************** // be_visitor_operation_rettype_pre_invoke_cs @@ -46,28 +41,34 @@ be_visitor_operation_rettype_pre_invoke_cs:: int be_visitor_operation_rettype_pre_invoke_cs::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); + *os << "{" << be_idt_nl << bt->name () << "_slice *tmp;" << be_nl << "ACE_ALLOCATOR_RETURN (tmp, " << bt->name () << "_alloc (), _tao_retval._retn ());" << be_nl << "_tao_retval = tmp;" << be_uidt_nl << "}\n"; + return 0; } int be_visitor_operation_rettype_pre_invoke_cs::visit_interface (be_interface *) { - // don't do anything. This is the overriding action + // Don't do anything. This is the overriding action. return 0; } @@ -81,57 +82,69 @@ int be_visitor_operation_rettype_pre_invoke_cs:: visit_predefined_type (be_predefined_type *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); switch (node->pt ()) { case AST_PredefinedType::PT_any: os->indent (); + *os << "{" << be_idt_nl << "CORBA::Any *tmp;" << be_nl << "ACE_NEW_RETURN (tmp, CORBA::Any, _tao_retval._retn ());" << be_nl << "_tao_retval = tmp;" << be_uidt_nl << "}\n"; + break; default: break; } + return 0; } int be_visitor_operation_rettype_pre_invoke_cs::visit_sequence (be_sequence *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); + *os << "{" << be_idt_nl << bt->name () << " *tmp;" << be_nl << "ACE_NEW_RETURN (tmp, " << bt->name () << ", _tao_retval._retn ());" << be_nl << "_tao_retval = tmp;" << be_uidt_nl << "}\n"; + return 0; } int be_visitor_operation_rettype_pre_invoke_cs::visit_structure (be_structure *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } - // check if the union is variable if (node->size_type () == be_type::VARIABLE) { os->indent (); @@ -142,13 +155,15 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_structure (be_structure *node) << "_tao_retval = tmp;" << be_uidt_nl << "}\n"; } + return 0; } int be_visitor_operation_rettype_pre_invoke_cs::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // set the alias node + this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -157,6 +172,7 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } @@ -164,18 +180,22 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_typedef (be_typedef *node) int be_visitor_operation_rettype_pre_invoke_cs::visit_union (be_union *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } - // check if the union is variable if (node->size_type () == be_type::VARIABLE) { os->indent (); + *os << "{" << be_idt_nl << bt->name () << " *tmp;" << be_nl << "ACE_NEW_RETURN (tmp, " @@ -183,6 +203,7 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_union (be_union *node) << "_tao_retval = tmp;" << be_uidt_nl << "}\n"; } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp index 300c34bb256..c5f18a17af3 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_return_cs.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_return_cs, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_return_cs, + "$Id$") // ************************************************************ // be_visitor_operation_rettype_return_cs @@ -33,118 +28,127 @@ ACE_RCSID(be_visitor_operation, rettype_return_cs, "$Id$") // code to generate the return statement of the stub. // ************************************************************ -be_visitor_operation_rettype_return_cs::be_visitor_operation_rettype_return_cs -(be_visitor_context *ctx) +be_visitor_operation_rettype_return_cs:: +be_visitor_operation_rettype_return_cs (be_visitor_context *ctx) : be_visitor_decl (ctx) { } -be_visitor_operation_rettype_return_cs::~be_visitor_operation_rettype_return_cs (void) +be_visitor_operation_rettype_return_cs:: +~be_visitor_operation_rettype_return_cs (void) { } int be_visitor_operation_rettype_return_cs::visit_array (be_array *) { - // Grab the out stream TAO_OutStream *os = this->ctx_->stream (); *os << "_tao_retval._retn ()"; + return 0; } int be_visitor_operation_rettype_return_cs::visit_enum (be_enum *) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); *os << "_tao_retval"; + return 0; } int be_visitor_operation_rettype_return_cs::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); *os << "_tao_retval._retn ()"; + return 0; } int be_visitor_operation_rettype_return_cs::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); *os << "_tao_retval"; + return 0; } int be_visitor_operation_rettype_return_cs::visit_valuetype (be_valuetype *) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); *os << "_tao_retval._retn ()"; + return 0; } int be_visitor_operation_rettype_return_cs::visit_valuetype_fwd (be_valuetype_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); *os << "_tao_retval._retn ()"; + return 0; } int be_visitor_operation_rettype_return_cs::visit_predefined_type (be_predefined_type *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); switch (node->pt ()) { case AST_PredefinedType::PT_pseudo: *os << "_tao_retval._retn ()"; - break; + break; case AST_PredefinedType::PT_any: *os << "_tao_retval._retn ()"; - break; + break; case AST_PredefinedType::PT_void: break; - default: *os << "_tao_retval"; + break; } + return 0; } int be_visitor_operation_rettype_return_cs::visit_sequence (be_sequence *) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); *os << "_tao_retval._retn ()"; + return 0; } int be_visitor_operation_rettype_return_cs::visit_string (be_string *) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); *os << "_tao_retval._retn ()"; + return 0; } int be_visitor_operation_rettype_return_cs::visit_structure (be_structure *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); if (node->size_type () == be_decl::VARIABLE) { @@ -154,13 +158,15 @@ be_visitor_operation_rettype_return_cs::visit_structure (be_structure *node) { *os << "_tao_retval"; } + return 0; } int be_visitor_operation_rettype_return_cs::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // set the alias node + this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -169,6 +175,7 @@ be_visitor_operation_rettype_return_cs::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } @@ -176,7 +183,7 @@ be_visitor_operation_rettype_return_cs::visit_typedef (be_typedef *node) int be_visitor_operation_rettype_return_cs::visit_union (be_union *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + TAO_OutStream *os = this->ctx_->stream (); if (node->size_type () == be_decl::VARIABLE) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp index 79602578ad9..bb9e1a763bd 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_vardecl_cs, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_vardecl_cs, + "$Id$") // ************************************************************ // be_visitor_operation_rettype_vardecl_cs @@ -47,18 +42,21 @@ be_visitor_operation_rettype_vardecl_cs:: int be_visitor_operation_rettype_vardecl_cs::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); *os << bt->name () << "_var _tao_retval;"; - *os << be_nl; return 0; @@ -67,13 +65,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_array (be_array *node) int be_visitor_operation_rettype_vardecl_cs::visit_enum (be_enum *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); @@ -87,13 +89,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_enum (be_enum *node) int be_visitor_operation_rettype_vardecl_cs::visit_interface (be_interface *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); @@ -118,13 +124,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface_fwd ( be_interface_fwd *node ) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); @@ -147,13 +157,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface_fwd ( int be_visitor_operation_rettype_vardecl_cs::visit_valuetype (be_valuetype *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); @@ -166,13 +180,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype (be_valuetype *node) int be_visitor_operation_rettype_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); *os << "::" << bt->name () << "_var _tao_retval;\n\n" @@ -203,22 +221,27 @@ be_visitor_operation_rettype_vardecl_cs::visit_predefined_type (be_predefined_ty case AST_PredefinedType::PT_pseudo: *os << bt->name () << "_var _tao_retval (" << bt->name () << "::_nil ());"; + break; case AST_PredefinedType::PT_any: *os << bt->name () << "_var _tao_retval;"; + break; case AST_PredefinedType::PT_void: break; case AST_PredefinedType::PT_longdouble: *os << bt->name () << " _tao_retval = ACE_CDR_LONG_DOUBLE_INITIALIZER;"; + break; case AST_PredefinedType::PT_longlong: *os << bt->name () << " _tao_retval = ACE_CDR_LONGLONG_INITIALIZER;"; + break; default: *os << bt->name () << " _tao_retval = 0;"; + break; } @@ -230,17 +253,22 @@ be_visitor_operation_rettype_vardecl_cs::visit_predefined_type (be_predefined_ty int be_visitor_operation_rettype_vardecl_cs::visit_sequence (be_sequence *node) { - // we should never directly be here because anonymous sequence return types - // are not allowed - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + // We should never directly be here because anonymous sequence return types + // are not allowed. + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); + *os << bt->name () << "_var _tao_retval;\n" << be_nl; return 0; @@ -253,8 +281,6 @@ be_visitor_operation_rettype_vardecl_cs::visit_string (be_string *node) os->indent (); - // @@ Jeff, this sort of code looks weird to me, on *all* platforms - // sizeof(char) is 1, by definition... if (node->width () == (long) sizeof (char)) { *os << "CORBA::String_var _tao_retval;"; @@ -271,18 +297,22 @@ be_visitor_operation_rettype_vardecl_cs::visit_string (be_string *node) int be_visitor_operation_rettype_vardecl_cs::visit_structure (be_structure *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); - // based on whether we are variable or not, we return a pointer or the - // aggregate type + // Based on whether we are variable or not, we return a pointer or the + // aggregate type. if (node->size_type () == be_decl::VARIABLE) { *os << bt->name () << "_var _tao_retval;" << be_nl; @@ -301,7 +331,8 @@ be_visitor_operation_rettype_vardecl_cs::visit_structure (be_structure *node) int be_visitor_operation_rettype_vardecl_cs::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // set the alias node + this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -310,6 +341,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } @@ -317,18 +349,22 @@ be_visitor_operation_rettype_vardecl_cs::visit_typedef (be_typedef *node) int be_visitor_operation_rettype_vardecl_cs::visit_union (be_union *node) { - TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - be_type *bt; // return type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; - if (this->ctx_->alias ()) // a typedefed return type - bt = this->ctx_->alias (); + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); - // based on whether we are variable or not, we return a pointer or the - // aggregate type + // Based on whether we are variable or not, we return a pointer or the + // aggregate type. if (node->size_type () == be_decl::VARIABLE) { *os << bt->name () << "_var _tao_retval;"; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp index fb8da6e0eb2..3b1bec6ed16 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp @@ -19,14 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_operation.h" - -ACE_RCSID(be_visitor_operation, rettype_vardecl_ss, "$Id$") - +ACE_RCSID (be_visitor_operation, + rettype_vardecl_ss, + "$Id$") // ************************************************************************ // be_visitor_operation_rettype_vardecl_ss @@ -34,8 +29,8 @@ ACE_RCSID(be_visitor_operation, rettype_vardecl_ss, "$Id$") // of the return type. // ************************************************************************ -be_visitor_operation_rettype_vardecl_ss::be_visitor_operation_rettype_vardecl_ss -(be_visitor_context *ctx) +be_visitor_operation_rettype_vardecl_ss:: +be_visitor_operation_rettype_vardecl_ss (be_visitor_context *ctx) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp index 7818851434d..2dbf281187a 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_ch.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, - operation_smart_proxy_ch, + smart_proxy_ch, "$Id$") - // ****************************************************** // Primary visitor for "operation" in client header. // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp index 7f3e0bc24d6..e0740edbd2a 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/smart_proxy_cs.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, operation_smart_proxy_cs, "$Id$") - // ************************************************************ // Operation visitor for client stubs // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_sh.cpp index c279b788c7b..dee8e532915 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_sh.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, thru_poa_collocated_sh, "$Id$") - // ************************************************************************* // This visitor generates code for the thru_poa_collocated operation signature in a // server header file. diff --git a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp index b4b064c52f6..a6c49b433a0 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, thru_poa_collocated_ss, "$Id$") - // ************************************************************************* // This visitor generates code for the thru_poa_collocated operation signature in a // server skeletons file. diff --git a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp index 4f7e5c3eba1..ac4f698f973 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_proxy_impl_ss.cpp @@ -1,15 +1,9 @@ // $Id$ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, be_visitor_operation_thru_poa_proxy_impl_ss, "$Id$") - // ************************************************************ // Operation visitor for client stubs // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp index a583e5e5701..ea3cc13e472 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp @@ -19,16 +19,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, tie_sh, "$Id$") - // ************************************************************ // Operation visitor for server header for TIE class operations. // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp b/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp index b5a7ff5eb3b..131fe85fbde 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp @@ -18,11 +18,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_operation.h" - ACE_RCSID (be_visitor_operation, tie_si, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_root.cpp b/TAO/TAO_IDL/be/be_visitor_root.cpp index 6521d5d8535..e817d94d311 100644 --- a/TAO/TAO_IDL/be/be_visitor_root.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root.cpp @@ -16,12 +16,35 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_constant.h" +#include "be_enum.h" +#include "be_exception.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_module.h" +#include "be_root.h" +#include "be_structure.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_helper.h" +#include "be_extern.h" + #include "be_visitor_root.h" +#include "be_visitor_constant.h" +#include "be_visitor_enum.h" +#include "be_visitor_exception.h" +#include "be_visitor_interface.h" +#include "be_visitor_interface_fwd.h" +#include "be_visitor_module.h" +#include "be_visitor_structure.h" +#include "be_visitor_typedef.h" +#include "be_visitor_union.h" +#include "be_visitor_valuetype.h" +#include "be_visitor_valuetype_fwd.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_root/root.cpp" #include "be_visitor_root/root_ch.cpp" #include "be_visitor_root/root_ci.cpp" @@ -35,4 +58,6 @@ #include "be_visitor_root/any_op.cpp" #include "be_visitor_root/cdr_op.cpp" -ACE_RCSID(be, be_visitor_root, "$Id$") +ACE_RCSID (be, + be_visitor_root, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp b/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp index 9d31730b5c7..427dbbb8125 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/any_op.cpp @@ -19,14 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, any_op, "$Id$") - +ACE_RCSID (be_visitor_root, + any_op, + "$Id$") // *************************************************************************** // Root visitor for generating Any operator declarations in the client header @@ -45,12 +40,13 @@ be_visitor_root_any_op::~be_visitor_root_any_op (void) int be_visitor_root_any_op::visit_root (be_root *node) { - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root::visit_root - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp b/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp index 36f9214da42..b9101b6c527 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp @@ -19,14 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, cdr_op, "$Id$") - +ACE_RCSID (be_visitor_root, + cdr_op, + "$Id$") // *************************************************************************** // Root visitor for generating CDR operator declarations in the client header @@ -53,12 +48,12 @@ be_visitor_root_cdr_op::visit_root (be_root *node) << "#ifndef __ACE_INLINE__\n\n"; } - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root_cdr_op::visit_root - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_CDR_OP_CH) diff --git a/TAO/TAO_IDL/be/be_visitor_root/root.cpp b/TAO/TAO_IDL/be/be_visitor_root/root.cpp index f4db20744e8..bd676128b11 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root.cpp @@ -18,26 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_root.h" -#include "be_visitor_valuetype/obv_module.h" -#include "be_visitor_constant.h" -#include "be_visitor_enum.h" -#include "be_visitor_exception.h" -#include "be_visitor_interface_fwd.h" -#include "be_visitor_module.h" -#include "be_visitor_structure.h" -#include "be_visitor_typedef.h" -#include "be_visitor_union.h" -#include "be_visitor_valuetype_fwd.h" - ACE_RCSID (be_visitor_root, root, "$Id$") - // Generic Root visitor be_visitor_root::be_visitor_root (be_visitor_context *ctx) : be_visitor_scope (ctx) @@ -604,6 +588,7 @@ be_visitor_root::visit_interface (be_interface *node) // will be modified based on what type of node we are visiting. be_visitor_context ctx (*this->ctx_); ctx.node (node); + int status = 1; switch (this->ctx_->state ()) { @@ -611,41 +596,89 @@ be_visitor_root::visit_interface (be_interface *node) ctx.state (TAO_CodeGen::TAO_INTERFACE_CH); break; case TAO_CodeGen::TAO_ROOT_CI: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CI); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CI); + be_visitor_interface_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CS); + be_visitor_interface_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_SH: - ctx.state (TAO_CodeGen::TAO_INTERFACE_SH); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_SH); + be_visitor_interface_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_IH: - ctx.state (TAO_CodeGen::TAO_INTERFACE_IH); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_IH); + be_visitor_interface_ih visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_SI: - ctx.state (TAO_CodeGen::TAO_INTERFACE_SI); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_SI); + be_visitor_interface_si visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_SS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_SS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_SS); + be_visitor_interface_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_IS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_IS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_IS); + be_visitor_interface_is visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: - ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH); + be_visitor_interface_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS); + be_visitor_interface_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH); + be_visitor_interface_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI); + be_visitor_interface_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: - ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS); + be_visitor_interface_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } default: { ACE_ERROR_RETURN ((LM_ERROR, @@ -656,6 +689,19 @@ be_visitor_root::visit_interface (be_interface *node) } } + if (status == 0) + { + return 0; + } + else if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root::" + "visit_interface - " + "failed to accept visitor\n"), + -1); + } + // Change the state depending on the kind of node strategy ctx.state (node->next_state (ctx.state ())); @@ -801,33 +847,66 @@ be_visitor_root::visit_valuetype (be_valuetype *node) // will be modified based on what type of node we are visiting. be_visitor_context ctx (*this->ctx_); ctx.node (node); + int status = 0; switch (this->ctx_->state ()) { case TAO_CodeGen::TAO_ROOT_CH: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CH); + be_visitor_valuetype_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CI: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_CI); - break; + { + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CI); + be_visitor_valuetype_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CS: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CS); + be_visitor_valuetype_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH); + be_visitor_valuetype_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI); - break; + { + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI); + be_visitor_valuetype_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS); + be_visitor_valuetype_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH); - break; + { + ctx.state (TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH); + be_visitor_valuetype_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS); - break; + { + ctx.state (TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS); + be_visitor_valuetype_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_ROOT_SH: case TAO_CodeGen::TAO_ROOT_IH: case TAO_CodeGen::TAO_ROOT_SI: @@ -845,21 +924,7 @@ be_visitor_root::visit_valuetype (be_valuetype *node) } } - // Change the state depending on the kind of node strategy. - ctx.state (node->next_state (ctx.state ())); - - be_visitor *visitor = tao_cg->make_visitor (&ctx); - - if (!visitor) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_root::" - "visit_valuetype - " - "NUL visitor\n"), - -1); - } - - if (node->accept (visitor) == -1) + if (status == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root::" @@ -868,39 +933,6 @@ be_visitor_root::visit_valuetype (be_valuetype *node) -1); } - delete visitor; - visitor = 0; - - // Do addtional "extra" code generation if necessary. - if (node->has_extra_code_generation (ctx.state ())) - { - // Change the state depending on the kind of node strategy. - ctx.state (node->next_state (ctx.state (), 1)); - - visitor = tao_cg->make_visitor (&ctx); - - if (!visitor) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_root::" - "visit_valuetype - " - "NUL visitor\n"), - -1); - } - - if (node->accept (visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_root::" - "visit_valuetype - " - "failed to accept visitor\n"), - -1); - } - - delete visitor; - visitor = 0; - } - return 0; } @@ -952,37 +984,26 @@ be_visitor_root::visit_valuetype_fwd (be_valuetype_fwd *node) case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IS: case TAO_CodeGen::TAO_ROOT_IH: - return 0; // nothing to be done + return 0; // nothing to be done default: { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root::" "visit_valuetype_fwd - " - "Bad context state\n" - ), -1); + "Bad context state\n"), + -1); } } - be_visitor *visitor = tao_cg->make_visitor (&ctx); - if (!visitor) + if (status == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root::" "visit_valuetype_fwd - " - "NUL visitor\n" - ), -1); + "failed to accept visitor\n"), + -1); } - // let the node accept this visitor - if (node->accept (visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_root::" - "visit_valuetype_fwd - " - "failed to accept visitor\n" - ), -1); - } - delete visitor; return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp index fd9bb00d90e..ff7dba28e3a 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_ch.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, root_ch, "$Id$") - +ACE_RCSID (be_visitor_root, + root_ch, + "$Id$") // ******************************** // Root visitor for client header @@ -47,10 +42,10 @@ be_visitor_root_ch::init (void) if (tao_cg->start_client_header (be_global->be_get_client_hdr_fname ()) == -1) { - ACE_ERROR ((LM_ERROR, - "(%N:%l) be_visitor_root_ch::init - " - "Error opening client header file\n")); - return -1; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root_ch::init - " + "Error opening client header file\n"), + -1); } // Initialize the stream. diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp index a7c9d9e60db..4a6001866d6 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_ci.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, root_ci, "$Id$") - +ACE_RCSID (be_visitor_root, + root_ci, + "$Id$") // ********************************* // Root visitor for client inline @@ -47,10 +42,10 @@ be_visitor_root_ci::init (void) if (tao_cg->start_client_inline (be_global->be_get_client_inline_fname ()) == -1) { - ACE_ERROR ((LM_ERROR, - "(%N:%l) be_visitor_root_ci - " - "Error opening client inline file\n")); - return -1; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root_ci - " + "Error opening client inline file\n"), + -1); } this->ctx_->stream (tao_cg->client_inline ()); diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp index aea6f39d996..2fcc8acd791 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_cs.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, root_cs, "$Id$") - +ACE_RCSID (be_visitor_root, + root_cs, + "$Id$") // *********************************** // Root visitor for client stubs @@ -49,7 +44,8 @@ be_visitor_root_cs::init (void) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root_cs - " - "Error opening client stub file\n"), -1); + "Error opening client stub file\n"), + -1); } // init stream diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp index e913ee653b6..5ff8eea3403 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_ih.cpp @@ -16,14 +16,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, root_ih, "$Id$") - +ACE_RCSID (be_visitor_root, + root_ih, + "$Id$") // *********************************** // Root visitor for implementation header @@ -41,7 +36,6 @@ be_visitor_root_ih::~be_visitor_root_ih (void) int be_visitor_root_ih::init (void) { - // open the file if (tao_cg->start_implementation_header ( be_global->be_get_implementation_hdr_fname () ) @@ -56,7 +50,6 @@ be_visitor_root_ih::init (void) } - // set the stream and the next state this->ctx_->stream (tao_cg->implementation_header ()); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp index c6b1aeab137..6f79c610fcf 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_is.cpp @@ -14,14 +14,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -//ACE_RCSID(be_visitor_root, root_ss, "$Id$") - +ACE_RCSID (be_visitor_root, + root_is, + "$Id$") // ****************************************************** // Root visitor for implementation skeletons @@ -39,7 +34,7 @@ be_visitor_root_is::~be_visitor_root_is (void) int be_visitor_root_is::init (void) { - // first open the file for writing + // First open the file for writing. if (tao_cg->start_implementation_skeleton ( be_global->be_get_implementation_skel_fname () ) @@ -47,10 +42,10 @@ be_visitor_root_is::init (void) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root_is::init - " - "Error opening implementation skeletons file\n"), -1); + "Error opening implementation skeletons file\n"), + -1); } - // set stream this->ctx_->stream (tao_cg->implementation_skeleton ()); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp index 3443aa6fac7..affeb35db6c 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, root_sh, "$Id$") - +ACE_RCSID (be_visitor_root, + root_sh, + "$Id$") // *********************************** // Root visitor for server header diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp index dedd3512e93..77cd9ceb807 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, root_si, "$Id$") - +ACE_RCSID (be_visitor_root, + root_si, + "$Id$") // *********************************************** // Root visitor for server inline @@ -49,7 +44,8 @@ be_visitor_root_si::init (void) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root_si::init - " - "server inline open failed\n"), -1); + "server inline open failed\n"), + -1); } if (be_global->gen_tie_classes ()) diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp index c661b0ffea1..fcaf4307fac 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" - -ACE_RCSID(be_visitor_root, root_ss, "$Id$") - +ACE_RCSID (be_visitor_root, + root_ss, + "$Id$") // ****************************************************** // Root visitor for server skeletons @@ -51,7 +46,8 @@ be_visitor_root_ss::init (void) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_root_ss::init - " - "Error opening server skeletons file\n"), -1); + "Error opening server skeletons file\n"), + -1); } if (be_global->gen_tie_classes ()) diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp index a15e855d3c9..a0c622bc66f 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp @@ -18,15 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_root.h" -#include "be_visitor_interface.h" - -ACE_RCSID(be_visitor_root, root_sth, "$Id$") - +ACE_RCSID (be_visitor_root, + root_sth, + "$Id$") // **************************************** // Root visitor for server template header diff --git a/TAO/TAO_IDL/be/be_visitor_scope.cpp b/TAO/TAO_IDL/be/be_visitor_scope.cpp index e2cc13b8793..1b473fa8395 100644 --- a/TAO/TAO_IDL/be/be_visitor_scope.cpp +++ b/TAO/TAO_IDL/be/be_visitor_scope.cpp @@ -19,13 +19,14 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_argument.h" +#include "be_scope.h" #include "be_visitor_scope.h" +#include "be_visitor_context.h" -ACE_RCSID(be, be_visitor_scope, "$Id$") - +ACE_RCSID (be, + be_visitor_scope, + "$Id$") // ****************************************************** // Generic visitor for a scope. diff --git a/TAO/TAO_IDL/be/be_visitor_sequence.cpp b/TAO/TAO_IDL/be/be_visitor_sequence.cpp index e147b3f6f1e..863d6bd9b43 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence.cpp @@ -16,12 +16,28 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_array.h" +#include "be_enum.h" +#include "be_exception.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_predefined_type.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_union.h" +#include "be_type.h" +#include "be_typedef.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_helper.h" +#include "be_extern.h" +#include "utl_identifier.h" +#include "nr_extern.h" + #include "be_visitor_sequence.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_sequence/any_op_ch.cpp" #include "be_visitor_sequence/any_op_cs.cpp" #include "be_visitor_sequence/cdr_op_ch.cpp" diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp index f3b7dd95692..74f5d11f66e 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp @@ -18,21 +18,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_sequence, any_op_ch, "$Id$") - +ACE_RCSID (be_visitor_sequence, + any_op_ch, + "$Id$") // *************************************************************************** // Sequence visitor for generating Any operator declarations in the client header // *************************************************************************** -be_visitor_sequence_any_op_ch::be_visitor_sequence_any_op_ch -(be_visitor_context *ctx) +be_visitor_sequence_any_op_ch::be_visitor_sequence_any_op_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -53,7 +49,7 @@ be_visitor_sequence_any_op_ch::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); - // generate the Any <<= and >>= operators + // Generate the Any <<= and >>= operators. os->indent (); *os << be_global->stub_export_macro (); *os << " void" diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp index 5f832013e69..3642ee6d578 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp @@ -18,22 +18,19 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_sequence, any_op_cs, "$Id$") +ACE_RCSID (be_visitor_sequence, + any_op_cs, + "$Id$") // *************************************************************************** // Sequence visitor for generating Any operator declarations in the client // stubs file // *************************************************************************** -be_visitor_sequence_any_op_cs::be_visitor_sequence_any_op_cs -(be_visitor_context *ctx) +be_visitor_sequence_any_op_cs::be_visitor_sequence_any_op_cs ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -52,7 +49,7 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); - // Any <<= and >>= operators + // Any <<= and >>= operators. os->indent (); *os << "void operator<<= (" << be_idt << be_idt_nl << "CORBA::Any &_tao_any," << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp index ae3536245da..434e5706ed8 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp @@ -18,21 +18,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_sequence, buffer_type, "$Id$") - +ACE_RCSID (be_visitor_sequence, + buffer_type, + "$Id$") // **************************************************************** // We have to generate the buffer type in the constructor // **************************************************************** -be_visitor_sequence_buffer_type:: -be_visitor_sequence_buffer_type (be_visitor_context *ctx) +be_visitor_sequence_buffer_type::be_visitor_sequence_buffer_type ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -49,14 +45,23 @@ be_visitor_sequence_buffer_type::visit_node (be_type *node) be_type *bt; if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH) - *os << bt->nested_type_name (this->ctx_->scope ()); + { + *os << bt->nested_type_name (this->ctx_->scope ()); + } else - *os << bt->name (); + { + *os << bt->name (); + } + return 0; } @@ -64,10 +69,16 @@ int be_visitor_sequence_buffer_type::visit_predefined_type (be_predefined_type *node) { TAO_OutStream *os = this->ctx_->stream (); + if (node->pt () == AST_PredefinedType::PT_pseudo) - *os << node->name () << "_ptr"; + { + *os << node->name () << "_ptr"; + } else - *os << node->name (); + { + *os << node->name (); + } + return 0; } @@ -81,10 +92,16 @@ int be_visitor_sequence_buffer_type::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); + if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH) - *os << node->nested_type_name (this->ctx_->scope (), "_ptr"); + { + *os << node->nested_type_name (this->ctx_->scope (), "_ptr"); + } else - *os << node->name () << "_ptr"; + { + *os << node->name () << "_ptr"; + } + return 0; } @@ -92,10 +109,16 @@ int be_visitor_sequence_buffer_type::visit_interface_fwd (be_interface_fwd *node) { TAO_OutStream *os = this->ctx_->stream (); + if (this->ctx_->state () == TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH) - *os << node->nested_type_name (this->ctx_->scope (), "_ptr"); + { + *os << node->nested_type_name (this->ctx_->scope (), "_ptr"); + } else - *os << node->name () << "_ptr"; + { + *os << node->name () << "_ptr"; + } + return 0; } @@ -161,7 +184,8 @@ be_visitor_sequence_buffer_type::visit_array (be_array *node) int be_visitor_sequence_buffer_type::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // set the alias node + this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -170,6 +194,7 @@ be_visitor_sequence_buffer_type::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp index 32c29cc8b76..4c860142bf7 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp @@ -19,20 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_sequence, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_sequence, + cdr_op_ch, + "$Id$") // *************************************************************************** // Sequence visitor for generating CDR operator declarations in the client header // *************************************************************************** -be_visitor_sequence_cdr_op_ch::be_visitor_sequence_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_sequence_cdr_op_ch::be_visitor_sequence_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -44,15 +41,15 @@ be_visitor_sequence_cdr_op_ch::~be_visitor_sequence_cdr_op_ch (void) int be_visitor_sequence_cdr_op_ch::visit_sequence (be_sequence *node) { - if (node->cli_hdr_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_hdr_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator declarations - be_type *bt = be_type::narrow_from_decl (node); be_typedef *tdef = be_typedef::narrow_from_decl (bt); diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp index cff75285ad5..bc92dc2684a 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp @@ -19,22 +19,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_sequence, cdr_op_ci, "$Id$") - +ACE_RCSID (be_visitor_sequence, + cdr_op_ci, + "$Id$") // *************************************************************************** // Sequence visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_sequence_cdr_op_ci::be_visitor_sequence_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_sequence_cdr_op_ci::be_visitor_sequence_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -46,10 +42,12 @@ be_visitor_sequence_cdr_op_ci::~be_visitor_sequence_cdr_op_ci (void) int be_visitor_sequence_cdr_op_ci::visit_sequence (be_sequence *node) { - if (node->cli_inline_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_inline_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp index 4dd714d544d..913121af8eb 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp @@ -19,11 +19,6 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, cdr_op_cs, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp index 1232a499956..5d0c6833595 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_sequence, elemtype, "$Id$") - +ACE_RCSID (be_visitor_sequence, + elemtype, + "$Id$") // *********************************************************** // sequence element type visitor for return types of [] methods // *********************************************************** -be_visitor_sequence_elemtype:: -be_visitor_sequence_elemtype (be_visitor_context *ctx) +be_visitor_sequence_elemtype::be_visitor_sequence_elemtype ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -50,14 +46,23 @@ be_visitor_sequence_elemtype::visit_node (be_type *node) be_type *bt; if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH) - *os << bt->nested_type_name (this->ctx_->scope ()) << " &"; + { + *os << bt->nested_type_name (this->ctx_->scope ()) << " &"; + } else - *os << bt->name () << " &"; + { + *os << bt->name () << " &"; + } + return 0; } @@ -68,9 +73,13 @@ be_visitor_sequence_elemtype::visit_predefined_type (be_predefined_type *node) be_type *bt; if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } switch (node->pt ()) { @@ -79,6 +88,7 @@ be_visitor_sequence_elemtype::visit_predefined_type (be_predefined_type *node) int is_pseudo_object = ACE_OS::strcmp (node->local_name ()->get_string (), "Object") != 0; + if (is_pseudo_object) { *os << "TAO_Pseudo_Object_Manager<"; @@ -87,6 +97,7 @@ be_visitor_sequence_elemtype::visit_predefined_type (be_predefined_type *node) { *os << "TAO_Object_Manager<"; } + if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH) { *os << bt->nested_type_name (this->ctx_->scope ()) << ","; @@ -101,10 +112,15 @@ be_visitor_sequence_elemtype::visit_predefined_type (be_predefined_type *node) break; default: if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH) - *os << bt->nested_type_name (this->ctx_->scope ()) << " &"; + { + *os << bt->nested_type_name (this->ctx_->scope ()) << " &"; + } else - *os << bt->name () << " &"; + { + *os << bt->name () << " &"; + } } + return 0; } @@ -121,9 +137,13 @@ be_visitor_sequence_elemtype::visit_interface (be_interface *node) be_type *bt; if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH) { @@ -148,9 +168,13 @@ be_visitor_sequence_elemtype::visit_valuetype (be_valuetype *node) be_type *bt; if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH) { @@ -175,9 +199,13 @@ be_visitor_sequence_elemtype::visit_interface_fwd (be_interface_fwd *node) be_type *bt; if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH) { @@ -202,9 +230,13 @@ be_visitor_sequence_elemtype::visit_valuetype_fwd (be_valuetype_fwd *node) be_type *bt; if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH) { @@ -273,6 +305,7 @@ int be_visitor_sequence_elemtype::visit_typedef (be_typedef *node) { this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -281,6 +314,7 @@ be_visitor_sequence_elemtype::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp index 5bfbd0b57ff..af5d0e45be4 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp @@ -20,14 +20,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_obj_sequence_ch, "$Id$") - int be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp index feb90e31a0a..589d4358b25 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp @@ -19,9 +19,6 @@ // Modifications by Aniruddha Gokhale // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_obj_sequence_ci, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp index bf51424b76a..9aedb1f3020 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp @@ -19,9 +19,6 @@ // Modifications by Aniruddha Gokhale // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_obj_sequence_cs, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp index 6e6a167697d..afc53785a3d 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ch.cpp @@ -18,14 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_sequence_ch, "$Id$") - int be_visitor_sequence_ch::gen_bounded_sequence (be_sequence *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp index 14b3ac8479f..12c65e6b954 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp @@ -18,11 +18,9 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_sequence, gen_bounded_sequence_ci, "$Id$") - +ACE_RCSID (be_visitor_sequence, + gen_bounded_sequence_ci, + "$Id$") int be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) @@ -33,12 +31,14 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) // Retrieve the base type since we may need to do some code // generation for the base type. bt = be_type::narrow_from_decl (node->base_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_sequence_ci::" "visit_sequence - " - "Bad element type\n"), -1); + "Bad element type\n"), + -1); } // If we contain an anonymous sequence, diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp index 11075b2288b..bff0ecd7d6a 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp @@ -18,14 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_sequence_cs, "$Id$") - int be_visitor_sequence_cs::gen_bounded_sequence (be_sequence *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ch.cpp index 5ac6e43cda1..77aa4f0f9a7 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ch.cpp @@ -19,14 +19,10 @@ // Modifications by Aniruddha Gokhale // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_str_sequence_ch, "$Id$") - int be_visitor_sequence_ch::gen_bounded_str_sequence (be_sequence *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp index 910464abd10..1d812a7a7ed 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp @@ -20,14 +20,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_str_sequence_ci, "$Id$") - int be_visitor_sequence_ci::gen_bounded_str_sequence (be_sequence *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp index e3fbd3a32a6..f9c52236c97 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp @@ -20,9 +20,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_str_sequence_cs, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_ch.cpp index f9347776058..5765060d42b 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_ch.cpp @@ -18,9 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_wstr_sequence_ch, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_ci.cpp index a8d0e7de912..a53dc89ec60 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_ci.cpp @@ -18,9 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_wstr_sequence_ci, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_cs.cpp index c629ce046c5..ea70ec143bc 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_wstr_sequence_cs.cpp @@ -18,9 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_bounded_wstr_sequence_cs, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp index 1c688940ce3..89ed1572fbe 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp @@ -20,15 +20,10 @@ // // ============================================================================ - -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_unbounded_obj_sequence_ch, "$Id$") - int be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp index eac4ac2698d..f1da3ed2854 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp @@ -19,9 +19,6 @@ // Modifications by Aniruddha Gokhale // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_unbounded_obj_sequence_ci, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp index 25e0acfef31..712e7dc2b74 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp @@ -19,9 +19,6 @@ // Modifications by Aniruddha Gokhale // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_unbounded_obj_sequence_cs, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ch.cpp index 3227a4b9ae4..fde9d8dfe05 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ch.cpp @@ -18,9 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_unbounded_sequence_ch, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp index f6a6d32e63a..9c558ec65bc 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp @@ -18,9 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_unbounded_sequence_ci, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp index c8828556951..23546d87070 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp @@ -18,9 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, gen_unbounded_sequence_cs, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp index cef298252f5..17a189bd353 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_base.cpp @@ -18,22 +18,16 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_sequence.h" - -ACE_RCSID(be_visitor_sequence, sequence_base, "$Id$") - +ACE_RCSID (be_visitor_sequence, + sequence_base, + "$Id$") // **************************************************************** // We have to generate the parameters for the template that implements // each sequence type. // **************************************************************** -be_visitor_sequence_base:: -be_visitor_sequence_base (be_visitor_context *ctx) +be_visitor_sequence_base::be_visitor_sequence_base (be_visitor_context *ctx) : be_visitor_decl (ctx) { } @@ -47,7 +41,9 @@ int be_visitor_sequence_base::visit_predefined_type (be_predefined_type *node) { TAO_OutStream *os = this->ctx_->stream (); + *os << node->name (); + return 0; } @@ -176,8 +172,8 @@ be_visitor_sequence_base::visit_typedef (be_typedef *node) } be_visitor_sequence_base_template_args:: - be_visitor_sequence_base_template_args (be_visitor_context *ctx, - be_sequence *seq) +be_visitor_sequence_base_template_args (be_visitor_context *ctx, + be_sequence *seq) : be_visitor_sequence_base (ctx), beseq_ (seq) { @@ -186,7 +182,7 @@ be_visitor_sequence_base_template_args:: be_visitor_sequence_base_template_args:: - ~be_visitor_sequence_base_template_args (void) +~be_visitor_sequence_base_template_args (void) { //no-op } diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp index 12fb8b09564..3f1a1da8d8b 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, sequence_ch, "$Id$") - // Root visitor for client header. be_visitor_sequence_ch::be_visitor_sequence_ch (be_visitor_context *ctx) : be_visitor_decl (ctx) diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp index b1f113a6c4e..682cdf9f5f3 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, sequence_ci, "$Id$") - // *********************************************************** // Sequence visitor for inline generation. // *********************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp index fb10bec42ae..e4c94964bbd 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp @@ -18,16 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_sequence.h" - ACE_RCSID (be_visitor_sequence, sequence_cs, "$Id$") - // ************************************************************ // Root visitor for client stub class // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_structure.cpp b/TAO/TAO_IDL/be/be_visitor_structure.cpp index 53305f2da63..288b9ef1fc4 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure.cpp @@ -18,13 +18,16 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_field.h" +#include "be_structure.h" +#include "be_helper.h" +#include "be_extern.h" #include "be_visitor_structure.h" +#include "be_visitor_field.h" +#include "be_visitor_typecode.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_structure/structure.cpp" #include "be_visitor_structure/structure_ch.cpp" #include "be_visitor_structure/structure_ci.cpp" @@ -35,4 +38,6 @@ #include "be_visitor_structure/cdr_op_ci.cpp" #include "be_visitor_structure/cdr_op_cs.cpp" -ACE_RCSID(be, be_visitor_structure, "$Id$") +ACE_RCSID (be, + be_visitor_structure, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp index 270d28077df..d8e5ccd9d59 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/any_op_ch.cpp @@ -18,21 +18,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_structure.h" - -ACE_RCSID(be_visitor_structure, any_op_ch, "$Id$") - +ACE_RCSID (be_visitor_structure, + any_op_ch, + "$Id$") // *************************************************************************** // Structure visitor for generating Any operator declarations in the client header // *************************************************************************** -be_visitor_structure_any_op_ch::be_visitor_structure_any_op_ch -(be_visitor_context *ctx) +be_visitor_structure_any_op_ch::be_visitor_structure_any_op_ch ( + be_visitor_context *ctx + ) : be_visitor_structure (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp index 76635942a48..ca4e2e83347 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/any_op_cs.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_structure.h" - -ACE_RCSID(be_visitor_structure, any_op_cs, "$Id$") - +ACE_RCSID (be_visitor_structure, + any_op_cs, + "$Id$") // *************************************************************************** // Structure visitor for generating Any operator declarations in the client // stubs file // *************************************************************************** -be_visitor_structure_any_op_cs::be_visitor_structure_any_op_cs -(be_visitor_context *ctx) +be_visitor_structure_any_op_cs::be_visitor_structure_any_op_cs ( + be_visitor_context *ctx + ) : be_visitor_structure (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp index 4f561b10d61..4185d0e2669 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ch.cpp @@ -19,20 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_structure.h" - -ACE_RCSID(be_visitor_structure, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_structure, + cdr_op_ch, + "$Id$") // *************************************************************************** // Structure visitor for generating CDR operator declarations in the client header // *************************************************************************** -be_visitor_structure_cdr_op_ch::be_visitor_structure_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_structure_cdr_op_ch::be_visitor_structure_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_structure (ctx) { } @@ -44,15 +41,18 @@ be_visitor_structure_cdr_op_ch::~be_visitor_structure_cdr_op_ch (void) int be_visitor_structure_cdr_op_ch::visit_structure (be_structure *node) { - if (node->cli_hdr_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_hdr_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator declarations + // Generate the CDR << and >> operator declarations. os->indent (); + *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const " << node->name () << " &);" << be_nl; @@ -61,15 +61,16 @@ be_visitor_structure_cdr_op_ch::visit_structure (be_structure *node) << node->name () << " &);\n"; - // set the substate as generating code for the types defined in our scope + // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_cdr_op_ch::" "visit_structure - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } diff --git a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ci.cpp index 395750ef6a2..6b171c4c67f 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_ci.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_structure.h" -#include "be_visitor_field.h" - -ACE_RCSID(be_visitor_structure, cdr_op_ci, "$Id$") +ACE_RCSID (be_visitor_structure, + cdr_op_ci, + "$Id$") // *************************************************************************** // Structure visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_structure_cdr_op_ci::be_visitor_structure_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_structure_cdr_op_ci::be_visitor_structure_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_structure (ctx) { } @@ -46,49 +42,51 @@ int be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) { // already generated and/or we are imported. Don't do anything. - if (node->cli_inline_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_inline_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); // First generate code for our children. The reason we do this first is // because the inlined code for our children must be available before we use - // it in our parent + // it in our parent. - // set the substate as generating code for the types defined in our scope + // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_cdr_op_ci" "::visit_structure - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } - // set the sub state as generating code for the output operator + // Set the sub state as generating code for the output operator. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT); *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, " << "const " << node->name () << " &_tao_aggregate)" << be_nl << "{" << be_idt_nl; { - be_visitor_context* new_ctx = - new be_visitor_context (*this->ctx_); - be_visitor_cdr_op_field_decl field_decl (new_ctx); + be_visitor_context new_ctx (*this->ctx_); + be_visitor_cdr_op_field_decl field_decl (&new_ctx); field_decl.visit_scope (node); } *os << "if (" << be_idt_nl; - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_cdr_op_ci::" "visit_structure - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << be_uidt_nl << ")" << be_idt_nl @@ -97,27 +95,26 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) << "return 0;" << be_uidt_nl << be_uidt_nl << "}\n\n"; - // set the substate as generating code for the input operator + // Set the substate as generating code for the input operator. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT); *os << "ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, " << node->name () << " &_tao_aggregate)" << be_nl << "{" << be_idt_nl; { - be_visitor_context* new_ctx = - new be_visitor_context (*this->ctx_); - be_visitor_cdr_op_field_decl field_decl (new_ctx); + be_visitor_context new_ctx (*this->ctx_); + be_visitor_cdr_op_field_decl field_decl (&new_ctx); field_decl.visit_scope (node); } *os << "if (" << be_idt_nl; - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_cdr_op_ci" "::visit_structure - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } *os << be_uidt_nl << ")" << be_idt_nl @@ -143,6 +140,7 @@ be_visitor_structure_cdr_op_ci::post_process (be_decl *bd) case TAO_CodeGen::TAO_CDR_OUTPUT: case TAO_CodeGen::TAO_CDR_INPUT: *os << " &&" << be_nl; + break; case TAO_CodeGen::TAO_CDR_SCOPE: default: diff --git a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp index db7f2e7cbc6..7c9c1797e4d 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/cdr_op_cs.cpp @@ -18,16 +18,13 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_structure, + cdr_op_cs, + "$Id$") -#include "be_visitor_structure.h" -#include "be_visitor_field.h" - -ACE_RCSID(be_visitor_structure, cdr_op_cs, "$Id$") - -be_visitor_structure_cdr_op_cs::be_visitor_structure_cdr_op_cs (be_visitor_context *ctx) +be_visitor_structure_cdr_op_cs::be_visitor_structure_cdr_op_cs ( + be_visitor_context *ctx + ) : be_visitor_structure (ctx) { } @@ -39,23 +36,25 @@ be_visitor_structure_cdr_op_cs::~be_visitor_structure_cdr_op_cs (void) int be_visitor_structure_cdr_op_cs::visit_structure (be_structure *node) { - if (node->cli_stub_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_stub_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } - // set the substate as generating code for the types defined in our scope + // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_cdr_op_cs::" "visit_structure - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } - node->cli_stub_cdr_op_gen (1); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp index 532392cf184..33a1ec1fa86 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure.cpp @@ -18,15 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_structure.h" -#include "be_visitor_field.h" - ACE_RCSID (be_visitor_structure, structure, "$Id$") - be_visitor_structure::be_visitor_structure (be_visitor_context *ctx) : be_visitor_scope (ctx) { diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp index 253488143cf..ff1448ce383 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp @@ -18,15 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_structure.h" -#include "be_visitor_typecode/typecode_decl.h" - ACE_RCSID (be_visitor_structure, structure_ch, "$Id$") - // ****************************************************** // for client header // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp index 8271008eb2b..83d98176692 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_structure.h" - -ACE_RCSID(be_visitor_structure, structure_ci, "$Id$") - +ACE_RCSID (be_visitor_structure, + structure_ci, + "$Id$") // ****************************************************** // for client inline diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp index 73c0855247c..dd98e1c89e6 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp @@ -18,15 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_structure.h" -#include "be_visitor_typecode/typecode_defn.h" - ACE_RCSID (be_visitor_structure, structure_cs, "$Id$") - // *************************************************************************** // For client stubs. // *************************************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode.cpp index 9267ece581e..9f39e9c258a 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode.cpp @@ -18,15 +18,34 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_array.h" +#include "be_enum.h" +#include "be_enum_val.h" +#include "be_exception.h" +#include "be_field.h" +#include "be_interface.h" +#include "be_module.h" +#include "be_predefined_type.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_type.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_union_branch.h" +#include "be_valuetype.h" +#include "be_helper.h" +#include "be_extern.h" +#include "utl_identifier.h" +#include "ast_union_label.h" #include "be_visitor_typecode.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_typecode/typecode_decl.cpp" #include "be_visitor_typecode/typecode_defn.cpp" -ACE_RCSID(be, be_visitor_typecode, "$Id$") +ACE_RCSID (be, + be_visitor_typecode, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp index aac1ea44444..4ee204f3cd7 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_typecode.h" - -ACE_RCSID(be_visitor_typecode, typecode_decl, "$Id$") - +ACE_RCSID (be_visitor_typecode, + typecode_decl, + "$Id$") // ****************************************************** // TypeCode declarations diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp index 48f0db46537..93cd879d830 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp @@ -18,19 +18,12 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +ACE_RCSID (be_visitor_typecode, + typecode_defn, + "$Id$") -#include "be_visitor_typecode.h" - -ACE_RCSID(be_visitor_typecode, typecode_defn, "$Id$") - - -// // This is an implementation of C++ "scoped lock" idiom in order to // avoid repetitive code. -// class Scoped_Compute_Queue_Guard { public: @@ -47,17 +40,18 @@ Scoped_Compute_Queue_Guard::Scoped_Compute_Queue_Guard ( { if (customer_ != 0) { - // reset the compute queue to set the stage for computing our - // encapsulation length + // Reset the compute queue to set the stage for computing our + // encapsulation length. customer_->queue_reset (customer_->compute_queue_); } } + Scoped_Compute_Queue_Guard::~Scoped_Compute_Queue_Guard (void) { if (customer_ != 0) { - // reset the compute queue since we must not affect computation of other - // nodes + // Reset the compute queue since we must not affect computation of other + // nodes. customer_->queue_reset (customer_->compute_queue_); } } diff --git a/TAO/TAO_IDL/be/be_visitor_typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef.cpp index c9ca1e8818f..964aa163a76 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef.cpp @@ -18,13 +18,28 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_array.h" +#include "be_enum.h" +#include "be_interface.h" +#include "be_predefined_type.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_type.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_extern.h" +#include "be_helper.h" #include "be_visitor_typedef.h" +#include "be_visitor_array.h" +#include "be_visitor_enum.h" +#include "be_visitor_sequence.h" +#include "be_visitor_structure.h" +#include "be_visitor_typecode.h" +#include "be_visitor_union.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_typedef/typedef.cpp" #include "be_visitor_typedef/typedef_ch.cpp" #include "be_visitor_typedef/typedef_ci.cpp" @@ -35,4 +50,6 @@ #include "be_visitor_typedef/cdr_op_ci.cpp" #include "be_visitor_typedef/cdr_op_cs.cpp" -ACE_RCSID(be, be_visitor_typedef, "$Id$") +ACE_RCSID (be, + be_visitor_typedef, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp index 0d6aec20e8d..2340ba59374 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/any_op_ch.cpp @@ -18,21 +18,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_typedef.h" - -ACE_RCSID(be_visitor_typedef, any_op_ch, "$Id$") - +ACE_RCSID (be_visitor_typedef, + any_op_ch, + "$Id$") // *************************************************************************** // Typedef visitor for generating Any operator declarations in the client header // *************************************************************************** -be_visitor_typedef_any_op_ch::be_visitor_typedef_any_op_ch -(be_visitor_context *ctx) +be_visitor_typedef_any_op_ch::be_visitor_typedef_any_op_ch ( + be_visitor_context *ctx + ) : be_visitor_typedef (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp index 6d8a868df16..9e01f31dc19 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/any_op_cs.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_typedef.h" - -ACE_RCSID(be_visitor_typedef, any_op_cs, "$Id$") - +ACE_RCSID (be_visitor_typedef, + any_op_cs, + "$Id$") // *************************************************************************** // Typedef visitor for generating Any operator declarations in the client // stubs file // *************************************************************************** -be_visitor_typedef_any_op_cs::be_visitor_typedef_any_op_cs -(be_visitor_context *ctx) +be_visitor_typedef_any_op_cs::be_visitor_typedef_any_op_cs ( + be_visitor_context *ctx + ) : be_visitor_typedef (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp index 59c3cfc9187..733e20b1715 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ch.cpp @@ -18,21 +18,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_typedef.h" - -ACE_RCSID(be_visitor_typedef, cdr_op_ch, "$Id$") - +ACE_RCSID (be_visitor_typedef, + cdr_op_ch, + "$Id$") // *************************************************************************** // Typedef visitor for generating Cdr operator declarations in the client header // *************************************************************************** -be_visitor_typedef_cdr_op_ch::be_visitor_typedef_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_typedef_cdr_op_ch::be_visitor_typedef_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_typedef (ctx) { } @@ -51,7 +47,7 @@ be_visitor_typedef_cdr_op_ch::visit_typedef (be_typedef *node) TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator declarations + // Generate the CDR << and >> operator declarations. os->indent (); // In general, we may have a chain of typedefs. i.e., diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp index 99b7c108306..07cbcf6a804 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_typedef.h" - -ACE_RCSID(be_visitor_typedef, cdr_op_ci, "$Id$") - +ACE_RCSID (be_visitor_typedef, + cdr_op_ci, + "$Id$") // *************************************************************************** // Typedef visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_typedef_cdr_op_ci::be_visitor_typedef_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_typedef_cdr_op_ci::be_visitor_typedef_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_typedef (ctx) { } @@ -52,7 +48,7 @@ be_visitor_typedef_cdr_op_ci::visit_typedef (be_typedef *node) TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator impls + // Generate the CDR << and >> operator impls. os->indent (); diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp index 91ab655906d..51ce0958d04 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_typedef.h" - -ACE_RCSID(be_visitor_typedef, cdr_op_cs, "$Id$") - +ACE_RCSID (be_visitor_typedef, + cdr_op_cs, + "$Id$") // *************************************************************************** // Typedef visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_typedef_cdr_op_cs::be_visitor_typedef_cdr_op_cs -(be_visitor_context *ctx) +be_visitor_typedef_cdr_op_cs::be_visitor_typedef_cdr_op_cs ( + be_visitor_context *ctx + ) : be_visitor_typedef (ctx) { } @@ -50,7 +46,7 @@ be_visitor_typedef_cdr_op_cs::visit_typedef (be_typedef *node) TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator impls + // Generate the CDR << and >> operator impls. os->indent (); diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp index ef18630ad24..d4285985149 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp @@ -18,19 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_typedef.h" -#include "be_visitor_array.h" -#include "be_visitor_enum.h" -#include "be_visitor_sequence.h" -#include "be_visitor_structure.h" -#include "be_visitor_union.h" - ACE_RCSID (be_visitor_typedef, typedef, "$Id$") - // ****************************************************** // Generic typedef visitor. // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp index a53e9fba5b9..8380fdbbd6b 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp @@ -18,17 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_typedef.h" -#include "be_visitor_typecode/typecode_decl.h" - ACE_RCSID(be_visitor_typedef, typedef_ch, "$Id$") - // ****************************************************** // Typedef visitor for client header // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp index b52ec2b573d..61767ff05de 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_typedef.h" - -ACE_RCSID(be_visitor_typedef, typedef_ci, "$Id$") - +ACE_RCSID (be_visitor_typedef, + typedef_ci, + "$Id$") // ****************************************************** // Typedef visitor for client inline diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp index 1b049984fa8..6d7beaa49a1 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp @@ -18,17 +18,10 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_typedef.h" -#include "be_visitor_typecode/typecode_defn.h" - ACE_RCSID (be_visitor_typedef, typedef_cs, "$Id$") - // ****************************************************** // Typedef visitor for client stubs // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union.cpp b/TAO/TAO_IDL/be/be_visitor_union.cpp index 17db8dd01ab..74e16f5ad55 100644 --- a/TAO/TAO_IDL/be/be_visitor_union.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union.cpp @@ -18,13 +18,22 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_enum.h" +#include "be_typedef.h" +#include "be_predefined_type.h" +#include "be_union.h" +#include "be_union_branch.h" +#include "be_helper.h" +#include "be_extern.h" +#include "ast_union_label.h" #include "be_visitor_union.h" +#include "be_visitor_enum.h" +#include "be_visitor_context.h" +#include "be_visitor_union_branch.h" +#include "be_visitor_typecode.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_union/discriminant_ch.cpp" #include "be_visitor_union/discriminant_ci.cpp" #include "be_visitor_union/discriminant_cs.cpp" @@ -38,4 +47,6 @@ #include "be_visitor_union/cdr_op_ci.cpp" #include "be_visitor_union/cdr_op_cs.cpp" -ACE_RCSID(be, be_visitor_union, "$Id$") +ACE_RCSID (be, + be_visitor_union, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp index fccf30875f8..38923787872 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/any_op_ch.cpp @@ -18,21 +18,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union.h" - -ACE_RCSID(be_visitor_union, any_op_ch, "$Id$") - +ACE_RCSID (be_visitor_union, + any_op_ch, + "$Id$") // *************************************************************************** // Union visitor for generating Any operator declarations in the client header // *************************************************************************** -be_visitor_union_any_op_ch::be_visitor_union_any_op_ch -(be_visitor_context *ctx) +be_visitor_union_any_op_ch::be_visitor_union_any_op_ch ( + be_visitor_context *ctx + ) : be_visitor_union (ctx) { } @@ -44,15 +40,18 @@ be_visitor_union_any_op_ch::~be_visitor_union_any_op_ch (void) int be_visitor_union_any_op_ch::visit_union (be_union *node) { - if (node->cli_hdr_any_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_hdr_any_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the Any <<= and >>= operator declarations + // Generate the Any <<= and >>= operator declarations. os->indent (); + *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, const " << node->name () << " &); // copying version" << be_nl; @@ -66,13 +65,12 @@ be_visitor_union_any_op_ch::visit_union (be_union *node) << " operator>>= (const CORBA::Any &, const " << node->name () << " *&);\n"; - - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union::visit_union - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } node->cli_hdr_any_op_gen (1); @@ -82,17 +80,16 @@ be_visitor_union_any_op_ch::visit_union (be_union *node) int be_visitor_union_any_op_ch::visit_union_branch (be_union_branch *node) { - be_type *bt; // field's type + // First generate the type information. + be_type *bt = be_type::narrow_from_decl (node->field_type ()); - // first generate the type information - bt = be_type::narrow_from_decl (node->field_type ()); if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_any_op_ch::" "visit_union_branch - " - "Bad field type\n" - ), -1); + "Bad field type\n"), + -1); } if (bt->accept (this) == -1) diff --git a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp index 560aa5bab7c..cbec3d3bef6 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/any_op_cs.cpp @@ -18,22 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union.h" - -ACE_RCSID(be_visitor_union, any_op_cs, "$Id$") - +ACE_RCSID (be_visitor_union, + any_op_cs, + "$Id$") // *************************************************************************** // Union visitor for generating Any operator declarations in the client // stubs file // *************************************************************************** -be_visitor_union_any_op_cs::be_visitor_union_any_op_cs -(be_visitor_context *ctx) +be_visitor_union_any_op_cs::be_visitor_union_any_op_cs ( + be_visitor_context *ctx + ) : be_visitor_union (ctx) { } @@ -45,15 +41,18 @@ be_visitor_union_any_op_cs::~be_visitor_union_any_op_cs (void) int be_visitor_union_any_op_cs::visit_union (be_union *node) { - if (node->cli_stub_any_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_stub_any_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the Any <<= and >>= operator declarations + // Generate the Any <<= and >>= operator declarations. os->indent (); + *os << "void operator<<= (" << be_idt << be_idt_nl << "CORBA::Any &_tao_any," << be_nl << "const " << node->name () << " &_tao_elem" << be_uidt_nl @@ -159,7 +158,8 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union::visit_union - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } node->cli_stub_any_op_gen (1); @@ -169,17 +169,15 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) int be_visitor_union_any_op_cs::visit_union_branch (be_union_branch *node) { - be_type *bt; // field's type + be_type *bt = be_type::narrow_from_decl (node->field_type ()); - // first generate the type information - bt = be_type::narrow_from_decl (node->field_type ()); if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_any_op_cs::" "visit_union_branch - " - "Bad field type\n" - ), -1); + "Bad field type\n"), + -1); } if (bt->accept (this) == -1) @@ -187,8 +185,9 @@ be_visitor_union_any_op_cs::visit_union_branch (be_union_branch *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_any_op_cs::" "visit_union_branch - " - "codegen for field type failed\n" - ), -1); + "codegen for field type failed\n"), + -1); } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp index 80cb8e824ba..12169e60ba5 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ch.cpp @@ -19,20 +19,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union.h" - -ACE_RCSID(be_visitor_union, cdr_op_ch, "$Id$") +ACE_RCSID (be_visitor_union, + cdr_op_ch, + "$Id$") // *************************************************************************** // Union visitor for generating CDR operator declarations in the client header // *************************************************************************** -be_visitor_union_cdr_op_ch::be_visitor_union_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_union_cdr_op_ch::be_visitor_union_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_union (ctx) { } @@ -44,15 +41,18 @@ be_visitor_union_cdr_op_ch::~be_visitor_union_cdr_op_ch (void) int be_visitor_union_cdr_op_ch::visit_union (be_union *node) { - if (node->cli_hdr_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_hdr_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator declarations + // Generate the CDR << and >> operator declarations. os->indent (); + *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const " << node->name () << " &);" << be_nl; @@ -61,15 +61,16 @@ be_visitor_union_cdr_op_ch::visit_union (be_union *node) << node->name () << " &);\n"; - // set the substate as generating code for the types defined in our scope + // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_cdr_op_ch::" "visit_union - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } node->cli_hdr_cdr_op_gen (1); diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp index ae148558877..e1295658c4d 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp @@ -18,21 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union.h" - -ACE_RCSID(be_visitor_union, cdr_op_ci, "$Id$") +ACE_RCSID (be_visitor_union, + cdr_op_ci, + "$Id$") // *************************************************************************** // Union visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_union_cdr_op_ci::be_visitor_union_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_union_cdr_op_ci::be_visitor_union_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_union (ctx) { } @@ -45,25 +42,28 @@ int be_visitor_union_cdr_op_ci::visit_union (be_union *node) { // already generated and/or we are imported. Don't do anything. - if (node->cli_inline_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_inline_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } - // set the substate as generating code for the types defined in our scope + // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_cdr_op_ci" "::visit_union - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); - // set the sub state as generating code for the output operator + // Set the sub state as generating code for the output operator. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT); *os << "ACE_INLINE CORBA::Boolean operator<< (" << be_idt << be_idt_nl @@ -77,20 +77,21 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) case AST_Expression::EV_bool: *os << "CORBA_Any::from_boolean tmp (_tao_union._d ());" << be_nl << "if ( !(strm << tmp) )" << be_idt_nl; - break; + break; case AST_Expression::EV_char: *os << "CORBA_Any::from_char tmp (_tao_union._d ());" << be_nl << "if ( !(strm << tmp) )" << be_idt_nl; - break; + break; case AST_Expression::EV_wchar: *os << "CORBA_Any::from_wchar tmp (_tao_union._d ());" << be_nl << "if ( !(strm << tmp) )" << be_idt_nl; - break; + break; default: *os << "if ( !(strm << _tao_union._d ()) )" << be_idt_nl; + break; } @@ -106,7 +107,8 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_cdr_op_ci::" "visit_union - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } // If there is no explicit default case, but there @@ -127,7 +129,7 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) << "return result;" << be_uidt_nl << "}\n\n"; - // set the substate as generating code for the input operator + // Set the substate as generating code for the input operator. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT); *os << "ACE_INLINE CORBA::Boolean operator>> (" << be_idt << be_idt_nl << "TAO_InputCDR &strm," << be_nl @@ -147,20 +149,21 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) case AST_Expression::EV_bool: *os << "CORBA_Any::to_boolean tmp (_tao_discriminant);" << be_nl << "if ( !(strm >> tmp) )" << be_idt_nl; - break; + break; case AST_Expression::EV_char: *os << "CORBA_Any::to_char tmp (_tao_discriminant);" << be_nl << "if ( !(strm >> tmp) )" << be_idt_nl; - break; + break; case AST_Expression::EV_wchar: *os << "CORBA_Any::to_wchar tmp (_tao_discriminant);" << be_nl << "if ( !(strm >> tmp) )" << be_idt_nl; - break; + break; default: *os << "if ( !(strm >> _tao_discriminant) )" << be_idt_nl; + break; } @@ -176,7 +179,8 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_cdr_op_ci::" "visit_union - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } // If there is no explicit default case, but there diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp index 507a62dd743..05092325e82 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_cs.cpp @@ -18,21 +18,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union.h" - -ACE_RCSID(be_visitor_union, cdr_op_cs, "$Id$") +ACE_RCSID (be_visitor_union, + cdr_op_cs, + "$Id$") // *************************************************************************** // Union visitor for generating CDR operator declarations in the client // stubs file // *************************************************************************** -be_visitor_union_cdr_op_cs::be_visitor_union_cdr_op_cs -(be_visitor_context *ctx) +be_visitor_union_cdr_op_cs::be_visitor_union_cdr_op_cs ( + be_visitor_context *ctx + ) : be_visitor_union (ctx) { } @@ -45,20 +42,23 @@ int be_visitor_union_cdr_op_cs::visit_union (be_union *node) { // already generated and/or we are imported. Don't do anything. - if (node->cli_stub_cdr_op_gen () || - node->imported () || - node->is_local ()) - return 0; + if (node->cli_stub_cdr_op_gen () + || node->imported () + || node->is_local ()) + { + return 0; + } - // set the substate as generating code for the types defined in our scope + // Set the substate as generating code for the types defined in our scope this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_cdr_op_cs" "::visit_union - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } node->cli_stub_cdr_op_gen (1); diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp index 0d363f8164b..6e376df059f 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp @@ -18,21 +18,17 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union.h" -#include "be_visitor_enum/enum_ch.h" - ACE_RCSID (be_visitor_union, discriminant_ch, "$Id$") - // ************************************************************************* // Visitor for discriminant in client header file. // ************************************************************************* -be_visitor_union_discriminant_ch::be_visitor_union_discriminant_ch -(be_visitor_context *ctx) +be_visitor_union_discriminant_ch::be_visitor_union_discriminant_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp index 08611d4a894..c02c60bfd77 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp @@ -18,21 +18,17 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union.h" - -ACE_RCSID(be_visitor_union, discriminant_ci, "$Id$") - +ACE_RCSID (be_visitor_union, + discriminant_ci, + "$Id$") // ************************************************************************* // be_visitor_discriminant_ci - visitor for discriminant in client inline file // ************************************************************************* -be_visitor_union_discriminant_ci::be_visitor_union_discriminant_ci -(be_visitor_context *ctx) +be_visitor_union_discriminant_ci::be_visitor_union_discriminant_ci ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -44,21 +40,24 @@ be_visitor_union_discriminant_ci::~be_visitor_union_discriminant_ci (void) int be_visitor_union_discriminant_ci::visit_enum (be_enum *node) { - TAO_OutStream *os; // output stream be_union *bu = - this->ctx_->be_node_as_union (); // get the enclosing union backend + this->ctx_->be_node_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); // now check if we need to generate the _default () method be_union::DefaultValue dv; + if (bu->default_value (dv) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -67,6 +66,7 @@ be_visitor_union_discriminant_ci::visit_enum (be_enum *node) "computing default value failed\n"), -1); } + if ((dv.computed_ != 0) && (bu->default_index () == -1)) { // only if all cases are not covered AND there is no explicit @@ -80,13 +80,17 @@ be_visitor_union_discriminant_ci::visit_enum (be_enum *node) be_type* dt = be_type::narrow_from_decl (bu->disc_type ()); + if (dt == 0) - return -1; + { + return -1; + } // Find where was the enum defined, if it was defined in the globa // scope, then it is easy to generate the enum values.... be_scope* scope = be_scope::narrow_from_scope (dt->defined_in ()); + if (scope == 0) { *os << node->value_to_name (dv.u.enum_val); @@ -116,6 +120,7 @@ be_visitor_union_discriminant_ci::visit_enum (be_enum *node) << "{" << be_idt_nl << "return this->disc_;" << be_uidt_nl << "}\n\n"; + return 0; } @@ -123,21 +128,24 @@ int be_visitor_union_discriminant_ci::visit_predefined_type (be_predefined_type *node) { - TAO_OutStream *os; // output stream be_union *bu = this->ctx_->be_node_as_union (); // get the enclosing union backend be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // now check if we need to generate the _default () method + // Now check if we need to generate the _default () method. be_union::DefaultValue dv; + if (bu->default_value (dv) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -146,29 +154,36 @@ be_visitor_union_discriminant_ci::visit_predefined_type (be_predefined_type "computing default value failed\n"), -1); } + if ((dv.computed_ != 0) && (bu->default_index () == -1)) { - // only if all cases are not covered AND there is no explicit - // default, we get the _default () method + // Only if all cases are not covered AND there is no explicit + // default, we get the _default () method. os->indent (); + *os << "// the implicit _default () method" << be_nl; *os << "ACE_INLINE void " << be_nl << bu->name () << "::_default ()" << be_nl << "{" << be_idt_nl << "this->disc_ = "; + switch (bu->udisc_type ()) { case AST_Expression::EV_short: *os << dv.u.short_val; + break; case AST_Expression::EV_ushort: *os << dv.u.ushort_val; + break; case AST_Expression::EV_long: *os << dv.u.long_val; + break; case AST_Expression::EV_ulong: *os << dv.u.ulong_val; + break; case AST_Expression::EV_char: os->print ("'\\%d'", dv.u.char_val); @@ -178,23 +193,26 @@ be_visitor_union_discriminant_ci::visit_predefined_type (be_predefined_type break; case AST_Expression::EV_bool: *os << dv.u.bool_val; + break; case AST_Expression::EV_longlong: case AST_Expression::EV_ulonglong: - // unimplemented + // Unimplemented. default: - // error caught earlier. + // Error caught earlier. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_discriminant_ci::" "visit_predefined_type - " "bad or unimplemented discriminant type\n"), -1); } + *os << ";" << be_uidt_nl << "}\n\n"; } os->indent (); - // the set method + + // The set method. *os << "// accessor to set the discriminant" << be_nl << "ACE_INLINE void" << be_nl << bu->name () << "::_d (" << bt->name () @@ -203,33 +221,34 @@ be_visitor_union_discriminant_ci::visit_predefined_type (be_predefined_type << "this->disc_ = discval;" << be_uidt_nl << "}" << be_nl; - // the get method + // The get method. *os << "// accessor to get the discriminant" << be_nl << "ACE_INLINE " << bt->name () << be_nl << bu->name () << "::_d (void) const" << be_nl << "{" << be_idt_nl << "return this->disc_;" << be_uidt_nl << "}\n\n"; + return 0; } int be_visitor_union_discriminant_ci::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // save the typedef node for use in code generation - // as we visit the base type + this->ctx_->alias (node); - // the node to be visited in the base primitve type that gets typedefed + // The node to be visited in the base primitve type that gets typedefed. be_type *bt = node->primitive_base_type (); + if (!bt || (bt->accept (this) == -1)) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_discriminant_ci::" "visit_typedef - " - "Bad primitive type\n" - ), -1); + "Bad primitive type\n"), + -1); } - this->ctx_->alias (0); + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp index 3b067c12b9c..e7c719f34da 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_cs.cpp @@ -18,15 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union.h" -#include "be_visitor_enum/enum_cs.h" - ACE_RCSID (be_visitor_union, discriminant_cs, "$Id$") - // ************************************************************************* // Visitor for discriminant in client stubs. // ************************************************************************* @@ -49,11 +44,14 @@ be_visitor_union_discriminant_cs::visit_enum (be_enum *node) this->ctx_->be_node_as_union (); // get the enclosing union backend be_type *bt; - // Check if we are visiting this node via a visit to a typedef node. if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (bt->node_type () != AST_Decl::NT_typedef && bt->is_child (bu)) diff --git a/TAO/TAO_IDL/be/be_visitor_union/union.cpp b/TAO/TAO_IDL/be/be_visitor_union/union.cpp index e06edf10dda..8340e0ed575 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union.cpp @@ -18,15 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union.h" -#include "be_visitor_union_branch.h" - ACE_RCSID (be_visitor_union, union, "$Id$") - be_visitor_union::be_visitor_union (be_visitor_context *ctx) : be_visitor_scope (ctx) { diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp index c840cdc11e6..ab00c6c0aca 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp @@ -18,15 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union.h" -#include "be_visitor_typecode/typecode_decl.h" - ACE_RCSID (be_visitor_union, union_ch, "$Id$") - // ****************************************************** // For client header. // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp index c545f646a65..56971e41d03 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp @@ -18,14 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union.h" - ACE_RCSID (be_visitor_union, union_ci, "$Id$") - // ****************************************************** // For client inline. // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp index 00d1fcd1659..00026783543 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp @@ -18,13 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_union.h" -#include "be_visitor_typecode/typecode_defn.h" - -ACE_RCSID(be_visitor_union, union_cs, "$Id$") +ACE_RCSID (be_visitor_union, + union_cs, + "$Id$") // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp index 0898d4cc7ad..487a3d62f0b 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp @@ -17,13 +17,31 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_array.h" +#include "be_enum.h" +#include "be_interface.h" +#include "be_interface_fwd.h" +#include "be_predefined_type.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_union_branch.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_helper.h" +#include "ast_union_label.h" +#include "utl_identifier.h" #include "be_visitor_union_branch.h" +#include "be_visitor_array.h" +#include "be_visitor_enum.h" +#include "be_visitor_sequence.h" +#include "be_visitor_structure.h" +#include "be_visitor_union.h" +#include "be_visitor_context.h" -// include all the individual files #include "be_visitor_union_branch/private_ch.cpp" #include "be_visitor_union_branch/public_assign_cs.cpp" #include "be_visitor_union_branch/public_reset_cs.cpp" @@ -35,4 +53,6 @@ #include "be_visitor_union_branch/cdr_op_ci.cpp" #include "be_visitor_union_branch/cdr_op_cs.cpp" -ACE_RCSID(be, be_visitor_union_branch, "$Id$") +ACE_RCSID (be, + be_visitor_union_branch, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp index 73ba240073d..50a96af0e65 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ch.cpp @@ -19,19 +19,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union_branch.h" -#include "be_visitor_array.h" -#include "be_visitor_enum.h" -#include "be_visitor_sequence.h" -#include "be_visitor_structure.h" -#include "be_visitor_union.h" - ACE_RCSID (be_visitor_union_branch, cdr_op_ch, "$Id$") - // ********************************************** // Visitor for union_branch in the client header file. // ********************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp index 6545710d540..14000e5f1e9 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp @@ -18,18 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_union_branch.h" -#include "be_visitor_array.h" -#include "be_visitor_enum.h" -#include "be_visitor_sequence.h" -#include "be_visitor_structure.h" -#include "be_visitor_union.h" - -ACE_RCSID(be_visitor_union_branch, cdr_op_ci, "$Id$") - +ACE_RCSID (be_visitor_union_branch, + cdr_op_ci, + "$Id$") // ********************************************** // Visitor for union_branch in the client stubs file. diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp index 2b1563db5df..0be5d282013 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp @@ -18,14 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union_branch.h" - ACE_RCSID (be_visitor_union_branch, cdr_op_cs, "$Id$") - // ********************************************** // Visitor for union_branch in the client stubs file. // ********************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp index 3b71f0e6d59..6a603f42b40 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp @@ -19,21 +19,18 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union_branch.h" - -ACE_RCSID(be_visitor_union_branch, private_ch, "$Id$") - +ACE_RCSID (be_visitor_union_branch, + private_ch, + "$Id$") // ********************************************** // visitor for union_branch in the client header generating the private information // ********************************************** // Constructor. -be_visitor_union_branch_private_ch::be_visitor_union_branch_private_ch (be_visitor_context *ctx) +be_visitor_union_branch_private_ch::be_visitor_union_branch_private_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -54,8 +51,7 @@ be_visitor_union_branch_private_ch::visit_union_branch (be_union_branch *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_union_branch - " - "Bad union_branch type\n" - ), + "Bad union_branch type\n"), -1); } @@ -66,16 +62,13 @@ be_visitor_union_branch_private_ch::visit_union_branch (be_union_branch *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_union_branch - " - "codegen for union_branch type failed\n" - ), + "codegen for union_branch type failed\n"), -1); } return 0; } -// Visit operations on all possible data types that a union_branch can be. - int be_visitor_union_branch_private_ch::visit_array (be_array *node) { @@ -83,7 +76,7 @@ be_visitor_union_branch_private_ch::visit_array (be_array *node) be_decl *bu = this->ctx_->scope (); be_type *bt; - // Check if we are visiting this node via a visit to a typedef node + // Check if we are visiting this node via a visit to a typedef node. if (this->ctx_->alias ()) { bt = this->ctx_->alias (); @@ -98,8 +91,7 @@ be_visitor_union_branch_private_ch::visit_array (be_array *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_array - " - "bad context information\n" - ), + "bad context information\n"), -1); } @@ -144,8 +136,7 @@ be_visitor_union_branch_private_ch::visit_enum (be_enum *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_enum - " - "bad context information\n" - ), + "bad context information\n"), -1); } @@ -179,8 +170,7 @@ be_visitor_union_branch_private_ch::visit_interface (be_interface *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_interface - " - "bad context information\n" - ), + "bad context information\n"), -1); } @@ -214,8 +204,7 @@ be_visitor_union_branch_private_ch::visit_interface_fwd (be_interface_fwd *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_interface_fwd - " - "bad context information\n" - ), + "bad context information\n"), -1); } @@ -251,8 +240,7 @@ be_visitor_union_branch_private_ch::visit_predefined_type ( ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_predefined_type - " - "bad context information\n" - ), + "bad context information\n"), -1); } @@ -309,8 +297,7 @@ be_visitor_union_branch_private_ch::visit_sequence (be_sequence *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_sequence - " - "bad context information\n" - ), + "bad context information\n"), -1); } @@ -335,8 +322,7 @@ be_visitor_union_branch_private_ch::visit_string (be_string *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_string - " - "bad context information\n" - ), + "bad context information\n"), -1); } @@ -376,8 +362,7 @@ be_visitor_union_branch_private_ch::visit_structure (be_structure *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_structure - " - "bad context information\n" - ), + "bad context information\n"), -1); } @@ -412,8 +397,7 @@ be_visitor_union_branch_private_ch::visit_typedef (be_typedef *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_typedef - " - "Bad primitive type\n" - ), + "Bad primitive type\n"), -1); } @@ -443,8 +427,7 @@ be_visitor_union_branch_private_ch::visit_union (be_union *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_private_ch::" "visit_union - " - "bad context information\n" - ), + "bad context information\n"), -1); } diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp index bce48e20e18..50cc4d35255 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp @@ -18,51 +18,41 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union_branch.h" - -ACE_RCSID(be_visitor_union_branch, public_access_cs, "$Id$") - +ACE_RCSID (be_visitor_union_branch, + public_access_cs, + "$Id$") // ***************************************************** // visitor for union_branch in the client // stubs file for the access method // ***************************************************** -// constructor be_visitor_union_branch_public_access_cs:: be_visitor_union_branch_public_access_cs (be_visitor_context *ctx) : be_visitor_decl (ctx) { } -// destructor be_visitor_union_branch_public_access_cs:: ~be_visitor_union_branch_public_access_cs (void) { } -// visit the union_branch node int -be_visitor_union_branch_public_access_cs:: -visit_union_branch (be_union_branch *node) +be_visitor_union_branch_public_access_cs::visit_union_branch ( + be_union_branch *node + ) { - TAO_OutStream *os; - be_type *bt; // union_branch's type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt = be_type::narrow_from_decl (node->field_type ()); - os = this->ctx_->stream (); - // first generate the type information - bt = be_type::narrow_from_decl (node->field_type ()); if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_cs::" "visit_union_branch - " - "Bad union_branch type\n" - ), -1); + "Bad union_branch type\n"), + -1); } this->ctx_->node (node); // save the node @@ -71,19 +61,26 @@ visit_union_branch (be_union_branch *node) i < node->label_list_length (); ++i) { - // check if we are printing the default case + // Check if we are printing the default case. if (node->label (i)->label_kind () == AST_UnionLabel::UL_default) - *os << "default:"; + { + *os << "default:"; + } else { *os << "case "; node->gen_label_value (os, i); *os << ":"; } + if (i == (node->label_list_length () - 1)) - *os << be_idt_nl; + { + *os << be_idt_nl; + } else - *os << be_nl; + { + *os << be_nl; + } } if (bt->accept (this) == -1) @@ -91,71 +88,79 @@ visit_union_branch (be_union_branch *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_cs::" "visit_union_branch - " - "codegen for union_branch type failed\n" - ), -1); + "codegen for union_branch type failed\n"), + -1); } + return 0; } -// =visit operations on all possible data types that a union_branch can be - int be_visitor_union_branch_public_access_cs::visit_array (be_array *node) { - TAO_OutStream *os; // output stream be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_enum - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } - // for anonymous arrays, the type name has a _ prepended. We compute the + // For anonymous arrays, the type name has a _ prepended. We compute the // fullname with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and - // save the node's local name and full name in a buffer for quick use later - // on - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - if (bt->node_type () != AST_Decl::NT_typedef // not a typedef - && bt->is_child (bu)) // bt is defined inside the union + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); + + if (bt->node_type () != AST_Decl::NT_typedef + && bt->is_child (bu)) { - // for anonymous arrays ... - // we have to generate a name for us that has an underscope prepended to - // our local name. This needs to be inserted after the parents's name + // For anonymous arrays ... + // We have to generate a name for us that has an underscope prepended to + // our local name. This needs to be inserted after the parents's name. if (bt->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), + ACE_OS::sprintf (fname, + "%s::_%s", + parent->full_name (), bt->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", bt->full_name ()); + ACE_OS::sprintf (fname, + "_%s", + bt->full_name ()); } } else { - // typedefed node - ACE_OS::sprintf (fname, "%s", bt->full_name ()); + ACE_OS::sprintf (fname, + "%s", + bt->full_name ()); } - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); + *os << "if (alloc_flag)" << be_idt_nl << "this->u_." << ub->local_name () << "_ = " << fname << "_alloc ();" << be_uidt_nl @@ -168,19 +173,21 @@ int be_visitor_union_branch_public_access_cs::visit_enum (be_enum *) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_enum - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } + TAO_OutStream *os = this->ctx_->stream (); + *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl; @@ -191,27 +198,31 @@ int be_visitor_union_branch_public_access_cs::visit_interface (be_interface *node) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; - + { + bt = node; + } if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_interface - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } + TAO_OutStream *os = this->ctx_->stream (); + *os << "if (alloc_flag)" << be_idt_nl << "ACE_NEW_RETURN (this->u_." << ub->local_name () << "_, " << "(" @@ -225,19 +236,21 @@ int be_visitor_union_branch_public_access_cs::visit_interface_fwd (be_interface_fwd *) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_interface - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } + TAO_OutStream *os = this->ctx_->stream (); + *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl << "return (CORBA::Object_ptr) &this->u_." << ub->local_name () << "_->inout ();" << be_uidt_nl; @@ -248,76 +261,87 @@ be_visitor_union_branch_public_access_cs::visit_interface_fwd (be_interface_fwd int be_visitor_union_branch_public_access_cs::visit_predefined_type (be_predefined_type *node) { - TAO_OutStream *os; // output stream be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_interface - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } - os = this->ctx_->stream (); + + TAO_OutStream *os = this->ctx_->stream (); switch (node->pt ()) { case AST_PredefinedType::PT_pseudo: *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl; + break; case AST_PredefinedType::PT_any: *os << "if (alloc_flag)" << be_idt_nl << "ACE_NEW_RETURN (this->u_." << ub->local_name () << "_, " << bt->name () << ", 0);" << be_uidt_nl << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl; + break; case AST_PredefinedType::PT_void: *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl; + break; default: *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl; } + return 0; } int be_visitor_union_branch_public_access_cs::visit_sequence (be_sequence *node) { - TAO_OutStream *os; // output stream be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_sequence - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } - os = this->ctx_->stream (); + + TAO_OutStream *os = this->ctx_->stream (); + *os << "if (alloc_flag)" << be_idt_nl << "ACE_NEW_RETURN (this->u_." << ub->local_name () << "_, " << bt->name () << ", 0);" << be_uidt_nl @@ -330,19 +354,21 @@ int be_visitor_union_branch_public_access_cs::visit_string (be_string *) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_string - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } + TAO_OutStream *os = this->ctx_->stream (); + *os << "ACE_UNUSED_ARG (alloc_flag);" << be_nl << "return &this->u_." << ub->local_name () << "_;" << be_uidt_nl; @@ -352,28 +378,32 @@ be_visitor_union_branch_public_access_cs::visit_string (be_string *) int be_visitor_union_branch_public_access_cs::visit_structure (be_structure *node) { - TAO_OutStream *os; // output stream be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_structure - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } - os = this->ctx_->stream (); + + TAO_OutStream *os = this->ctx_->stream (); + if (bt->size_type () == be_type::VARIABLE || node->has_constructor ()) { @@ -394,18 +424,18 @@ be_visitor_union_branch_public_access_cs::visit_structure (be_structure *node) int be_visitor_union_branch_public_access_cs::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // save the typedef node for use in code generation - // as we visit the base type + this->ctx_->alias (node); - // the node to be visited in the base primitve type that gets typedefed + // The node to be visited in the base primitve type that gets typedefed. be_type *bt = node->primitive_base_type (); + if (!bt || (bt->accept (this) == -1)) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_typedef - " - "Bad primitive type\n" - ), -1); + "Bad primitive type\n"), + -1); } this->ctx_->alias (0); @@ -415,28 +445,32 @@ be_visitor_union_branch_public_access_cs::visit_typedef (be_typedef *node) int be_visitor_union_branch_public_access_cs::visit_union (be_union *node) { - TAO_OutStream *os; // output stream be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_access_cs::" "visit_union - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } - os = this->ctx_->stream (); + + TAO_OutStream *os = this->ctx_->stream (); + *os << "if (alloc_flag)" << be_idt_nl << "ACE_NEW_RETURN (this->u_." << ub->local_name () << "_, " << bt->name () << ", 0);" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp index 6349e48d814..ac5a3f9a9a5 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union_branch.h" - -ACE_RCSID(be_visitor_union_branch, public_assign_cs, "$Id$") - +ACE_RCSID (be_visitor_union_branch, + public_assign_cs, + "$Id$") // ********************************************** // visitor for union_branch in the client stubs file generating the code for @@ -33,21 +28,23 @@ ACE_RCSID(be_visitor_union_branch, public_assign_cs, "$Id$") // ********************************************** // constructor -be_visitor_union_branch_public_assign_cs::be_visitor_union_branch_public_assign_cs -(be_visitor_context *ctx) +be_visitor_union_branch_public_assign_cs:: +be_visitor_union_branch_public_assign_cs (be_visitor_context *ctx) : be_visitor_decl (ctx) { } // destructor -be_visitor_union_branch_public_assign_cs::~be_visitor_union_branch_public_assign_cs -(void) +be_visitor_union_branch_public_assign_cs:: +~be_visitor_union_branch_public_assign_cs (void) { } // visit the union_branch node int -be_visitor_union_branch_public_assign_cs::visit_union_branch (be_union_branch *node) +be_visitor_union_branch_public_assign_cs::visit_union_branch ( + be_union_branch *node + ) { TAO_OutStream *os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp index c6d5d820e2e..924b53a1d32 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp @@ -18,19 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union_branch.h" -#include "be_visitor_array.h" -#include "be_visitor_enum.h" -#include "be_visitor_sequence.h" -#include "be_visitor_structure.h" -#include "be_visitor_union.h" - ACE_RCSID (be_visitor_union_branch, public_ch, "$Id$") - // ********************************************** // Visitor for union_branch in the client header file. // ********************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp index 58bad7041af..f9dec8b9596 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp @@ -18,14 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union_branch.h" - ACE_RCSID (be_visitor_union_branch, public_ci, "$Id$") - // ***************************************************** // Visitor for union_branch in the client inline file. // ***************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp index 8f2b1f9a377..b71a82bb660 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_cs.cpp @@ -18,14 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_union_branch.h" - ACE_RCSID (be_visitor_union_branch, public_cs, "$Id$") - // ********************************************** // Visitor for union_branch in the client stubs file. // ********************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp index 3f5e80ba612..86152e03313 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp @@ -18,28 +18,21 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_union_branch.h" - -ACE_RCSID(be_visitor_union_branch, public_reset_cs, "$Id$") - +ACE_RCSID (be_visitor_union_branch, + public_reset_cs, + "$Id$") // ***************************************************** // visitor for union_branch in the client // stubs file for the reset method // ***************************************************** -// constructor be_visitor_union_branch_public_reset_cs:: be_visitor_union_branch_public_reset_cs (be_visitor_context *ctx) : be_visitor_decl (ctx) { } -// destructor be_visitor_union_branch_public_reset_cs:: ~be_visitor_union_branch_public_reset_cs (void) { @@ -47,33 +40,31 @@ be_visitor_union_branch_public_reset_cs:: // visit the union_branch node int -be_visitor_union_branch_public_reset_cs:: -visit_union_branch (be_union_branch *node) +be_visitor_union_branch_public_reset_cs::visit_union_branch ( + be_union_branch *node + ) { - TAO_OutStream *os; - be_type *bt; // union_branch's type + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt = be_type::narrow_from_decl (node->field_type ()); - os = this->ctx_->stream (); - // first generate the type information - bt = be_type::narrow_from_decl (node->field_type ()); if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_cs::" "visit_union_branch - " - "Bad union_branch type\n" - ), -1); + "Bad union_branch type\n"), + -1); } this->ctx_->node (node); // save the node - for (unsigned long i = 0; - i < node->label_list_length (); - ++i) + for (unsigned long i = 0; i < node->label_list_length (); ++i) { // check if we are printing the default case if (node->label (i)->label_kind () == AST_UnionLabel::UL_default) - *os << "default:"; + { + *os << "default:"; + } else { *os << "case "; @@ -91,52 +82,56 @@ visit_union_branch (be_union_branch *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_cs::" "visit_union_branch - " - "codegen for union_branch type failed\n" - ), -1); + "codegen for union_branch type failed\n"), + -1); } + return 0; } -// =visit operations on all possible data types that a union_branch can be - int be_visitor_union_branch_public_reset_cs::visit_array (be_array *node) { - TAO_OutStream *os; // output stream be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_enum - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } - // for anonymous arrays, the type name has a _ prepended. We compute the + // For anonymous arrays, the type name has a _ prepended. We compute the // full_name with or without the underscore and use it later on. - char fname [NAMEBUFSIZE]; // to hold the full and + char fname [NAMEBUFSIZE]; // to hold the full and. // save the node's local name and full name in a buffer for quick use later // on - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); + if (bt->node_type () != AST_Decl::NT_typedef // not a typedef && bt->is_child (bu)) // bt is defined inside the union { - // for anonymous arrays ... - // we have to generate a name for us that has an underscope prepended to - // our local name. This needs to be inserted after the parents's name + // For anonymous arrays ... + // We have to generate a name for us that has an underscope prepended to + // our local name. This needs to be inserted after the parents's name. if (bt->is_nested ()) { @@ -151,15 +146,16 @@ be_visitor_union_branch_public_reset_cs::visit_array (be_array *node) } else { - // typedefed node ACE_OS::sprintf (fname, "%s", bt->full_name ()); } - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); + *os << fname << "_free (this->u_." << ub->local_name () << "_);" << be_nl << "this->u_." << ub->local_name () << "_ = 0;" << be_nl << "break;" << be_uidt_nl; + return 0; } @@ -167,17 +163,17 @@ int be_visitor_union_branch_public_reset_cs::visit_enum (be_enum *) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_enum - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); @@ -190,20 +186,21 @@ int be_visitor_union_branch_public_reset_cs::visit_interface (be_interface *) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_interface - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); + *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () @@ -217,19 +214,21 @@ int be_visitor_union_branch_public_reset_cs::visit_interface_fwd (be_interface_fwd *) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_interface - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } + TAO_OutStream *os = this->ctx_->stream (); + *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." << ub->local_name () @@ -240,20 +239,22 @@ be_visitor_union_branch_public_reset_cs::visit_interface_fwd (be_interface_fwd * } int -be_visitor_union_branch_public_reset_cs::visit_predefined_type (be_predefined_type *node) +be_visitor_union_branch_public_reset_cs::visit_predefined_type ( + be_predefined_type *node + ) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_predefined_type - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); @@ -271,9 +272,11 @@ be_visitor_union_branch_public_reset_cs::visit_predefined_type (be_predefined_ty *os << "CORBA::release (this->u_." << ub->local_name () << "_);" << be_nl; } + *os << "this->u_." << ub->local_name () << "_ = 0;" << be_nl << "break;" << be_uidt_nl; + break; case AST_PredefinedType::PT_any: *os << "delete this->u_." @@ -281,12 +284,14 @@ be_visitor_union_branch_public_reset_cs::visit_predefined_type (be_predefined_ty << "this->u_." << ub->local_name () << "_ = 0;" << be_nl << "break;" << be_uidt_nl; + break; case AST_PredefinedType::PT_void: break; default: *os << "break;" << be_uidt_nl; } + return 0; } @@ -294,20 +299,21 @@ int be_visitor_union_branch_public_reset_cs::visit_sequence (be_sequence *) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_sequence - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); + *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." @@ -322,17 +328,17 @@ int be_visitor_union_branch_public_reset_cs::visit_string (be_string *node) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_string - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); @@ -358,28 +364,32 @@ be_visitor_union_branch_public_reset_cs::visit_string (be_string *node) int be_visitor_union_branch_public_reset_cs::visit_structure (be_structure *node) { - TAO_OutStream *os; // output stream be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); be_type *bt; - // check if we are visiting this node via a visit to a typedef node if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_structure - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } - os = this->ctx_->stream (); + + TAO_OutStream *os = this->ctx_->stream (); + if (bt->size_type () == be_type::VARIABLE || node->has_constructor ()) { @@ -398,18 +408,18 @@ be_visitor_union_branch_public_reset_cs::visit_structure (be_structure *node) int be_visitor_union_branch_public_reset_cs::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // save the typedef node for use in code generation - // as we visit the base type + this->ctx_->alias (node); - // the node to be visited in the base primitve type that gets typedefed + // The node to be visited in the base primitve type that gets typedefed. be_type *bt = node->primitive_base_type (); + if (!bt || (bt->accept (this) == -1)) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_typedef - " - "Bad primitive type\n" - ), -1); + "Bad primitive type\n"), + -1); } this->ctx_->alias (0); @@ -420,20 +430,21 @@ int be_visitor_union_branch_public_reset_cs::visit_union (be_union *) { be_union_branch *ub = - this->ctx_->be_node_as_union_branch (); // get union branch + this->ctx_->be_node_as_union_branch (); be_union *bu = - this->ctx_->be_scope_as_union (); // get the enclosing union backend + this->ctx_->be_scope_as_union (); if (!ub || !bu) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_union_branch_public_reset_cs::" "visit_union - " - "bad context information\n" - ), -1); + "bad context information\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); + *os << "delete this->u_." << ub->local_name () << "_;" << be_nl << "this->u_." diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp index 662f378433f..d79cf1e10e0 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp @@ -18,20 +18,51 @@ // // ============================================================================ +#include "be_argument.h" +#include "be_array.h" +#include "be_attribute.h" +#include "be_constant.h" +#include "be_enum.h" +#include "be_exception.h" +#include "be_factory.h" +#include "be_field.h" +#include "be_interface_fwd.h" +#include "be_module.h" +#include "be_predefined_type.h" +#include "be_operation.h" +#include "be_sequence.h" +#include "be_string.h" +#include "be_structure.h" +#include "be_typedef.h" +#include "be_union.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_helper.h" +#include "be_extern.h" +#include "utl_identifier.h" -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - +#include "be_visitor_argument.h" +#include "be_visitor_array.h" #include "be_visitor_valuetype.h" +#include "be_visitor_field.h" +#include "be_visitor_constant.h" +#include "be_visitor_enum.h" +#include "be_visitor_exception.h" +#include "be_visitor_operation.h" +#include "be_visitor_sequence.h" +#include "be_visitor_structure.h" +#include "be_visitor_typecode.h" +#include "be_visitor_typedef.h" +#include "be_visitor_union.h" +#include "be_visitor_context.h" #include "be_visitor_valuetype/valuetype.cpp" #include "be_visitor_valuetype/valuetype_ch.cpp" +#include "be_visitor_valuetype/valuetype_ci.cpp" +#include "be_visitor_valuetype/valuetype_cs.cpp" #include "be_visitor_valuetype/valuetype_obv_ch.cpp" #include "be_visitor_valuetype/valuetype_obv_ci.cpp" #include "be_visitor_valuetype/valuetype_obv_cs.cpp" -#include "be_visitor_valuetype/valuetype_ci.cpp" -#include "be_visitor_valuetype/valuetype_cs.cpp" #include "be_visitor_valuetype/any_op_ch.cpp" #include "be_visitor_valuetype/any_op_cs.cpp" #include "be_visitor_valuetype/cdr_op_ch.cpp" @@ -54,3 +85,6 @@ #include "be_visitor_valuetype/valuetype_init_cs.cpp" #include "be_visitor_valuetype/valuetype_init_arglist_ch.cpp" +ACE_RCSID (be, + be_visitor_valuetype, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp index ab1945a19a6..1fa8514f202 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_ch.cpp @@ -18,9 +18,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_valuetype.h" - ACE_RCSID (be_visitor_valuetype, ami_exception_holder_ch, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp index 8b78cb56557..924091b2ace 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/ami_exception_holder_cs.cpp @@ -18,29 +18,29 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, ami_exception_holder_cs, "$Id$") - +ACE_RCSID (be_visitor_valuetype, + ami_exception_holder_cs, + "$Id$") // ************************************************************ // Interface visitor for client stubs // ************************************************************ -be_visitor_valuetype_ami_exception_holder_cs::be_visitor_valuetype_ami_exception_holder_cs (be_visitor_context *ctx) +be_visitor_valuetype_ami_exception_holder_cs:: +be_visitor_valuetype_ami_exception_holder_cs (be_visitor_context *ctx) : be_visitor_valuetype (ctx) { } -be_visitor_valuetype_ami_exception_holder_cs::~be_visitor_valuetype_ami_exception_holder_cs (void) +be_visitor_valuetype_ami_exception_holder_cs:: +~be_visitor_valuetype_ami_exception_holder_cs (void) { } int -be_visitor_valuetype_ami_exception_holder_cs::visit_valuetype (be_valuetype *node) +be_visitor_valuetype_ami_exception_holder_cs::visit_valuetype ( + be_valuetype *node + ) { TAO_OutStream *os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp index e36b19f53bf..922eb6971ac 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_ch.cpp @@ -20,14 +20,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, any_op_ch, "$Id$") - +ACE_RCSID (be_visitor_valuetype, + any_op_ch, + "$Id$") // *************************************************************************** // Valuetype visitor for generating Any operator declarations. diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp index e188f10523a..8955c59e853 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/any_op_cs.cpp @@ -18,14 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, any_op_cs, "$Id$") - +ACE_RCSID (be_visitor_valuetype, + any_op_cs, + "$Id$") // *************************************************************************** // Valuetype visitor for generating Any operator declarations in the client diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp index f48eba2001e..f5288638ccb 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp @@ -20,15 +20,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_operation.h" -#include "be_visitor_argument.h" - ACE_RCSID (be_visitor_valuetype, arglist, "$Id$") - // ************************************************************ // Operation visitor to generate the argument list. // We have separated code generation for this from the 4 main diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp index 51c3b5aa54a..7b4bae8219d 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ch.cpp @@ -20,17 +20,13 @@ // // ============================================================================ +ACE_RCSID (be_visitor_valuetype, + cdr_op_ch, + "$Id$") -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, cdr_op_ch, "$Id$") - -be_visitor_valuetype_cdr_op_ch::be_visitor_valuetype_cdr_op_ch -(be_visitor_context *ctx) +be_visitor_valuetype_cdr_op_ch::be_visitor_valuetype_cdr_op_ch ( + be_visitor_context *ctx + ) : be_visitor_valuetype (ctx) { } @@ -50,8 +46,6 @@ be_visitor_valuetype_cdr_op_ch::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); os->indent (); //start with whatever indentation level we are at now - - if (!node->cli_hdr_cdr_op_gen ()) { // Generate helper functions declaration. @@ -60,11 +54,10 @@ be_visitor_valuetype_cdr_op_ch::visit_valuetype (be_valuetype *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_valuetype_cdr_op_ch::" "visit_valuetype - " - "codegen for helper functions failed\n"), -1); + "codegen for helper functions failed\n"), + -1); } - // generate the CDR << and >> operator declarations (prototypes) - os->indent (); //start with whatever indentation level we are at now *os << be_global->stub_export_macro () << " " @@ -78,29 +71,25 @@ be_visitor_valuetype_cdr_op_ch::visit_valuetype (be_valuetype *node) node->cli_hdr_cdr_op_gen (1); } - - // set the substate as generating code for the types defined in our scope + // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_valuetype_cdr_op_ch::" "visit_valuetype - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } - //@@ Boris: that's suck! if (!node->is_abstract_valuetype ()) { - // functions that marshal state - be_visitor_context* new_ctx = - new be_visitor_context (*this->ctx_); - be_visitor_valuetype_marshal_ch visitor (new_ctx); + // Functions that marshal state. + be_visitor_context new_ctx (*this->ctx_); + be_visitor_valuetype_marshal_ch visitor (&new_ctx); visitor.visit_valuetype (node); } - - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ci.cpp index ad77ab00e28..7f1b6b9c423 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_ci.cpp @@ -20,18 +20,13 @@ // // ============================================================================ +ACE_RCSID (be_visitor_valuetype, + cdr_op_ci, + "$Id$") -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" -// #include "be_visitor_field.h" - -ACE_RCSID(be_visitor_valuetype, cdr_op_ci, "$Id$") - -be_visitor_valuetype_cdr_op_ci::be_visitor_valuetype_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_valuetype_cdr_op_ci::be_visitor_valuetype_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_valuetype (ctx) { } @@ -43,9 +38,11 @@ be_visitor_valuetype_cdr_op_ci::~be_visitor_valuetype_cdr_op_ci (void) int be_visitor_valuetype_cdr_op_ci::visit_valuetype (be_valuetype *node) { - // already generated and/or we are imported. Don't do anything. + // Already generated and/or we are imported. Don't do anything. if (node->cli_inline_cdr_op_gen () || node->imported ()) - return 0; + { + return 0; + } // Generate helper functions implementation. if (node->gen_helper_inline () == -1) @@ -53,17 +50,14 @@ be_visitor_valuetype_cdr_op_ci::visit_valuetype (be_valuetype *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_valuetype_cdr_op_ci::" "visit_valuetype - " - "codegen for helper functions failed\n"), -1); + "codegen for helper functions failed\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); os->indent (); //start with whatever indentation level we are at now - // Generate CDR << and >> operator signatures - - //@@ Boris: Can I move this to be_valuetype? (as with _var, _out, etc?) - - //This is just declaration so no ACE_INLINE + // This is just declaration so no ACE_INLINE *os << be_global->stub_export_macro () << " " << "CORBA::Boolean operator<< (TAO_OutputCDR &, const " << node->full_name () << " *);" << be_nl; @@ -72,26 +66,13 @@ be_visitor_valuetype_cdr_op_ci::visit_valuetype (be_valuetype *node) << "CORBA::Boolean operator>> (TAO_InputCDR &, " << node->full_name () << " *&);" << be_nl; - - - // Generate marshaling code if any - - // @@ Boris: the next statement is patrue anymore since I moved code - // to stubs. - - // First generate code for our children. The reason we do this first is - // because the inlined code for our children must be available before we use - // it in our parent - - // set the substate as generating code for the types defined in our scope - //this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_valuetype_cdr_op_ci" "::visit_valuetype - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } node->cli_inline_cdr_op_gen (I_TRUE); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp index 574b3cd3131..0e66fd2ca60 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/cdr_op_cs.cpp @@ -21,17 +21,13 @@ // // ============================================================================ +ACE_RCSID (be_visitor_valuetype, + valuetype_cdr_op_cs, + "$Id$") -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, valuetype_cdr_op_cs, "$Id$") - -be_visitor_valuetype_cdr_op_cs::be_visitor_valuetype_cdr_op_cs -(be_visitor_context *ctx) +be_visitor_valuetype_cdr_op_cs::be_visitor_valuetype_cdr_op_cs ( + be_visitor_context *ctx + ) : be_visitor_valuetype (ctx) { } @@ -43,9 +39,11 @@ be_visitor_valuetype_cdr_op_cs::~be_visitor_valuetype_cdr_op_cs (void) int be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) { - // already generated and/or we are imported. Don't do anything. + // Already generated and/or we are imported. Don't do anything. if (node->cli_stub_cdr_op_gen () || node->imported ()) - return 0; + { + return 0; + } // Generate helper functions implementation. if (node->gen_helper_stubs () == -1) @@ -53,35 +51,22 @@ be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_valuetype_cdr_op_cs::" "visit_valuetype - " - "codegen for helper functions failed\n"), -1); + "codegen for helper functions failed\n"), + -1); } - // Generate marshaling code - - TAO_OutStream *os = this->ctx_->stream (); - // @@ Boris: Do I need to let our children a chance to generate anything? - // Sounds fair ;-) - - // @@ Boris: the next statement is not true anymore since this is a CS - - // First generate code for our children. The reason we do this first is - // because the inlined code for our children must be available before we use - // it in our parent - - // set the substate as generating code for the types defined in our scope - // this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); - // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_valuetype_cdr_op_ci" "::visit_valuetype - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } - // set the sub state as generating code for the output operator + // Set the sub state as generating code for the output operator. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT); *os << "CORBA::Boolean" << be_nl << "operator<< (TAO_OutputCDR &strm, const " @@ -89,19 +74,20 @@ be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) << " *_tao_valuetype)" << be_nl << "{" << be_idt_nl; *os << "return CORBA_ValueBase::_tao_marshal (strm," << be_idt_nl - << "ACE_const_cast (" << node->full_name () << "*, _tao_valuetype)," << be_nl + << "ACE_const_cast (" << node->full_name () << "*, _tao_valuetype)," + << be_nl << "(ptr_arith_t) &" << node->full_name() <<"::_downcast);" << be_uidt<< be_uidt_nl << "}\n\n"; - // set the substate as generating code for the input operator - //this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT); *os << "CORBA::Boolean" << be_nl << "operator>> (TAO_InputCDR &strm, " << node->full_name () << " *&_tao_valuetype)" << be_nl << "{" << be_idt_nl; - *os << "return " << node->full_name() << "::_tao_unmarshal (strm, _tao_valuetype);" + *os << "return " << node->full_name() + << "::_tao_unmarshal (strm, _tao_valuetype);" + #ifdef obv_marshal_old_version *os << "CORBA::ValueBase *ptr;" << be_nl << "int retval = CORBA_ValueBase::_tao_unmarshal (strm," @@ -113,19 +99,18 @@ be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) << be_uidt_nl << "}" << be_idt_nl << "return retval;" #endif /* obv_marshal_old_version */ + << be_uidt_nl << "}\n\n"; - //@@ Boris: ment to be refactored if (!node->is_abstract_valuetype ()) - { - // functions that marshal state - be_visitor_context* new_ctx = new be_visitor_context (*this->ctx_); - be_visitor_valuetype_marshal_cs visitor (new_ctx); - visitor.visit_valuetype (node); - } + { + // Functions that marshal state. + be_visitor_context new_ctx (*this->ctx_); + be_visitor_valuetype_marshal_cs visitor (&new_ctx); + visitor.visit_valuetype (node); + } node->cli_stub_cdr_op_gen (I_TRUE); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp index 3fde72dda7f..0d4a7238d01 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ch.cpp @@ -18,19 +18,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_field.h" -#include "be_visitor_array.h" -#include "be_visitor_enum.h" -#include "be_visitor_structure.h" -#include "be_visitor_sequence.h" -#include "be_visitor_union.h" - ACE_RCSID (be_visitor_valuetype, field_cdr_op_ch, "$Id$") - // ********************************************** // Visitor for field in the client header file. // ********************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp index 2689a58661a..9b52fb60117 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp @@ -19,14 +19,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_field.h" - ACE_RCSID (be_visitor_valuetype, field_cdr_op_ci, "$Id$") - // ********************************************** // Visitor for field in the client inline file. // ********************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp index 157429b1133..d77d20a368a 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp @@ -20,18 +20,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_array.h" -#include "be_visitor_enum.h" -#include "be_visitor_sequence.h" -#include "be_visitor_structure.h" -#include "be_visitor_union.h" - ACE_RCSID (be_visitor_valuetype, field_ch, "$Id$") - be_visitor_valuetype_field_ch::be_visitor_valuetype_field_ch ( be_visitor_context *ctx ) diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp index a4ff2e23c85..4678af40c7d 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ci.cpp @@ -20,14 +20,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_valuetype.h" - ACE_RCSID (be_visitor_valuetype, field_ci, "$Id$") - be_visitor_valuetype_field_ci::be_visitor_valuetype_field_ci ( be_visitor_context *ctx ) diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp index d24c3ea34eb..e73fbb825c3 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp @@ -20,15 +20,10 @@ // derived from be_visitor_union_branch/public_ci.cpp // // ============================================================================ - -#include "be.h" -#include "be_visitor_valuetype.h" - ACE_RCSID (be_visitor_valuetype, field_cs, "$Id$") - be_visitor_valuetype_field_cs::be_visitor_valuetype_field_cs ( be_visitor_context *ctx ) diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp index 4688584e439..a4fa8a2aeb6 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp @@ -20,14 +20,9 @@ // // ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, marshal_ch, "$Id$") +ACE_RCSID (be_visitor_valuetype, + marshal_ch, + "$Id$") // *************************************************************************** // Structure visitor for generating declarations diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp index e2df4c9c46d..61144ba3f60 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp @@ -19,15 +19,9 @@ // // ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, marshal_cs, "$Id$") - +ACE_RCSID (be_visitor_valuetype, + marshal_cs, + "$Id$") be_visitor_valuetype_marshal_cs::be_visitor_valuetype_marshal_cs ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp index 63caf813a69..0fea9926210 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp @@ -20,13 +20,10 @@ // // ============================================================================ -#include "be.h" - ACE_RCSID (be_visitor_obv_module, obv_module, "$Id$") - // ************************************************************ // OBV module visitor for server header. // ************************************************************ @@ -93,6 +90,7 @@ be_visitor_obv_module::visit_valuetype (be_valuetype *node) { be_visitor_context ctx (*this->ctx_); ctx.node (node); + int status = 1; switch (this->ctx_->state ()) { @@ -100,8 +98,13 @@ be_visitor_obv_module::visit_valuetype (be_valuetype *node) ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CH); break; case TAO_CodeGen::TAO_MODULE_OBV_CI: - ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CI); - break; + { + // This context state is not involved in any strategies. + ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CI); + be_visitor_valuetype_obv_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } case TAO_CodeGen::TAO_MODULE_OBV_CS: ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CS); break; @@ -116,6 +119,19 @@ be_visitor_obv_module::visit_valuetype (be_valuetype *node) } } + if (status == 0) + { + return 0; + } + else if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_obv_module::" + "visit_valuetype - " + "failed to accept visitor\n"), + -1); + } + // Change the state depending on the kind of node strategy. ctx.state (node->next_state (ctx.state ())); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp index 7be03891886..ac639ee46d5 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp @@ -19,15 +19,6 @@ // // ============================================================================ -#include "be_visitor_valuetype.h" -#include "be_visitor_field.h" -#include "be_visitor_constant.h" -#include "be_visitor_enum.h" -#include "be_visitor_exception.h" -#include "be_visitor_structure.h" -#include "be_visitor_typedef.h" -#include "be_visitor_union.h" - ACE_RCSID (be_visitor_valuetype, valuetype, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp index 43021787f23..6cc7011d832 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp @@ -20,16 +20,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_valuetype.h" -#include "be_visitor_typecode/typecode_decl.h" -#include "be_visitor_operation/rettype.h" - ACE_RCSID (be_visitor_valuetype, valuetype_ch, "$Id$") - // ****************************************************** // Valuetype visitor for client header // ****************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp index 98c5d6eba6b..c845a8a0589 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp @@ -19,14 +19,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_valuetype.h" - ACE_RCSID (be_visitor_valuetype, valuetype_ci, "$Id$") - // ************************************************** // Valuetype visitor for client inline. // ************************************************** diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp index 70161628737..d9f91efc5c2 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp @@ -19,15 +19,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_valuetype.h" -#include "be_visitor_typecode/typecode_defn.h" - ACE_RCSID (be_visitor_valuetype, valuetype_cs, "$Id$") - // ************************************************************ // Valuetype visitor for client stubs. // ************************************************************ diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init.cpp index 780004ba2d8..84a56777620 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init.cpp @@ -20,13 +20,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, valuetype_init, "$Id$") +ACE_RCSID (be_visitor_valuetype, + valuetype_init, + "$Id$") be_visitor_valuetype_init::be_visitor_valuetype_init ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp index c31295d6c78..ee8ef8cbdcb 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp @@ -19,14 +19,10 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_valuetype.h" - ACE_RCSID (be_visitor_valuetype_init, arglist_ch, "$Id$") - be_visitor_valuetype_init_arglist_ch::be_visitor_valuetype_init_arglist_ch ( be_visitor_context *ctx ) diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp index ccfd431ff39..707cabb3623 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ch.cpp @@ -20,9 +20,6 @@ // // ============================================================================ -#include "be.h" -#include "be_visitor_valuetype.h" - ACE_RCSID (be_visitor_valuetype, valuetype_init_ch, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp index 87ef979a821..1dd99e30f41 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp @@ -20,13 +20,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, valuetype_init_ci, "$Id$") +ACE_RCSID (be_visitor_valuetype, + valuetype_init_ci, + "$Id$") be_visitor_valuetype_init_ci::be_visitor_valuetype_init_ci ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp index 5c4d7caf51c..dd7ae161ebd 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_cs.cpp @@ -20,14 +20,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype, valuetype_init_cs, "$Id$") - +ACE_RCSID (be_visitor_valuetype, + valuetype_init_cs, + "$Id$") be_visitor_valuetype_init_cs::be_visitor_valuetype_init_cs ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp index 7ea87ebec20..99b0503444b 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp @@ -22,14 +22,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype_obv_ch, valuetype_obv_ch, "$Id$") - +ACE_RCSID (be_visitor_valuetype, + valuetype_obv_ch, + "$Id$") // ****************************************************** // Valuetype visitor for client header diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp index c2bdf1529a5..6a202046cf0 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ci.cpp @@ -22,14 +22,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype_obv_ci, valuetype_obv_ci, "$Id$") - +ACE_RCSID (be_visitor_valuetype, + valuetype_obv_ci, + "$Id$") // ****************************************************** // Valuetype visitor for OBV_ class implementation diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp index e3fc33230fb..c118abf5898 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp @@ -22,14 +22,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype.h" - -ACE_RCSID(be_visitor_valuetype_obv_cs, valuetype_obv_cs, "$Id$") - +ACE_RCSID (be_visitor_valuetype, + valuetype_obv_cs, + "$Id$") // ****************************************************** // Valuetype visitor for OBV_ class implementation diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp index fc13b3c768c..bcc4a2200da 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp @@ -18,20 +18,20 @@ // // ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" +#include "be_valuetype.h" +#include "be_valuetype_fwd.h" +#include "be_extern.h" +#include "be_helper.h" #include "be_visitor_valuetype_fwd.h" +#include "be_visitor_context.h" -// include all the individual files - -// Not implemented yet. #include "be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp" #include "be_visitor_valuetype_fwd/valuetype_fwd_ci.cpp" #include "be_visitor_valuetype_fwd/cdr_op_ch.cpp" #include "be_visitor_valuetype_fwd/cdr_op_ci.cpp" -ACE_RCSID(be, be_visitor_valuetype_fwd, "$Id$") +ACE_RCSID (be, + be_visitor_valuetype_fwd, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp index 31ebdf15ef8..7211d05830b 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ch.cpp @@ -21,14 +21,9 @@ // // ================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype_fwd.h" - -ACE_RCSID(be_visitor_valuetype_fwd, valuetype_fwd_cdr_op_ch, "$Id$") - +ACE_RCSID (be_visitor_valuetype_fwd, + cdr_op_ch, + "$Id$") be_visitor_valuetype_fwd_cdr_op_ch::be_visitor_valuetype_fwd_cdr_op_ch ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp index 436fa441618..2a237f3d5a6 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/cdr_op_ci.cpp @@ -20,27 +20,25 @@ // // ================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype_fwd.h" - -ACE_RCSID(be_visitor_valuetype_fwd, cdr_op_ci, "$Id$") +ACE_RCSID (be_visitor_valuetype_fwd, + cdr_op_ci, + "$Id$") // **************************************************************** // Interface visitor for generating CDR operator declarations in the // client header // **************************************************************** -be_visitor_valuetype_fwd_cdr_op_ci:: -be_visitor_valuetype_fwd_cdr_op_ci (be_visitor_context *ctx) +be_visitor_valuetype_fwd_cdr_op_ci::be_visitor_valuetype_fwd_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } -be_visitor_valuetype_fwd_cdr_op_ci:: -~be_visitor_valuetype_fwd_cdr_op_ci (void) +be_visitor_valuetype_fwd_cdr_op_ci::~be_visitor_valuetype_fwd_cdr_op_ci ( + void + ) { } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp index 01a7497e552..9ed1864aba5 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp @@ -20,14 +20,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype_fwd.h" - -ACE_RCSID(be_visitor_valuetype_fwd, valuetype_fwd_ch, "$Id$") - +ACE_RCSID (be_visitor_valuetype_fwd, + valuetype_fwd_ch, + "$Id$") be_visitor_valuetype_fwd_ch::be_visitor_valuetype_fwd_ch (be_visitor_context *ctx) : be_visitor_decl (ctx) diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ci.cpp index ba6aa3972f0..b24a18a32b2 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ci.cpp @@ -19,13 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_visitor_valuetype_fwd.h" - -ACE_RCSID(be_visitor_valuetype_fwd, valuetype_fwd_ci, "$Id$") +ACE_RCSID (be_visitor_valuetype_fwd, + valuetype_fwd_ci, + "$Id$") be_visitor_valuetype_fwd_ci::be_visitor_valuetype_fwd_ci ( be_visitor_context *ctx diff --git a/TAO/TAO_IDL/be_include/be.h b/TAO/TAO_IDL/be_include/be.h deleted file mode 100644 index 732cfa46729..00000000000 --- a/TAO/TAO_IDL/be_include/be.h +++ /dev/null @@ -1,148 +0,0 @@ -// $Id$ - -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#ifndef _BE_BE_HH -#define _BE_BE_HH - -// be.h - -#if defined (_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#endif /* _MSC_VER >= 1200 */ -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -// ACE includes - -#include "ace/ACE.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/OS.h" -#include "ace/Singleton.h" -#include "ace/Synch.h" -#include "ace/Log_Msg.h" -#include "ace/Containers.h" -#include "ace/Process.h" - -// BE includes - -#include "be_decl.h" // class BE_Decl -#include "be_scope.h" // class BE_Scope -#include "be_generator.h" // class BE_generator - -#include "be_global.h" // global data for back end -#include "be_extern.h" // pointer to global BE - // data object - -#include "be_type.h" -#include "be_predefined_type.h" // class BE_PredefinedType -#include "be_module.h" // class BE_Module -#include "be_interface.h" // class BE_Interface -#include "be_interface_fwd.h" // class BE_InterfaceFwd -#include "be_valuetype.h" // class be_valuetype -#include "be_valuetype_fwd.h" // class be_valuetype_fwd -#include "be_structure.h" // class BE_Structure -#include "be_exception.h" // class BE_Exception -#include "be_expression.h" // class BE_Expr_val -#include "be_enum.h" // class BE_Enum -#include "be_operation.h" // class BE_Operation -#include "be_field.h" // class BE_Field -#include "be_argument.h" // class BE_Argument -#include "be_attribute.h" // class BE_Attribute -#include "be_union.h" // class BE_Union -#include "be_union_branch.h" // class BE_UnionBranch -#include "be_union_label.h" // class BE_UnionLabel -#include "be_constant.h" // class BE_Constant -#include "be_enum_val.h" // class BE_EnumVal -#include "be_array.h" // class BE_Array -#include "be_sequence.h" // class BE_Sequence -#include "be_string.h" // class BE_String -#include "be_typedef.h" // class BE_Typedef -#include "be_root.h" // class BE_Root -#include "be_native.h" // class BE_Native -#include "be_factory.h" // class be_factory - -#include "be_helper.h" // helper functions -#include "be_codegen.h" // code generator -#include "be_stream_factory.h" // output stream factory - -#include "be_visitor.h" // abstract visitor -#include "be_visitor_factory.h" // visitor factory -#include "be_visitor_context.h" // visitor context -#include "be_visitor_ami_pre_proc.h" // generate AMI implied IDL -#include "be_visitor_amh_pre_proc.h" // generate AMH implied IDL - -#include "be_interface_strategy.h" // strategy for interface nodes - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#endif /* _BE_BE_HH */ diff --git a/TAO/TAO_IDL/be_include/be_constant.h b/TAO/TAO_IDL/be_include/be_constant.h index a9007d9dc5f..06a28e71b26 100644 --- a/TAO/TAO_IDL/be_include/be_constant.h +++ b/TAO/TAO_IDL/be_include/be_constant.h @@ -25,7 +25,6 @@ #include "be_decl.h" #include "ast_constant.h" -#include "ast_expression.h" class be_visitor; diff --git a/TAO/TAO_IDL/be_include/be_extern.h b/TAO/TAO_IDL/be_include/be_extern.h index db5cf3a479a..2f04a741f9e 100644 --- a/TAO/TAO_IDL/be_include/be_extern.h +++ b/TAO/TAO_IDL/be_include/be_extern.h @@ -68,15 +68,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #define _BE_EXTERN_BE_EXTERN_HH #include "TAO_IDL_BE_Export.h" - -// be_extern.h - Defines the BE part of the BE<->FE protocol +#include "be_global.h" extern TAO_IDL_BE_Export BE_GlobalData *be_global; -extern TAO_IDL_BE_Export BE_GlobalData *set_be_global (BE_GlobalData *bg); - -// Functions: - -extern TAO_IDL_BE_Export void BE_produce (void); -extern TAO_IDL_BE_Export void BE_abort (void); #endif // _BE_EXTERN_BE_EXTERN_HH diff --git a/TAO/TAO_IDL/be_include/be_generator.h b/TAO/TAO_IDL/be_include/be_generator.h index 1ab9f79b753..a9476053201 100644 --- a/TAO/TAO_IDL/be_include/be_generator.h +++ b/TAO/TAO_IDL/be_include/be_generator.h @@ -73,6 +73,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // is implemented to create nodes of AST classes subclassed in this BE #include "TAO_IDL_BE_Export.h" +#include "ast_generator.h" class TAO_IDL_BE_Export be_generator : public AST_Generator { @@ -192,6 +193,7 @@ public: virtual AST_Sequence *create_sequence (AST_Expression *v, AST_Type *bt, + UTL_ScopedName *n, idl_bool local, idl_bool abstract); diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index a0a3b2e5398..7ed669436f9 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -20,8 +20,13 @@ #ifndef _BE_GLOBAL_H #define _BE_GLOBAL_H +#include "TAO_IDL_BE_Export.h" +#include "idl_bool.h" +#include "ace/Unbounded_Queue.h" + class be_interface; class be_interface_fwd; +class UTL_String; // Defines a class containing all back end global data. diff --git a/TAO/TAO_IDL/be_include/be_helper.h b/TAO/TAO_IDL/be_include/be_helper.h index 206c01581ee..ca2d09b34ba 100644 --- a/TAO/TAO_IDL/be_include/be_helper.h +++ b/TAO/TAO_IDL/be_include/be_helper.h @@ -23,6 +23,12 @@ #ifndef TAO_BE_OUTSTRM_H #define TAO_BE_OUTSTRM_H +#include "ace/CDR_Base.h" + +class Identifier; +class UTL_IdList; +class AST_Expression; + // a dummy structure to inform TAO_OutStream's << operator to put a newline // and use the current indentation for the succeeding line struct TAO_NL diff --git a/TAO/TAO_IDL/be_include/be_native.h b/TAO/TAO_IDL/be_include/be_native.h index 01b581413e7..a0ccb9818bd 100644 --- a/TAO/TAO_IDL/be_include/be_native.h +++ b/TAO/TAO_IDL/be_include/be_native.h @@ -27,7 +27,6 @@ class be_visitor; // Representation of "native" IDL type added by the POA spec. - class be_native : public virtual AST_Native, public virtual be_type { diff --git a/TAO/TAO_IDL/be_include/be_operation.h b/TAO/TAO_IDL/be_include/be_operation.h index 1c87ed1eae0..2ded44fef52 100644 --- a/TAO/TAO_IDL/be_include/be_operation.h +++ b/TAO/TAO_IDL/be_include/be_operation.h @@ -24,12 +24,13 @@ #include "be_scope.h" #include "be_decl.h" +#include "be_codegen.h" #include "ast_operation.h" -#include "be_operation_strategy.h" class AST_Type; class be_visitor; class be_argument; +class be_operation_strategy; class be_operation : public virtual AST_Operation, public virtual be_scope, diff --git a/TAO/TAO_IDL/be_include/be_operation_strategy.h b/TAO/TAO_IDL/be_include/be_operation_strategy.h index 5e04b45a5ed..310a3d4f1e7 100644 --- a/TAO/TAO_IDL/be_include/be_operation_strategy.h +++ b/TAO/TAO_IDL/be_include/be_operation_strategy.h @@ -25,12 +25,12 @@ class be_operation; -// Base class for operation level strategeis - +// Base class for operation level strategies. class be_operation_strategy { public: - enum Strategy_Kind { + enum Strategy_Kind + { DEFAULT = 0, AMI_SENDC, AMI_HANDLER_REPLY_STUB, @@ -40,41 +40,42 @@ public: be_operation_strategy (be_operation *node, Strategy_Kind strategy_type); - virtual ~be_operation_strategy (); + virtual ~be_operation_strategy (void); int strategy_type (); // Return the type of the strategy. - virtual TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state, - int is_extra_state = 0) = 0; - // Change the sate if necessary + virtual TAO_CodeGen::CG_STATE next_state ( + TAO_CodeGen::CG_STATE current_state, + int is_extra_state = 0 + ) = 0; + // Change the state if necessary. virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state); - // returns true if we have to genrate extra code. + // Returns true if we have to genrate extra code. - virtual be_operation *marshaling (); - // returns the operation containing special marshaling information, + virtual be_operation *marshaling (void); + // Returns the operation containing special marshaling information, // this makes sense if not all arguments get marshaled, e.g. AMI - // sendc_ operations + // sendc_ operations. - virtual be_operation *arguments (); - // returns a customized arguments list, e.g. AMI sendc_ operations + virtual be_operation *arguments (void); + // Returns a customized arguments list, e.g. AMI sendc_ operations // only use the in and inout arguments but not the out arguments, // also the first argument is the reply handler. protected: be_operation *node_; - // The node we strategize + // The node we strategize. Strategy_Kind strategy_type_; - // the type of strategy + // The type of strategy. }; -// Default (do nothing) strategy for operations - +// Default (do nothing) strategy for operations. class be_operation_default_strategy : public be_operation_strategy { @@ -83,7 +84,7 @@ public: virtual ~be_operation_default_strategy (); - // overridden methods. + // Overridden methods. TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state, int is_extra_state = 0); @@ -92,51 +93,48 @@ public: // Strategy to mark normal reply handler operations // in order to have them generate the reply stub -// alias client skeleton for AMI - +// alias client skeleton for AMI. class be_operation_ami_handler_reply_stub_strategy : public be_operation_strategy { public: be_operation_ami_handler_reply_stub_strategy (be_operation *node); - virtual ~be_operation_ami_handler_reply_stub_strategy (); + virtual ~be_operation_ami_handler_reply_stub_strategy (void); - // overridden methods. + // Overridden methods. TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state, int is_extra_state = 0); virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state); - // returns true if we have to genrate extra code. + // Returns true if we have to genrate extra code. }; // Strategy to mark normal sendc_ operations // in AMI mode. - -class be_operation_ami_sendc_strategy - : public be_operation_strategy +class be_operation_ami_sendc_strategy : public be_operation_strategy { public: be_operation_ami_sendc_strategy (be_operation *node, be_operation *marshaling, be_operation *arguments); - virtual ~be_operation_ami_sendc_strategy (); + virtual ~be_operation_ami_sendc_strategy (void); - // overridden methods. + // Overridden methods. TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state, int is_extra_state = 0); virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state); - // returns true if we have to genrate extra code. + // Returns true if we have to genrate extra code. - virtual be_operation *marshaling (); - // returns the operation containing special marshaling information, + virtual be_operation *marshaling (void); + // Returns the operation containing special marshaling information, // this makes sense if not all arguments get marshaled, e.g. AMI // sendc_ operations - virtual be_operation *arguments (); + virtual be_operation *arguments (void); // returns a customized arguments list, e.g. AMI sendc_ operations // only use the in and inout arguments but not the out arguments, // also the first argument is the reply handler. @@ -148,7 +146,6 @@ private: // Strategy for raise operations in the AMI exception // holder valuetype. - class be_operation_ami_exception_holder_raise_strategy : public be_operation_strategy { @@ -157,14 +154,15 @@ public: virtual ~be_operation_ami_exception_holder_raise_strategy (); - // overridden methods. - virtual TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state, - int is_extra_state = 0); + // Overridden methods. + virtual TAO_CodeGen::CG_STATE next_state ( + TAO_CodeGen::CG_STATE current_state, + int is_extra_state = 0 + ); }; -// AMH strategy - +// AMH strategy. class be_operation_amh_strategy : public be_operation_strategy { @@ -173,13 +171,13 @@ public: virtual ~be_operation_amh_strategy (); - // overridden methods. + // Overridden methods. TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state, int is_extra_state = 0); virtual int has_extra_code_generation (TAO_CodeGen::CG_STATE current_state); - virtual be_operation *arguments (); + virtual be_operation *arguments (void); private: be_operation *arguments_; diff --git a/TAO/TAO_IDL/be_include/be_sequence.h b/TAO/TAO_IDL/be_include/be_sequence.h index abf916c0b56..e04d9c141a5 100644 --- a/TAO/TAO_IDL/be_include/be_sequence.h +++ b/TAO/TAO_IDL/be_include/be_sequence.h @@ -57,6 +57,7 @@ public: be_sequence (AST_Expression *v, AST_Type *bt, + UTL_ScopedName *n, idl_bool local, idl_bool abstract); // Constructor. diff --git a/TAO/TAO_IDL/be_include/be_union.h b/TAO/TAO_IDL/be_include/be_union.h index 4463f06e849..24a27b860c3 100644 --- a/TAO/TAO_IDL/be_include/be_union.h +++ b/TAO/TAO_IDL/be_include/be_union.h @@ -37,10 +37,10 @@ public: be_union (void); // Default constructor. - be_union(AST_ConcreteType *dt, - UTL_ScopedName *n, - idl_bool local, - idl_bool abstract); + be_union (AST_ConcreteType *dt, + UTL_ScopedName *n, + idl_bool local, + idl_bool abstract); // Constructor. virtual int gen_var_defn (char *local_name = 0); diff --git a/TAO/TAO_IDL/be_include/be_union_branch.h b/TAO/TAO_IDL/be_include/be_union_branch.h index d98f1519ec6..2f90195ee4d 100644 --- a/TAO/TAO_IDL/be_include/be_union_branch.h +++ b/TAO/TAO_IDL/be_include/be_union_branch.h @@ -26,8 +26,10 @@ #include "ast_union_branch.h" class UTL_LabelList; -class UTL_Type; +class AST_Type; class be_visitor; +class TAO_OutStream; +class be_union; class be_union_branch : public virtual AST_UnionBranch, public virtual be_decl diff --git a/TAO/TAO_IDL/be_include/be_valuetype.h b/TAO/TAO_IDL/be_include/be_valuetype.h index 44af6358e4b..80cd1429a1c 100644 --- a/TAO/TAO_IDL/be_include/be_valuetype.h +++ b/TAO/TAO_IDL/be_include/be_valuetype.h @@ -19,6 +19,7 @@ #define TAO_BE_VALUETYPE_H #include "be_interface.h" +#include "ast_field.h" class TAO_OutStream; diff --git a/TAO/TAO_IDL/be_include/be_visitor_amh_pre_proc.h b/TAO/TAO_IDL/be_include/be_visitor_amh_pre_proc.h index 9f2ec8ddc3b..6aec1529666 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_amh_pre_proc.h +++ b/TAO/TAO_IDL/be_include/be_visitor_amh_pre_proc.h @@ -16,14 +16,8 @@ #ifndef TAO_BE_VISITOR_AMH_PRE_PROC_H #define TAO_BE_VISITOR_AMH_PRE_PROC_H -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_root.h" -#include "be_module.h" -#include "be_interface.h" #include "be_visitor_scope.h" +#include "ace/SString.h" /** * @class be_visitor_amh_pre_proc @@ -33,7 +27,8 @@ class be_visitor_amh_pre_proc : public be_visitor_scope { private: - typedef enum { + typedef enum + { NORMAL, GET_OPERATION, SET_OPERATION diff --git a/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h b/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h index 53d98fdf0ff..5f2cdb4d2c4 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h +++ b/TAO/TAO_IDL/be_include/be_visitor_ami_pre_proc.h @@ -25,15 +25,10 @@ #ifndef TAO_BE_VISITOR_AMI_PRE_PROC_H #define TAO_BE_VISITOR_AMI_PRE_PROC_H -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -#include "be_root.h" -#include "be_module.h" -#include "be_interface.h" #include "be_visitor_scope.h" +#include "ace/SString.h" +class AST_Interface; class be_visitor_ami_pre_proc : public be_visitor_scope { @@ -47,7 +42,8 @@ class be_visitor_ami_pre_proc : public be_visitor_scope private: typedef AST_Interface *AST_Interface_ptr; - typedef enum { + typedef enum + { NORMAL, GET_OPERATION, SET_OPERATION diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/argument.h b/TAO/TAO_IDL/be_include/be_visitor_argument/argument.h index dec4beb6a0a..c5d61e09a04 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/argument.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/argument.h @@ -21,6 +21,8 @@ #ifndef _BE_VISITOR_ARGUMENT_ARGUMENT_H_ #define _BE_VISITOR_ARGUMENT_ARGUMENT_H_ +#include "ast_argument.h" + class be_visitor_args : public be_visitor_decl { // @@ -45,7 +47,8 @@ public: // destructor //= helper - virtual const char *type_name (be_type *type, const char *suffix=0); + virtual const char *type_name (be_type *type, + const char *suffix = 0); // helper that produces either a nested name for header files or full name // for others diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/vardecl_ss.h b/TAO/TAO_IDL/be_include/be_visitor_argument/vardecl_ss.h index 9faa901fc69..374f1f1a2ee 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/vardecl_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/vardecl_ss.h @@ -25,6 +25,7 @@ // ************************************************************ // class be_visitor_args_vardecl_ss // ************************************************************ + class be_visitor_args_vardecl_ss : public be_visitor_args { // diff --git a/TAO/TAO_IDL/be_include/be_visitor_array.h b/TAO/TAO_IDL/be_include/be_visitor_array.h index 619792ff8b1..cbf86c2142a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_array.h +++ b/TAO/TAO_IDL/be_include/be_visitor_array.h @@ -22,9 +22,7 @@ #define TAO_BE_VISITOR_ARRAY_H #include "be_visitor_decl.h" -// generic visitor #include "be_visitor_array/array.h" -// concrete visitors #include "be_visitor_array/array_ch.h" #include "be_visitor_array/array_ci.h" #include "be_visitor_array/array_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_attribute.h b/TAO/TAO_IDL/be_include/be_visitor_attribute.h index 9c5aa46988e..66ba0d3c30b 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_attribute.h +++ b/TAO/TAO_IDL/be_include/be_visitor_attribute.h @@ -22,8 +22,7 @@ #ifndef TAO_BE_VISITOR_ATTRIBUTE_H #define TAO_BE_VISITOR_ATTRIBUTE_H -#include "be_visitor.h" -#include "be_visitor_scope.h" +#include "be_visitor_decl.h" #include "be_visitor_attribute/attribute.h" #endif diff --git a/TAO/TAO_IDL/be_include/be_visitor_constant.h b/TAO/TAO_IDL/be_include/be_visitor_constant.h index acc6f65d31f..5b5d1e9f616 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_constant.h +++ b/TAO/TAO_IDL/be_include/be_visitor_constant.h @@ -22,8 +22,7 @@ #ifndef TAO_BE_VISITOR_CONSTANT_H #define TAO_BE_VISITOR_CONSTANT_H -#include "be_visitor.h" -#include "be_visitor_scope.h" +#include "be_visitor_decl.h" #include "be_visitor_constant/constant_ch.h" #include "be_visitor_constant/constant_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_context.h b/TAO/TAO_IDL/be_include/be_visitor_context.h index 0487711615a..4316d420ca4 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_context.h +++ b/TAO/TAO_IDL/be_include/be_visitor_context.h @@ -26,6 +26,34 @@ #ifndef TAO_BE_VISITOR_CONTEXT_H #define TAO_BE_VISITOR_CONTEXT_H +#include "be_codegen.h" +#include "idl_bool.h" + +class TAO_OutStream; +class be_decl; +class be_typedef; +class be_attribute; +class be_interface; +class be_interface_fwd; +class be_argument; +class be_array; +class be_constant; +class be_enum; +class be_enum_val; +class be_exceptionl; +class be_field; +class be_module; +class be_operation; +class be_exception; +class be_predefined_type; +class be_root; +class be_sequence; +class be_string; +class be_structure; +class be_typedef; +class be_union; +class be_union_branch; + class be_visitor_context { public: @@ -106,7 +134,7 @@ public: idl_bool comma (void); // are we supposed to generate a comma? - be_interface* interface (void) const; + be_interface *interface (void) const; void interface (be_interface*); // In some cases we need to generate the objects of one interface as // members of a derived visitor (the TIE classes are a good diff --git a/TAO/TAO_IDL/be_include/be_visitor_enum.h b/TAO/TAO_IDL/be_include/be_visitor_enum.h index d8deaff8f47..30cac6d835b 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_enum.h +++ b/TAO/TAO_IDL/be_include/be_visitor_enum.h @@ -22,7 +22,7 @@ #ifndef TAO_BE_VISITOR_ENUM_H #define TAO_BE_VISITOR_ENUM_H -#include "be_visitor.h" +#include "be_visitor_decl.h" #include "be_visitor_scope.h" #include "be_visitor_enum/enum_ch.h" #include "be_visitor_enum/enum_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_exception.h b/TAO/TAO_IDL/be_include/be_visitor_exception.h index 64c85361e1a..1e441f874df 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_exception.h +++ b/TAO/TAO_IDL/be_include/be_visitor_exception.h @@ -22,7 +22,7 @@ #ifndef TAO_BE_VISITOR_EXCEPTION_H #define TAO_BE_VISITOR_EXCEPTION_H -#include "be_visitor.h" +#include "be_visitor_decl.h" #include "be_visitor_scope.h" #include "be_visitor_exception/exception.h" #include "be_visitor_exception/exception_ch.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_factory.h b/TAO/TAO_IDL/be_include/be_visitor_factory.h index 4eb8b631457..984bc673db2 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_factory.h +++ b/TAO/TAO_IDL/be_include/be_visitor_factory.h @@ -10,8 +10,7 @@ // be_visitor_factory.h // // = DESCRIPTION -// Define an abstract visitor Factory and a bunch of concrete visitor -// factories (whcih are singletons). +// Define a visitor Factory which is a singleton. // // = AUTHOR // Aniruddha Gokhale @@ -21,70 +20,32 @@ #ifndef TAO_BE_VISITOR_FACTORY_H #define TAO_BE_VISITOR_FACTORY_H +#include "ace/Singleton.h" +#include "ace/Synch.h" + +class be_visitor; +class be_visitor_context; + class TAO_Visitor_Factory { // =TITLE // TAO_Visitor_Factory // // =DESCRIPTION - // An abstract visitor factory class + // Visitor factory class public: TAO_Visitor_Factory (void); - // constructor - - virtual ~TAO_Visitor_Factory (void); - // destructor - - virtual be_visitor *make_visitor (be_visitor_context *) = 0; - // make a visitor -}; - -class TAO_Common_Visitor_Factory : public TAO_Visitor_Factory -{ - // =TITLE - // TAO_Common_Visitor_Factory - // - // =DESCRIPTION - // A concrete visitor factory for generating the visitors irrsepective of - // whether we use compiled or interpretive marshaling - -public: - - TAO_Common_Visitor_Factory (void); - // constructor - - virtual ~TAO_Common_Visitor_Factory (void); - // destructor - - virtual be_visitor *make_visitor (be_visitor_context *); - // make the right visitor based on the context and code generation state -}; - -class TAO_Compiled_Visitor_Factory : public TAO_Visitor_Factory -{ - // =TITLE - // TAO_Compiled_Visitor_Factory - // - // =DESCRIPTION - // A concrete visitor factory for generating the visitors for stubs and - // skeletons using compiled marshaling. - -public: - - TAO_Compiled_Visitor_Factory (void); - // constructor - virtual ~TAO_Compiled_Visitor_Factory (void); - // destructor + ~TAO_Visitor_Factory (void); - virtual be_visitor *make_visitor (be_visitor_context *); - // make the right visitor based on the context and code generation state + be_visitor *make_visitor (be_visitor_context *); + // Make a visitor. }; -// Singleton instance of the BE Visitor Factory -typedef ACE_Singleton<TAO_Common_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> TAO_COMMON_VISITOR_FACTORY; -typedef ACE_Singleton<TAO_Compiled_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> TAO_COMPILED_VISITOR_FACTORY; +// Singleton instance of the BE Visitor Factory. +typedef ACE_Singleton<TAO_Visitor_Factory, ACE_SYNCH_RECURSIVE_MUTEX> + TAO_VISITOR_FACTORY; #endif /* if !defined _TAO_BE_VISITOR_FACTORY_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_field.h b/TAO/TAO_IDL/be_include/be_visitor_field.h index 47913a1c9c4..79a2f83c358 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field.h @@ -22,7 +22,6 @@ #define TAO_BE_VISITOR_FIELD_H #include "be_visitor_decl.h" - #include "be_visitor_field/field_ch.h" #include "be_visitor_field/field_ci.h" #include "be_visitor_field/field_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface.h index ffb728a8f52..e56fe93aa7f 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface.h @@ -21,8 +21,10 @@ #ifndef TAO_BE_VISITOR_INTERFACE_H #define TAO_BE_VISITOR_INTERFACE_H -#include "be_visitor_scope.h" +#include "ace/SString.h" +#include "be_visitor_decl.h" +#include "be_visitor_scope.h" #include "be_visitor_interface/interface.h" #include "be_visitor_interface/interface_ch.h" #include "be_visitor_interface/interface_ci.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd.h b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd.h index 00000706930..195162ae8b4 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd.h @@ -22,12 +22,12 @@ #ifndef TAO_BE_VISITOR_INTERFACE_FWD_H #define TAO_BE_VISITOR_INTERFACE_FWD_H -#include "be_visitor.h" +#include "be_visitor_decl.h" #include "be_visitor_scope.h" - #include "be_visitor_interface_fwd/interface_fwd_ch.h" #include "be_visitor_interface_fwd/interface_fwd_ci.h" #include "be_visitor_interface_fwd/cdr_op_ch.h" #include "be_visitor_interface_fwd/cdr_op_ci.h" #include "be_visitor_interface_fwd/any_op_ch.h" + #endif /* TAO_BE_VISITOR_INTERFACE_FWD_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_module.h b/TAO/TAO_IDL/be_include/be_visitor_module.h index ea4f140fd6d..0d8a70a64ff 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_module.h +++ b/TAO/TAO_IDL/be_include/be_visitor_module.h @@ -22,12 +22,8 @@ #ifndef TAO_BE_VISITOR_MODULE_H #define TAO_BE_VISITOR_MODULE_H -#include "be_visitor.h" #include "be_visitor_scope.h" - #include "be_visitor_module/module.h" -// we need derived module visitors for the client and server header files. For -// the others, they use the default module visitor #include "be_visitor_module/module_ch.h" #include "be_visitor_module/module_sh.h" #include "be_visitor_module/module_ih.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation.h index 94329dd2031..e832c262fb2 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation.h @@ -22,7 +22,6 @@ #ifndef TAO_BE_VISITOR_OPERATION_H #define TAO_BE_VISITOR_OPERATION_H -#include "be_visitor.h" #include "be_visitor_scope.h" #include "be_visitor_operation/operation.h" #include "be_visitor_operation/operation_ch.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation.h index 88e9a1ed4ac..68c30431639 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation.h @@ -47,7 +47,8 @@ public: virtual int void_return_type (be_type *); // is my return type void? - virtual int has_param_type (be_operation *, AST_Argument::Direction); + virtual int has_param_type (be_operation *, + AST_Argument::Direction); // does any of the argument node have the specified direction /// Count the number of "in" and "inout" parameters. diff --git a/TAO/TAO_IDL/be_include/be_visitor_root.h b/TAO/TAO_IDL/be_include/be_visitor_root.h index 3c304af0a9e..e9d6cfd3c68 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_root.h +++ b/TAO/TAO_IDL/be_include/be_visitor_root.h @@ -22,9 +22,7 @@ #ifndef TAO_BE_VISITOR_ROOT_H #define TAO_BE_VISITOR_ROOT_H -#include "be_visitor.h" #include "be_visitor_scope.h" - #include "be_visitor_root/root.h" #include "be_visitor_root/root_ch.h" #include "be_visitor_root/root_ci.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_scope.h b/TAO/TAO_IDL/be_include/be_visitor_scope.h index d7696f1e32b..6aa0a2be7b6 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_scope.h +++ b/TAO/TAO_IDL/be_include/be_visitor_scope.h @@ -21,8 +21,8 @@ #ifndef TAO_BE_VISITOR_SCOPE_H #define TAO_BE_VISITOR_SCOPE_H -#include "idl_bool.h" #include "be_visitor_decl.h" +#include "idl_bool.h" class be_visitor_scope : public be_visitor_decl { diff --git a/TAO/TAO_IDL/be_include/be_visitor_sequence.h b/TAO/TAO_IDL/be_include/be_visitor_sequence.h index 07588e9428a..47a92008307 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_sequence.h +++ b/TAO/TAO_IDL/be_include/be_visitor_sequence.h @@ -7,15 +7,12 @@ #define TAO_BE_VISITOR_SEQUENCE_H #include "be_visitor_decl.h" - #include "be_visitor_sequence/sequence_ch.h" #include "be_visitor_sequence/sequence_ci.h" #include "be_visitor_sequence/sequence_cs.h" -// =helper visitors to generate the base type and element type #include "be_visitor_sequence/sequence_base.h" #include "be_visitor_sequence/buffer_type.h" #include "be_visitor_sequence/elemtype.h" -// = any operators #include "be_visitor_sequence/any_op_ch.h" #include "be_visitor_sequence/any_op_cs.h" #include "be_visitor_sequence/cdr_op_ch.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure.h b/TAO/TAO_IDL/be_include/be_visitor_structure.h index b3decadc89e..353fd3abf18 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_structure.h +++ b/TAO/TAO_IDL/be_include/be_visitor_structure.h @@ -22,12 +22,8 @@ #ifndef TAO_BE_VISITOR_STRUCTURE_H #define TAO_BE_VISITOR_STRUCTURE_H -#include "be_visitor.h" #include "be_visitor_scope.h" - -// generic visitor #include "be_visitor_structure/structure.h" -// concrete visitors #include "be_visitor_structure/structure_ch.h" #include "be_visitor_structure/structure_ci.h" #include "be_visitor_structure/structure_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode.h b/TAO/TAO_IDL/be_include/be_visitor_typecode.h index c6d623cf5a0..a8282089607 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typecode.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode.h @@ -22,9 +22,7 @@ #ifndef TAO_BE_VISITOR_TYPECODE_H #define TAO_BE_VISITOR_TYPECODE_H -#include "be_visitor_decl.h" #include "be_visitor_scope.h" - #include "be_visitor_typecode/typecode_decl.h" #include "be_visitor_typecode/typecode_defn.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h index f35fe573144..911243fbb2f 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h @@ -25,6 +25,7 @@ #include "ace/CDR_Base.h" #include "ace/Containers_T.h" +#include "be_visitor_decl.h" #include "be_visitor_scope.h" const int TAO_BE_VISITOR_TYPECODE_DEFN_MAX_STACK_SIZE = 1024; diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef.h b/TAO/TAO_IDL/be_include/be_visitor_typedef.h index 05524ceecbe..392b75257f9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef.h @@ -22,12 +22,8 @@ #ifndef TAO_BE_VISITOR_TYPEDEF_H #define TAO_BE_VISITOR_TYPEDEF_H -#include "be_visitor.h" #include "be_visitor_scope.h" - -// generic visitor #include "be_visitor_typedef/typedef.h" -// concrete visitors #include "be_visitor_typedef/typedef_ch.h" #include "be_visitor_typedef/typedef_ci.h" #include "be_visitor_typedef/typedef_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_union.h b/TAO/TAO_IDL/be_include/be_visitor_union.h index 2d3489a5798..9dfce609a10 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union.h @@ -22,12 +22,8 @@ #ifndef TAO_BE_VISITOR_UNION_H #define TAO_BE_VISITOR_UNION_H -#include "be_visitor.h" #include "be_visitor_scope.h" - -// generic visitor #include "be_visitor_union/union.h" -// concrete visitors #include "be_visitor_union/union_ch.h" #include "be_visitor_union/union_ci.h" #include "be_visitor_union/union_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch.h index c284f47f97a..7f4b039f2b7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union_branch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch.h @@ -22,7 +22,6 @@ #define TAO_BE_VISITOR_UNION_BRANCH_H #include "be_visitor_decl.h" - #include "be_visitor_union_branch/public_ch.h" #include "be_visitor_union_branch/public_ci.h" #include "be_visitor_union_branch/public_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype.h index 873ab40c764..ef01361bac9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype.h @@ -19,7 +19,6 @@ #define TAO_BE_VISITOR_VALUETYPE_H #include "be_visitor_scope.h" - #include "be_visitor_valuetype/valuetype.h" #include "be_visitor_valuetype/valuetype_ch.h" #include "be_visitor_valuetype/valuetype_obv_ch.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd.h index ce88329fe5d..129fd270c7b 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd.h @@ -23,9 +23,7 @@ #ifndef TAO_BE_VISITOR_VALUETYPE_FWD_H #define TAO_BE_VISITOR_VALUETYPE_FWD_H -#include "be_visitor.h" #include "be_visitor_scope.h" - #include "be_visitor_valuetype_fwd/valuetype_fwd_ch.h" #include "be_visitor_valuetype_fwd/valuetype_fwd_ci.h" #include "be_visitor_valuetype_fwd/cdr_op_ch.h" diff --git a/TAO/TAO_IDL/driver/drv_args.cpp b/TAO/TAO_IDL/driver/drv_args.cpp index 1ac164fe6a7..2cfb2763791 100644 --- a/TAO/TAO_IDL/driver/drv_args.cpp +++ b/TAO/TAO_IDL/driver/drv_args.cpp @@ -66,14 +66,19 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // drv_args.c - Argument parsing for IDL compiler main driver -#include "idl.h" -#include "idl_extern.h" -#include "drv_private.h" -#include "drv_extern.h" -#include "be.h" -#include "ace/Process.h" +#include "idl_defines.h" +#include "global_extern.h" +#include "drv_extern.h" +#include "be_global.h" +#include "be_extern.h" +#include "ace/Process.h" -ACE_RCSID(driver, drv_args, "$Id$") +ACE_RCSID (driver, + drv_args, + "$Id$") + +extern long DRV_nfiles; +extern const char *DRV_files[]; // Push a file into the list of files to be processed static void @@ -86,16 +91,19 @@ DRV_push_file (const char *s) static void DRV_prep_cpp_arg (char *s) { - char *newarg = new char[512]; + char *newarg = 0; + ACE_NEW (newarg, + char[512]); char *farg; newarg[0] = '\0'; for (farg = ACE_OS::strtok (s, ","); - farg != NULL; + farg != 0; farg = ACE_OS::strtok (0, ",")) { - ACE_OS::strcat (newarg, farg); + ACE_OS::strcat (newarg, + farg); } DRV_cpp_putarg (newarg); @@ -445,6 +453,114 @@ DRV_usage (void) )); } +// Return 0 on success, -1 failure. The <errno> corresponding to the +// error that caused the GPERF execution is also set. +int +DRV_check_gperf (void) +{ + // If absolute path is not specified yet, let us call just + // "gperf". Hopefully PATH is set up correctly to locate the gperf. + if (idl_global->gperf_path () == 0) + { + // If ACE_GPERF is defined then use that gperf program instead of "gperf." +#if defined (ACE_GPERF) + idl_global->gperf_path (ACE_GPERF); +#else + idl_global->gperf_path ("gperf"); +#endif /* ACE_GPERF */ + } + + // If we have absolute path for the <gperf> rather than just the + // executable name <gperf>, make sure the file exists + // firsts. Otherwise just call <gperf>. Probably PATH is set + // correctly to take care of this. + + // If ACE_GPERF is defined then use that gperf program instead of "gperf." +#if defined (ACE_GPERF) + if (ACE_OS::strcmp (idl_global->gperf_path (), ACE_GPERF) != 0) +#else + if (ACE_OS::strcmp (idl_global->gperf_path (), "gperf") != 0) +#endif /* ACE_GPERF */ + { + // It is absolute path. Check the existance, permissions and + // the modes. + if (ACE_OS::access (idl_global->gperf_path (), + F_OK | X_OK) == -1) + { + // Problem with the file. No point in having the absolute + // path. Swith to "gperf". + // If ACE_GPERF is defined then use that gperf program + //instead of "gperf." +#if defined (ACE_GPERF) + idl_global->gperf_path (ACE_GPERF); +#else + idl_global->gperf_path ("gperf"); +#endif /* ACE_GPERF */ + } + } + + // Just call gperf in silent mode. It will come and immly exit. + + // Using ACE_Process. + ACE_Process process; + ACE_Process_Options process_options; + + // Set the command line for the gperf program. + process_options.command_line ("%s" + " " + "-V", + idl_global->gperf_path ()); + + // Spawn a process for gperf. + if (process.spawn (process_options) == -1) + { + return -1; + } + +#if defined (ACE_WIN32) + // No wait or anything in Win32. + return 0; +#endif /* ACE_WIN32 */ + + // Wait for gperf to complete. + ACE_exitcode wait_status = 0; + if (process.wait (&wait_status) == -1) + { + return -1; + } + else + { + // Wait is sucessful, we will check the exit code from the + // spawned process. + if (WIFEXITED (wait_status)) + { + // Normal exit. + + // Check the exit value of the spawned process. ACE_Process + // exits with <errno> as exit code, if it is not able to + // exec gperf program, so get the exit code now and set that + // to <errno> again, so that it can be used to print error + // messages. + errno = WEXITSTATUS (wait_status); + if (errno) + { + // <exec> has failed. + return -1; + } + else + { + // Everything was alright. + return 0; + } + } + else + { + // Not a normal exit. No <errno> might be set. + return -1; + } + } +} + // Parse arguments on command line void DRV_parse_args (long ac, char **av) @@ -1275,110 +1391,3 @@ DRV_parse_args (long ac, char **av) } } -// Return 0 on success, -1 failure. The <errno> corresponding to the -// error that caused the GPERF execution is also set. -int -DRV_check_gperf (void) -{ - // If absolute path is not specified yet, let us call just - // "gperf". Hopefully PATH is set up correctly to locate the gperf. - if (idl_global->gperf_path () == 0) - { - // If ACE_GPERF is defined then use that gperf program instead of "gperf." -#if defined (ACE_GPERF) - idl_global->gperf_path (ACE_GPERF); -#else - idl_global->gperf_path ("gperf"); -#endif /* ACE_GPERF */ - } - - // If we have absolute path for the <gperf> rather than just the - // executable name <gperf>, make sure the file exists - // firsts. Otherwise just call <gperf>. Probably PATH is set - // correctly to take care of this. - - // If ACE_GPERF is defined then use that gperf program instead of "gperf." -#if defined (ACE_GPERF) - if (ACE_OS::strcmp (idl_global->gperf_path (), ACE_GPERF) != 0) -#else - if (ACE_OS::strcmp (idl_global->gperf_path (), "gperf") != 0) -#endif /* ACE_GPERF */ - { - // It is absolute path. Check the existance, permissions and - // the modes. - if (ACE_OS::access (idl_global->gperf_path (), - F_OK | X_OK) == -1) - { - // Problem with the file. No point in having the absolute - // path. Swith to "gperf". - // If ACE_GPERF is defined then use that gperf program - //instead of "gperf." -#if defined (ACE_GPERF) - idl_global->gperf_path (ACE_GPERF); -#else - idl_global->gperf_path ("gperf"); -#endif /* ACE_GPERF */ - } - } - - // Just call gperf in silent mode. It will come and immly exit. - - // Using ACE_Process. - ACE_Process process; - ACE_Process_Options process_options; - - // Set the command line for the gperf program. - process_options.command_line ("%s" - " " - "-V", - idl_global->gperf_path ()); - - // Spawn a process for gperf. - if (process.spawn (process_options) == -1) - { - return -1; - } - -#if defined (ACE_WIN32) - // No wait or anything in Win32. - return 0; -#endif /* ACE_WIN32 */ - - // Wait for gperf to complete. - ACE_exitcode wait_status = 0; - if (process.wait (&wait_status) == -1) - { - return -1; - } - else - { - // Wait is sucessful, we will check the exit code from the - // spawned process. - if (WIFEXITED (wait_status)) - { - // Normal exit. - - // Check the exit value of the spawned process. ACE_Process - // exits with <errno> as exit code, if it is not able to - // exec gperf program, so get the exit code now and set that - // to <errno> again, so that it can be used to print error - // messages. - errno = WEXITSTATUS (wait_status); - if (errno) - { - // <exec> has failed. - return -1; - } - else - { - // Everything was alright. - return 0; - } - } - else - { - // Not a normal exit. No <errno> might be set. - return -1; - } - } -} diff --git a/TAO/TAO_IDL/driver/drv_init.cpp b/TAO/TAO_IDL/driver/drv_init.cpp index 0fd784b8605..4c09f6b1f96 100644 --- a/TAO/TAO_IDL/driver/drv_init.cpp +++ b/TAO/TAO_IDL/driver/drv_init.cpp @@ -64,14 +64,12 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -// Initialization for IDL compiler driver program +ACE_RCSID (driver, + drv_init, + "$Id$") -#include "idl.h" -#include "idl_extern.h" -#include "drv_private.h" -#include "be.h" - -ACE_RCSID(driver, drv_init, "$Id$") +extern long DRV_nfiles; +extern long DRV_file_index; const size_t LOCAL_ESCAPES_BUFFER_SIZE = 1024; diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp index 5793dfedcd4..255fe6a0a5a 100644 --- a/TAO/TAO_IDL/driver/drv_preproc.cpp +++ b/TAO/TAO_IDL/driver/drv_preproc.cpp @@ -66,17 +66,21 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // Pass an IDL file through the C preprocessor -#include "idl.h" -#include "idl_extern.h" -#include "drv_private.h" +#include "idl_bool.h" +#include "idl_defines.h" +#include "global_extern.h" +#include "fe_extern.h" #include "drv_extern.h" +#include "utl_string.h" #include "ace/Version.h" #include "ace/Process_Manager.h" #include "ace/SString.h" #include "ace/Env_Value_T.h" #include "ace/ARGV.h" -ACE_RCSID(driver, drv_preproc, "$Id$") +ACE_RCSID (driver, + drv_preproc, + "$Id$") static long argcount = 0; static long max_argcount = 128; @@ -84,14 +88,14 @@ static const char *arglist[128]; static const char *output_arg_format = 0; static long output_arg_index = 0; -// Push the new CPP location if we got a -Yp argument +// Push the new CPP location if we got a -Yp argument. void DRV_cpp_new_location (const char *new_loc) { arglist[0] = new_loc; } -// Push an argument into the arglist +// Push an argument into the arglist. void DRV_cpp_putarg (const char *str) { @@ -133,21 +137,56 @@ DRV_cpp_expand_output_arg (const char *filename) } } -// Initialize the cpp argument list +// Lines can be 1024 chars long. +#define LINEBUF_SIZE 1024 +static char drv_line[LINEBUF_SIZE + 1]; + +// Get a line from stdin. +static long +DRV_get_line (FILE *f) +{ + char *l = fgets (drv_line, + LINEBUF_SIZE, + f); + long i = 0; + + if (l == 0) + { + return I_FALSE; + } + + if (*l == '\0' && feof (f)) + { + return I_FALSE; + } + + if (*l == '\0') + { + return I_TRUE; + } + + i = strlen(l) - 1; + + if (l[i] == '\n') + { + l[i] = '\0'; + } + + return I_TRUE; +} + +// Initialize the cpp argument list. void DRV_cpp_init (void) { - // @@ There are two "one time" memory leaks in this function. - // They will not blow off the program but should be fixed at some point. const char *cpp_loc, *cpp_args; // See if TAO_IDL_PREPROCESSOR is defined. - - ACE_Env_Value<char*> preprocessor ("TAO_IDL_PREPROCESSOR", (char *) 0); + ACE_Env_Value<char*> preprocessor ("TAO_IDL_PREPROCESSOR", + (char *) 0); // Set cpp_loc to the built in location, unless it has been overriden by // environment variables. - if (preprocessor != 0) { cpp_loc = preprocessor; @@ -179,7 +218,7 @@ DRV_cpp_init (void) // Add an option to the IDL compiler to make the TAO version // available to the user. A XX.YY.ZZ release gets version 0xXXYYZZ, - // for example, 5.1.14 gets 0x050114 + // for example, 5.1.14 gets 0x050114. char version_option[128]; ACE_OS::sprintf (version_option, "-D__TAO_IDL=0x%2.2d%2.2d%2.2d", @@ -191,7 +230,6 @@ DRV_cpp_init (void) DRV_cpp_putarg ("-I."); // Added some customizable preprocessor options - ACE_Env_Value<char*> args1 ("TAO_IDL_PREPROCESSOR_ARGS", (char *) 0); @@ -201,7 +239,8 @@ DRV_cpp_init (void) } else { - // Check for the deprecated TAO_IDL_DEFAULT_CPP_FLAGS environment variable + // Check for the deprecated TAO_IDL_DEFAULT_CPP_FLAGS environment + // variable. ACE_Env_Value<char*> args2 ("TAO_IDL_DEFAULT_CPP_FLAGS", (char *) 0); @@ -238,7 +277,8 @@ DRV_cpp_init (void) // TAO_IDL_INCLUDE_DIR should be in quotes, // e.g. "/usr/local/include/tao" - ACE_OS::strcat (option, TAO_IDL_INCLUDE_DIR); + ACE_OS::strcat (option, + TAO_IDL_INCLUDE_DIR); #else const char* TAO_ROOT = ACE_OS::getenv ("TAO_ROOT"); @@ -282,7 +322,8 @@ DRV_cpp_init (void) for (size_t arg_cnt = 0; arg_cnt < arglist.argc (); ++arg_cnt) { // Check for an argument that specifies the preprocessor's output file. - if (ACE_OS::strstr (arglist[arg_cnt], "%s") != 0 && output_arg_format == 0) + if (ACE_OS::strstr (arglist[arg_cnt], "%s") != 0 + && output_arg_format == 0) { output_arg_format = ACE::strnew (arglist[arg_cnt]); output_arg_index = argcount; @@ -295,42 +336,126 @@ DRV_cpp_init (void) } } -// Lines can be 1024 chars long. -#define LINEBUF_SIZE 1024 -static char drv_line[LINEBUF_SIZE + 1]; - -// Get a line from stdin -static long -DRV_get_line (FILE *f) +// We really need to know whether this line is a "#include ...". If +// so, we would like to separate the "file name" and keep that in the +// idl_global. We need them to produce "#include's in the stubs and +// skeletons. +void +DRV_check_for_include (const char* buf) { - char *l = fgets (drv_line, - LINEBUF_SIZE, - f); - long i = 0; + const char* r = buf; + const char* h; - if (l == NULL) - { - return I_FALSE; - } + // Skip initial '#'. + if (*r != '#') + { + return; + } + else + { + r++; + } - if (*l == '\0' && feof (f)) - { - return I_FALSE; - } + // Skip the tabs and spaces. + while (*r == ' ' || *r == '\t') + { + ++r; + } - if (*l == '\0') - { - return I_TRUE; - } + // Probably we are at the word `include`. If not return. + if (*r != 'i') + { + return; + } - i = strlen(l) - 1; + // Check whether this word is `include` or no. + const char* include_str = "include"; - if (l[i] == '\n') - { - l[i] = '\0'; - } + for (size_t ii = 0; + ii < strlen ("include") && *r != '\0' && *r != ' ' && *r != '\t'; + ++r, ++ii) + { + // Return if it doesn't match. + if (include_str [ii] != *r) + { + return; + } + } - return I_TRUE; + // Next thing is finding the file that has been `#include'd. Skip + // all the blanks and tabs and reach the startng " or < character. + for (; (*r != '"') && (*r != '<'); ++r) + { + if (*r == '\n' || *r == '\0') + { + return; + } + } + + // Decide on the end char. + char end_char = '"'; + + if (*r == '<') + { + end_char = '>'; + } + + // Skip this " or <. + ++r; + + // Store this position. + h = r; + + // Found this in idl.ll. Decides the file to be standard input. + if (*h == '\0') + { + return; + } + + // Find the closing " or < character. + for (; *r != end_char; ++r) + { + continue; + } + + // Make a new string for this file name. + char* file_name = 0; + ACE_NEW (file_name, + char [r - h + 1]); + + // Copy the char's. + size_t fi = 0; + + for (; h != r; ++fi, ++h) + { + file_name [fi] = *h; + } + + // Terminate the string. + file_name [fi] = '\0'; + + // Put Microsoft-style pathnames into a canonical form. + size_t i = 0; + + for (size_t j = 0; file_name [j] != '\0'; ++i, ++j) + { + if (file_name [j] == '\\' && file_name [j + 1] == '\\') + { + j++; + } + + file_name [i] = file_name [j]; + } + + // Terminate this string. + file_name [i] = '\0'; + + // Store in the idl_global, unless it's "orb.idl" - + // we don't want to generate header includes for that. + if (ACE_OS::strcmp (file_name, "orb.idl")) + { + idl_global->add_to_included_idl_files (file_name); + } } // Copy from stdin to a file @@ -341,7 +466,7 @@ DRV_copy_input (FILE *fin, { FILE *f = ACE_OS::fopen (fn, "w"); - if (f == NULL) + if (f == 0) { ACE_ERROR ((LM_ERROR, "%s%s%s%s", @@ -353,7 +478,7 @@ DRV_copy_input (FILE *fin, ACE_OS::exit (99); } - if (fin == NULL) + if (fin == 0) { ACE_ERROR ((LM_ERROR, "%s%s", @@ -410,16 +535,16 @@ DRV_copy_input (FILE *fin, } // Strip down a name to the last component, -// i.e. everything after the last '/' or '\' character +// i.e. everything after the last '/' or '\' character. static char * DRV_stripped_name (char *fn) { - char *n = fn; - long l; + char *n = fn; + long l; - if (n == NULL) + if (n == 0) { - return NULL; + return 0; } l = strlen (n); @@ -440,11 +565,11 @@ DRV_stripped_name (char *fn) return n; } -// File names +// File names. static char tmp_file[128]; static char tmp_ifile[128]; -// Pass input through preprocessor +// Pass input through preprocessor. void DRV_pre_proc (const char *myfile) { @@ -455,14 +580,22 @@ DRV_pre_proc (const char *myfile) const char* tmpdir = idl_global->temp_dir (); - ACE_OS::strcpy (tmp_file, tmpdir); - ACE_OS::strcpy (tmp_ifile, tmpdir); + ACE_OS::strcpy (tmp_file, + tmpdir); + ACE_OS::strcpy (tmp_ifile, + tmpdir); - ACE_OS::strcat (tmp_file, "idlf_XXXXXX"); - ACE_OS::strcat (tmp_ifile, "idli_XXXXXX"); + ACE_OS::strcat (tmp_file, + "idlf_XXXXXX"); + ACE_OS::strcat (tmp_ifile, + "idli_XXXXXX"); - (void) ACE_OS::mktemp (tmp_file); ACE_OS::strcat (tmp_file, ".cc"); - (void) ACE_OS::mktemp (tmp_ifile); ACE_OS::strcat (tmp_ifile, ".cc"); + (void) ACE_OS::mktemp (tmp_file); + ACE_OS::strcat (tmp_file, + ".cc"); + (void) ACE_OS::mktemp (tmp_ifile); + ACE_OS::strcat (tmp_ifile, + ".cc"); UTL_String *tmp = 0; @@ -587,6 +720,7 @@ DRV_pre_proc (const char *myfile) argcount -= 2; ACE_exitcode status = 0; + if (process.wait (&status) == ACE_INVALID_PID) { ACE_ERROR ((LM_ERROR, @@ -718,128 +852,6 @@ DRV_pre_proc (const char *myfile) } } -// We really need to know whether this line is a "#include ...". If -// so, we would like to separate the "file name" and keep that in the -// idl_global. We need them to produce "#include's in the stubs and -// skeletons. -void -DRV_check_for_include (const char* buf) -{ - const char* r = buf; - const char* h; - - // Skip initial '#'. - if (*r != '#') - { - return; - } - else - { - r++; - } - - // Skip the tabs and spaces. - while (*r == ' ' || *r == '\t') - { - r++; - } - - // Probably we are at the word `include`. If not return. - if (*r != 'i') - { - return; - } - - // Check whether this word is `include` or no. - const char* include_str = "include"; - - for (size_t ii = 0; - ii < strlen ("include") && *r != '\0' && *r != ' ' && *r != '\t'; - r++, ii++) - { - // Return if it doesn't match. - if (include_str [ii] != *r) - { - return; - } - } - - // Next thing is finding the file that has been `#include'd. Skip - // all the blanks and tabs and reach the startng " or < character. - for (; (*r != '"') && (*r != '<'); r++) - { - if (*r == '\n' || *r == '\0') - { - return; - } - } - - // Decide on the end char. - char end_char = '"'; - - if (*r == '<') - { - end_char = '>'; - } - - // Skip this " or <. - r++; - - // Store this position. - h = r; - - // Found this in idl.ll. Decides the file to be standard input. - if (*h == '\0') - { - return; - } - - // Find the closing " or < character. - for (; *r != end_char; r++) - { - continue; - } - - // Make a new string for this file name. - char* file_name = 0; - ACE_NEW (file_name, - char [r - h + 1]); - - // Copy the char's. - size_t fi = 0; - - for (; h != r; fi++, h++) - { - file_name [fi] = *h; - } - - // Terminate the string. - file_name [fi] = '\0'; - - // Put Microsoft-style pathnames into a canonical form. - size_t i = 0; - - for (size_t j = 0; file_name [j] != '\0'; i++, j++) - { - if (file_name [j] == '\\' && file_name [j + 1] == '\\') - { - j++; - } - - file_name [i] = file_name [j]; - } - - // Terminate this string. - file_name [i] = '\0'; - - // Store in the idl_global, unless it's "orb.idl" - - // we don't want to generate header includes for that. - if (ACE_OS::strcmp (file_name, "orb.idl")) - { - idl_global->add_to_included_idl_files (file_name); - } -} - #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Env_Value<char*>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) diff --git a/TAO/TAO_IDL/fe/fe_declarator.cpp b/TAO/TAO_IDL/fe/fe_declarator.cpp index 0b44087b598..6c70795f0b3 100644 --- a/TAO/TAO_IDL/fe/fe_declarator.cpp +++ b/TAO/TAO_IDL/fe/fe_declarator.cpp @@ -64,13 +64,16 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -#include "idl.h" -#include "idl_extern.h" -#include "fe_private.h" +#include "fe_declarator.h" +#include "ast_array.h" +#include "ast_type.h" +#include "utl_err.h" +#include "global_extern.h" +#include "ace/config-all.h" -ACE_RCSID(fe, fe_declarator, "$Id$") - -// Constructor(s) and destructor +ACE_RCSID (fe, + fe_declarator, + "$Id$") FE_Declarator::FE_Declarator (UTL_ScopedName *n, DeclaratorType dt, @@ -81,8 +84,6 @@ FE_Declarator::FE_Declarator (UTL_ScopedName *n, this->pd_name = n; } -// Public operations. - // Compose the type of the complex declarator (if any) with the base // type supplied in ct. AST_Type * diff --git a/TAO/TAO_IDL/fe/fe_extern.cpp b/TAO/TAO_IDL/fe/fe_extern.cpp index 072afc7e7e0..cf2d05b168d 100644 --- a/TAO/TAO_IDL/fe/fe_extern.cpp +++ b/TAO/TAO_IDL/fe/fe_extern.cpp @@ -69,18 +69,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. * fe_extern.cc - export FE interfaces to driver */ -#include "idl.h" -#include "idl_extern.h" - -#include "fe_private.h" - -#include "utl_err.h" -#include "utl_indenter.h" -#include "utl_string.h" - -ACE_RCSID(fe, fe_extern, "$Id$") - -// yacc parser interface +#include "fe_extern.h" +#include "ast_root.h" +#include "global_extern.h" +#include "utl_err.h" +#include "utl_indenter.h" + +ACE_RCSID (fe, + fe_extern, + "$Id$") extern int tao_yyparse (void); extern FILE *tao_yyin; diff --git a/TAO/TAO_IDL/fe/fe_global.cpp b/TAO/TAO_IDL/fe/fe_global.cpp index 014f6521169..7f1e0f66ddd 100644 --- a/TAO/TAO_IDL/fe/fe_global.cpp +++ b/TAO/TAO_IDL/fe/fe_global.cpp @@ -1,11 +1,12 @@ // $Id$ -#include "TAO_IDL_FE_Export.h" +#include "TAO_IDL_FE_Export.h" -ACE_RCSID(fe, fe_global, "$Id$") +ACE_RCSID (fe, + fe_global, + "$Id$") -class TAO_IDL_FE_Export IDL_GlobalData; // Global data is stored in an - // instance of this +class TAO_IDL_FE_Export IDL_GlobalData; TAO_IDL_FE_Export IDL_GlobalData *idl_global = 0; diff --git a/TAO/TAO_IDL/fe/fe_init.cpp b/TAO/TAO_IDL/fe/fe_init.cpp index 3f5178adad3..c6c88a51602 100644 --- a/TAO/TAO_IDL/fe/fe_init.cpp +++ b/TAO/TAO_IDL/fe/fe_init.cpp @@ -62,28 +62,20 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ - -/* - * fe_init.cc - Initialize the FE - * - * The FE initialization is carried out in two stages, with the BE - * initialization protocol sandwiched between the two stages. - * - * The first stage is responsible for creating the scopes stack. - * The second stage is run after the BE initialization has created - * and returned an instance of AST_Generator (or a subclass). This - * instance is used to create the root node for the AST, and to - * populate it with AST_PredefinedType nodes which represent the - * predefined IDL types. This AST root is then pushed on the scopes - * stack as the outermost scope. - */ - -#include "idl.h" -#include "idl_extern.h" -#include "fe_private.h" - -ACE_RCSID(fe, fe_init, "$Id$") +*/ + +#include "ast_module.h" +#include "ast_predefined_type.h" +#include "ast_generator.h" +#include "ast_root.h" +#include "utl_scoped_name.h" +#include "utl_identifier.h" +#include "global_extern.h" +#include "fe_extern.h" + +ACE_RCSID (fe, + fe_init, + "$Id$") // Create a scoped name static UTL_ScopedName * diff --git a/TAO/TAO_IDL/fe/fe_interface_header.cpp b/TAO/TAO_IDL/fe/fe_interface_header.cpp index 3e5f360466a..169ec4da8eb 100644 --- a/TAO/TAO_IDL/fe/fe_interface_header.cpp +++ b/TAO/TAO_IDL/fe/fe_interface_header.cpp @@ -68,13 +68,17 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // interface header as the interface is being parsed and before the // AST_Interface node used to represent this interface is created. -#include "idl.h" -#include "idl_extern.h" -#include "fe_private.h" - -ACE_RCSID(fe, fe_interface_header, "$Id$") - -// Constructor(s) and destructor +#include "fe_interface_header.h" +#include "ast_interface.h" +#include "ast_module.h" +#include "utl_namelist.h" +#include "utl_err.h" +#include "global_extern.h" +#include "nr_extern.h" + +ACE_RCSID (fe, + fe_interface_header, + "$Id$") FE_InterfaceHeader::FE_InterfaceHeader (UTL_ScopedName *n, UTL_NameList *nl, diff --git a/TAO/TAO_IDL/fe/fe_lookup.cpp b/TAO/TAO_IDL/fe/fe_lookup.cpp index 1b449b99308..1e48e4cddd9 100644 --- a/TAO/TAO_IDL/fe/fe_lookup.cpp +++ b/TAO/TAO_IDL/fe/fe_lookup.cpp @@ -1,7 +1,7 @@ // $Id$ -#include "idl.h" -#include "idl_extern.h" -#include "fe_private.h" + +#include "fe_private.h" + /* starting time is 2:40:07 */ /* C++ code produced by gperf version 2.8 (ACE version) */ /* Command-line: /project/adaptive/ACE_wrappers/build/SunOS5.5/bin/gperf -M -J -c -C -D -E -T -f 0 -a -o -t -p -K keyword_ -L C++ -Z TAO_IDL_CPP_Keyword_Table -N lookup -k1,2,$ fe/keywords.dat */ @@ -41,7 +41,7 @@ TAO_IDL_CPP_Keyword_Table::lookup (const char *str, unsigned int len) DUPLICATES = 0 }; - static const struct TAO_IDL_CPP_Keyword_Entry wordlist[] = + static const struct TAO_IDL_CPP_Keyword_Entry wordlist[] = { {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"",0}, {"delete", "_cxx_delete"}, diff --git a/TAO/TAO_IDL/fe/fe_private.cpp b/TAO/TAO_IDL/fe/fe_private.cpp index 41c9d1664e0..2df2edca523 100644 --- a/TAO/TAO_IDL/fe/fe_private.cpp +++ b/TAO/TAO_IDL/fe/fe_private.cpp @@ -62,20 +62,13 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -/* - * fe_private.cc - Declare global data which are private to the FE - * part - */ - -#include "idl.h" -#include "idl_extern.h" -#include "fe_private.h" +#include "fe_private.h" +#include "utl_strlist.h" -ACE_RCSID(fe, fe_private, "$Id$") +ACE_RCSID (fe, + fe_private, + "$Id$") -/* - * List of pragmas - */ -UTL_StrList *DRV_global_pragmas = NULL; +UTL_StrList *DRV_global_pragmas = 0; diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index 66828674bc9..51e9286f93a 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -67,8 +67,19 @@ trademarks or registered trademarks of Sun Microsystems, Inc. * idl.ll - Lexical scanner for IDL 1.1 */ -#include "idl.h" -#include "idl_extern.h" +#include "utl_strlist.h" +#include "utl_exprlist.h" +#include "utl_labellist.h" +#include "utl_decllist.h" +#include "utl_string.h" +#include "utl_err.h" +#include "ast_union_label.h" +#include "ast_field.h" +#include "ast_expression.h" +#include "ast_argument.h" +#include "ast_operation.h" +#include "fe_interface_header.h" +#include "global_extern.h" #include "fe_private.h" #include "y.tab.h" diff --git a/TAO/TAO_IDL/fe/idl.yy b/TAO/TAO_IDL/fe/idl.yy index 2cb6a667f83..66297f2c388 100644 --- a/TAO/TAO_IDL/fe/idl.yy +++ b/TAO/TAO_IDL/fe/idl.yy @@ -71,10 +71,35 @@ trademarks or registered trademarks of Sun Microsystems, Inc. /* Declarations */ %{ -#include "idl.h" -#include "idl_extern.h" -#include "fe_private.h" -#include <stdio.h> +#include "utl_strlist.h" +#include "utl_namelist.h" +#include "fe_interface_header.h" +#include "utl_exprlist.h" +#include "utl_labellist.h" +#include "utl_decllist.h" +#include "ast_field.h" +#include "ast_expression.h" +#include "ast_argument.h" +#include "ast_operation.h" +#include "global_extern.h" +#include "utl_identifier.h" +#include "utl_err.h" +#include "ast_generator.h" +#include "ast_module.h" +#include "ast_interface.h" +#include "ast_interface_fwd.h" +#include "utl_string.h" +#include "ast_constant.h" +#include "fe_declarator.h" +#include "ast_union.h" +#include "ast_extern.h" +#include "ast_enum.h" +#include "ast_root.h" +#include "ast_sequence.h" +#include "ast_string.h" +#include "ast_factory.h" +#include "ast_exception.h" +#include "ast_array.h" #if (defined(apollo) || defined(hpux)) && defined(__cplusplus) extern "C" int yywrap(); @@ -2724,10 +2749,15 @@ sequence_type_spec } else { + Identifier id ("sequence"); + UTL_ScopedName sn (&id, + 0); + $$ = idl_global->gen ()->create_sequence ( $4, tp, + &sn, s->is_local (), s->is_abstract () ); @@ -2767,10 +2797,15 @@ sequence_type_spec } else { + Identifier id ("sequence"); + UTL_ScopedName sn (&id, + 0); + $$ = idl_global->gen ()->create_sequence ( idl_global->gen ()->create_expr ((unsigned long) 0), tp, + &sn, s->is_local (), s->is_abstract () ); diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index d6c3b11233f..cb53f61dffc 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -849,8 +849,19 @@ trademarks or registered trademarks of Sun Microsystems, Inc. * idl.ll - Lexical scanner for IDL 1.1 */ -#include "idl.h" -#include "idl_extern.h" +#include "utl_strlist.h" +#include "utl_exprlist.h" +#include "utl_labellist.h" +#include "utl_decllist.h" +#include "utl_string.h" +#include "utl_err.h" +#include "ast_union_label.h" +#include "ast_field.h" +#include "ast_expression.h" +#include "ast_argument.h" +#include "ast_operation.h" +#include "fe_interface_header.h" +#include "global_extern.h" #include "fe_private.h" #include "y.tab.h" diff --git a/TAO/TAO_IDL/fe/y.tab.cpp b/TAO/TAO_IDL/fe/y.tab.cpp index 615afa4156f..4e20689564c 100644 --- a/TAO/TAO_IDL/fe/y.tab.cpp +++ b/TAO/TAO_IDL/fe/y.tab.cpp @@ -3,10 +3,35 @@ char tao_yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90 \n\ Modified 5/2/90 by J. Roskind to support graphic debugging modes"; #endif -#include "idl.h" -#include "idl_extern.h" -#include "fe_private.h" -#include <stdio.h> +#include "utl_strlist.h" +#include "utl_namelist.h" +#include "fe_interface_header.h" +#include "utl_exprlist.h" +#include "utl_labellist.h" +#include "utl_decllist.h" +#include "ast_field.h" +#include "ast_expression.h" +#include "ast_argument.h" +#include "ast_operation.h" +#include "global_extern.h" +#include "utl_identifier.h" +#include "utl_err.h" +#include "ast_generator.h" +#include "ast_module.h" +#include "ast_interface.h" +#include "ast_interface_fwd.h" +#include "utl_string.h" +#include "ast_constant.h" +#include "fe_declarator.h" +#include "ast_union.h" +#include "ast_extern.h" +#include "ast_enum.h" +#include "ast_root.h" +#include "ast_sequence.h" +#include "ast_string.h" +#include "ast_factory.h" +#include "ast_exception.h" +#include "ast_array.h" #if (defined(apollo) || defined(hpux)) && defined(__cplusplus) extern "C" int tao_yywrap(); @@ -3679,10 +3704,15 @@ case 269: } else { + Identifier id ("sequence"); + UTL_ScopedName sn (&id, + 0); + tao_yyval.dcval = idl_global->gen ()->create_sequence ( tao_yyvsp[-2].exval, tp, + &sn, s->is_local (), s->is_abstract () ); @@ -3722,10 +3752,15 @@ case 270: } else { + Identifier id ("sequence"); + UTL_ScopedName sn (&id, + 0); + tao_yyval.dcval = idl_global->gen ()->create_sequence ( idl_global->gen ()->create_expr ((unsigned long) 0), tp, + &sn, s->is_local (), s->is_abstract () ); diff --git a/TAO/TAO_IDL/include/ast_argument.h b/TAO/TAO_IDL/include/ast_argument.h index ddd5b649476..26557ba9da2 100644 --- a/TAO/TAO_IDL/include/ast_argument.h +++ b/TAO/TAO_IDL/include/ast_argument.h @@ -70,8 +70,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // Representation of argument to operation: // An argument is a field with a direction attached -#include "idl_fwd.h" -#include "idl_narrow.h" #include "ast_field.h" diff --git a/TAO/TAO_IDL/include/ast_array.h b/TAO/TAO_IDL/include/ast_array.h index 5acad2b1f39..4f74b748fb0 100644 --- a/TAO/TAO_IDL/include/ast_array.h +++ b/TAO/TAO_IDL/include/ast_array.h @@ -67,8 +67,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_ARRAY_AST_ARRAY_HH #define _AST_ARRAY_AST_ARRAY_HH +#include "ast_concrete_type.h" + +class UTL_ExprList; +class AST_Expression; +class AST_Type; +class ast_visitor; + // Representation of array declaration: -// An array is a combination of a list of dimensions and a base type +// An array is a combination of a list of dimensions and a base type. class TAO_IDL_FE_Export AST_Array : public virtual AST_ConcreteType { diff --git a/TAO/TAO_IDL/include/ast_attribute.h b/TAO/TAO_IDL/include/ast_attribute.h index e4cbc42b833..de63d57a10f 100644 --- a/TAO/TAO_IDL/include/ast_attribute.h +++ b/TAO/TAO_IDL/include/ast_attribute.h @@ -67,8 +67,12 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_ATTRIBUTE_AST_ATTRIBUTE_HH #define _AST_ATTRIBUTE_AST_ATTRIBUTE_HH +#include "ast_field.h" +#include "utl_scoped_name.h" +#include "ace/OS.h" + // Representation of attribute declaration: -// An attribute is a field with a readonly property +// An attribute is a field with a readonly property. class TAO_IDL_FE_Export AST_Attribute : public virtual AST_Field { diff --git a/TAO/TAO_IDL/include/ast_component.h b/TAO/TAO_IDL/include/ast_component.h index aa22fdba074..f69f159a651 100644 --- a/TAO/TAO_IDL/include/ast_component.h +++ b/TAO/TAO_IDL/include/ast_component.h @@ -4,6 +4,8 @@ #ifndef _AST_INTERFACE_AST_COMPONENT_HH #define _AST_INTERFACE_AST_COMPONENT_HH +#include "ast_interface.h" + class TAO_IDL_FE_Export AST_Component : public virtual AST_Interface { public: diff --git a/TAO/TAO_IDL/include/ast_concrete_type.h b/TAO/TAO_IDL/include/ast_concrete_type.h index 68838a4a636..79f132748c3 100644 --- a/TAO/TAO_IDL/include/ast_concrete_type.h +++ b/TAO/TAO_IDL/include/ast_concrete_type.h @@ -67,6 +67,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_CONCRETE_TYPE_AST_CONCRETE_TYPE_HH #define _AST_CONCRETE_TYPE_AST_CONCRETE_TYPE_HH +#include "ast_type.h" + // Class for all concrete types. // This is useful to group together IDL types other than objects. diff --git a/TAO/TAO_IDL/include/ast_constant.h b/TAO/TAO_IDL/include/ast_constant.h index 27a9c6a0b9e..f75ab767cdd 100644 --- a/TAO/TAO_IDL/include/ast_constant.h +++ b/TAO/TAO_IDL/include/ast_constant.h @@ -67,6 +67,10 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_CONSTANT_AST_CONSTANT_HH #define _AST_CONSTANT_AST_CONSTANT_HH +#include "ast_expression.h" +#include "ast_decl.h" +#include "global_extern.h" + // Representation of constant declaration: // // NOTE: Part of the job of the constructor is to convert @@ -80,9 +84,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. class TAO_IDL_FE_Export AST_Constant : public virtual AST_Decl { public: - // Operations. - - // Constructor(s). AST_Constant (void); AST_Constant (AST_Expression::ExprType et, @@ -94,12 +95,10 @@ public: AST_Expression *ev, UTL_ScopedName *n); - // Destructor. virtual ~AST_Constant (void); // Data Accessors. AST_Expression *constant_value (void); - AST_Expression::ExprType et (void); // Accessors for the private member. @@ -120,7 +119,6 @@ public: virtual void destroy (void); private: - // Data. AST_Expression *pd_constant_value; // The value. diff --git a/TAO/TAO_IDL/include/ast_decl.h b/TAO/TAO_IDL/include/ast_decl.h index 40d66efb401..88461a0f50d 100644 --- a/TAO/TAO_IDL/include/ast_decl.h +++ b/TAO/TAO_IDL/include/ast_decl.h @@ -74,21 +74,16 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // records the type of the node. This may be useful for BEs to be able // to distinguish the real type of a node given only a superclass. -/* -** DEPENDENCIES: utl_scope.hh, utl_scoped_name.hh, utl_strlist.hh -** -** USE: Included from ast.hh -*/ - -#include "idl_fwd.h" -#include "idl_narrow.h" -#include "idl_bool.h" #include "utl_scoped_name.h" -#include "utl_string.h" +#include "idl_narrow.h" // This is for AIX w/IBM C++ class Identifier; +class UTL_Scope; +class UTL_String; +class ast_visitor; + // This class is needed (only for g++) to get around a bug in g++ which // causes virtual operations to not be looked up correctly if an operation // is defined in more than one virtual public base class. This class makes diff --git a/TAO/TAO_IDL/include/ast_enum.h b/TAO/TAO_IDL/include/ast_enum.h index 5ea0a6266ed..e563f48c217 100644 --- a/TAO/TAO_IDL/include/ast_enum.h +++ b/TAO/TAO_IDL/include/ast_enum.h @@ -62,33 +62,25 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _AST_ENUM_AST_ENUM_HH #define _AST_ENUM_AST_ENUM_HH -// Representation of enum: +#include "ast_concrete_type.h" +#include "utl_scope.h" -/* -** DEPENDENCIES: ast_concrete_type.hh, utl_scope.hh, ast_enum_val.hh, -** utl_scoped_name.hh, utl_strlist.hh, ast_expression.hh, -** -** USE: Included from ast.hh -*/ +class AST_EnumVal; class TAO_IDL_FE_Export AST_Enum : public virtual AST_ConcreteType, public virtual UTL_Scope { public: - // Operations. - - // Constructor(s) AST_Enum (void); AST_Enum (UTL_ScopedName *n, idl_bool local, idl_bool abstract); - // Destructor. virtual ~AST_Enum (void); // Narrowing diff --git a/TAO/TAO_IDL/include/ast_enum_val.h b/TAO/TAO_IDL/include/ast_enum_val.h index 121c0600619..46b3ce331dd 100644 --- a/TAO/TAO_IDL/include/ast_enum_val.h +++ b/TAO/TAO_IDL/include/ast_enum_val.h @@ -67,7 +67,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_ENUM_VAL_AST_ENUM_VAL_HH #define _AST_ENUM_VAL_AST_ENUM_VAL_HH -// Representation of enumerator in enum. +#include "ast_constant.h" // An enumerator is a constant of type unsigned long. diff --git a/TAO/TAO_IDL/include/ast_exception.h b/TAO/TAO_IDL/include/ast_exception.h index bce16beee09..c947b0fd9fa 100644 --- a/TAO/TAO_IDL/include/ast_exception.h +++ b/TAO/TAO_IDL/include/ast_exception.h @@ -67,6 +67,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_EXCEPTION_AST_EXCEPTION_HH #define _AST_EXCEPTION_AST_EXCEPTION_HH +#include "ast_structure.h" + // NOTE: add (AST_ConcreteType *) is defined here because an exception // can contain locally defined types in addition to fields. // @@ -78,7 +80,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. class TAO_IDL_FE_Export AST_Exception : public virtual AST_Structure { public: - // Constructor(s). AST_Exception (void); AST_Exception (UTL_ScopedName *n, @@ -104,7 +105,7 @@ public: private: friend int tao_yyparse (void); - // Scope Management Protocol + // Scope Management Protocol. virtual AST_Field *fe_add_field (AST_Field *f); virtual AST_Union *fe_add_union (AST_Union *u); virtual AST_Structure *fe_add_structure (AST_Structure *s); diff --git a/TAO/TAO_IDL/include/ast_expression.h b/TAO/TAO_IDL/include/ast_expression.h index 600f400779f..d729cba1188 100644 --- a/TAO/TAO_IDL/include/ast_expression.h +++ b/TAO/TAO_IDL/include/ast_expression.h @@ -68,6 +68,11 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #define _AST_EXPRESSION_AST_EXPRESSION_HH #include "ace/CDR_Stream.h" +#include "utl_scoped_name.h" + +class UTL_String; +class UTL_Scope; +class ast_visitor; // Representation of expression values. diff --git a/TAO/TAO_IDL/include/ast_extern.h b/TAO/TAO_IDL/include/ast_extern.h index 6e10f10f168..da0c4db0f56 100644 --- a/TAO/TAO_IDL/include/ast_extern.h +++ b/TAO/TAO_IDL/include/ast_extern.h @@ -67,17 +67,12 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_EXTERN_AST_EXTERN_HH #define _AST_EXTERN_AST_EXTERN_HH -// ast_extern.hh -// -// Declares all global functions for the AST +#include "idl_bool.h" -/* -** DEPENDENCIES: none -** -** USE: Included from idl_extern.hh -*/ +class AST_InterfaceFwd; +class AST_Decl; -// Functions: +// Declares all global functions for the AST // Two functions are provided for storing AST nodes representing fwd // declared interfaces, and for checking the stored nodes after parsing @@ -86,7 +81,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. extern void AST_record_fwd_interface (AST_InterfaceFwd *i); extern void AST_check_fwd_interface (void); - extern idl_bool AST_illegal_recursive_type (AST_Decl *t); #endif // _AST_EXTERN_AST_EXTERN_HH diff --git a/TAO/TAO_IDL/include/ast_factory.h b/TAO/TAO_IDL/include/ast_factory.h index 8d2becad7df..c97400cd0df 100644 --- a/TAO/TAO_IDL/include/ast_factory.h +++ b/TAO/TAO_IDL/include/ast_factory.h @@ -69,9 +69,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // Representation of OBV factory construct declaration. -#include "idl_fwd.h" -#include "idl_narrow.h" -#include "utl_list.h" #include "ast_decl.h" #include "utl_scope.h" #include "utl_scoped_name.h" @@ -107,7 +104,7 @@ public: DEF_NARROW_FROM_SCOPE(AST_Factory); // AST Dumping. - virtual void dump (ostream &o); + virtual void dump (ACE_OSTREAM_TYPE &o); // Cleanup function. virtual void destroy (void); diff --git a/TAO/TAO_IDL/include/ast_field.h b/TAO/TAO_IDL/include/ast_field.h index 6c9beb7ac42..d100a89ff08 100644 --- a/TAO/TAO_IDL/include/ast_field.h +++ b/TAO/TAO_IDL/include/ast_field.h @@ -67,7 +67,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_FIELD_AST_FIELD_HH #define _AST_FIELD_AST_FIELD_HH -// Representation of a generic field +// Representation of a generic field. // Used as member in structures, exceptions and unions, and as a base // type for attributes and arguments to operations @@ -76,10 +76,10 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // is used directly inside a structure, the second when it is used as // the base type for attributes and operations. -#include "idl_fwd.h" -#include "idl_narrow.h" #include "ast_decl.h" +#include "utl_scoped_name.h" +class AST_Type; class TAO_IDL_FE_Export AST_Field : public virtual AST_Decl { diff --git a/TAO/TAO_IDL/include/ast_generator.h b/TAO/TAO_IDL/include/ast_generator.h index 104b42b88ce..2ecfdb5154a 100644 --- a/TAO/TAO_IDL/include/ast_generator.h +++ b/TAO/TAO_IDL/include/ast_generator.h @@ -67,6 +67,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_GENERATOR_AST_GENERATOR_HH #define _AST_GENERATOR_AST_GENERATOR_HH +#include "ast_operation.h" +#include "ast_argument.h" +#include "ast_predefined_type.h" +#include "ast_union_label.h" + +class AST_Root; +class UTL_LabelList; +class UTL_ExprList; + // Defines base class for node generators. class TAO_IDL_FE_Export AST_Generator @@ -233,6 +242,7 @@ public: // Create a node representing a sequence type. virtual AST_Sequence *create_sequence (AST_Expression *v, AST_Type *bt, + UTL_ScopedName *n, idl_bool local, idl_bool abstract); diff --git a/TAO/TAO_IDL/include/ast_interface.h b/TAO/TAO_IDL/include/ast_interface.h index 3b39146c35d..7d21d6257fe 100644 --- a/TAO/TAO_IDL/include/ast_interface.h +++ b/TAO/TAO_IDL/include/ast_interface.h @@ -71,17 +71,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // be defined manifest locally; the constants defined in these // enums are inserted in the enclosing scope. -#include "idl_fwd.h" -#include "idl_narrow.h" #include "ast_type.h" #include "utl_scope.h" -#include "ast_decl.h" class TAO_IDL_FE_Export AST_Interface : public virtual AST_Type, public virtual UTL_Scope { public: - // Constructor(s). AST_Interface (void); AST_Interface (UTL_ScopedName *n, @@ -94,7 +90,6 @@ public: virtual ~AST_Interface (void); - // Data Accessors. static void fwd_redefinition_helper (AST_Interface *&i, UTL_Scope *s); diff --git a/TAO/TAO_IDL/include/ast_interface_fwd.h b/TAO/TAO_IDL/include/ast_interface_fwd.h index 621e3a6988b..44b0996af64 100644 --- a/TAO/TAO_IDL/include/ast_interface_fwd.h +++ b/TAO/TAO_IDL/include/ast_interface_fwd.h @@ -67,23 +67,22 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_INTERFACE_FWD_AST_INTERFACE_FWD_HH #define _AST_INTERFACE_FWD_AST_INTERFACE_FWD_HH +#include "ast_type.h" + +class AST_Interface; + // Representation of a forward interface declaration. class TAO_IDL_FE_Export AST_InterfaceFwd : public virtual AST_Type { public: - // Operations. - - // Constructor(s). AST_InterfaceFwd (void); AST_InterfaceFwd (AST_Interface *dummy, UTL_ScopedName *n); - // Destructor. virtual ~AST_InterfaceFwd (void); - // Data Accessors. AST_Interface *full_definition (void); void set_full_definition (AST_Interface *nfd); @@ -105,10 +104,8 @@ public: virtual int ast_accept (ast_visitor *visitor); private: - // Data. - AST_Interface *pd_full_definition; - // The interface this is a forward declaration of + // The interface this is a forward declaration of. }; #endif // _AST_INTERFACE_FWD_AST_INTERFACE_FWD_HH diff --git a/TAO/TAO_IDL/include/ast_module.h b/TAO/TAO_IDL/include/ast_module.h index 6df56041b42..c7fb4923262 100644 --- a/TAO/TAO_IDL/include/ast_module.h +++ b/TAO/TAO_IDL/include/ast_module.h @@ -67,6 +67,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_MODULE_AST_MODULE_HH #define _AST_MODULE_AST_MODULE_HH +#include "ast_decl.h" +#include "utl_scope.h" + // Representation of module. // // NOTE: add(AST_EnumValue *) is defined here because enums can diff --git a/TAO/TAO_IDL/include/ast_native.h b/TAO/TAO_IDL/include/ast_native.h index 7627faf4354..164d2ff4085 100644 --- a/TAO/TAO_IDL/include/ast_native.h +++ b/TAO/TAO_IDL/include/ast_native.h @@ -4,6 +4,8 @@ #ifndef _AST_NATIVE_H_ #define _AST_NATIVE_H_ +#include "ast_type.h" + // Representation of "native" IDL type added by the POA spec. class TAO_IDL_FE_Export AST_Native : public virtual AST_Type diff --git a/TAO/TAO_IDL/include/ast_operation.h b/TAO/TAO_IDL/include/ast_operation.h index 80708f8c031..94b7bc3f91f 100644 --- a/TAO/TAO_IDL/include/ast_operation.h +++ b/TAO/TAO_IDL/include/ast_operation.h @@ -67,14 +67,10 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_OPERATION_AST_OPERATION_HH #define _AST_OPERATION_AST_OPERATION_HH -// Representation of operation declaration. - -#include "idl_fwd.h" -#include "idl_narrow.h" -#include "utl_list.h" #include "ast_decl.h" #include "utl_scope.h" -#include "utl_scoped_name.h" + +class UTL_ExceptList; class TAO_IDL_FE_Export AST_Operation : public virtual AST_Decl, public virtual UTL_Scope diff --git a/TAO/TAO_IDL/include/ast_predefined_type.h b/TAO/TAO_IDL/include/ast_predefined_type.h index 2aa20f19506..01d25e12905 100644 --- a/TAO/TAO_IDL/include/ast_predefined_type.h +++ b/TAO/TAO_IDL/include/ast_predefined_type.h @@ -67,10 +67,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_PREDEFINED_TYPE_AST_PREDEFINED_TYPE_HH #define _AST_PREDEFINED_TYPE_AST_PREDEFINED_TYPE_HH -// Representation of predefined types: -// -// Instances of this class are inserted into the global context by -// the front end before the start of parsing. +#include "ast_concrete_type.h" + +class ast_visitor; class TAO_IDL_FE_Export AST_PredefinedType : public virtual AST_ConcreteType { diff --git a/TAO/TAO_IDL/include/ast_root.h b/TAO/TAO_IDL/include/ast_root.h index 9f1bd33b333..f8bbacdfa57 100644 --- a/TAO/TAO_IDL/include/ast_root.h +++ b/TAO/TAO_IDL/include/ast_root.h @@ -67,14 +67,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_ROOT_AST_ROOT_HH #define _AST_ROOT_AST_ROOT_HH +#include "ast_module.h" + // Representation of root of AST. class TAO_IDL_FE_Export AST_Root : public virtual AST_Module { public: - // Operations. - - // Constructor(s) and destructor. AST_Root (void); AST_Root (UTL_ScopedName *n); diff --git a/TAO/TAO_IDL/include/ast_sequence.h b/TAO/TAO_IDL/include/ast_sequence.h index 148a6e87a01..855dd739896 100644 --- a/TAO/TAO_IDL/include/ast_sequence.h +++ b/TAO/TAO_IDL/include/ast_sequence.h @@ -67,20 +67,22 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_SEQUENCE_AST_SEQUENCE_HH #define _AST_SEQUENCE_AST_SEQUENCE_HH -// Representation of sequence declaration: -// +#include "ast_concrete_type.h" +#include "idl_bool.h" + +class AST_Expression; +class AST_Type; + // A sequence is a combination of a maximum size and a base type. class TAO_IDL_FE_Export AST_Sequence : public virtual AST_ConcreteType { public: - // Operations. - - // Constructor(s). AST_Sequence (void); AST_Sequence (AST_Expression *max_size, AST_Type *bt, + UTL_ScopedName *n, idl_bool local, idl_bool abstract); diff --git a/TAO/TAO_IDL/include/ast_string.h b/TAO/TAO_IDL/include/ast_string.h index 5973e2d8e97..db5a89f1123 100644 --- a/TAO/TAO_IDL/include/ast_string.h +++ b/TAO/TAO_IDL/include/ast_string.h @@ -67,6 +67,11 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_STRING_AST_STRING_HH #define _AST_STRING_AST_STRING_HH +#include "ast_concrete_type.h" +#include "utl_scoped_name.h" + +class AST_Expression; + // Representation of string declaration. // A string type is represented by a maximum size. diff --git a/TAO/TAO_IDL/include/ast_structure.h b/TAO/TAO_IDL/include/ast_structure.h index bc09173d7e4..1110be80e8d 100644 --- a/TAO/TAO_IDL/include/ast_structure.h +++ b/TAO/TAO_IDL/include/ast_structure.h @@ -77,15 +77,14 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // enums are inserted in the enclosing scope. It is unlikely that // a BE writer will need to overload this function in AST_Structure. +#include "ast_concrete_type.h" +#include "utl_scope.h" #include "ace/Unbounded_Queue.h" class TAO_IDL_FE_Export AST_Structure : public virtual AST_ConcreteType, public virtual UTL_Scope { public: - // Operations. - - // Constructor(s). AST_Structure (void); AST_Structure (UTL_ScopedName *n, @@ -97,7 +96,6 @@ public: idl_bool local, idl_bool abstract); - // Destructor. virtual ~AST_Structure (void); // Narrowing. diff --git a/TAO/TAO_IDL/include/ast_type.h b/TAO/TAO_IDL/include/ast_type.h index feefba27813..24a292fa610 100644 --- a/TAO/TAO_IDL/include/ast_type.h +++ b/TAO/TAO_IDL/include/ast_type.h @@ -67,16 +67,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_TYPE_AST_TYPE_HH #define _AST_TYPE_AST_TYPE_HH +#include "ast_decl.h" + // Class for all IDL types // // This is useful wherever any IDL type defining construct can appear // such as the base type for a typedef or array. -#include "idl_fwd.h" -#include "idl_narrow.h" -#include "ast_decl.h" - - class TAO_IDL_FE_Export AST_Type : public virtual AST_Decl { public: diff --git a/TAO/TAO_IDL/include/ast_typedef.h b/TAO/TAO_IDL/include/ast_typedef.h index c888f543832..2d72dadcb2c 100644 --- a/TAO/TAO_IDL/include/ast_typedef.h +++ b/TAO/TAO_IDL/include/ast_typedef.h @@ -67,6 +67,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_TYPEDEF_AST_TYPEDEF_HH #define _AST_TYPEDEF_AST_TYPEDEF_HH +#include "ast_type.h" + // Representation of typedef declaration. // A typedef declaration is a renaming of a base type. diff --git a/TAO/TAO_IDL/include/ast_union.h b/TAO/TAO_IDL/include/ast_union.h index 1f3ba7da1c0..1e57c2da8af 100644 --- a/TAO/TAO_IDL/include/ast_union.h +++ b/TAO/TAO_IDL/include/ast_union.h @@ -67,8 +67,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_UNION_AST_UNION_HH #define _AST_UNION_AST_UNION_HH -// Representation of union declaration: -// +#include "ast_structure.h" + // NOTE: add (AST_ConcreteType *) is defined here because a union // can contain locally defined types in addition to fields. // diff --git a/TAO/TAO_IDL/include/ast_union_branch.h b/TAO/TAO_IDL/include/ast_union_branch.h index 0ced0e3236e..191d3b4003e 100644 --- a/TAO/TAO_IDL/include/ast_union_branch.h +++ b/TAO/TAO_IDL/include/ast_union_branch.h @@ -67,6 +67,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_UNION_BRANCH_AST_UNION_BRAN_HH #define _AST_UNION_BRANCH_AST_UNION_BRAN_HH +#include "ast_field.h" +#include "utl_scoped_name.h" + +class UTL_LabelList; +class AST_Type; +class AST_UnionLabel; + // Representation of union branch declaration. // A branch of a union is a field with a label. diff --git a/TAO/TAO_IDL/include/ast_union_label.h b/TAO/TAO_IDL/include/ast_union_label.h index 5f0182221af..f173ee5b459 100644 --- a/TAO/TAO_IDL/include/ast_union_label.h +++ b/TAO/TAO_IDL/include/ast_union_label.h @@ -67,6 +67,12 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_UNION_LABEL_AST_UNION_LABEL_HH #define _AST_UNION_LABEL_AST_UNION_LABEL_HH +#include "TAO_IDL_FE_Export.h" +#include "ace/OS.h" + +class AST_Expression; +class ast_visitor; + // Defines labels for unions. class TAO_IDL_FE_Export AST_UnionLabel @@ -75,13 +81,10 @@ public: // Define kind of label. enum UnionLabel { - UL_default // Label is "default". - , UL_label // Regular label. + UL_default + , UL_label }; - // Operations. - - // Constructor(s) and destructor. AST_UnionLabel (void); AST_UnionLabel (UnionLabel lk, @@ -89,7 +92,6 @@ public: virtual ~AST_UnionLabel (void); - // Data Accessors. UnionLabel label_kind (void); AST_Expression *label_val (void); diff --git a/TAO/TAO_IDL/include/drv_extern.h b/TAO/TAO_IDL/include/drv_extern.h index 3097f4ad8b4..7de6ded7ae0 100644 --- a/TAO/TAO_IDL/include/drv_extern.h +++ b/TAO/TAO_IDL/include/drv_extern.h @@ -67,22 +67,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _DRV_EXTERN_DRV_EXTERN_HH #define _DRV_EXTERN_DRV_EXTERN_HH -// External functions for the IDL compiler driver program +// The ACE_Process_Options default size of 1024 is sometimes not enough. +const unsigned long TAO_IDL_COMMAND_LINE_BUFFER_SIZE = 4 * 1024; -// Functions - -extern void DRV_init (void); +// External functions for the IDL compiler driver program. extern void DRV_parse_args (long, char **); extern void DRV_usage (void); - extern void DRV_pre_proc (const char *myfile); - extern void DRV_cpp_init (void); extern void DRV_cpp_putarg (const char *str); extern void DRV_cpp_new_location (const char *new_loc); -extern void DRV_fork (void); -extern int DRV_check_gperf (void); -extern void DRV_check_for_include (const char* buf); - #endif // _DRV_EXTERN_DRV_EXTERN_HH diff --git a/TAO/TAO_IDL/include/drv_private.h b/TAO/TAO_IDL/include/drv_private.h index ab89a4e7862..250d608af4a 100644 --- a/TAO/TAO_IDL/include/drv_private.h +++ b/TAO/TAO_IDL/include/drv_private.h @@ -86,7 +86,7 @@ extern long DRV_file_index; // Functions -extern void DRV_drive (const char *); +//extern void DRV_drive (const char *); // Compiler driver for single file #endif // _DRV_PRIVATE_DRV_PRIVATE_HH diff --git a/TAO/TAO_IDL/include/fe_declarator.h b/TAO/TAO_IDL/include/fe_declarator.h index eb76e94902e..e34495f5d9e 100644 --- a/TAO/TAO_IDL/include/fe_declarator.h +++ b/TAO/TAO_IDL/include/fe_declarator.h @@ -67,7 +67,12 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _FE_DECLARATOR_FE_DECLARATOR_HH #define _FE_DECLARATOR_FE_DECLARATOR_HH -class FE_Declarator +#include "utl_scoped_name.h" + +class AST_Decl; +class AST_Type; + +class FE_Declarator { public: // Enum to denote types of declarators. diff --git a/TAO/TAO_IDL/include/fe_extern.h b/TAO/TAO_IDL/include/fe_extern.h index 2586dccf0f1..f7a398b97e2 100644 --- a/TAO/TAO_IDL/include/fe_extern.h +++ b/TAO/TAO_IDL/include/fe_extern.h @@ -67,35 +67,17 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _FE_EXTERN_FE_EXTERN_HH #define _FE_EXTERN_FE_EXTERN_HH -// fe_extern.hh -// -// Declares all global functions for the FE - -/* -** DEPENDENCIES: none -** -** USE: Included from idl_extern.hh -*/ +#include "TAO_IDL_FE_Export.h" -// Functions: - -// Initialization: -// -// FE initialization is done in two stages, with the BE initialization -// occurring in between. The first stage is responsible for creating -// the sope stack. The BE initialization creates the generator object -// which is then used in the second stage to create the global scope -// and to populate it with nodes for the predefined types +// Declares all global functions for the FE TAO_IDL_FE_Export void -FE_init (void); // Initialize FE - -// Interface to Yacc parser +FE_init (void); class File; TAO_IDL_FE_Export int -FE_yyparse (void); // Invode yyparse +FE_yyparse (void); TAO_IDL_FE_Export void FE_set_yyin (File *); // Set yyin diff --git a/TAO/TAO_IDL/include/fe_interface_header.h b/TAO/TAO_IDL/include/fe_interface_header.h index 1e21b4c5c80..5b1b3e46ef1 100644 --- a/TAO/TAO_IDL/include/fe_interface_header.h +++ b/TAO/TAO_IDL/include/fe_interface_header.h @@ -67,27 +67,21 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _FE_INTERFACE_HEADER_FE_INTERFACE_HH #define _FE_INTERFACE_HEADER_FE_INTERFACE_HH -// FE_InterfaceHeader -// +#include "TAO_IDL_FE_Export.h" +#include "utl_scoped_name.h" + +class UTL_NameList; +class AST_Interface; + // Internal class for FE to describe interface headers // // FE_obv_header // Internal class for FE to describe valuetype headers // -/* -** DEPENDENCIES: utl_scoped_name.hh, ast_interface.hh, utl_scope.hh, -** ast_decl.hh -** -** USE: Included from fe.hh -*/ - class TAO_IDL_FE_Export FE_InterfaceHeader { public: - // Operations - - // Constructor(s) FE_InterfaceHeader (UTL_ScopedName *n, UTL_NameList *l, UTL_NameList *supports = 0, diff --git a/TAO/TAO_IDL/include/fe_private.h b/TAO/TAO_IDL/include/fe_private.h index 90f8e2edcf7..0c975ff65b2 100644 --- a/TAO/TAO_IDL/include/fe_private.h +++ b/TAO/TAO_IDL/include/fe_private.h @@ -67,15 +67,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _FE_FE_HH #define _FE_FE_HH -// fe_private.hh - Defines data which is private to the FE but -// which must be accessible throughout the FE - -// FE includes - -#include "fe_interface_header.h"// class FE_InterfaceHeader -#include "fe_declarator.h" // class FE_Declarator - -// FE Operations +#include "TAO_IDL_FE_Export.h" // Define an entry for the C++ keyword and its mapping. struct TAO_IDL_FE_Export TAO_IDL_CPP_Keyword_Entry @@ -90,9 +82,11 @@ class TAO_IDL_FE_Export TAO_IDL_CPP_Keyword_Table // Define a table that provides the lookup for the C++ // keyword. The lookup uses a perfect hash function private: - unsigned int hash (const char *str, unsigned int len); + unsigned int hash (const char *str, + unsigned int len); public: - const TAO_IDL_CPP_Keyword_Entry *lookup (const char *str, unsigned int len); + const TAO_IDL_CPP_Keyword_Entry *lookup (const char *str, + unsigned int len); }; #endif /* _FE_FE_HH */ diff --git a/TAO/TAO_IDL/include/global_extern.h b/TAO/TAO_IDL/include/global_extern.h index b00c7405497..dce69d00c37 100644 --- a/TAO/TAO_IDL/include/global_extern.h +++ b/TAO/TAO_IDL/include/global_extern.h @@ -67,6 +67,12 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _GLOBAL_EXTERN_GLOBAL_EXTERN_HH #define _GLOBAL_EXTERN_GLOBAL_EXTERN_HH +#include "TAO_IDL_FE_Export.h" +#include "idl_global.h" +#include "idl_bool.h" + +class AST_Decl; + // global_extern.hh - Global data for the IDL compiler extern TAO_IDL_FE_Export IDL_GlobalData *idl_global; diff --git a/TAO/TAO_IDL/include/idl.h b/TAO/TAO_IDL/include/idl.h deleted file mode 100644 index 9ee8edc1435..00000000000 --- a/TAO/TAO_IDL/include/idl.h +++ /dev/null @@ -1,98 +0,0 @@ -// $Id$ - -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#ifndef _IDL_IDL_HH -#define _IDL_IDL_HH - -// idl.hh -// -// Main include file for IDL compiler. Includes the rest of the -// files defining the different units of the compiler - -#include "ace/ACE.h" // Most important ACE include file -#include "ace/streams.h" // iostreams - - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "TAO_IDL_FE_Export.h" // Defines export macro -#include "idl_narrow.h" // IDL Narrowing mechanism -#include "idl_defines.h" // Constants for IDL compiler -#include "idl_fwd.h" // Forward decls of classes -#include "idl_bool.h" // Defines boolean for IDL -#include "utl_string.h" // Defines utility string class -#include "utl_identifier.h" // Defines utility identifier class -#include "ast.h" // AST classes -#include "util.h" // Utility classes - -#if defined (interface) -// Mingw needs this. -# undef interface -#endif /* defined (interface) */ - -#endif // _IDL_IDL_HH diff --git a/TAO/TAO_IDL/include/idl_bool.h b/TAO/TAO_IDL/include/idl_bool.h index 838e7dbfcb8..b7356d80247 100644 --- a/TAO/TAO_IDL/include/idl_bool.h +++ b/TAO/TAO_IDL/include/idl_bool.h @@ -62,25 +62,17 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _IDL_BOOL_IDL_BOOL_HH #define _IDL_BOOL_IDL_BOOL_HH /* - * idl_bool.hh - Boolean definitions for IDL CFE - * * This is interim. When porting to a new platform, this file will be * modified to incorporate definitions for the boolean type suitable * for the new platform. */ -/* -** DEPENDENCIES: NONE -** -** USE: Included from idl.hh -*/ - #ifndef I_TRUE #define I_TRUE 1 #endif @@ -89,6 +81,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #define I_FALSE 0 #endif -typedef long idl_bool; +typedef long idl_bool; #endif // _IDL_BOOL_IDL_BOOL_HH diff --git a/TAO/TAO_IDL/include/idl_extern.h b/TAO/TAO_IDL/include/idl_extern.h deleted file mode 100644 index 8f4e5e60421..00000000000 --- a/TAO/TAO_IDL/include/idl_extern.h +++ /dev/null @@ -1,79 +0,0 @@ -// $Id$ - -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#ifndef _IDL_EXTERN_IDL_EXTERN_HH -#define _IDL_EXTERN_IDL_EXTERN_HH - -// idl_extern.hh -// -// Global variables and functions for IDL compiler - -#include "fe_extern.h" // External API of FE -#include "ast_extern.h" // External API of AST -#include "nr_extern.h" // External API of NR -#include "global_extern.h" // Global data - -#endif // _IDL_EXTERN_IDL_EXTERN_HH diff --git a/TAO/TAO_IDL/include/idl_fwd.h b/TAO/TAO_IDL/include/idl_fwd.h deleted file mode 100644 index 5198f1bcae8..00000000000 --- a/TAO/TAO_IDL/include/idl_fwd.h +++ /dev/null @@ -1,148 +0,0 @@ -// $Id$ - -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#ifndef _IDL_FWD_IDL_FWD_HH -#define _IDL_FWD_IDL_FWD_HH - -// idl_fwd.hh -// -// Forward declaration of all class names in CFE-BEs contract - -/* -** DEPENDENCIES: NONE -** -** USE: Included from idl.hh -*/ - -// Class for global data representation: - -class IDL_GlobalData; // Global data is stored in an - // instance of this - -// Classes for utility of the IDL compiler: - -class UTL_ScopeStack; // Stack of scopes -class UTL_Scope; // A definition scope (mixin) - -class UTL_LongList; // List of longs -class UTL_StrList; // List of strings -class UTL_StrlistActiveIterator; // Active iterator for list of strings -class UTL_IdList; // List of identifiers -class UTL_IdListActiveIterator; // Active iterator for list of id's -class UTL_ExceptList; // List of exceptions -class UTL_NameList; // List of scoped names -class UTL_ExprList; // List of expressions -class UTL_InterfList; // List of interfaces -class UTL_LabelList; // List of union branch labels -class UTL_DeclList; // List of declarators -class UTL_String; // String class -class UTL_Identifier; // Identifier class - -class UTL_Error; // Error class -class UTL_Indenter; // Indenter class - -// Classes for utility of the FE. These classes are used only -// by the FE but their forward declaration is needed because lists -// of them are constructed by classes in UTL - -class FE_InterfaceHeader; // Interface header -class FE_Declarator; // Declarator - -// Generator class for the AST - -class AST_Generator; // Generate nodes of various types - -// Classes for AST: - -class AST_Decl; // The rock bottom base class - -class AST_PredefinedType; // A predefined type -class AST_Type; // An IDL type -class AST_ConcreteType; // An IDL concrete type -class AST_Module; // A module -class AST_Root; // The root of an AST (a module) -class AST_Interface; // An interface -class AST_InterfaceFwd; // A forward interface decl -class AST_Constant; // A constant declaration -class AST_Expression; // Value of an expression -class AST_Exception; // An exception declaration -class AST_Attribute; // An attribute declaration -class AST_Operation; // An operation declaration -class AST_Argument; // An argument to an operation -class AST_Union; // A union declaration -class AST_UnionBranch; // A branch in a union -class AST_UnionLabel; // A union branch label -class AST_Structure; // A structure declaration -class AST_Field; // A field in a structure or union -class AST_Enum; // An enum declaration -class AST_EnumVal; // An enumerator in an enum -class AST_Sequence; // A sequence declaration -class AST_String; // A string declaration -class AST_Array; // An array declaration -class AST_Typedef; // A typedef declaration -class AST_Native; // A native declaration - -#endif // _IDL_FWD_IDL_FWD_HH diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index 233c1aba9e0..9f0947b52e2 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -70,6 +70,16 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ace/SString.h" #include "ace/Hash_Map_Manager_T.h" #include "ace/Containers_T.h" +#include "idl_bool.h" +#include "ast_expression.h" +#include "ast_predefined_type.h" +#include "utl_stack.h" + +class AST_Root; +class AST_Generator; +class UTL_Error; +class UTL_String; +class UTL_Indenter; // idl_global.hh // @@ -213,8 +223,6 @@ public: // Operations virtual UTL_ScopeStack &scopes (void); // Scopes stack -// virtual void set_scopes (UTL_ScopeStack *); - // Set it virtual AST_Root *root (void); // Root of AST virtual void set_root (AST_Root *); // Set it diff --git a/TAO/TAO_IDL/include/nr_extern.h b/TAO/TAO_IDL/include/nr_extern.h index 84a0b599685..0e9195b8d57 100644 --- a/TAO/TAO_IDL/include/nr_extern.h +++ b/TAO/TAO_IDL/include/nr_extern.h @@ -67,6 +67,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _NR_EXTERN_NR_EXTERN_HH #define _NR_EXTERN_NR_EXTERN_HH +class UTL_Scope; +class AST_Decl; + // nr_extern.hh - Defines entry points provided by narrowing // Convert between an UTL_Scope and an AST_Decl. diff --git a/TAO/TAO_IDL/include/util.h b/TAO/TAO_IDL/include/util.h deleted file mode 100644 index 4bc69cf38e2..00000000000 --- a/TAO/TAO_IDL/include/util.h +++ /dev/null @@ -1,84 +0,0 @@ -// $Id$ - -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -#ifndef _UTIL_UTIL_HH -#define _UTIL_UTIL_HH - -// util.hh - Includes commonly used things defined in the util directory - -#include "utl_stack.h" // class fe_stack -#include "utl_exprlist.h" // class UTL_ExprList -#include "utl_strlist.h" // class UTL_StrList -#include "utl_idlist.h" // class UTL_IdList -#include "utl_exceptlist.h" // class UTL_ExceptList -#include "utl_namelist.h" // class UTL_NameList -#include "utl_labellist.h" // class UTL_LabelList -#include "utl_decllist.h" // class UTL_DeclList -#include "idl_global.h" // Class IDL_GlobalData -#include "utl_err.h" // class UTL_Error -#include "utl_indenter.h" // class UTL_Indenter - -#endif // _UTIL_UTIL_HH diff --git a/TAO/TAO_IDL/include/utl_decllist.h b/TAO/TAO_IDL/include/utl_decllist.h index a94cc679941..45492f4dce7 100644 --- a/TAO/TAO_IDL/include/utl_decllist.h +++ b/TAO/TAO_IDL/include/utl_decllist.h @@ -67,8 +67,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _UTL_DECLLIST_UTL_DECLLIST_HH #define _UTL_DECLLIST_UTL_DECLLIST_HH -// utl_decllist.hh -// +#include "TAO_IDL_FE_Export.h" +#include "utl_list.h" + // List of FE_Declarator nodes // NOTE: This list class only works correctly because we use single public @@ -77,11 +78,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -/* -** DEPENDENCIES: utl_list.hh, fe_declarator.hh -** -** USE: Included from util.hh -*/ +class FE_Declarator; class TAO_IDL_FE_Export UTL_DeclList : public UTL_List { diff --git a/TAO/TAO_IDL/include/utl_err.h b/TAO/TAO_IDL/include/utl_err.h index 8333e57d881..24f1def016d 100644 --- a/TAO/TAO_IDL/include/utl_err.h +++ b/TAO/TAO_IDL/include/utl_err.h @@ -67,16 +67,16 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _UTL_ERR_UTL_ERR_HH #define _UTL_ERR_UTL_ERR_HH -// utl_err.hh -// -// Defines error codes and error handling class for UTL -// This will change as a result of internationalization +#include "AST_Expression.h" +#include "idl_global.h" +#include "utl_scoped_name.h" -/* -** DEPENDENCIES: ast.hh -** -** USE: Included from util.hh -*/ +class AST_Decl; +class AST_Interface; +class AST_Enum; +class AST_Union; +class AST_UnionLabel; +class UTL_String; class TAO_IDL_FE_Export UTL_Error { @@ -155,7 +155,7 @@ public: AST_Decl *t3); // Report a syntax error in IDL input - void syntax_error(IDL_GlobalData::ParseState ps); + void syntax_error (IDL_GlobalData::ParseState ps); // Report clash of declared and referenced indentifiers void redef_error (char *n, diff --git a/TAO/TAO_IDL/include/utl_exceptlist.h b/TAO/TAO_IDL/include/utl_exceptlist.h index 54debd976f8..f10b5d575ab 100644 --- a/TAO/TAO_IDL/include/utl_exceptlist.h +++ b/TAO/TAO_IDL/include/utl_exceptlist.h @@ -67,9 +67,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _UTL_EXCEPTLIST_UTL_EXCEPTLIST_HH #define _UTL_EXCEPTLIST_UTL_EXCEPTLIST_HH -// utl_exceptlist.hh -// -// List of AST_Exception nodes +#include "utl_list.h" + +class AST_Exception; // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. @@ -77,40 +77,29 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -/* -** DEPENDENCIES: utl_list.hh, ast_exception.hh -** -** USE: Included from util.hh -*/ - class TAO_IDL_FE_Export UTL_ExceptList : public UTL_List { public: - // Operations + UTL_ExceptList (AST_Exception *s, + UTL_ExceptList *cdr); - // Constructor(s) - UTL_ExceptList (AST_Exception *s, UTL_ExceptList *cdr); - - // Get list item - AST_Exception *head(); + // Get list item. + AST_Exception *head (void); private: - // Data - AST_Exception *pd_car_data; // Item of this list + // Data. + AST_Exception *pd_car_data; }; -// Active iterator for UTL_ExceptList +// Active iterator for UTL_ExceptList. class TAO_IDL_FE_Export UTL_ExceptlistActiveIterator : public UTL_ListActiveIterator { public: - // Operations - - // Constructor(s) - UTL_ExceptlistActiveIterator(UTL_ExceptList *s); + UTL_ExceptlistActiveIterator (UTL_ExceptList *s); // Get current item - AST_Exception *item(); + AST_Exception *item (void); }; #endif // _UTL_EXCEPTLIST_UTL_EXCEPTLIST_HH diff --git a/TAO/TAO_IDL/include/utl_exprlist.h b/TAO/TAO_IDL/include/utl_exprlist.h index 11e2aec397a..53e09c7a500 100644 --- a/TAO/TAO_IDL/include/utl_exprlist.h +++ b/TAO/TAO_IDL/include/utl_exprlist.h @@ -62,14 +62,16 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _UTL_EXPRLIST_UTL_EXPRLIST_HH #define _UTL_EXPRLIST_UTL_EXPRLIST_HH -// utl_exprlist.hh -// -// List of strings +#include "utl_list.h" + +class AST_Expression; + +// List of expressions. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. @@ -77,39 +79,28 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -/* -** DEPENDENCIES: ast_expression.hh, utl_list.hh -** -** USE: Included from util.hh -*/ - class TAO_IDL_FE_Export UTL_ExprList : public UTL_List { public: - // Operations + UTL_ExprList (AST_Expression *s, + UTL_ExprList *cdr); - // Constructor(s) - UTL_ExprList(AST_Expression *s, UTL_ExprList *cdr); - - // Get list item - AST_Expression *head(); + // Get list item. + AST_Expression *head (void); private: - // Data - AST_Expression *pd_car_data; // List item + // Data. + AST_Expression *pd_car_data; }; -// Active iterator for UTL_ExprList +// Active iterator for UTL_ExprList. class UTL_ExprlistActiveIterator : public UTL_ListActiveIterator { public: - // Operations - - // Constructor(s) - UTL_ExprlistActiveIterator(UTL_ExprList *s); + UTL_ExprlistActiveIterator (UTL_ExprList *s); - // Get current item - AST_Expression *item(); + // Get current item. + AST_Expression *item (void); }; #endif // _UTL_EXPRLIST_UTL_EXPRLIST_HH diff --git a/TAO/TAO_IDL/include/utl_identifier.h b/TAO/TAO_IDL/include/utl_identifier.h index 68227a45b86..5aef90772af 100644 --- a/TAO/TAO_IDL/include/utl_identifier.h +++ b/TAO/TAO_IDL/include/utl_identifier.h @@ -67,18 +67,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _UTL_IDENTIFIER_UTL_IDENTIFIER_HH #define _UTL_IDENTIFIER_UTL_IDENTIFIER_HH -// utl_identifier.hh -// -// Identifier - -/* -** DEPENDENCIES: utl_string.hh -** -** USE: Included from util.hh -*/ - -#include "idl_fwd.h" -#include "utl_string.h" +#include "ace/OS.h" +#include "TAO_IDL_FE_Export.h" +#include "idl_bool.h" class TAO_IDL_FE_Export Identifier { @@ -115,7 +106,7 @@ public: idl_bool escaped (void) const; // Accessor for the member. - virtual void dump (ACE_OSTREAM_TYPE &o); + virtual void dump (ACE_OSTREAM_TYPE &o); // Dump to an ostream. virtual void destroy (void); diff --git a/TAO/TAO_IDL/include/utl_idlist.h b/TAO/TAO_IDL/include/utl_idlist.h index 8886864a85f..e6f1fa49bca 100644 --- a/TAO/TAO_IDL/include/utl_idlist.h +++ b/TAO/TAO_IDL/include/utl_idlist.h @@ -67,8 +67,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _UTL_IDLIST_UTL_IDLIST_HH #define _UTL_IDLIST_UTL_IDLIST_HH -// utl_idlist.hh -// // List of Identifiers // NOTE: This list class only works correctly because we use single public @@ -77,16 +75,11 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -/* -** DEPENDENCIES: utl_list.hh, utl_identifier.hh -** -** USE: Included from util.hh -*/ +#include "TAO_IDL_FE_Export.h" +#include "utl_list.h" +#include "ace/OS.h" -#include "idl_fwd.h" -#include "utl_list.h" -#include "utl_identifier.h" -#include "utl_string.h" +class Identifier; class TAO_IDL_FE_Export UTL_IdList : public UTL_List { @@ -103,29 +96,25 @@ public: virtual ~UTL_IdList (void) {} // destructor - // =AST Dumping - virtual void dump (ACE_OSTREAM_TYPE &o); - // dump to ostream + // Dump to ostream. virtual void destroy (void); // Cleanup function. - // Other operations - UTL_List *copy (void); - // Copy the list + // Copy the list. Identifier *head (void); - // get element + // Get element. Identifier *last_component (void); - // Get last element in this list + // Get last element in this list. private: Identifier *pd_car_data; }; -// Active iterator for UTL_IdList +// Active iterator for UTL_IdList. class TAO_IDL_FE_Export UTL_IdListActiveIterator : public UTL_ListActiveIterator @@ -136,10 +125,9 @@ class TAO_IDL_FE_Export UTL_IdListActiveIterator // Iterator for the IDList public: UTL_IdListActiveIterator (UTL_IdList *s); - // Constructor(s) - Identifier *item (); - // retrieves the next item + Identifier *item (void); + // Retrieves the next item. }; #endif // _UTL_IDLIST_UTL_IDLIST_HH diff --git a/TAO/TAO_IDL/include/utl_indenter.h b/TAO/TAO_IDL/include/utl_indenter.h index e50edd3681b..451fffe6417 100644 --- a/TAO/TAO_IDL/include/utl_indenter.h +++ b/TAO/TAO_IDL/include/utl_indenter.h @@ -62,22 +62,16 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _UTL_INDENTER_UTL_INDENTER_HH #define _UTL_INDENTER_UTL_INDENTER_HH -// UTL indenter: -// +#include "ace/OS.h" + // Utility class for control of indentation level during dumping // May also be useful for BEs that want to produce nicely formatted -// output - -/* -** DEPENDENCIES: NONE -** -** USE: in CFE in dumping the AST -*/ +// output. class UTL_Indenter { @@ -86,32 +80,28 @@ class UTL_Indenter // =DESCRIPTION // useful in generating indented output public: - // Operations - - UTL_Indenter(); // constructor - // Constructor(s) + UTL_Indenter (void); - virtual ~UTL_Indenter() {} - // destructor + ~UTL_Indenter (void) {} - void reset(); - // Reset indentation level to 0 + void reset (void); + // Reset indentation level to 0. - void increase(); - // Increase indentation level + void increase (void); + // Increase indentation level. - void decrease(); - // Decrease indentation level + void decrease (void); + // Decrease indentation level. void skip_to (ACE_OSTREAM_TYPE &o); - // Skip to indentation level stop + // Skip to indentation level stop. void skip_to (FILE *fp); - // skip to indentation level stop + // skip to indentation level stop. private: - // Data - long pd_indent_level; // How far to indent + // How far to indent. + long pd_indent_level; }; #endif // _UTL_INDENTER_UTL_INDENTER_HH diff --git a/TAO/TAO_IDL/include/utl_labellist.h b/TAO/TAO_IDL/include/utl_labellist.h index 5881cdb5013..80b8d8d505f 100644 --- a/TAO/TAO_IDL/include/utl_labellist.h +++ b/TAO/TAO_IDL/include/utl_labellist.h @@ -62,14 +62,16 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _UTL_LABELLIST_UTL_LABELLIST_HH #define _UTL_LABELLIST_UTL_LABELLIST_HH -// utl_labellist.hh -// -// List of AST_UnionBranch nodes +#include "utl_list.h" + +class AST_UnionLabel; + +// List of AST_UnionBranch nodes. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. @@ -77,39 +79,27 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -/* -** DEPENDENCIES: utl_list.hh, ast_union_label.hh -** -** USE: Included from util.hh -*/ - class TAO_IDL_FE_Export UTL_LabelList : public UTL_List { public: - // Operations + UTL_LabelList (AST_UnionLabel *s, + UTL_LabelList *cdr); - // Constructor(s) - UTL_LabelList(AST_UnionLabel *s, UTL_LabelList *cdr); - - // Get list item - AST_UnionLabel *head(); + // Get list item. + AST_UnionLabel *head (void); private: - // Data - AST_UnionLabel *pd_car_data; // List item + AST_UnionLabel *pd_car_data; }; -// Active iterator for UTL_LabelList +// Active iterator for UTL_LabelList. class UTL_LabellistActiveIterator : public UTL_ListActiveIterator { public: - // Operations - - // Constructor(s) - UTL_LabellistActiveIterator(UTL_LabelList *source); + UTL_LabellistActiveIterator (UTL_LabelList *source); - // Get current item - AST_UnionLabel *item(); + // Get current item. + AST_UnionLabel *item (void); }; #endif // _UTL_LABELLIST_UTL_LABELLIST_HH diff --git a/TAO/TAO_IDL/include/utl_list.h b/TAO/TAO_IDL/include/utl_list.h index a6d3c89d8ea..98e9952d3a4 100644 --- a/TAO/TAO_IDL/include/utl_list.h +++ b/TAO/TAO_IDL/include/utl_list.h @@ -67,15 +67,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _UTL_LIST_UTL_LIST_HH #define _UTL_LIST_UTL_LIST_HH -// utl_list.hh -// -// General single-linked lists - -/* -** DEPENDENCIES: NONE -** -** USE: Included from util.hh -*/ +// General single-linked list. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. @@ -83,28 +75,27 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -// Forward declare active iterator for UTL_List -class UTL_ListActiveIterator; +#include "TAO_IDL_FE_Export.h" +#include "idl_bool.h" + +// Forward declare active iterator for UTL_List. +class UTL_ListActiveIterator; class TAO_IDL_FE_Export UTL_List { public: - // Operations - - // Constructor UTL_List (UTL_List *c); - // Destructor virtual ~UTL_List (void); - // Smash last cdr pointer in "this" with l + // Smash last cdr pointer in "this" with l. void nconc (UTL_List *l); - // Copy the list starting at "this" + // Copy the list starting at "this". virtual UTL_List *copy (void); - // Get next list - UTL_List *tail (); + // Get next list. + UTL_List *tail (void); // Set next list void set_tail (UTL_List *l); @@ -116,34 +107,31 @@ public: virtual void destroy (void); private: - // Data - UTL_List *pd_cdr_data; // The next list + // The next list. + UTL_List *pd_cdr_data; // Operations - long list_length (long n); // How long is it? + long list_length (long n); - // Friend class - friend class UTL_ListActiveIterator; // Friend class + // Friend class. + friend class UTL_ListActiveIterator; }; -// Active iterator for lists +// Active iterator for lists. class TAO_IDL_FE_Export UTL_ListActiveIterator { public: - // Operations - - // Constructor(s) UTL_ListActiveIterator (UTL_List *s); - // Get next list - virtual void next (); + // Get next list. + virtual void next (void); // Are we at the end of this list? virtual idl_bool is_done (void); protected: - // Data - UTL_List *source; // On what to iterate? + // On what to iterate? + UTL_List *source; }; #endif // _UTL_LIST_UTL_LIST_HH diff --git a/TAO/TAO_IDL/include/utl_namelist.h b/TAO/TAO_IDL/include/utl_namelist.h index 198b5c5c002..193fa38bab5 100644 --- a/TAO/TAO_IDL/include/utl_namelist.h +++ b/TAO/TAO_IDL/include/utl_namelist.h @@ -62,14 +62,14 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _UTL_NAMELIST_UTL_NAMELIST_HH #define _UTL_NAMELIST_UTL_NAMELIST_HH -// utl_namelist.hh -// -// List of UTL_ScopedName nodes +#include "utl_scoped_name.h" + +// List of UTL_ScopedName nodes. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. @@ -77,39 +77,28 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -/* -** DEPENDENCIES: utl_list.hh, utl_scoped_name.hh -** -** USE: Included from util.hh -*/ - class TAO_IDL_FE_Export UTL_NameList : public UTL_List { public: - // Operations - - // Constructor(s) - UTL_NameList(UTL_ScopedName *s, UTL_NameList *cdr); + UTL_NameList (UTL_ScopedName *s, + UTL_NameList *cdr); - // Get list item - UTL_ScopedName *head(); + // Get list item. + UTL_ScopedName *head (void); private: - // Data - UTL_ScopedName *pd_car_data; // List item + // List item. + UTL_ScopedName *pd_car_data; }; -// Active iterator for UTL_NameList +// Active iterator for UTL_NameList. class UTL_NamelistActiveIterator : public UTL_ListActiveIterator { public: - // Operations - - // Constructor(s) - UTL_NamelistActiveIterator(UTL_NameList *source); + UTL_NamelistActiveIterator (UTL_NameList *source); - // Get current item - UTL_ScopedName *item(); + // Get current item. + UTL_ScopedName *item (void); }; #endif // _UTL_NAMELIST_UTL_NAMELIST_HH diff --git a/TAO/TAO_IDL/include/utl_scope.h b/TAO/TAO_IDL/include/utl_scope.h index 835342e9715..f6d33c09d17 100644 --- a/TAO/TAO_IDL/include/utl_scope.h +++ b/TAO/TAO_IDL/include/utl_scope.h @@ -81,15 +81,37 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // the responsibility of those functions then to call the add() // function defined in the parent "AST_" class. -#include "idl_fwd.h" -#include "idl_narrow.h" #include "ast_decl.h" #include "ast_expression.h" +#include "ast_typedef.h" #include "utl_scoped_name.h" // This is for AIX w/IBM C++. class Identifier; +class AST_PredefinedType; +class AST_Module; +class AST_Interface; +class AST_InterfaceFwd; +class AST_Constant; +class AST_Exception; +class AST_Attribute; +class AST_Operation; +class AST_Argument; +class AST_Union; +class AST_UnionBranch; +class AST_Structure; +class AST_Field; +class AST_Enum; +class AST_EnumVal; +class AST_Sequence; +class AST_String; +class AST_Array; +class AST_Native; +class AST_Factory; +class UTL_StrList; +class UTL_NameList; + // Forward declaration of active iterator for UTL_Scope. class UTL_ScopeActiveIterator; @@ -178,22 +200,22 @@ public: // Other Operations. // Name Lookup Mechanism - virtual AST_Decl *lookup_by_name (UTL_ScopedName *, - idl_bool treat_as_ref, - idl_bool in_parent = 1); + AST_Decl *lookup_by_name (UTL_ScopedName *, + idl_bool treat_as_ref, + idl_bool in_parent = 1); // Look up the Identifier * specified only in the local scope. - virtual AST_Decl *lookup_by_name_local (Identifier *, - long index); + AST_Decl *lookup_by_name_local (Identifier *, + long index); // Look up a predefined type by its ExprType. - virtual AST_Decl *lookup_primitive_type (AST_Expression::ExprType); + AST_Decl *lookup_primitive_type (AST_Expression::ExprType); // Look up one of the pseudo-object types. AST_Decl *lookup_pseudo (Identifier *); // How many entries are used? - virtual unsigned long nmembers (void); + unsigned long nmembers (void); // Add to decls. Node represents a local declaration // The new decl e is inserted after ex if ex is not 0. @@ -248,8 +270,8 @@ protected: virtual AST_Decl *look_in_inherited (UTL_ScopedName *, idl_bool treat_as_ref); // Lookup based on the local name. - virtual AST_Decl *lookup_for_add (AST_Decl *d, - idl_bool treat_as_ref); + AST_Decl *lookup_for_add (AST_Decl *d, + idl_bool treat_as_ref); // Is there a (case-insensitive) clash between a local name // and an IDL keyword? @@ -354,27 +376,32 @@ public: UTL_Scope::ScopeIterationKind ik); // Advance to next item. - virtual void next (void); + void next (void); // Get current item. - virtual AST_Decl *item (void); + AST_Decl *item (void); // Have we iterated over entire scope? - virtual idl_bool is_done (void); + idl_bool is_done (void); // What kind of iterator is this? - virtual UTL_Scope::ScopeIterationKind iteration_kind (void); + UTL_Scope::ScopeIterationKind iteration_kind (void); // What stage are we in with this iterator? - virtual UTL_Scope::ScopeIterationKind iteration_stage (void); + UTL_Scope::ScopeIterationKind iteration_stage (void); private: - // Data. + // Scope to iterate over. + UTL_Scope *iter_source; + + // What kind of iteration? + UTL_Scope::ScopeIterationKind ik; + + // What stage? + UTL_Scope::ScopeIterationKind stage; - UTL_Scope *iter_source; // Scope to iterate over - UTL_Scope::ScopeIterationKind ik; // What kind of iteration - UTL_Scope::ScopeIterationKind stage; // What stage - long il; // What location in stage + // What location in stage? + long il; }; #endif // _UTL_SCOPE_UTL_SCOPE_HH diff --git a/TAO/TAO_IDL/include/utl_scoped_name.h b/TAO/TAO_IDL/include/utl_scoped_name.h index 2cdc381bf2f..9cb63b6d043 100644 --- a/TAO/TAO_IDL/include/utl_scoped_name.h +++ b/TAO/TAO_IDL/include/utl_scoped_name.h @@ -67,16 +67,11 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _AST_SCOPED_NAME_AST_SCOPED_NAME_HH #define _AST_SCOPED_NAME_AST_SCOPED_NAME_HH -// Define UTL_ScopedName as a list of strings +#include "utl_idlist.h" -/* -** DEPENDENCIES: utl_strlist.hh -** -** USE: Included from ast.hh -*/ - -typedef UTL_IdList UTL_ScopedName; +// Define UTL_ScopedName as a list of strings. -typedef UTL_IdListActiveIterator UTL_ScopedNameActiveIterator; +typedef UTL_IdList UTL_ScopedName; +typedef UTL_IdListActiveIterator UTL_ScopedNameActiveIterator; #endif // _AST_SCOPED_NAME_AST_SCOPED_NAME_HH diff --git a/TAO/TAO_IDL/include/utl_stack.h b/TAO/TAO_IDL/include/utl_stack.h index 4596c0de6b2..e7084338265 100644 --- a/TAO/TAO_IDL/include/utl_stack.h +++ b/TAO/TAO_IDL/include/utl_stack.h @@ -62,62 +62,59 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _UTL_STACK_UTL_STACK_HH #define _UTL_STACK_UTL_STACK_HH -// utl_stack.hh - Defines the UTL_ScopeStack class - a stack of scopes -// -// UTL_ScopeStack implements scope nesting +#include "TAO_IDL_FE_Export.h" -/* -** DEPENDENCIES: utl_scope.hh -** -** USE: Included from util.hh -*/ +class UTL_Scope; -// Forward declaration of active iterator for UTL_ScopeStack +// UTL_ScopeStack implements scope nesting. + +// Forward declaration of active iterator for UTL_ScopeStack. class UTL_ScopeStackActiveIterator; class TAO_IDL_FE_Export UTL_ScopeStack { public: - // Operations - - // Constructor and destructor. UTL_ScopeStack (void); - virtual ~UTL_ScopeStack (void); + ~UTL_ScopeStack (void); // Return top element. - virtual UTL_Scope *top (void); + UTL_Scope *top (void); // Pop top element. - virtual void pop (void); + void pop (void); // Clear entire stack. - virtual void clear (void); + void clear (void); // Push an element on the stack and return stack. - virtual UTL_ScopeStack *push (UTL_Scope *el); + UTL_ScopeStack *push (UTL_Scope *el); // How deep is the stack now? - virtual unsigned long depth (void); + unsigned long depth (void); // Return bottom element. - virtual UTL_Scope *bottom (void); + UTL_Scope *bottom (void); // Return (top - 1) element. - virtual UTL_Scope *next_to_top (void); + UTL_Scope *next_to_top (void); // return topmost non-NULL element. - virtual UTL_Scope *top_non_null (void); + UTL_Scope *top_non_null (void); private: - // Data. - UTL_Scope **pd_stack_data; // Store scopes stack - unsigned long pd_stack_data_nalloced; // How many allocated? - unsigned long pd_stack_top; // How many used? + // Store scopes stack + UTL_Scope **pd_stack_data; + + // How many allocated? + unsigned long pd_stack_data_nalloced; + + // How many used? + unsigned long pd_stack_top; // Friend active iterator class for UTL_ScopeStack. friend class UTL_ScopeStackActiveIterator; @@ -127,24 +124,23 @@ private: class TAO_IDL_FE_Export UTL_ScopeStackActiveIterator { public: - // Operations - - // Constructor - UTL_ScopeStackActiveIterator( UTL_ScopeStack &s); + UTL_ScopeStackActiveIterator (UTL_ScopeStack &s); // Advance to next element. - virtual void next (void); + void next (void); // Get current item. - virtual UTL_Scope*item (void); + UTL_Scope*item (void); // Is the iteration finished? - virtual long is_done (void); + long is_done (void); private: - // Data. - UTL_ScopeStack &source; // On what to iterate? - long il; // Where are we in iteration? + // On what to iterate? + UTL_ScopeStack &source; + + // Where are we in iteration? + long il; }; #endif // _UTL_STACK_UTL_STACK_HH diff --git a/TAO/TAO_IDL/include/utl_string.h b/TAO/TAO_IDL/include/utl_string.h index b64dd3b7b36..e6aa8be7946 100644 --- a/TAO/TAO_IDL/include/utl_string.h +++ b/TAO/TAO_IDL/include/utl_string.h @@ -62,18 +62,14 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _STRING_STRING_HH #define _STRING_STRING_HH -// utl_string.hh - contains a quick and dirty TEMPORARY string implementation - -/* -** DEPENDENCIES: NONE -** -** USE: Included from util.hh -*/ +#include "TAO_IDL_FE_Export.h" +#include "idl_bool.h" +#include "ace/OS.h" class TAO_IDL_FE_Export UTL_String { @@ -82,27 +78,17 @@ class TAO_IDL_FE_Export UTL_String // =DESCRIPTION // string class to store identifiers public: - // =Operations - UTL_String (void); - // Default constructor. UTL_String (const char *str); - // Construct from a const char *. UTL_String (UTL_String *s); - // Copy constructor. - - virtual ~UTL_String (void); - // Destructor. - // =AST Dumping. + ~UTL_String (void); virtual void dump (ACE_OSTREAM_TYPE &o); // Dump to the ostream. - // =Other Operations - char *get_string (void); // Get contents of utl_string. @@ -110,10 +96,10 @@ public: // Get canonical representation. This is (implemented as) the all upper // case corresponding string. - virtual long compare (UTL_String *s); + idl_bool compare (UTL_String *s); // Compare two UTL_String * - virtual long compare_quiet (UTL_String *s); + long compare_quiet (UTL_String *s); // Like the above but without error or warning message output. virtual void destroy (void); @@ -130,8 +116,6 @@ private: unsigned long len; // How long is string. - // =Private helper operations. - void canonicalize (void); // Compute canonical representation. }; diff --git a/TAO/TAO_IDL/include/utl_strlist.h b/TAO/TAO_IDL/include/utl_strlist.h index eb9ca3e4291..9a4a02cab9f 100644 --- a/TAO/TAO_IDL/include/utl_strlist.h +++ b/TAO/TAO_IDL/include/utl_strlist.h @@ -62,14 +62,17 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _UTL_STRLIST_UTL_STRLIST_HH #define _UTL_STRLIST_UTL_STRLIST_HH -// utl_strlist.hh -// -// List of String nodes +#include "utl_list.h" +#include "ace/OS.h" + +class UTL_String; + +// List of String nodes. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. @@ -77,46 +80,35 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -/* -** DEPENDENCIES: utl_list.hh, utl_string.hh -** -** USE: Included from util.hh -*/ - class TAO_IDL_FE_Export UTL_StrList : public UTL_List { public: - // Operations - - // Constructor - UTL_StrList(UTL_String *s, UTL_StrList *cdr); + UTL_StrList (UTL_String *s, + UTL_StrList *cdr); - // Destructor virtual ~UTL_StrList (void); // AST Dumping - virtual void dump(ACE_OSTREAM_TYPE &o); - - // Other Operations + virtual void dump (ACE_OSTREAM_TYPE &o); // Copy a list of strings - virtual UTL_List *copy(); + virtual UTL_List *copy (void); // Cleanup method. virtual void destroy (void); // Get list element - UTL_String *head(); + UTL_String *head (void); // Set the list element - void set_head(UTL_String *); + void set_head (UTL_String *); // Get last element in this list - UTL_String *last_component(); + UTL_String *last_component (void); private: - // Data - UTL_String *pd_car_data; // The list item + // The list item + UTL_String *pd_car_data; }; // Active iterator for UTL_StrList @@ -124,13 +116,10 @@ class TAO_IDL_FE_Export UTL_StrlistActiveIterator : public UTL_ListActiveIterator { public: - // Operations - - // Constructor(s) UTL_StrlistActiveIterator(UTL_StrList *s); - // Get current item - UTL_String *item(); + // Get current item. + UTL_String *item (void); }; #endif // _UTL_STRLIST_UTL_STRLIST_HH diff --git a/TAO/TAO_IDL/narrow/narrow.cpp b/TAO/TAO_IDL/narrow/narrow.cpp index 2a0e7c7ca49..c086e46614e 100644 --- a/TAO/TAO_IDL/narrow/narrow.cpp +++ b/TAO/TAO_IDL/narrow/narrow.cpp @@ -64,17 +64,24 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(narrow, narrow, "$Id$") +#include "ast_module.h" +#include "ast_root.h" +#include "ast_interface.h" +#include "ast_operation.h" +#include "ast_factory.h" +#include "ast_exception.h" +#include "ast_union.h" +#include "ast_enum.h" +#include "ast_interface_fwd.h" +#include "utl_scope.h" + +ACE_RCSID (narrow, + narrow, + "$Id$") // Narrowing functions for AST -/* - * Convert a UTL_Scope node into an AST_Decl node if possible - */ -AST_Decl * +TAO_IDL_FE_Export AST_Decl * ScopeAsDecl (UTL_Scope *s) { if (s == 0) return 0; @@ -107,7 +114,7 @@ ScopeAsDecl (UTL_Scope *s) /* * Convert an AST_Decl to a UTL_Scope if possible */ -UTL_Scope * +TAO_IDL_FE_Export UTL_Scope * DeclAsScope (AST_Decl *d) { if (d == 0) return 0; diff --git a/TAO/TAO_IDL/tao_idl.bor b/TAO/TAO_IDL/tao_idl.bor index f2a7d2e5dba..2ab115690dc 100644 --- a/TAO/TAO_IDL/tao_idl.bor +++ b/TAO/TAO_IDL/tao_idl.bor @@ -6,9 +6,7 @@ NAME = tao_idl OBJFILES = \ $(OBJDIR)\drv_args.obj \ - $(OBJDIR)\drv_init.obj \ $(OBJDIR)\drv_preproc.obj \ - $(OBJDIR)\drv_private.obj \ $(OBJDIR)\tao_idl.obj CFLAGS = $(ACE_CFLAGS) $(TAO_IDL_FE_CFLAGS) $(TAO_IDL_BE_CFLAGS) diff --git a/TAO/TAO_IDL/tao_idl.cpp b/TAO/TAO_IDL/tao_idl.cpp index 02f1413c8b2..d8fdfc18c64 100644 --- a/TAO/TAO_IDL/tao_idl.cpp +++ b/TAO/TAO_IDL/tao_idl.cpp @@ -64,18 +64,36 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -#include "idl.h" +#include "idl_defines.h" +#include "be_codegen.h" +#include "be_generator.h" +#include "be_extern.h" #include "global_extern.h" #include "fe_extern.h" -#include "drv_private.h" +#include "ast_root.h" +#include "utl_string.h" #include "drv_extern.h" -#include "be.h" #include "ace/Process.h" #include "../tao/Version.h" -ACE_RCSID(TAO_IDL, tao_idl, "$Id$") +ACE_RCSID (TAO_IDL, + tao_idl, + "$Id$") -#define IDL_CFE_VERSION "1.3.0" +#define IDL_CFE_VERSION "1.3.0" + +#if !defined (NFILES) +# define NFILES 1024 +#endif /* ! NFILES */ + +const char *DRV_files[NFILES]; +long DRV_nfiles = 0; +long DRV_file_index = -1; + +const size_t LOCAL_ESCAPES_BUFFER_SIZE = 1024; + +extern TAO_IDL_BE_Export void BE_produce (void); +extern TAO_IDL_BE_Export void BE_abort (void); // Initialize the BE. The protocol requires only that this routine // return an instance of AST_Generator (or a subclass thereof). @@ -115,51 +133,60 @@ DRV_version (void) BE_version (); } -// Fork off a process, wait for it to die. void -DRV_fork (void) +DRV_init (void) { - for (DRV_file_index = 0; - DRV_file_index < DRV_nfiles; - ++DRV_file_index) - { - ACE_Process_Options options (1, - TAO_IDL_COMMAND_LINE_BUFFER_SIZE); - options.creation_flags (ACE_Process_Options::NO_EXEC); - options.command_line ("%s %s %s", - idl_global->prog_name (), - idl_global->idl_flags (), - DRV_files[DRV_file_index]); - ACE_Process manager; - pid_t child_pid = manager.spawn (options); - - if (child_pid == 0) - { - // OK, do it to this file (in the child). - DRV_drive (DRV_files[DRV_file_index]); - ACE_OS::exit (0); - } - - if (child_pid == ACE_INVALID_PID) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("IDL: spawn failed\n"))); - - ACE_OS::exit (99); - } - - // child_pid is the process id of something at this point. - if (manager.wait () == -1) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("IDL: wait failed\n"))); - - ACE_OS::exit (99); - } - } - - // Now the parent process can exit. - ACE_OS::exit (0); + // Initialize FE global data object. + ACE_NEW (idl_global, + IDL_GlobalData); + + // Initialize some of its data. + idl_global->set_root (0); + idl_global->set_gen (0); + idl_global->set_err (FE_new_UTL_Error ()); + idl_global->set_err_count (0); + idl_global->set_indent (FE_new_UTL_Indenter ()); + idl_global->set_filename (0); + idl_global->set_main_filename (0); + idl_global->set_real_filename (0); + idl_global->set_stripped_filename (0); + idl_global->set_import (I_TRUE); + idl_global->set_in_main_file (I_FALSE); + idl_global->set_lineno (-1); + idl_global->set_prog_name (0); + +#if defined (TAO_IDL_PREPROCESSOR) + idl_global->set_cpp_location (TAO_IDL_PREPROCESSOR); +#elif defined (ACE_CC_PREPROCESSOR) + idl_global->set_cpp_location (ACE_CC_PREPROCESSOR); +#else + // Just default to cc + idl_global->set_cpp_location ("cc"); +#endif /* TAO_IDL_PREPROCESSOR */ + + char local_escapes[LOCAL_ESCAPES_BUFFER_SIZE]; + ACE_OS::memset (&local_escapes, + 0, + LOCAL_ESCAPES_BUFFER_SIZE); + + idl_global->set_local_escapes (local_escapes); + idl_global->set_be (""); + idl_global->set_compile_flags (0); + idl_global->set_read_from_stdin (I_FALSE); + idl_global->set_include_file_names (0); + idl_global->set_n_include_file_names (0); + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + + // Put an empty prefix on the stack for the global scope. + idl_global->pragma_prefixes ().push (ACE::strnew ("")); + + // Initialize BE global data object. + ACE_NEW (be_global, + BE_GlobalData); + + // Initialize driver private data + DRV_nfiles = 0; + DRV_file_index = 0; } /* @@ -289,6 +316,53 @@ DRV_drive (const char *s) ACE_OS::exit (0); } +// Fork off a process, wait for it to die. +void +DRV_fork (void) +{ + for (DRV_file_index = 0; + DRV_file_index < DRV_nfiles; + ++DRV_file_index) + { + ACE_Process_Options options (1, + TAO_IDL_COMMAND_LINE_BUFFER_SIZE); + options.creation_flags (ACE_Process_Options::NO_EXEC); + options.command_line ("%s %s %s", + idl_global->prog_name (), + idl_global->idl_flags (), + DRV_files[DRV_file_index]); + ACE_Process manager; + pid_t child_pid = manager.spawn (options); + + if (child_pid == 0) + { + // OK, do it to this file (in the child). + DRV_drive (DRV_files[DRV_file_index]); + ACE_OS::exit (0); + } + + if (child_pid == ACE_INVALID_PID) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("IDL: spawn failed\n"))); + + ACE_OS::exit (99); + } + + // child_pid is the process id of something at this point. + if (manager.wait () == -1) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("IDL: wait failed\n"))); + + ACE_OS::exit (99); + } + } + + // Now the parent process can exit. + ACE_OS::exit (0); +} + /* ** LOGIC: ** diff --git a/TAO/TAO_IDL/tao_idl.dsp b/TAO/TAO_IDL/tao_idl.dsp index 2e26be3d610..a0da8d7ad26 100644 --- a/TAO/TAO_IDL/tao_idl.dsp +++ b/TAO/TAO_IDL/tao_idl.dsp @@ -91,18 +91,10 @@ SOURCE=.\driver\drv_args.cpp # End Source File
# Begin Source File
-SOURCE=.\driver\drv_init.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\driver\drv_preproc.cpp
# End Source File
# Begin Source File
-SOURCE=.\driver\drv_private.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\tao_idl.cpp
# End Source File
# End Group
@@ -113,10 +105,6 @@ SOURCE=.\tao_idl.cpp SOURCE=.\include\drv_extern.h
# End Source File
-# Begin Source File
-
-SOURCE=.\include\drv_private.h
-# End Source File
# End Group
# End Target
# End Project
diff --git a/TAO/TAO_IDL/util/utl_decllist.cpp b/TAO/TAO_IDL/util/utl_decllist.cpp index d295094b2a8..dd34ce2c344 100644 --- a/TAO/TAO_IDL/util/utl_decllist.cpp +++ b/TAO/TAO_IDL/util/utl_decllist.cpp @@ -74,8 +74,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -#include "idl.h" -#include "idl_extern.h" +#include "utl_decllist.h" #include "fe_declarator.h" ACE_RCSID (util, diff --git a/TAO/TAO_IDL/util/utl_err.cpp b/TAO/TAO_IDL/util/utl_err.cpp index 26644667b05..79d4440eb6e 100644 --- a/TAO/TAO_IDL/util/utl_err.cpp +++ b/TAO/TAO_IDL/util/utl_err.cpp @@ -67,24 +67,25 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // utl_err.cc - Implementation of error reporting object for IDL // compiler program -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(util, utl_err, "$Id$") - -#if defined(ACE_GCC_HONORS_STD_NAMESPACE) && (ACE_GCC_HONORS_STD_NAMESPACE == 1) +#include "utl_err.h" +#include "utl_identifier.h" +#include "utl_string.h" +#include "global_extern.h" +#include "nr_extern.h" +#include "ast_interface.h" +#include "ast_enum.h" +#include "ast_union.h" +#include "ast_union_label.h" + +ACE_RCSID (util, + utl_err, + "$Id$") + +#if defined (ACE_GCC_HONORS_STD_NAMESPACE) \ + && (ACE_GCC_HONORS_STD_NAMESPACE == 1) using std::cerr; #endif - -/* - * Helper functions to do: - * - * - Convert an error code to an error string - * - Print out an error message header - * - Convert an ExprType to a string - */ - // Convert an error code into a const char * static const char * error_string (UTL_Error::ErrorCode c) @@ -241,7 +242,7 @@ exprtype_to_string (AST_Expression::ExprType t) // Convert a parse state into a possible error message static const char * -parse_state_to_error_message(IDL_GlobalData::ParseState ps) +parse_state_to_error_message (IDL_GlobalData::ParseState ps) { switch (ps) { case IDL_GlobalData::PS_NoState: diff --git a/TAO/TAO_IDL/util/utl_exceptlist.cpp b/TAO/TAO_IDL/util/utl_exceptlist.cpp index 8ad5d138ead..f92c1ccabbe 100644 --- a/TAO/TAO_IDL/util/utl_exceptlist.cpp +++ b/TAO/TAO_IDL/util/utl_exceptlist.cpp @@ -62,7 +62,7 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ // utl_exceptlist.cc // @@ -74,68 +74,40 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -#include "idl.h" -#include "idl_extern.h" +#include "utl_exceptlist.h" -ACE_RCSID(util, utl_exceptlist, "$Id$") +ACE_RCSID (util, + utl_exceptlist, + "$Id$") -/* - * Constructor(s) - */ - -UTL_ExceptList::UTL_ExceptList(AST_Exception *s, UTL_ExceptList *cdr) - : UTL_List(cdr), - pd_car_data(s) +UTL_ExceptList::UTL_ExceptList (AST_Exception *s, + UTL_ExceptList *cdr) + : UTL_List (cdr), + pd_car_data (s) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -// Get list item +// Get list item. AST_Exception * -UTL_ExceptList::head() +UTL_ExceptList::head (void) { - return pd_car_data; + return this->pd_car_data; } -/* - * Redefinition of inherited virtual operations - */ - -// UTL_ExceptList active iterator - -/* - * Constructor - */ - -UTL_ExceptlistActiveIterator::UTL_ExceptlistActiveIterator(UTL_ExceptList *s) - : UTL_ListActiveIterator(s) +UTL_ExceptlistActiveIterator::UTL_ExceptlistActiveIterator (UTL_ExceptList *s) + : UTL_ListActiveIterator(s) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -// Get current item +// Get current item. AST_Exception * -UTL_ExceptlistActiveIterator::item() +UTL_ExceptlistActiveIterator::item (void) { - if (source == NULL) - return NULL; - return ((UTL_ExceptList *) source)->head(); + if (source == 0) + { + return 0; + } + + return ((UTL_ExceptList *) source)->head (); } -/* - * Redefinition of inherited virtual operations - */ diff --git a/TAO/TAO_IDL/util/utl_exprlist.cpp b/TAO/TAO_IDL/util/utl_exprlist.cpp index 0f3c5a3b2a8..2f96cded1b5 100644 --- a/TAO/TAO_IDL/util/utl_exprlist.cpp +++ b/TAO/TAO_IDL/util/utl_exprlist.cpp @@ -62,11 +62,9 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -// utl_exprlist.cc -// -// Implementation of a list of strings +// Implementation of a list of expressions. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. @@ -74,68 +72,40 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -#include "idl.h" -#include "idl_extern.h" +#include "utl_exprlist.h" -ACE_RCSID(util, utl_exprlist, "$Id$") +ACE_RCSID (util, + utl_exprlist, + "$Id$") -/* - * Constructor(s) - */ - -UTL_ExprList::UTL_ExprList(AST_Expression *s, UTL_ExprList *cdr) - : UTL_List(cdr), - pd_car_data(s) +UTL_ExprList::UTL_ExprList (AST_Expression *s, + UTL_ExprList *cdr) + : UTL_List(cdr), + pd_car_data(s) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -// Get list item +// Get list item. AST_Expression * -UTL_ExprList::head() +UTL_ExprList::head (void) { - return pd_car_data; + return this->pd_car_data; } -/* - * Redefinition of inherited virtual operations - */ - -// UTL_ExprList active iterator - -/* - * Constructor - */ - -UTL_ExprlistActiveIterator::UTL_ExprlistActiveIterator(UTL_ExprList *s) - : UTL_ListActiveIterator(s) +UTL_ExprlistActiveIterator::UTL_ExprlistActiveIterator (UTL_ExprList *s) + : UTL_ListActiveIterator(s) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -// Get current item +// Get current item. AST_Expression * -UTL_ExprlistActiveIterator::item() +UTL_ExprlistActiveIterator::item (void) { - if (source == NULL) - return NULL; - return ((UTL_ExprList *) source)->head(); + if (source == 0) + { + return 0; + } + + return ((UTL_ExprList *) source)->head (); } -/* - * Redefinition of inherited virtual operations - */ diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index f923e2d41e6..90c0e6e3327 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -62,20 +62,25 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ - -// utl_global.cc - Implementation of class IDL_GlobalData -// +*/ -#include "idl.h" -#include "idl_extern.h" +#include "idl_global.h" +#include "global_extern.h" +#include "ast_root.h" +#include "ast_generator.h" +#include "utl_identifier.h" +#include "utl_indenter.h" +#include "utl_err.h" +#include "utl_string.h" -ACE_RCSID(util, utl_global, "$Id$") +ACE_RCSID (util, + utl_global, + "$Id$") // Define an increment for the size of the array used to store names of -// included files -#undef INCREMENT -#define INCREMENT 64 +// included files. +#undef INCREMENT +#define INCREMENT 64 IDL_GlobalData::IDL_GlobalData (void) : pd_root (0), diff --git a/TAO/TAO_IDL/util/utl_identifier.cpp b/TAO/TAO_IDL/util/utl_identifier.cpp index 5104f345fcb..367c1e467f2 100644 --- a/TAO/TAO_IDL/util/utl_identifier.cpp +++ b/TAO/TAO_IDL/util/utl_identifier.cpp @@ -62,20 +62,18 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -// utl_identifier - Implementation of identifiers +#include "utl_identifier.h" +#include "global_extern.h" +#include "utl_err.h" +#include "utl_string.h" -#include "idl.h" -#include "idl_extern.h" +ACE_RCSID (util, + utl_identifier, + "$Id$") -ACE_RCSID(util, utl_identifier, "$Id$") - -/* - * Constructors - */ - -Identifier::Identifier () +Identifier::Identifier (void) : pv_string (0), escaped_ (0) { diff --git a/TAO/TAO_IDL/util/utl_idlist.cpp b/TAO/TAO_IDL/util/utl_idlist.cpp index 1e7551d0b51..967589476ac 100644 --- a/TAO/TAO_IDL/util/utl_idlist.cpp +++ b/TAO/TAO_IDL/util/utl_idlist.cpp @@ -64,20 +64,20 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -// utl_idlist.cc -// -// Implementation of a list of utl_string nodes +// Implementation of a list of utl_string nodes. // NOTE: This list class only works correctly because we use single public -// inheritance, as opposed to multiple inheritance or public virtual. +// inheritance, as opposed to multiple inheritance or public virtual. // It relies on a type-unsafe cast from UTL_List to subclasses, which // will cease to operate correctly if you use either multiple or // public virtual inheritance. -#include "idl.h" -#include "idl_extern.h" +#include "utl_idlist.h" +#include "utl_identifier.h" -ACE_RCSID(util, utl_idlist, "$Id$") +ACE_RCSID (util, + utl_idlist, + "$Id$") // Constructor UTL_IdList::UTL_IdList (Identifier *s, diff --git a/TAO/TAO_IDL/util/utl_indenter.cpp b/TAO/TAO_IDL/util/utl_indenter.cpp index ba00f0cb394..06702447ce1 100644 --- a/TAO/TAO_IDL/util/utl_indenter.cpp +++ b/TAO/TAO_IDL/util/utl_indenter.cpp @@ -67,69 +67,62 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // utl_indenter.cc - Implementation of indenter for dumping IDL AST // -#include "idl.h" -#include "idl_extern.h" +#include "utl_indenter.h" -ACE_RCSID(util, utl_indenter, "$Id$") +ACE_RCSID (util, + utl_indenter, + "$Id$") /* * Constructors */ -UTL_Indenter::UTL_Indenter () +UTL_Indenter::UTL_Indenter (void) : pd_indent_level (0) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -// Reset indentation level +// Reset indentation level. void -UTL_Indenter::reset () +UTL_Indenter::reset (void) { - pd_indent_level = 0; + this->pd_indent_level = 0; } -// Increase indentation level +// Increase indentation level. void -UTL_Indenter::increase () +UTL_Indenter::increase (void) { - pd_indent_level++; + ++this->pd_indent_level; } -// Decrease indentation level +// Decrease indentation level. void UTL_Indenter::decrease () { - if (pd_indent_level > 0) - pd_indent_level--; + if (this->pd_indent_level > 0) + { + --this->pd_indent_level; + } } -// Produce white space to indent to current indentation level on ostream o +// Produce white space to indent to current indentation level on ostream o. void UTL_Indenter::skip_to (ACE_OSTREAM_TYPE &o) { - long i; - - for (i = 0; i < pd_indent_level; i++) - o << " "; + for (long i = 0; i < this->pd_indent_level; ++i) + { + o << " "; + } } -// Produce white space to indent to current indentation level on ostream o +// Produce white space to indent to current indentation level on ostream o. void UTL_Indenter::skip_to (FILE *fp) { - long i; - - for (i = 0; i < pd_indent_level; i++) - ACE_OS::fprintf (fp, " "); + for (long i = 0; i < this->pd_indent_level; ++i) + { + ACE_OS::fprintf (fp, + " "); + } } -/* - * Redefined virtual operations - */ diff --git a/TAO/TAO_IDL/util/utl_labellist.cpp b/TAO/TAO_IDL/util/utl_labellist.cpp index 7c4d172f06e..8241f3c63c7 100644 --- a/TAO/TAO_IDL/util/utl_labellist.cpp +++ b/TAO/TAO_IDL/util/utl_labellist.cpp @@ -64,70 +64,41 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -// utl_labellist.cc -// -// Implementation of a list of scoped names +// Implementation of a list of union labels. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. -// It relies on a type-unsafe cast from UTL_List to subclasses, which -// will cease to operate correctly if you use either multiple or -// public virtual inheritance. +// It relies on a type-unsafe cast from UTL_List to subclasses, which +// will cease to operate correctly if you use either multiple or +// public virtual inheritance. -#include "idl.h" -#include "idl_extern.h" +#include "utl_labellist.h" -ACE_RCSID(util, utl_labellist, "$Id$") +ACE_RCSID (util, + utl_labellist, + "$Id$") -/* - * Constructor(s) - */ - -UTL_LabelList::UTL_LabelList(AST_UnionLabel *s, UTL_LabelList *cdr) - : UTL_List(cdr), - pd_car_data(s) +UTL_LabelList::UTL_LabelList (AST_UnionLabel *s, + UTL_LabelList *cdr) + : UTL_List(cdr), + pd_car_data(s) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -// Get list item +// Get list item. AST_UnionLabel * -UTL_LabelList::head() +UTL_LabelList::head (void) { - return pd_car_data; + return this->pd_car_data; } -/* - * Redefinition of inherited virtual operations - */ - -// UTL_LabelList active iterator - -/* - * Constructor - */ - UTL_LabellistActiveIterator::UTL_LabellistActiveIterator (UTL_LabelList *s) - : UTL_ListActiveIterator (s) + : UTL_ListActiveIterator (s) { } -/* - * Private operations - */ -/* - * Public operations - */ - -// Get current item +// Get current item. AST_UnionLabel * UTL_LabellistActiveIterator::item (void) { @@ -139,6 +110,3 @@ UTL_LabellistActiveIterator::item (void) return ((UTL_LabelList *) source)->head (); } -/* - * Redefinition of inherited virtual operations - */ diff --git a/TAO/TAO_IDL/util/utl_list.cpp b/TAO/TAO_IDL/util/utl_list.cpp index a17b85b089d..dc9cebf2029 100644 --- a/TAO/TAO_IDL/util/utl_list.cpp +++ b/TAO/TAO_IDL/util/utl_list.cpp @@ -62,37 +62,32 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -// utl_list.cc -// -// Implementation of generic single-linked lists +// Implementation of generic single-linked list. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. -// It relies on a type-unsafe cast from UTL_List to subclasses, which -// will cease to operate correctly if you use either multiple or -// public virtual inheritance. +// It relies on a type-unsafe cast from UTL_List to subclasses, which +// will cease to operate correctly if you use either multiple or +// public virtual inheritance. -#include "idl.h" -#include "idl_extern.h" +#include "utl_list.h" -ACE_RCSID(util, utl_list, "$Id$") +ACE_RCSID (util, + utl_list, + "$Id$") -// Constructor UTL_List::UTL_List (UTL_List *c) : pd_cdr_data (c) { } -// Destructor UTL_List::~UTL_List (void) { } -// Private operations - -// Compute list length +// Compute list length. long UTL_List::list_length (long n) { @@ -106,8 +101,6 @@ UTL_List::list_length (long n) } } -// Public operations - // Smash last cdr with l. void UTL_List::nconc (UTL_List *l) @@ -144,7 +137,7 @@ UTL_List::copy (void) return retval; } -// Get next list +// Get next list. UTL_List * UTL_List::tail (void) { @@ -179,16 +172,11 @@ UTL_List::destroy (void) // UTL_List active iterator. -// Constructor UTL_ListActiveIterator::UTL_ListActiveIterator (UTL_List *s) : source (s) { } -/* - * Public operations - */ - // Is iterator done? idl_bool UTL_ListActiveIterator::is_done (void) @@ -196,9 +184,9 @@ UTL_ListActiveIterator::is_done (void) return (this->source == 0) ? I_TRUE : I_FALSE; } -// Advance to next item +// Advance to next item. void -UTL_ListActiveIterator::next () +UTL_ListActiveIterator::next (void) { if (this->source != 0) { diff --git a/TAO/TAO_IDL/util/utl_namelist.cpp b/TAO/TAO_IDL/util/utl_namelist.cpp index 9f9869d32de..92b3e7a998a 100644 --- a/TAO/TAO_IDL/util/utl_namelist.cpp +++ b/TAO/TAO_IDL/util/utl_namelist.cpp @@ -62,80 +62,50 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -// utl_namelist.cc -// -// Implementation of a list of scoped names +// Implementation of a list of scoped names. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. -// It relies on a type-unsafe cast from UTL_List to subclasses, which -// will cease to operate correctly if you use either multiple or -// public virtual inheritance. +// It relies on a type-unsafe cast from UTL_List to subclasses, which +// will cease to operate correctly if you use either multiple or +// public virtual inheritance. -#include "idl.h" -#include "idl_extern.h" +#include "utl_namelist.h" -ACE_RCSID(util, utl_namelist, "$Id$") +ACE_RCSID (util, + utl_namelist, + "$Id$") -/* - * Constructor(s) - */ - -UTL_NameList::UTL_NameList(UTL_ScopedName *s, UTL_NameList *cdr) - : UTL_List(cdr), - pd_car_data(s) +UTL_NameList::UTL_NameList (UTL_ScopedName *s, + UTL_NameList *cdr) + : UTL_List(cdr), + pd_car_data(s) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -// Get list item +// Get list item. UTL_ScopedName * -UTL_NameList::head() +UTL_NameList::head (void) { - return pd_car_data; + return this->pd_car_data; } -/* - * Redefinition of inherited virtual operations - */ - -// UTL_NameList active iterator - -/* - * Constructor - */ - -UTL_NamelistActiveIterator::UTL_NamelistActiveIterator(UTL_NameList *s) - : UTL_ListActiveIterator(s) +UTL_NamelistActiveIterator::UTL_NamelistActiveIterator (UTL_NameList *s) + : UTL_ListActiveIterator(s) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -// Get current item +// Get current item. UTL_ScopedName * -UTL_NamelistActiveIterator::item() +UTL_NamelistActiveIterator::item (void) { - if (source == NULL) - return NULL; - return ((UTL_NameList *) source)->head(); + if (source == 0) + { + return 0; + } + + return ((UTL_NameList *) source)->head (); } -/* - * Redefinition of inherited virtual operations - */ diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp index 342be99fa10..acded37d921 100644 --- a/TAO/TAO_IDL/util/utl_scope.cpp +++ b/TAO/TAO_IDL/util/utl_scope.cpp @@ -64,10 +64,40 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(util, utl_scope, "$Id$") +#include "utl_scope.h" +#include "utl_identifier.h" +#include "utl_err.h" +#include "utl_indenter.h" +#include "utl_string.h" +#include "ast_interface.h" +#include "ast_interface_fwd.h" +#include "ast_typedef.h" +#include "ast_type.h" +#include "ast_root.h" +#include "ast_array.h" +#include "ast_enum.h" +#include "ast_concrete_type.h" +#include "ast_sequence.h" +#include "ast_string.h" +#include "ast_structure.h" +#include "ast_exception.h" +#include "ast_constant.h" +#include "ast_attribute.h" +#include "ast_operation.h" +#include "ast_argument.h" +#include "ast_union.h" +#include "ast_union_branch.h" +#include "ast_field.h" +#include "ast_enum_val.h" +#include "ast_native.h" +#include "ast_factory.h" +#include "ast_visitor.h" +#include "nr_extern.h" +#include "global_extern.h" + +ACE_RCSID (util, + utl_scope, + "$Id$") #undef INCREMENT #define INCREMENT 64 diff --git a/TAO/TAO_IDL/util/utl_stack.cpp b/TAO/TAO_IDL/util/utl_stack.cpp index 1ab831aa0b9..26db4e8c209 100644 --- a/TAO/TAO_IDL/util/utl_stack.cpp +++ b/TAO/TAO_IDL/util/utl_stack.cpp @@ -62,27 +62,19 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -/* - * utl_stack.cc - Implementation of class UTL_ScopeStack - */ - -#include "idl.h" -#include "ast_decl.h" -#include "idl_extern.h" - -ACE_RCSID(util, utl_stack, "$Id$") +#include "utl_stack.h" +#include "utl_scope.h" +#include "global_extern.h" -// Class UTL_ScopeStack +ACE_RCSID (util, + utl_stack, + "$Id$") #undef INCREMENT #define INCREMENT 64 -/* - * Constructor(s) and destructor - */ - UTL_ScopeStack::UTL_ScopeStack (void) : pd_stack_data_nalloced (INCREMENT), pd_stack_top (0) @@ -99,14 +91,6 @@ UTL_ScopeStack::~UTL_ScopeStack (void) } } -/* - * Private operations - */ - -/* - * Public operations - */ - // Push an element on the stack. UTL_ScopeStack * UTL_ScopeStack::push (UTL_Scope *el) @@ -115,7 +99,7 @@ UTL_ScopeStack::push (UTL_Scope *el) long ostack_data_nalloced; long i; - // Make sure there's space for one more + // Make sure there's space for one more. if (this->pd_stack_data_nalloced == this->pd_stack_top) { ostack_data_nalloced = this->pd_stack_data_nalloced; @@ -185,7 +169,7 @@ UTL_ScopeStack::bottom (void) return this->pd_stack_data[0]; } -// Clear entire stack +// Clear entire stack. void UTL_ScopeStack::clear (void) { @@ -199,13 +183,13 @@ UTL_ScopeStack::depth (void) return this->pd_stack_top; } -// Return (top - 1) element on stack +// Return (top - 1) element on stack. UTL_Scope * UTL_ScopeStack::next_to_top (void) { UTL_Scope *tmp, *retval; - if (depth() < 2) + if (this->depth () < 2) { return 0; } @@ -217,7 +201,7 @@ UTL_ScopeStack::next_to_top (void) return retval; // Return next one down } -// Return topmost non-NULL element +// Return topmost non-NULL element. UTL_Scope * UTL_ScopeStack::top_non_null (void) { @@ -232,30 +216,12 @@ UTL_ScopeStack::top_non_null (void) return 0; } -/* - * Redefinition of inherited virtual operations - */ - -// Class UTL_ScopeStackActiveIterator - -/* - * Constructor(s) - */ - UTL_ScopeStackActiveIterator::UTL_ScopeStackActiveIterator (UTL_ScopeStack &s) : source (s), il (s.pd_stack_top - 1) { } -/* - * Private operations - */ - -/* - * Public operations - */ - // Advance to next item void UTL_ScopeStackActiveIterator::next (void) @@ -263,7 +229,7 @@ UTL_ScopeStackActiveIterator::next (void) il--; } -// Get current item +// Get current item. UTL_Scope * UTL_ScopeStackActiveIterator::item (void) { diff --git a/TAO/TAO_IDL/util/utl_string.cpp b/TAO/TAO_IDL/util/utl_string.cpp index b5a714dc421..2b23ce2face 100644 --- a/TAO/TAO_IDL/util/utl_string.cpp +++ b/TAO/TAO_IDL/util/utl_string.cpp @@ -64,17 +64,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -// utl_string.cc - Implementation of quick and dirty TEMPORARY String -// for IDL compiler +#include "utl_string.h" +#include "global_extern.h" +#include "utl_err.h" -#include "idl.h" -#include "idl_extern.h" - -ACE_RCSID(util, utl_string, "$Id$") - -/* - * Constructors. - */ +ACE_RCSID (util, + utl_string, + "$Id$") UTL_String::UTL_String (void) : p_str (0), @@ -132,10 +128,6 @@ UTL_String::~UTL_String (void) { } -/* - * Private operations. - */ - // Compute a canonical form for this string. This is (implemented as) // a corresponding string with all upper case characters where the // original has lower case characters, identical characters otherwise. @@ -157,12 +149,8 @@ UTL_String::canonicalize (void) c_str[this->len] = '\0'; } -/* - * Public operations. - */ - // Compare two UTL_String *. -long +idl_bool UTL_String::compare (UTL_String *s) { char *s_c_str; @@ -180,9 +168,7 @@ UTL_String::compare (UTL_String *s) (ACE_OS::strcmp (this->c_str, s_c_str) == 0) ? I_TRUE : I_FALSE; } - /* - * Check that the names are typed consistently. - */ + // Check that the names are typed consistently. if (result == I_TRUE && ACE_OS::strcmp (this->p_str, s->get_string ()) != 0) { @@ -268,10 +254,6 @@ UTL_String::get_canonical_rep (void) return this->c_str; } -/* - * Redefined virtual operations. - */ - // AST Dumping. void UTL_String::dump (ACE_OSTREAM_TYPE &o) diff --git a/TAO/TAO_IDL/util/utl_strlist.cpp b/TAO/TAO_IDL/util/utl_strlist.cpp index ce2a9a630f5..c1e7cdaaf54 100644 --- a/TAO/TAO_IDL/util/utl_strlist.cpp +++ b/TAO/TAO_IDL/util/utl_strlist.cpp @@ -62,67 +62,82 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -// utl_strlist.cc -// -// Implementation of a list of utl_string nodes +// Implementation of a list of utl_string nodes. // NOTE: This list class only works correctly because we use single public // inheritance, as opposed to multiple inheritance or public virtual. -// It relies on a type-unsafe cast from UTL_List to subclasses, which -// will cease to operate correctly if you use either multiple or -// public virtual inheritance. +// It relies on a type-unsafe cast from UTL_List to subclasses, which +// will cease to operate correctly if you use either multiple or +// public virtual inheritance. -#include "idl.h" -#include "idl_extern.h" +#include "utl_strlist.h" +#include "utl_string.h" -ACE_RCSID(util, utl_strlist, "$Id$") +ACE_RCSID (util, + utl_strlist, + "$Id$") -// Constructor -UTL_StrList::UTL_StrList(UTL_String *s, UTL_StrList *cdr) - : UTL_List(cdr), - pd_car_data(s) +UTL_StrList::UTL_StrList (UTL_String *s, + UTL_StrList *cdr) + : UTL_List(cdr), + pd_car_data(s) { } -// Destructor UTL_StrList::~UTL_StrList (void) { } -// Public operations - -// Get list item +// Get list item. UTL_String * -UTL_StrList::head() +UTL_StrList::head (void) { - return pd_car_data; + return this->pd_car_data; } -// Set list item +// Set list item. void -UTL_StrList::set_head(UTL_String *s) +UTL_StrList::set_head (UTL_String *s) { - pd_car_data = s; + this->pd_car_data = s; } // Get last item of this list UTL_String * -UTL_StrList::last_component() +UTL_StrList::last_component (void) { - if (tail() == NULL) - return pd_car_data; - return ((UTL_StrList *) tail())->last_component(); + if (this->tail () == 0) + { + return pd_car_data; + } + + return ((UTL_StrList *) this->tail ())->last_component(); } -// Copy a list +// Copy a list. UTL_List * -UTL_StrList::copy() +UTL_StrList::copy (void) { - if (tail() == NULL) - return new UTL_StrList(head(), NULL); - return new UTL_StrList(head(), (UTL_StrList *) tail()->copy()); + UTL_List *retval = 0; + + if (this->tail () == 0) + { + ACE_NEW_RETURN (retval, + UTL_StrList (head (), + 0), + 0); + } + else + { + ACE_NEW_RETURN (retval, + UTL_StrList (head (), + (UTL_StrList *) this->tail ()->copy ()), + 0); + } + + return retval; } void |