diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-09-25 16:25:39 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-09-25 16:25:39 +0000 |
commit | 74e496c02eed5efc93bff0d14b2e39ac63f996d7 (patch) | |
tree | d8c088424cc4d957360cb3b13bfc4f0d2ae21dfa | |
parent | c7acd0e9fc7ae6e83664ca0022ee1e58d798954d (diff) | |
download | ATCD-74e496c02eed5efc93bff0d14b2e39ac63f996d7.tar.gz |
ChangeLogTag: Wed Sep 25 11:12:59 2002 Jeff Parsons <parsons@cs.wustl.edu>
455 files changed, 16988 insertions, 4394 deletions
diff --git a/TAO/TAO_IDL/Makefile.BE b/TAO/TAO_IDL/Makefile.BE index 1ba38a04996..2e586ed273e 100644 --- a/TAO/TAO_IDL/Makefile.BE +++ b/TAO/TAO_IDL/Makefile.BE @@ -31,6 +31,8 @@ FILES = be/be_array \ be/be_constant \ be/be_enum \ be/be_enum_val \ + be/be_event \ + be/be_event_fwd \ be/be_exception \ be/be_expression \ be/be_factory \ @@ -73,6 +75,7 @@ FILES = be/be_array \ be/be_visitor_argument \ be/be_visitor_array \ be/be_visitor_attribute \ + be/be_visitor_ccm_pre_proc \ be/be_visitor_component \ be/be_visitor_component_fwd \ be/be_visitor_constant \ diff --git a/TAO/TAO_IDL/Makefile.FE b/TAO/TAO_IDL/Makefile.FE index 9f38eec30a9..3a9c0a17927 100644 --- a/TAO/TAO_IDL/Makefile.FE +++ b/TAO/TAO_IDL/Makefile.FE @@ -43,6 +43,8 @@ FILES = fe/fe_declarator \ ast/ast_enum_val \ ast/ast_exception \ ast/ast_expression \ + ast/ast_event \ + ast/ast_event_fwd \ ast/ast_factory \ ast/ast_field \ ast/ast_home \ diff --git a/TAO/TAO_IDL/TAO_IDL_BE.bor b/TAO/TAO_IDL/TAO_IDL_BE.bor index 39ff741cbc5..d16bd2022ff 100644 --- a/TAO/TAO_IDL/TAO_IDL_BE.bor +++ b/TAO/TAO_IDL/TAO_IDL_BE.bor @@ -15,6 +15,8 @@ OBJFILES = \ $(OBJDIR)\be_decl.obj \ $(OBJDIR)\be_enum.obj \ $(OBJDIR)\be_enum_val.obj \ + $(OBJDIR)\be_event.obj \ + $(OBJDIR)\be_event_fwd.obj \ $(OBJDIR)\be_exception.obj \ $(OBJDIR)\be_expression.obj \ $(OBJDIR)\be_factory.obj \ @@ -54,6 +56,7 @@ OBJFILES = \ $(OBJDIR)\be_visitor_argument.obj \ $(OBJDIR)\be_visitor_array.obj \ $(OBJDIR)\be_visitor_attribute.obj \ + $(OBJDIR)\be_visitor_ccm_pre_proc.obj \ $(OBJDIR)\be_visitor_component.obj \ $(OBJDIR)\be_visitor_component_fwd.obj \ $(OBJDIR)\be_visitor_constant.obj \ diff --git a/TAO/TAO_IDL/TAO_IDL_BE_DLL.dsp b/TAO/TAO_IDL/TAO_IDL_BE_DLL.dsp index c6c71116985..f7dd64a26d0 100644 --- a/TAO/TAO_IDL/TAO_IDL_BE_DLL.dsp +++ b/TAO/TAO_IDL/TAO_IDL_BE_DLL.dsp @@ -142,6 +142,14 @@ SOURCE=.\be\be_enum_val.cpp # End Source File
# Begin Source File
+SOURCE=.\be\be_eventtype.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\be\be_eventtype_fwd.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\be\be_exception.cpp
# End Source File
# Begin Source File
@@ -302,6 +310,10 @@ SOURCE=.\be\be_visitor_attribute.cpp # End Source File
# Begin Source File
+SOURCE=.\be\be_visitor_ccm_pre_proc.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\be\be_visitor_component.cpp
# End Source File
# Begin Source File
@@ -326,6 +338,14 @@ SOURCE=.\be\be_visitor_enum.cpp # End Source File
# Begin Source File
+SOURCE=.\be\be_visitor_eventtype.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\be\be_visitor_eventtype_fwd.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\be\be_visitor_exception.cpp
# End Source File
# Begin Source File
@@ -450,6 +470,14 @@ SOURCE=.\be_include\be_enum_val.h # End Source File
# Begin Source File
+SOURCE=.\be_include\be_eventtype.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\be_include\be_eventtype_fwd.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_exception.h
# End Source File
# Begin Source File
@@ -606,6 +634,10 @@ SOURCE=.\be_include\be_visitor_attribute.h # End Source File
# Begin Source File
+SOURCE=.\be_include\be_visitor_ccm_pre_proc.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_visitor_component.h
# End Source File
# Begin Source File
@@ -630,6 +662,14 @@ SOURCE=.\be_include\be_visitor_enum.h # End Source File
# Begin Source File
+SOURCE=.\be_include\be_visitor_eventtype.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\be_include\be_visitor_eventtype_fwd.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_visitor_exception.h
# End Source File
# Begin Source File
diff --git a/TAO/TAO_IDL/TAO_IDL_BE_LIB.dsp b/TAO/TAO_IDL/TAO_IDL_BE_LIB.dsp index 05f0996d0a1..f769a35d27a 100644 --- a/TAO/TAO_IDL/TAO_IDL_BE_LIB.dsp +++ b/TAO/TAO_IDL/TAO_IDL_BE_LIB.dsp @@ -135,6 +135,14 @@ SOURCE=.\be\be_enum_val.cpp # End Source File
# Begin Source File
+SOURCE=.\be\be_eventtype.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\be\be_eventtype_fwd.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\be\be_exception.cpp
# End Source File
# Begin Source File
@@ -295,6 +303,10 @@ SOURCE=.\be\be_visitor_attribute.cpp # End Source File
# Begin Source File
+SOURCE=.\be\be_visitor_ccm_pre_proc.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\be\be_visitor_component.cpp
# End Source File
# Begin Source File
@@ -319,6 +331,14 @@ SOURCE=.\be\be_visitor_enum.cpp # End Source File
# Begin Source File
+SOURCE=.\be\be_visitor_eventtype.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\be\be_visitor_eventtype_fwd.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\be\be_visitor_exception.cpp
# End Source File
# Begin Source File
@@ -443,6 +463,14 @@ SOURCE=.\be_include\be_enum_val.h # End Source File
# Begin Source File
+SOURCE=.\be_include\be_eventtype.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\be_include\be_eventtype_fwd.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_exception.h
# End Source File
# Begin Source File
@@ -595,6 +623,10 @@ SOURCE=.\be_include\be_visitor_attribute.h # End Source File
# Begin Source File
+SOURCE=.\be_include\be_visitor_ccm_pre_proc.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_visitor_component.h
# End Source File
# Begin Source File
@@ -619,6 +651,14 @@ SOURCE=.\be_include\be_visitor_enum.h # End Source File
# Begin Source File
+SOURCE=.\be_include\be_visitor_eventtype.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\be_include\be_visitor_eventtype_fwd.h
+# End Source File
+# Begin Source File
+
SOURCE=.\be_include\be_visitor_exception.h
# End Source File
# Begin Source File
diff --git a/TAO/TAO_IDL/TAO_IDL_FE.bor b/TAO/TAO_IDL/TAO_IDL_FE.bor index a5982e45717..5bf8ce2fa48 100644 --- a/TAO/TAO_IDL/TAO_IDL_FE.bor +++ b/TAO/TAO_IDL/TAO_IDL_FE.bor @@ -16,6 +16,8 @@ OBJFILES = \ $(OBJDIR)\ast_decl.obj \ $(OBJDIR)\ast_enum.obj \ $(OBJDIR)\ast_enum_val.obj \ + $(OBJDIR)\ast_event.obj \ + $(OBJDIR)\ast_event_fwd.obj \ $(OBJDIR)\ast_exception.obj \ $(OBJDIR)\ast_expression.obj \ $(OBJDIR)\ast_factory.obj \ diff --git a/TAO/TAO_IDL/TAO_IDL_FE_DLL.dsp b/TAO/TAO_IDL/TAO_IDL_FE_DLL.dsp index d962ec8329a..e6d1ade4b7e 100644 --- a/TAO/TAO_IDL/TAO_IDL_FE_DLL.dsp +++ b/TAO/TAO_IDL/TAO_IDL_FE_DLL.dsp @@ -146,6 +146,14 @@ SOURCE=.\ast\ast_enum_val.cpp # End Source File
# Begin Source File
+SOURCE=.\ast\ast_eventtype.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ast\ast_eventtype_fwd.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\ast\ast_exception.cpp
# End Source File
# Begin Source File
@@ -406,6 +414,14 @@ SOURCE=.\include\ast_enum_val.h # End Source File
# Begin Source File
+SOURCE=.\include\ast_eventtype.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\ast_eventtype_fwd.h
+# End Source File
+# Begin Source File
+
SOURCE=.\include\ast_exception.h
# End Source File
# Begin Source File
diff --git a/TAO/TAO_IDL/TAO_IDL_FE_LIB.dsp b/TAO/TAO_IDL/TAO_IDL_FE_LIB.dsp index c085a25c697..c2cf5c991b9 100644 --- a/TAO/TAO_IDL/TAO_IDL_FE_LIB.dsp +++ b/TAO/TAO_IDL/TAO_IDL_FE_LIB.dsp @@ -139,6 +139,14 @@ SOURCE=.\ast\ast_enum_val.cpp # End Source File
# Begin Source File
+SOURCE=.\ast\ast_eventtype.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ast\ast_eventtype_fwd.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\ast\ast_exception.cpp
# End Source File
# Begin Source File
@@ -399,6 +407,14 @@ SOURCE=.\include\ast_enum_val.h # End Source File
# Begin Source File
+SOURCE=.\include\ast_eventtype.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\ast_eventtype_fwd.h
+# End Source File
+# Begin Source File
+
SOURCE=.\include\ast_exception.h
# End Source File
# Begin Source File
diff --git a/TAO/TAO_IDL/ast/Makefile.am b/TAO/TAO_IDL/ast/Makefile.am index da994a9d775..c072e69c1cf 100644 --- a/TAO/TAO_IDL/ast/Makefile.am +++ b/TAO/TAO_IDL/ast/Makefile.am @@ -29,6 +29,8 @@ libast_la_SOURCES = \ ast_decl.cpp \ ast_enum.cpp \ ast_enum_val.cpp \ + ast_event.cpp \ + ast_event_fwd.cpp \ ast_exception.cpp \ ast_expression.cpp \ ast_field.cpp \ diff --git a/TAO/TAO_IDL/ast/ast_attribute.cpp b/TAO/TAO_IDL/ast/ast_attribute.cpp index 56d7ec3924b..4924329f57b 100644 --- a/TAO/TAO_IDL/ast/ast_attribute.cpp +++ b/TAO/TAO_IDL/ast/ast_attribute.cpp @@ -71,13 +71,23 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // readonly. #include "ast_attribute.h" +#include "ast_exception.h" #include "ast_visitor.h" +#include "utl_namelist.h" +#include "utl_exceptlist.h" +#include "utl_scope.h" +#include "utl_err.h" +#include "global_extern.h" -ACE_RCSID(ast, ast_attribute, "$Id$") +ACE_RCSID (ast, + ast_attribute, + "$Id$") // Constructor(s) and destructor. AST_Attribute::AST_Attribute (void) - : pd_readonly (I_TRUE) + : pd_readonly (I_TRUE), + pd_get_exceptions (0), + pd_set_exceptions (0) { } @@ -93,7 +103,9 @@ AST_Attribute::AST_Attribute (idl_bool ro, n), COMMON_Base (local, abstract), - pd_readonly (ro) + pd_readonly (ro), + pd_get_exceptions (0), + pd_set_exceptions (0) { } @@ -121,11 +133,133 @@ AST_Attribute::ast_accept (ast_visitor *visitor) // Data accessors. idl_bool -AST_Attribute::readonly (void) +AST_Attribute::readonly (void) const { return this->pd_readonly; } +UTL_ExceptList * +AST_Attribute::get_get_exceptions (void) const +{ + return this->pd_get_exceptions; +} + +UTL_ExceptList * +AST_Attribute::get_set_exceptions (void) const +{ + return this->pd_set_exceptions; +} + +// NOTE: No attempt is made to ensure that exceptions are mentioned +// only once.. +UTL_NameList * +AST_Attribute::fe_add_get_exceptions (UTL_NameList *t) +{ + UTL_ScopedName *nl_n = 0; + AST_Exception *fe = 0; + AST_Decl *d = 0; + + this->pd_get_exceptions = 0; + + for (UTL_NamelistActiveIterator nl_i (t); !nl_i.is_done (); nl_i.next ()) + { + nl_n = nl_i.item (); + + d = this->defined_in ()->lookup_by_name (nl_n, + I_TRUE); + + if (d == 0 || d->node_type() != AST_Decl::NT_except) + { + idl_global->err ()->lookup_error (nl_n); + return 0; + } + + fe = AST_Exception::narrow_from_decl (d); + + if (fe == 0) + { + idl_global->err ()->error1 (UTL_Error::EIDL_ILLEGAL_RAISES, + this); + return 0; + } + + if (this->pd_get_exceptions == 0) + { + ACE_NEW_RETURN (this->pd_get_exceptions, + UTL_ExceptList (fe, + 0), + 0); + } + else + { + UTL_ExceptList *el = 0; + ACE_NEW_RETURN (el, + UTL_ExceptList (fe, + 0), + 0); + + this->pd_get_exceptions->nconc (el); + } + } + + return t; +} + +// NOTE: No attempt is made to ensure that exceptions are mentioned +// only once.. +UTL_NameList * +AST_Attribute::fe_add_set_exceptions (UTL_NameList *t) +{ + UTL_ScopedName *nl_n = 0; + AST_Exception *fe = 0; + AST_Decl *d = 0; + + this->pd_set_exceptions = 0; + + for (UTL_NamelistActiveIterator nl_i (t); !nl_i.is_done (); nl_i.next ()) + { + nl_n = nl_i.item (); + + d = this->defined_in ()->lookup_by_name (nl_n, + I_TRUE); + + if (d == 0 || d->node_type() != AST_Decl::NT_except) + { + idl_global->err ()->lookup_error (nl_n); + return 0; + } + + fe = AST_Exception::narrow_from_decl (d); + + if (fe == 0) + { + idl_global->err ()->error1 (UTL_Error::EIDL_ILLEGAL_RAISES, + this); + return 0; + } + + if (this->pd_set_exceptions == 0) + { + ACE_NEW_RETURN (this->pd_set_exceptions, + UTL_ExceptList (fe, + 0), + 0); + } + else + { + UTL_ExceptList *el = 0; + ACE_NEW_RETURN (el, + UTL_ExceptList (fe, + 0), + 0); + + this->pd_set_exceptions->nconc (el); + } + } + + return t; +} + // Narrowing methods. IMPL_NARROW_METHODS1(AST_Attribute, AST_Field) IMPL_NARROW_FROM_DECL(AST_Attribute) diff --git a/TAO/TAO_IDL/ast/ast_component.cpp b/TAO/TAO_IDL/ast/ast_component.cpp index d975ee28df3..f2545b327f7 100644 --- a/TAO/TAO_IDL/ast/ast_component.cpp +++ b/TAO/TAO_IDL/ast/ast_component.cpp @@ -1,6 +1,7 @@ // $Id$ #include "ast_component.h" +#include "ast_attribute.h" #include "ast_visitor.h" #include "utl_identifier.h" #include "utl_indenter.h" @@ -27,14 +28,14 @@ AST_Component::AST_Component (UTL_ScopedName *n, n_supports, supports_flat, n_supports_flat, - I_TRUE, + I_FALSE, I_FALSE), AST_Type (AST_Decl::NT_component, n), AST_Decl (AST_Decl::NT_component, n), UTL_Scope (AST_Decl::NT_component), - COMMON_Base (I_TRUE, + COMMON_Base (I_FALSE, I_FALSE), pd_base_component (base_component) { @@ -91,7 +92,7 @@ AST_Component::provides (void) return this->pd_provides; } -ACE_Unbounded_Queue<AST_Component::uses_description> & +ACE_Unbounded_Queue<AST_Component::port_description> & AST_Component::uses (void) { return this->pd_uses; diff --git a/TAO/TAO_IDL/ast/ast_decl.cpp b/TAO/TAO_IDL/ast/ast_decl.cpp index d9fb123516a..4ead555e25c 100644 --- a/TAO/TAO_IDL/ast/ast_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_decl.cpp @@ -890,7 +890,6 @@ AST_Decl::set_id_with_typeid (char *value) case AST_Decl::NT_factory: case AST_Decl::NT_component: case AST_Decl::NT_home: - case AST_Decl::NT_finder: case AST_Decl::NT_eventtype: break; default: diff --git a/TAO/TAO_IDL/ast/ast_eventtype.cpp b/TAO/TAO_IDL/ast/ast_eventtype.cpp new file mode 100644 index 00000000000..9595ab4a54f --- /dev/null +++ b/TAO/TAO_IDL/ast/ast_eventtype.cpp @@ -0,0 +1,134 @@ +// This may look like C, but it's really -*- C++ -*- +// $Id$ + +#include "ast_eventtype.h" +#include "ast_visitor.h" +#include "utl_identifier.h" +#include "utl_indenter.h" +#include "global_extern.h" + +ACE_RCSID (ast, + ast_eventtype, + "$Id$") + +AST_EventType::AST_EventType (void) +{ +} + +AST_EventType::AST_EventType (UTL_ScopedName *n, + AST_Interface **inherits, + long n_inherits, + AST_ValueType *inherits_concrete, + AST_Interface **inherits_flat, + long n_inherits_flat, + AST_Interface **supports, + long n_supports, + AST_Interface *supports_concrete, + idl_bool abstract, + idl_bool truncatable) + : AST_ValueType (n, + inherits, + n_inherits, + inherits_concrete, + inherits_flat, + n_inherits_flat, + supports, + n_supports, + supports_concrete, + abstract, + truncatable), + AST_Interface (n, + inherits, + n_inherits, + inherits_flat, + n_inherits_flat, + I_FALSE, + abstract), + AST_Type (AST_Decl::NT_eventtype, + n), + AST_Decl (AST_Decl::NT_eventtype, + n), + UTL_Scope (AST_Decl::NT_eventtype), + COMMON_Base (I_FALSE, + abstract) +{ +} + +AST_EventType::~AST_EventType (void) +{ +} + +void +AST_EventType::destroy (void) +{ + this->AST_ValueType::destroy (); +} + +void +AST_EventType::dump (ACE_OSTREAM_TYPE &o) +{ + if (this->is_abstract ()) + { + o << "abstract "; + } + else if (this->pd_truncatable) + { + o << "truncatable "; + } + + o << "eventtype "; + + this->local_name ()->dump (o); + o << " "; + + if (this->pd_n_inherits > 0) + { + o << ": "; + + for (long i = 0; i < this->pd_n_inherits; ++i) + { + this->pd_inherits[i]->local_name ()->dump (o); + + if (i < this->pd_n_inherits - 1) + { + o << ", "; + } + } + } + + o << "\n\n"; + + if (this->pd_n_supports > 0) + { + o << "supports "; + + for (long i = 0; i < this->pd_n_supports; ++i) + { + this->pd_supports[i]->local_name ()->dump (o); + + if (i < this->pd_n_supports - 1) + { + o << ", "; + } + } + } + + o << " {\n"; + + UTL_Scope::dump (o); + idl_global->indent ()->skip_to (o); + + o << "}"; +} + +int +AST_EventType::ast_accept (ast_visitor *visitor) +{ + return visitor->visit_eventtype (this); +} + + // Narrowing. +IMPL_NARROW_METHODS1(AST_EventType, AST_ValueType) +IMPL_NARROW_FROM_DECL(AST_EventType) +IMPL_NARROW_FROM_SCOPE(AST_EventType) + diff --git a/TAO/TAO_IDL/ast/ast_eventtype_fwd.cpp b/TAO/TAO_IDL/ast/ast_eventtype_fwd.cpp new file mode 100644 index 00000000000..3954a3bad15 --- /dev/null +++ b/TAO/TAO_IDL/ast/ast_eventtype_fwd.cpp @@ -0,0 +1,64 @@ +// $Id$ + +#include "ast_eventtype_fwd.h" +#include "ast_interface.h" +#include "ast_visitor.h" +#include "utl_identifier.h" + +ACE_RCSID( ast, + ast_eventtype_fwd, + "$Id$") + +AST_EventTypeFwd::AST_EventTypeFwd (void) +{ +} + +AST_EventTypeFwd::AST_EventTypeFwd (AST_Interface *dummy, + UTL_ScopedName *n) + : AST_ValueTypeFwd (dummy, + n), + AST_InterfaceFwd (dummy, + n), + AST_Type (AST_Decl::NT_eventtype_fwd, + n), + AST_Decl (AST_Decl::NT_eventtype_fwd, + n), + COMMON_Base (I_FALSE, + dummy->is_abstract ()) +{ +} + +AST_EventTypeFwd::~AST_EventTypeFwd (void) +{ +} + +// Redefinition of inherited virtual operations. + +// Dump this AST_InterfaceFwd node to the ostream o. +void +AST_EventTypeFwd::dump (ACE_OSTREAM_TYPE &o) +{ + if (this->is_abstract ()) + { + o << "abstract "; + } + + o << "eventtype "; + + this->local_name ()->dump (o); +} + +int +AST_EventTypeFwd::ast_accept (ast_visitor *visitor) +{ + return visitor->visit_eventtype_fwd (this); +} + +void +AST_EventTypeFwd::destroy (void) +{ +} + +// Narrowing methods. +IMPL_NARROW_METHODS1 (AST_EventTypeFwd, AST_ValueTypeFwd) +IMPL_NARROW_FROM_DECL (AST_EventTypeFwd) diff --git a/TAO/TAO_IDL/ast/ast_factory.cpp b/TAO/TAO_IDL/ast/ast_factory.cpp index 3acfaa81337..a0defbadc9d 100644 --- a/TAO/TAO_IDL/ast/ast_factory.cpp +++ b/TAO/TAO_IDL/ast/ast_factory.cpp @@ -86,9 +86,9 @@ AST_Factory::AST_Factory (void) } AST_Factory::AST_Factory (UTL_ScopedName *n) - : AST_Decl(AST_Decl::NT_factory, - n), - UTL_Scope(AST_Decl::NT_factory), + : AST_Decl (AST_Decl::NT_factory, + n), + UTL_Scope (AST_Decl::NT_factory), COMMON_Base (1, 0), //@@ Always local, never abstract argument_count_ (-1), diff --git a/TAO/TAO_IDL/ast/ast_generator.cpp b/TAO/TAO_IDL/ast/ast_generator.cpp index 0c6b6318db1..7d22214ad04 100644 --- a/TAO/TAO_IDL/ast/ast_generator.cpp +++ b/TAO/TAO_IDL/ast/ast_generator.cpp @@ -73,6 +73,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_root.h" #include "ast_valuetype.h" #include "ast_valuetype_fwd.h" +#include "ast_eventtype.h" +#include "ast_eventtype_fwd.h" #include "ast_component.h" #include "ast_component_fwd.h" #include "ast_home.h" @@ -306,6 +308,70 @@ AST_Generator::create_valuetype_fwd (UTL_ScopedName *n, return retval; } +AST_EventType * +AST_Generator::create_eventtype (UTL_ScopedName *n, + AST_Interface **inherits, + long n_inherits, + AST_ValueType *inherits_concrete, + AST_Interface **inherits_flat, + long n_inherits_flat, + AST_Interface **supports, + long n_supports, + AST_Interface *supports_concrete, + idl_bool abstract, + idl_bool truncatable) +{ + AST_EventType *retval = 0; + ACE_NEW_RETURN (retval, + AST_EventType (n, + inherits, + n_inherits, + inherits_concrete, + inherits_flat, + n_inherits_flat, + supports, + n_supports, + supports_concrete, + abstract, + truncatable), + 0); + + // The following helps with OBV_ namespace generation. + AST_Module *m = AST_Module::narrow_from_scope (retval->defined_in ()); + + if (m != 0) + { + m->set_has_nested_valuetype (); + } + + return retval; +} + +AST_EventTypeFwd * +AST_Generator::create_eventtype_fwd (UTL_ScopedName *n, + idl_bool abstract) +{ + AST_EventType *dummy = this->create_eventtype (n, + 0, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + abstract, + I_FALSE); + + AST_EventTypeFwd *retval = 0; + ACE_NEW_RETURN (retval, + AST_EventTypeFwd (dummy, + n), + 0); + + return retval; +} + AST_Component * AST_Generator::create_component (UTL_ScopedName *n, AST_Component *base_component, @@ -404,9 +470,13 @@ AST_Generator::create_structure (UTL_ScopedName *n, AST_StructureFwd * AST_Generator::create_structure_fwd (UTL_ScopedName *n) { + AST_Structure *dummy = this->create_structure (n, + 0, + 0); AST_StructureFwd *retval = 0; ACE_NEW_RETURN (retval, - AST_StructureFwd (n), + AST_StructureFwd (dummy, + n), 0); return retval; @@ -515,9 +585,14 @@ AST_Generator::create_union (AST_ConcreteType *dt, AST_UnionFwd * AST_Generator::create_union_fwd (UTL_ScopedName *n) { + AST_Union *dummy = this->create_union (0, + n, + 0, + 0); AST_UnionFwd *retval = 0; ACE_NEW_RETURN (retval, - AST_UnionFwd (n), + AST_UnionFwd (dummy, + n), 0); return retval; diff --git a/TAO/TAO_IDL/ast/ast_home.cpp b/TAO/TAO_IDL/ast/ast_home.cpp index e9b619651ed..6b86d2ca4e2 100644 --- a/TAO/TAO_IDL/ast/ast_home.cpp +++ b/TAO/TAO_IDL/ast/ast_home.cpp @@ -3,6 +3,7 @@ #include "ast_home.h" #include "ast_component.h" #include "ast_valuetype.h" +#include "ast_operation.h" #include "ast_visitor.h" #include "utl_identifier.h" #include "utl_indenter.h" @@ -84,7 +85,35 @@ AST_Home::finders (void) void AST_Home::destroy (void) { - this->AST_Interface::destroy (); + // Can't call AST_Interface->destroy() because all the + // home's decls are also added to the explicit interface. + + // Also, the factory and finder queues contain operation + // nodes which are simply reused by adding a return type + // and/or an argument. +/* + AST_Operation **tmp = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (this->pd_factories); + ! i.done (); + i.advance ()) + { + i.next (tmp); + (*tmp)->destroy (); + delete (*tmp); + (*tmp) = 0; + } + + for (ACE_Unbounded_Queue_Iterator<AST_Operation *> j (this->pd_finders); + ! j.done (); + j.advance ()) + { + j.next (tmp); + (*tmp)->destroy (); + delete (*tmp); + (*tmp) = 0; + } +*/ } void diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index 6e9b020b13b..82d739e03b3 100644 --- a/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/TAO/TAO_IDL/ast/ast_interface.cpp @@ -135,8 +135,6 @@ AST_Interface::~AST_Interface (void) { } -// Public operations. - void AST_Interface::be_replace_operation (AST_Decl *old_op, AST_Decl *new_op) @@ -151,7 +149,7 @@ AST_Interface::be_replace_operation (AST_Decl *old_op, void AST_Interface::be_add_operation (AST_Operation *op) { - this->fe_add_operation (op); + (void) this->fe_add_operation (op); } // Add an AST_Constant node (a constant declaration) to this scope. @@ -1023,7 +1021,7 @@ AST_Interface::dump (ACE_OSTREAM_TYPE &o) o << "}"; } -// This serves for both interfaces, valuetypes and components. +// This serves for interfaces, valuetypes, components and eventtypes. void AST_Interface::fwd_redefinition_helper (AST_Interface *&i, UTL_Scope *s) @@ -1058,7 +1056,8 @@ AST_Interface::fwd_redefinition_helper (AST_Interface *&i, // forward declaration. if (nt == AST_Decl::NT_interface_fwd || nt == AST_Decl::NT_valuetype_fwd - || nt == AST_Decl::NT_component_fwd) + || nt == AST_Decl::NT_component_fwd + || nt == AST_Decl::NT_eventtype_fwd) { AST_InterfaceFwd *fwd_def = AST_InterfaceFwd::narrow_from_decl (d); @@ -1068,7 +1067,8 @@ AST_Interface::fwd_redefinition_helper (AST_Interface *&i, // In all other cases, the lookup will find an interface node. else if (nt == AST_Decl::NT_interface || nt == AST_Decl::NT_valuetype - || nt == AST_Decl::NT_component) + || nt == AST_Decl::NT_component + || nt == AST_Decl::NT_eventtype) { fd = AST_Interface::narrow_from_decl (d); } @@ -1220,8 +1220,8 @@ AST_Interface::insert_non_dup (AST_Interface *t) return 1; } -// This serves only for interfaces. AST_ValueType has its -// own redefine() function which calls this one. +// This serves only for interfaces. It is overridden for valuetypes, +// components and eventtypes. void AST_Interface::redefine (AST_Interface *from) { diff --git a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp index 0b2fbb75a67..70968a21b7c 100644 --- a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp @@ -89,8 +89,8 @@ AST_InterfaceFwd::AST_InterfaceFwd (AST_Interface *dummy, n), AST_Decl (AST_Decl::NT_interface_fwd, n), - COMMON_Base (I_FALSE, - I_FALSE) + COMMON_Base (dummy->is_local (), + dummy->is_abstract ()) { // Create a dummy placeholder for the forward declared interface. This // interface node is not yet defined (n_inherits < 0), so some operations diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp index 8deda7f4d69..a5d59f5ac57 100644 --- a/TAO/TAO_IDL/ast/ast_module.cpp +++ b/TAO/TAO_IDL/ast/ast_module.cpp @@ -72,6 +72,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_predefined_type.h" #include "ast_valuetype.h" #include "ast_valuetype_fwd.h" +#include "ast_eventtype.h" +#include "ast_eventtype_fwd.h" #include "ast_component.h" #include "ast_component_fwd.h" #include "ast_home.h" @@ -410,6 +412,93 @@ AST_Module::fe_add_valuetype (AST_ValueType *t) return t; } +// Add this AST_EventType node (an event type declaration) to this scope. +AST_EventType * +AST_Module::fe_add_eventtype (AST_EventType *t) +{ + if (t->redef_clash ()) + { + return 0; + } + + AST_Decl *predef = 0; + AST_EventType *fwd = 0; + + // Already defined? + if ((predef = this->lookup_for_add (t, I_FALSE)) != 0) + { + // Treat fwd declared interfaces specially + if (predef->node_type () == AST_Decl::NT_eventtype) + { + fwd = AST_EventType::narrow_from_decl (predef); + + if (fwd == 0) + { + return 0; + } + + // Forward declared and not defined yet. + if (!fwd->is_defined ()) + { + if (fwd->defined_in () != this) + { + idl_global->err ()->error3 (UTL_Error::EIDL_SCOPE_CONFLICT, + fwd, + t, + this); + + return 0; + } + } + // OK, not illegal redef of forward declaration. Now check whether. + // it has been referenced already. + else if (this->referenced (predef, t->local_name ())) + { + idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE, + t, + this, + predef); + + return 0; + } + } + else if (!can_be_redefined (predef)) + { + idl_global->err ()->error3 (UTL_Error::EIDL_REDEF, + t, + this, + predef); + + return 0; + } + else if (referenced (predef, t->local_name ()) && !t->is_defined ()) + { + idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE, + t, + this, + predef); + + return 0; + } + else if (t->has_ancestor (predef)) + { + idl_global->err ()->redefinition_in_scope (t, + predef); + + return 0; + } + } + + // Add it to scope + this->add_to_scope (t); + + // Add it to set of locally referenced symbols + this->add_to_referenced (t, + I_FALSE, + t->local_name ()); + return t; +} + // Add this AST_Component node (a value type declaration) to this scope. AST_Component * AST_Module::fe_add_component (AST_Component *t) @@ -535,10 +624,9 @@ AST_Module::fe_add_home (AST_Home *t) // Add it to scope. this->add_to_scope (t); - // Add it to set of locally referenced symbols. - this->add_to_referenced (t, - I_FALSE, - t->local_name ()); + // The home's local name is not added to the referenced list, since + // the name will later be mangled to allow a creation of an + // equivalent interface with the original name. return t; } @@ -691,6 +779,80 @@ AST_Module::fe_add_valuetype_fwd (AST_ValueTypeFwd *v) return v; } +// Add this AST_EventTypeFwd node (a forward declaration of an IDL +// event type) to this scope. +AST_EventTypeFwd * +AST_Module::fe_add_eventtype_fwd (AST_EventTypeFwd *v) +{ + AST_Decl *d = 0; + AST_EventType *vtf = 0; + + // Already defined and cannot be redefined? Or already used? + if ((d = this->lookup_for_add (v, I_FALSE)) != 0) + { + // There used to be another check here ANDed with the one below: + // d->defined_in () == this. But lookup_for_add calls only + // lookup_by_name_local(), which does not bump up the scope, + // and look_in_previous() for modules. If look_in_previous() + // finds something, the scopes will NOT be the same pointer + // value, but the result is what we want. + if (d->node_type () == AST_Decl::NT_eventtype) + { + vtf = AST_EventType::narrow_from_decl (d); + + if (vtf == 0) + { + return 0; + } + + if (v->added () == 0) + { + v->set_added (1); + this->add_to_scope (v); + } + + // @@ Redefinition of forward. Type check not implemented. + v->set_full_definition (vtf); // @@ Memory leak. + return v; + } + + if (!can_be_redefined (d)) { + + idl_global->err ()->error3 (UTL_Error::EIDL_REDEF, + v, + this, + d); + return 0; + } + + if (this->referenced (d, v->local_name ())) + { + idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE, + v, + this, + d); + return 0; + } + + if (v->has_ancestor (d)) + { + idl_global->err ()->redefinition_in_scope (v, + d); + return 0; + } + } + + // Add it to scope + this->add_to_scope (v); + + // Add it to set of locally referenced symbols + this->add_to_referenced (v, + I_FALSE, + v->local_name ()); + + return v; +} + // Add this AST_ComponentFwd node (a forward declaration of an IDL // value type) to this scope. AST_ComponentFwd * diff --git a/TAO/TAO_IDL/ast/ast_operation.cpp b/TAO/TAO_IDL/ast/ast_operation.cpp index 21661fdeb58..03068e18d17 100644 --- a/TAO/TAO_IDL/ast/ast_operation.cpp +++ b/TAO/TAO_IDL/ast/ast_operation.cpp @@ -298,6 +298,18 @@ AST_Operation::be_add_argument (AST_Argument *arg) return arg; } +int +AST_Operation::be_insert_exception (AST_Exception *ex) +{ + UTL_ExceptList *new_list = 0; + ACE_NEW_RETURN (new_list, + UTL_ExceptList (ex, + this->pd_exceptions), + -1); + this->pd_exceptions = new_list; + return 0; +} + // Add these exceptions (identified by name) to this scope. // This looks up each name to resolve it to the name of a known // exception, and then adds the referenced exception to the list @@ -318,8 +330,8 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t) { nl_n = nl_i.item (); - d = lookup_by_name (nl_n, - I_TRUE); + d = this->lookup_by_name (nl_n, + I_TRUE); if (d == 0 || d->node_type() != AST_Decl::NT_except) { diff --git a/TAO/TAO_IDL/ast/ast_structure.cpp b/TAO/TAO_IDL/ast/ast_structure.cpp index ffeab3c1787..9780ee4bc63 100644 --- a/TAO/TAO_IDL/ast/ast_structure.cpp +++ b/TAO/TAO_IDL/ast/ast_structure.cpp @@ -69,6 +69,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // structure's fields are managed in a scope). #include "ast_union.h" +#include "ast_structure_fwd.h" #include "ast_field.h" #include "ast_enum.h" #include "ast_enum_val.h" @@ -533,6 +534,117 @@ AST_Structure::dump (ACE_OSTREAM_TYPE &o) o << "}"; } +// This serves for interfaces, valuetypes, components and eventtypes. +void +AST_Structure::fwd_redefinition_helper (AST_Structure *&i, + UTL_Scope *s) +{ + if (i == 0) + { + return; + } + + // Fwd redefinition should be in the same scope, so local + // lookup is all that's needed. + AST_Decl *d = s->lookup_by_name_local (i->local_name (), + 0); + + AST_Structure *fd = 0; + + if (d != 0) + { + // Full definition must have the same prefix as the forward declaration. + if (ACE_OS::strcmp (i->prefix (), d->prefix ()) != 0) + { + idl_global->err ()->error1 (UTL_Error::EIDL_PREFIX_CONFLICT, + i); + + return; + } + + AST_Decl::NodeType nt = d->node_type (); + + // If this interface has been forward declared in a previous opening + // of the module it's defined in, the lookup will find the + // forward declaration. + if (nt == AST_Decl::NT_struct_fwd + || nt == AST_Decl::NT_union_fwd) + { + AST_StructureFwd *fwd_def = + AST_StructureFwd::narrow_from_decl (d); + + fd = fwd_def->full_definition (); + } + // In all other cases, the lookup will find an interface node. + else if (nt == AST_Decl::NT_struct + || nt == AST_Decl::NT_union) + { + fd = AST_Structure::narrow_from_decl (d); + } + + // Successful? + if (fd == 0) + { + // Should we give an error here? + // No, look in fe_add_interface. + } + // If it is a forward declared interface.. + else if (!fd->is_defined ()) + { + // Check if redefining in same scope. If a module is reopened, + // a new pointer in created, and the first term below will be + // true. In that case, the scoped names must be compared. + if (fd->defined_in () != s + && i->name ()->compare (fd->name ()) != 0) + { + idl_global->err ()->error2 (UTL_Error::EIDL_SCOPE_CONFLICT, + i, + fd); + } + // All OK, do the redefinition. + else + { + AST_Decl::NodeType fd_nt = fd->node_type (); + AST_Decl::NodeType i_nt = i->node_type (); + + // Only redefinition of the same kind. + if (i_nt != fd_nt) + { + idl_global->err ()->error2 (UTL_Error::EIDL_REDEF, + i, + fd); + return; + } + + fd->redefine (i); + + // Use full definition node. + delete i; + i = fd; + } + } + } +} + +// This serves only for structs. It is overridden for unions. +void +AST_Structure::redefine (AST_Structure *from) +{ + // We've already checked for inconsistent prefixes. + this->prefix (ACE::strnew (from->prefix ())); + + this->set_defined_in (from->defined_in ()); + this->set_imported (idl_global->imported ()); + this->set_in_main_file (idl_global->in_main_file ()); + this->set_line (idl_global->lineno ()); + this->set_file_name (idl_global->filename ()); + this->ifr_added_ = from->ifr_added_; + this->ifr_fwd_added_ = from->ifr_fwd_added_; + this->fields_ = from->fields_; + this->member_count_ = from->member_count_; + this->local_struct_ = from->local_struct_; +} + // Compute the size type of the node in question. int AST_Structure::compute_size_type (void) diff --git a/TAO/TAO_IDL/ast/ast_structure_fwd.cpp b/TAO/TAO_IDL/ast/ast_structure_fwd.cpp index 4f64a401516..4aec5c6d670 100644 --- a/TAO/TAO_IDL/ast/ast_structure_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_structure_fwd.cpp @@ -19,10 +19,11 @@ AST_StructureFwd::AST_StructureFwd (void) { } -AST_StructureFwd::AST_StructureFwd (UTL_ScopedName *n) +AST_StructureFwd::AST_StructureFwd (AST_Structure *dummy, + UTL_ScopedName *n) : AST_Decl (AST_Decl::NT_struct_fwd, n), - pd_full_definition (0) + pd_full_definition (dummy) { } diff --git a/TAO/TAO_IDL/ast/ast_union.cpp b/TAO/TAO_IDL/ast/ast_union.cpp index d9a6e4aaa1e..6e94ab2c45e 100644 --- a/TAO/TAO_IDL/ast/ast_union.cpp +++ b/TAO/TAO_IDL/ast/ast_union.cpp @@ -164,7 +164,7 @@ AST_Union::AST_Union (AST_ConcreteType *dt, break; } } - else if (dt->node_type() == AST_Decl::NT_enum) + else if (dt->node_type () == AST_Decl::NT_enum) { this->pd_udisc_type = AST_Expression::EV_enum; this->pd_disc_type = dt; @@ -189,6 +189,27 @@ AST_Union::~AST_Union (void) // Public operations. +void +AST_Union::redefine (AST_Structure *from) +{ + AST_Union *u = AST_Union::narrow_from_decl (from); + + if (u == 0) + { + idl_global->err ()->redef_error (from->local_name ()->get_string (), + this->local_name ()->get_string ()); + return; + } + + // Copy over all the base class members. + this->AST_Structure::redefine (from); + + this->pd_disc_type = u->pd_disc_type; + this->pd_udisc_type = u->pd_udisc_type; + this->default_index_ = u->default_index_; + this->default_value_ = u->default_value_; +} + // Return the default_index. int AST_Union::default_index (void) @@ -1206,6 +1227,6 @@ AST_Union::udisc_type (void) } // Narrowing. -IMPL_NARROW_METHODS2(AST_Union, AST_ConcreteType, UTL_Scope) +IMPL_NARROW_METHODS1(AST_Union, AST_Structure) IMPL_NARROW_FROM_DECL(AST_Union) IMPL_NARROW_FROM_SCOPE(AST_Union) diff --git a/TAO/TAO_IDL/ast/ast_union_fwd.cpp b/TAO/TAO_IDL/ast/ast_union_fwd.cpp index b24676a653d..947004fa9a7 100644 --- a/TAO/TAO_IDL/ast/ast_union_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_union_fwd.cpp @@ -10,19 +10,20 @@ #include "ast_visitor.h" #include "utl_identifier.h" -ACE_RCSID( ast, +ACE_RCSID (ast, ast_union_fwd, "$Id$") AST_UnionFwd::AST_UnionFwd (void) - : pd_full_definition (0) { } -AST_UnionFwd::AST_UnionFwd (UTL_ScopedName *n) - : AST_Decl (AST_Decl::NT_union_fwd, - n), - pd_full_definition (0) +AST_UnionFwd::AST_UnionFwd (AST_Union *dummy, + UTL_ScopedName *n) + : AST_StructureFwd (dummy, + n), + AST_Decl (AST_Decl::NT_union_fwd, + n) { } @@ -46,31 +47,12 @@ AST_UnionFwd::ast_accept (ast_visitor *visitor) return visitor->visit_union_fwd (this); } -// Data accessors. - -AST_Union * -AST_UnionFwd::full_definition (void) -{ - return this->pd_full_definition; -} - -void -AST_UnionFwd::set_full_definition (AST_Union *nfd) -{ - this->pd_full_definition = nfd; -} - -idl_bool -AST_UnionFwd::is_defined (void) -{ - return (this->pd_full_definition != 0); -} - void AST_UnionFwd::destroy (void) { + this->AST_StructureFwd::destroy (); } // Narrowing methods. -IMPL_NARROW_METHODS1 (AST_UnionFwd, AST_Type) +IMPL_NARROW_METHODS1 (AST_UnionFwd, AST_StructureFwd) IMPL_NARROW_FROM_DECL (AST_UnionFwd) diff --git a/TAO/TAO_IDL/ast/ast_valuetype_fwd.cpp b/TAO/TAO_IDL/ast/ast_valuetype_fwd.cpp index 95e1e633dae..51494cb3663 100644 --- a/TAO/TAO_IDL/ast/ast_valuetype_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_valuetype_fwd.cpp @@ -1,6 +1,7 @@ // $Id$ #include "ast_valuetype_fwd.h" +#include "ast_interface.h" #include "ast_visitor.h" #include "utl_identifier.h" @@ -21,7 +22,7 @@ AST_ValueTypeFwd::AST_ValueTypeFwd (AST_Interface *dummy, AST_Decl (AST_Decl::NT_valuetype_fwd, n), COMMON_Base (I_FALSE, - I_FALSE) + dummy->is_abstract ()) { } diff --git a/TAO/TAO_IDL/be/Makefile.am b/TAO/TAO_IDL/be/Makefile.am index cf8ebeea9ae..c504a61f052 100644 --- a/TAO/TAO_IDL/be/Makefile.am +++ b/TAO/TAO_IDL/be/Makefile.am @@ -30,6 +30,8 @@ libbe_la_SOURCES = \ be_decl.cpp \ be_enum.cpp \ be_enum_val.cpp \ + be_event.cpp \ + be_Event_fwd.cpp \ be_exception.cpp \ be_expression.cpp \ be_field.cpp \ @@ -67,6 +69,7 @@ libbe_la_SOURCES = \ be_visitor_argument.cpp \ be_visitor_array.cpp \ be_visitor_attribute.cpp \ + be_visitor_ccm_pre_proc.cpp \ be_visitor_component.cpp \ be_visitor_component_fwd.cpp \ be_visitor_constant.cpp \ diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index 7100402a37f..cb975a06926 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -175,20 +175,22 @@ TAO_CodeGen::start_client_header (const char *fname) // protection, but do optimize based on #pragma once. *this->client_header_ << "\n#if !defined (ACE_LACKS_PRAGMA_ONCE)\n" << "# pragma once\n" - << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n\n"; + << "#endif /* ACE_LACKS_PRAGMA_ONCE */"; // Other include files. if (be_global->stub_export_include () != 0) { - *this->client_header_ << "#include \"" + *this->client_header_ << "\n\n#include \"" << be_global->stub_export_include () - << "\"\n"; + << "\""; } // Include the Messaging files if AMI is enabled. if (be_global->ami_call_back () == I_TRUE) { + *this->client_header_ << "\n\n"; + // Include Messaging skeleton file. this->gen_standard_include (this->client_header_, "tao/Messaging/Messaging.h"); @@ -202,7 +204,14 @@ TAO_CodeGen::start_client_header (const char *fname) if (be_global->gen_smart_proxies () == I_TRUE) { this->gen_standard_include (this->client_header_, - "tao/SmartProxies/Smart_Proxies.h"); + "\ntao/SmartProxies/Smart_Proxies.h"); + } + + size_t nfiles = idl_global->n_included_idl_files (); + + if (nfiles > 0) + { + *this->client_header_ << "\n"; } // We must include all the skeleton headers corresponding to @@ -210,9 +219,7 @@ TAO_CodeGen::start_client_header (const char *fname) // We will use the included IDL file names as they appeared // in the original main IDL file, not the one which went // thru CC preprocessor. - for (size_t j = 0; - j < idl_global->n_included_idl_files (); - j++) + for (size_t j = 0; j < nfiles; ++j) { char* idl_name = idl_global->included_idl_files ()[j]; @@ -231,28 +238,26 @@ TAO_CodeGen::start_client_header (const char *fname) // Sanity check and then print. if (client_hdr != 0) { - this->client_header_->print ("#include \"%s\"\n", + this->client_header_->print ("\n#include \"%s\"", client_hdr); } else { ACE_ERROR ((LM_WARNING, - ACE_TEXT ("WARNING, invalid file '%s' included\n"), + ACE_TEXT ("\nWARNING, invalid file '%s' included"), idl_name)); } } - *this->client_header_ << "\n"; // Generate the TAO_EXPORT_MACRO macro. - *this->client_header_ << "#if defined (TAO_EXPORT_MACRO)\n"; + *this->client_header_ << "\n\n#if defined (TAO_EXPORT_MACRO)\n"; *this->client_header_ << "#undef TAO_EXPORT_MACRO\n"; *this->client_header_ << "#endif\n"; *this->client_header_ << "#define TAO_EXPORT_MACRO " - << be_global->stub_export_macro () - << be_nl << be_nl; + << be_global->stub_export_macro (); // Generate export macro for nested classes. - *this->client_header_ << "#if defined (TAO_EXPORT_NESTED_CLASSES)\n" + *this->client_header_ << "\n\n#if defined (TAO_EXPORT_NESTED_CLASSES)\n" << "# if defined (TAO_EXPORT_NESTED_MACRO)\n" << "# undef TAO_EXPORT_NESTED_MACRO\n" << "# endif /* defined " @@ -260,25 +265,25 @@ TAO_CodeGen::start_client_header (const char *fname) << "# define TAO_EXPORT_NESTED_MACRO " << be_global->stub_export_macro () << be_nl - << "#endif /* TAO_EXPORT_NESTED_CLASSES */\n\n"; + << "#endif /* TAO_EXPORT_NESTED_CLASSES */"; - *this->client_header_ << "#if defined(_MSC_VER)\n" + *this->client_header_ << "\n\n#if defined(_MSC_VER)\n" << "#if (_MSC_VER >= 1200)\n" << "#pragma warning(push)\n" << "#endif /* _MSC_VER >= 1200 */\n" - << "#pragma warning(disable:4250)\n"; + << "#pragma warning(disable:4250)"; if (be_global->use_raw_throw ()) { - *this->client_header_ << "#pragma warning(disable:4290)\n"; + *this->client_header_ << "\n#pragma warning(disable:4290)"; } - *this->client_header_ << "#endif /* _MSC_VER */\n\n"; + *this->client_header_ << "\n#endif /* _MSC_VER */"; *this->client_header_ - << "#if defined (__BORLANDC__)\n" + << "\n\n#if defined (__BORLANDC__)\n" << "#pragma option push -w-rvl -w-rch -w-ccc -w-inl\n" - << "#endif /* __BORLANDC__ */\n\n"; + << "#endif /* __BORLANDC__ */"; return 0; } @@ -359,7 +364,7 @@ TAO_CodeGen::start_client_stubs (const char *fname) *this->client_stubs_ << "#include \"" << be_global->be_get_client_inline_fname (1) << "\"\n"; - *this->client_stubs_ << "#endif /* !defined INLINE */\n\n"; + *this->client_stubs_ << "#endif /* !defined INLINE */"; return 0; } @@ -530,11 +535,11 @@ TAO_CodeGen::start_server_header (const char *fname) *this->server_header_ << "#if defined (__BORLANDC__)\n" << "#pragma option push -w-rvl -w-rch -w-ccc -w-inl\n" - << "#endif /* __BORLANDC__ */\n\n"; + << "#endif /* __BORLANDC__ */"; if (be_global->skel_export_include () != 0) { - *this->server_header_ << "#include \"" + *this->server_header_ << "\n\n#include \"" << be_global->skel_export_include () << "\"\n"; @@ -555,7 +560,7 @@ TAO_CodeGen::start_server_header (const char *fname) << "# define TAO_EXPORT_NESTED_MACRO " << be_global->skel_export_macro () << be_nl - << "#endif /* TAO_EXPORT_NESTED_CLASSES */\n"; + << "#endif /* TAO_EXPORT_NESTED_CLASSES */"; } return 0; @@ -998,12 +1003,11 @@ TAO_CodeGen::end_client_header (void) { // Generate the <<= and >>= operators here. - *this->client_header_ << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ - << be_nl; + *this->client_header_ << be_nl << be_nl << "// TAO_IDL - Generated from" + << be_nl << "// " << __FILE__ << ":" << __LINE__; // Insert the code to include the inline file. - *this->client_header_ << "\n#if defined (__ACE_INLINE__)\n"; + *this->client_header_ << "\n\n#if defined (__ACE_INLINE__)\n"; *this->client_header_ << "#include \"" << be_global->be_get_client_inline_fname (1) << "\"\n"; @@ -1027,14 +1031,14 @@ TAO_CodeGen::end_client_header (void) << "\"\n"; } - *this->client_header_ << "#endif /* ifndef */\n"; + *this->client_header_ << "#endif /* ifndef */" << be_nl << be_nl; return 0; } int TAO_CodeGen::end_server_header (void) { - *this->server_header_ << be_nl << "// TAO_IDL - Generated from " + *this->server_header_ << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; @@ -1130,10 +1134,10 @@ TAO_CodeGen::end_implementation_header (const char *fname) int TAO_CodeGen::end_server_template_header (void) { - *this->server_template_header_ << be_nl << "// TAO_IDL - Generated from " + *this->server_template_header_ << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ - << be_nl << be_nl; + << be_nl; // Insert the code to include the inline file. *this->server_template_header_ << "\n#if defined (__ACE_INLINE__)\n"; @@ -1141,7 +1145,7 @@ TAO_CodeGen::end_server_template_header (void) << "#include \"" << be_global->be_get_server_template_inline_fname (1) << "\"\n"; - *this->server_template_header_ << "#endif /* defined INLINE */\n\n"; + *this->server_template_header_ << "#endif /* defined INLINE */\n"; // Insert the code to include the template source file. *this->server_template_header_ @@ -1150,7 +1154,7 @@ TAO_CodeGen::end_server_template_header (void) << "#include \"" << be_global->be_get_server_template_skeleton_fname (1) << "\"\n"; - *this->server_template_header_ << "#endif /* defined REQUIRED SOURCE */\n\n"; + *this->server_template_header_ << "#endif /* defined REQUIRED SOURCE */\n"; // Insert the code to include the template pragma. *this->server_template_header_ diff --git a/TAO/TAO_IDL/be/be_component.cpp b/TAO/TAO_IDL/be/be_component.cpp index 1a78b10ef75..164238db621 100644 --- a/TAO/TAO_IDL/be/be_component.cpp +++ b/TAO/TAO_IDL/be/be_component.cpp @@ -41,7 +41,7 @@ be_component::be_component (UTL_ScopedName *n, n_supports, supports_flat, n_supports_flat, - I_TRUE, + I_FALSE, I_FALSE), AST_Component (n, base_component, @@ -54,14 +54,14 @@ be_component::be_component (UTL_ScopedName *n, n_supports, supports_flat, n_supports_flat, - I_TRUE, + I_FALSE, I_FALSE), AST_Type (AST_Decl::NT_component, n), AST_Decl (AST_Decl::NT_component, n), UTL_Scope (AST_Decl::NT_component), - COMMON_Base (I_TRUE, + COMMON_Base (I_FALSE, I_FALSE) { this->size_type (AST_Type::VARIABLE); @@ -85,6 +85,18 @@ be_component::accept (be_visitor *visitor) return visitor->visit_component (this); } +AST_Structure * +be_component::be_add_structure (AST_Structure *t) +{ + return this->fe_add_structure (t); +} + +AST_Typedef * +be_component::be_add_typedef (AST_Typedef *t) +{ + return this->fe_add_typedef (t); +} + // Narrowing. IMPL_NARROW_METHODS2 (be_component, be_interface, AST_Component) IMPL_NARROW_FROM_DECL (be_component) diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index c98dd53bd4d..f07e0c102b6 100644 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ b/TAO/TAO_IDL/be/be_decl.cpp @@ -23,6 +23,10 @@ #include "be_scope.h" #include "be_interface.h" #include "be_interface_fwd.h" +#include "be_valuetype.h" +#include "be_component.h" +#include "be_eventtype.h" +#include "be_home.h" #include "be_module.h" #include "be_root.h" #include "be_exception.h" @@ -248,6 +252,14 @@ be_decl::scope (void) return be_factory::narrow_from_decl (d); case AST_Decl::NT_sequence: return be_sequence::narrow_from_decl (d); + case AST_Decl::NT_valuetype: + return be_valuetype::narrow_from_decl (d); + case AST_Decl::NT_component: + return be_component::narrow_from_decl (d); + case AST_Decl::NT_eventtype: + return be_eventtype::narrow_from_decl (d); + case AST_Decl::NT_home: + return be_home::narrow_from_decl (d); default: return (be_scope *)0; } diff --git a/TAO/TAO_IDL/be/be_eventtype.cpp b/TAO/TAO_IDL/be/be_eventtype.cpp new file mode 100644 index 00000000000..efca917cd6b --- /dev/null +++ b/TAO/TAO_IDL/be/be_eventtype.cpp @@ -0,0 +1,108 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_eventtype.cpp +// +// = DESCRIPTION +// Extension of class AST_EventType and be_valuetype that provides +// additional means for C++ mapping of an eventtype. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#include "be_eventtype.h" +#include "be_visitor.h" + +ACE_RCSID (be, + be_eventtype, + "$Id$") + +// Default constructor. +be_eventtype::be_eventtype (void) +{ +} + +// Constructor used to build the AST. +be_eventtype::be_eventtype (UTL_ScopedName *n, + AST_Interface **inherits, + long n_inherits, + AST_ValueType *inherits_concrete, + AST_Interface **inherits_flat, + long n_inherits_flat, + AST_Interface **supports, + long n_supports, + AST_Interface *supports_concrete, + idl_bool abstract, + idl_bool truncatable) + : be_valuetype (n, + inherits, + n_inherits, + inherits_concrete, + inherits_flat, + n_inherits_flat, + supports, + n_supports, + supports_concrete, + abstract, + truncatable), + be_interface (n, + inherits, + n_inherits, + inherits_flat, + n_inherits_flat, + 0, + abstract), + AST_ValueType (n, + inherits, + n_inherits, + inherits_concrete, + inherits_flat, + n_inherits_flat, + supports, + n_supports, + supports_concrete, + abstract, + truncatable), + AST_Interface (n, + inherits, + n_inherits, + inherits_flat, + n_inherits_flat, + 0, + abstract), + AST_Decl (AST_Decl::NT_eventtype, + n), + UTL_Scope (AST_Decl::NT_eventtype), + COMMON_Base (0, + abstract) +{ +} + +be_eventtype::~be_eventtype (void) +{ +} + +// Accept a visitor. +int +be_eventtype::accept (be_visitor *visitor) +{ + return visitor->visit_eventtype (this); +} + +void +be_eventtype::destroy (void) +{ + this->be_valuetype::destroy (); +} + +// Narrowing. +IMPL_NARROW_METHODS2 (be_eventtype, be_valuetype, AST_EventType) +IMPL_NARROW_FROM_DECL (be_eventtype) +IMPL_NARROW_FROM_SCOPE (be_eventtype) diff --git a/TAO/TAO_IDL/be/be_eventtype_fwd.cpp b/TAO/TAO_IDL/be/be_eventtype_fwd.cpp new file mode 100644 index 00000000000..a2fef99f504 --- /dev/null +++ b/TAO/TAO_IDL/be/be_eventtype_fwd.cpp @@ -0,0 +1,71 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_eventtype_fwd.h +// +// = DESCRIPTION +// Extension of class be_valuetype_fwd that provides additional +// means for C++ mapping of an eventtype. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + + +#include "be_eventtype_fwd.h" +#include "be_visitor.h" +#include "ast_interface.h" + +ACE_RCSID (be, + be_eventtype_fwd, + "$Id$") + +be_eventtype_fwd::be_eventtype_fwd (void) +{ +} + +be_eventtype_fwd::be_eventtype_fwd (AST_Interface *dummy, + UTL_ScopedName *n) + : be_valuetype_fwd (dummy, + n), + be_interface_fwd (dummy, + n), + AST_EventTypeFwd (dummy, + n), + AST_ValueTypeFwd (dummy, + n), + AST_InterfaceFwd (dummy, + n), + AST_Decl (AST_Decl::NT_valuetype_fwd, + n), + COMMON_Base (dummy->is_local (), + dummy->is_abstract ()) +{ +} + +be_eventtype_fwd::~be_eventtype_fwd (void) +{ +} + +int +be_eventtype_fwd::accept (be_visitor *visitor) +{ + return visitor->visit_eventtype_fwd (this); +} + +void +be_eventtype_fwd::destroy (void) +{ + this->be_valuetype_fwd::destroy (); +} + +// Narrowing. +IMPL_NARROW_METHODS2 (be_eventtype_fwd, be_valuetype_fwd, AST_EventTypeFwd) +IMPL_NARROW_FROM_DECL (be_eventtype_fwd) + diff --git a/TAO/TAO_IDL/be/be_generator.cpp b/TAO/TAO_IDL/be/be_generator.cpp index 9d9cf6cfce4..cab9504fbb4 100644 --- a/TAO/TAO_IDL/be/be_generator.cpp +++ b/TAO/TAO_IDL/be/be_generator.cpp @@ -75,6 +75,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "be_module.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" +#include "be_eventtype.h" +#include "be_eventtype_fwd.h" #include "be_component.h" #include "be_component_fwd.h" #include "be_home.h" @@ -304,6 +306,62 @@ be_generator::create_valuetype_fwd (UTL_ScopedName *n, return retval; } +AST_EventType * +be_generator::create_eventtype (UTL_ScopedName *n, + AST_Interface **inherits, + long n_inherits, + AST_ValueType *inherits_concrete, + AST_Interface **inherits_flat, + long n_inherits_flat, + AST_Interface **supports, + long n_supports, + AST_Interface *supports_concrete, + idl_bool abstract, + idl_bool truncatable) +{ + be_eventtype *retval = 0; + ACE_NEW_RETURN (retval, + be_eventtype (n, + inherits, + n_inherits, + inherits_concrete, + inherits_flat, + n_inherits_flat, + supports, + n_supports, + supports_concrete, + abstract, + truncatable), + 0); + + return retval; +} + +AST_EventTypeFwd * +be_generator::create_eventtype_fwd (UTL_ScopedName *n, + idl_bool abstract) +{ + AST_EventType *dummy = this->create_eventtype (n, + 0, + -1, + 0, + 0, + 0, + 0, + 0, + 0, + abstract, + 0); + + be_eventtype_fwd *retval = 0; + ACE_NEW_RETURN (retval, + be_eventtype_fwd (dummy, + n), + 0); + + return retval; +} + AST_Component * be_generator::create_component (UTL_ScopedName *n, AST_Component *base_component, @@ -402,9 +460,14 @@ be_generator::create_structure (UTL_ScopedName *n, AST_StructureFwd * be_generator::create_structure_fwd (UTL_ScopedName *n) { + + AST_Structure *dummy = this->create_structure (n, + 0, + 0); be_structure_fwd *retval = 0; ACE_NEW_RETURN (retval, - be_structure_fwd (n), + be_structure_fwd (dummy, + n), 0); return retval; @@ -513,9 +576,14 @@ be_generator::create_union (AST_ConcreteType *dt, AST_UnionFwd * be_generator::create_union_fwd (UTL_ScopedName *n) { + AST_Union *dummy = this->create_union (0, + n, + 0, + 0); be_union_fwd *retval = 0; ACE_NEW_RETURN (retval, - be_union_fwd (n), + be_union_fwd (dummy, + n), 0); return retval; diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index 4e3730d6030..ec952aa9e79 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -77,32 +77,6 @@ BE_GlobalData::BE_GlobalData (void) BE_GlobalData::~BE_GlobalData (void) { - delete this->client_hdr_ending_; - this->client_hdr_ending_ = 0; - delete this->client_stub_ending_; - this->client_stub_ending_ = 0; - delete this->client_inline_ending_; - this->client_inline_ending_ = 0; - delete this->server_hdr_ending_; - this->server_hdr_ending_ = 0; - delete this->implementation_hdr_ending_; - this->implementation_hdr_ending_ = 0; - delete this->implementation_skel_ending_; - this->implementation_skel_ending_ = 0; - delete this->impl_class_prefix_; - this->impl_class_prefix_ = 0; - delete this->impl_class_suffix_; - this->impl_class_suffix_ = 0; - delete this->server_template_hdr_ending_; - this->server_template_hdr_ending_ = 0; - delete this->server_skeleton_ending_; - this->server_skeleton_ending_ = 0; - delete this->server_template_skeleton_ending_; - this->server_template_skeleton_ending_ = 0; - delete this->server_inline_ending_; - this->server_inline_ending_ = 0; - delete this->server_template_inline_ending_; - this->server_template_inline_ending_ = 0; } // To switch between changing or non-changing standard include files @@ -851,4 +825,54 @@ BE_GlobalData::lookup_strategy (void) const void BE_GlobalData::destroy (void) { + delete this->client_hdr_ending_; + this->client_hdr_ending_ = 0; + + delete this->client_stub_ending_; + this->client_stub_ending_ = 0; + + delete this->client_inline_ending_; + this->client_inline_ending_ = 0; + + delete this->server_hdr_ending_; + this->server_hdr_ending_ = 0; + + delete this->implementation_hdr_ending_; + this->implementation_hdr_ending_ = 0; + + delete this->implementation_skel_ending_; + this->implementation_skel_ending_ = 0; + + delete this->impl_class_prefix_; + this->impl_class_prefix_ = 0; + + delete this->impl_class_suffix_; + this->impl_class_suffix_ = 0; + + delete this->server_template_hdr_ending_; + this->server_template_hdr_ending_ = 0; + + delete this->server_skeleton_ending_; + this->server_skeleton_ending_ = 0; + + delete this->server_template_skeleton_ending_; + this->server_template_skeleton_ending_ = 0; + + delete this->server_inline_ending_; + this->server_inline_ending_ = 0; + + delete this->server_template_inline_ending_; + this->server_template_inline_ending_ = 0; +} + +AST_PredefinedType * +BE_GlobalData:: void_type (void) const +{ + return this->void_type_; } + +void +BE_GlobalData::void_type (AST_PredefinedType *val) +{ + this->void_type_ = val; +}; diff --git a/TAO/TAO_IDL/be/be_helper.cpp b/TAO/TAO_IDL/be/be_helper.cpp index 3c523bcb806..047b4d7b9e8 100644 --- a/TAO/TAO_IDL/be/be_helper.cpp +++ b/TAO/TAO_IDL/be/be_helper.cpp @@ -46,7 +46,7 @@ static const char copyright[] = "// http://doc.ece.uci.edu/\n" "//\n" "// Information about TAO is available at:\n" -"// http://www.cs.wustl.edu/~schmidt/TAO.html\n"; +"// http://www.cs.wustl.edu/~schmidt/TAO.html"; TAO_NL::TAO_NL (void) { @@ -272,8 +272,8 @@ TAO_OutStream::gen_ifdef_macro (const char *flat_name, default: return -1; } - *this << "\n#if !defined (" << macro << ")\n"; - *this << "#define " << macro << be_nl << be_nl; + *this << "\n\n#if !defined (" << macro << ")\n"; + *this << "#define " << macro; return 0; } @@ -281,7 +281,7 @@ TAO_OutStream::gen_ifdef_macro (const char *flat_name, int TAO_OutStream::gen_endif (void) { - *this << "\n#endif /* end #if !defined */" << be_nl << be_nl; + *this << "\n\n#endif /* end #if !defined */"; return 0; } @@ -291,9 +291,7 @@ TAO_OutStream::gen_endif (void) int TAO_OutStream::gen_ifdef_AHETI (void) { - *this << "\n" - << "#if !defined (TAO_USE_SEQUENCE_TEMPLATES)" - << be_nl; + *this << "\n\n#if !defined (TAO_USE_SEQUENCE_TEMPLATES)"; return 0; } @@ -310,8 +308,7 @@ TAO_OutStream::gen_else_AHETI (void) int TAO_OutStream::gen_endif_AHETI (void) { - *this << "\n#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ " - << be_nl; + *this << "\n\n#endif /* !TAO_USE_SEQUENCE_TEMPLATES */ "; return 0; } diff --git a/TAO/TAO_IDL/be/be_home.cpp b/TAO/TAO_IDL/be/be_home.cpp index d85d1ea6444..0e919d8b51c 100644 --- a/TAO/TAO_IDL/be/be_home.cpp +++ b/TAO/TAO_IDL/be/be_home.cpp @@ -77,7 +77,8 @@ be_home::~be_home (void) void be_home::destroy (void) { - this->be_interface::destroy (); + // Can't call be_interface->destroy() because all the + // home's decls are also added to the explicit interface. this->AST_Home::destroy (); } diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index 9edb28a37fc..68486468996 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -30,6 +30,7 @@ #include "be_extern.h" #include "utl_identifier.h" #include "ast_generator.h" +#include "ast_component.h" #include "global_extern.h" #include "idl_defines.h" #include "nr_extern.h" @@ -489,7 +490,8 @@ be_interface::gen_stub_ctor (TAO_OutStream *os) // Generate the constructor from stub and servant. if (!this->is_local ()) { - *os << "ACE_INLINE" << be_nl; + *os << be_nl << be_nl + << "ACE_INLINE" << be_nl; *os << this->name () << "::" << this->local_name () << " (" << be_idt << be_idt_nl @@ -532,7 +534,7 @@ be_interface::gen_stub_ctor (TAO_OutStream *os) << "_setup_collocation (_tao_collocated);"; *os << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; } } @@ -565,7 +567,7 @@ be_interface::gen_var_defn (char *interface_name) // Depending upon the data type, there are some differences which we account // for over here. - *ch << be_nl << "// TAO_IDL - Generated from" << be_nl + *ch << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *ch << "class " << be_global->stub_export_macro () @@ -637,6 +639,10 @@ be_interface::gen_var_defn (char *interface_name) { *ch << "CORBA::AbstractBase *" << be_nl; } + else if (this->node_type () == AST_Decl::NT_component) + { + *ch << "Components::CCMObject *" << be_nl; + } else { *ch << "CORBA::Object *" << be_nl; @@ -647,14 +653,18 @@ be_interface::gen_var_defn (char *interface_name) if (this->is_abstract ()) { - *ch << "static CORBA::AbstractBase * tao_upcast (void *);"; + *ch << "static CORBA::AbstractBase *"; + } + else if (this->node_type () == AST_Decl::NT_component) + { + *ch << "Components::CCMObject *"; } else { - *ch << "static CORBA::Object * tao_upcast (void *);"; + *ch << "static CORBA::Object *"; } - *ch << be_uidt_nl << be_nl; + *ch << " tao_upcast (void *);" << be_uidt_nl << be_nl; // Private. *ch << "private:" << be_idt_nl; @@ -664,7 +674,7 @@ be_interface::gen_var_defn (char *interface_name) *ch << interface_name << "_var &operator= (const TAO_Base_var &rhs);" << be_uidt_nl; - *ch << "};\n\n"; + *ch << "};"; return 0; } @@ -707,23 +717,22 @@ be_interface::gen_var_impl (char *interface_local_name, TAO_OutStream *cs = tao_cg->client_stubs (); + *cs << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Generate the var implementation in the inline file // Depending upon the data type, there are some differences which we // account for over here. - cs->indent (); // start with whatever was our current indent level - - *cs << "// *************************************************************" + *cs << be_nl << be_nl + << "// *************************************************************" << be_nl << "// " << fname << be_nl - << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << "// *************************************************************" << be_nl << be_nl; // Default constructor. *cs << fname << "::" << lname - << " (void) // default constructor" << be_idt_nl; + << " (void)" << be_idt_nl; *cs << ": ptr_ (" << interface_local_name << "::_nil ())" << be_uidt_nl; *cs << "{}" << be_nl << be_nl; @@ -742,7 +751,7 @@ be_interface::gen_var_impl (char *interface_local_name, // Copy constructor. *cs << fname << "::" << lname << " (const ::" << interface_full_name - << "_var &p) // copy constructor" << be_nl; + << "_var &p)" << be_nl; *cs << " : TAO_Base_var ()," << be_nl; *cs << " ptr_ (" << interface_local_name << "::_duplicate (p.ptr ()))" << be_nl; @@ -750,7 +759,7 @@ be_interface::gen_var_impl (char *interface_local_name, // Destructor. *cs << fname << "::~" << lname - << " (void) // destructor" << be_nl; + << " (void)" << be_nl; *cs << "{" << be_idt_nl; *cs << "CORBA::release (this->ptr_);" << be_uidt_nl; *cs << "}" << be_nl << be_nl; @@ -871,6 +880,10 @@ be_interface::gen_var_impl (char *interface_local_name, { *cs << "CORBA::AbstractBase *p" << be_nl; } + else if (this->node_type () == AST_Decl::NT_component) + { + *cs << "Components::CCMObject *p" << be_nl; + } else { *cs << "CORBA::Object *p" << be_nl; @@ -888,6 +901,10 @@ be_interface::gen_var_impl (char *interface_local_name, { *cs << "CORBA::AbstractBase *" << be_nl; } + else if (this->node_type () == AST_Decl::NT_component) + { + *cs << "Components::CCMObject *" << be_nl; + } else { *cs << "CORBA::Object *" << be_nl; @@ -900,7 +917,7 @@ be_interface::gen_var_impl (char *interface_local_name, << " **, src);" << be_uidt_nl << "return *tmp;" << be_uidt_nl - << "}\n\n"; + << "}"; return 0; } @@ -925,7 +942,7 @@ be_interface::gen_out_defn (char *interface_name) TAO_OutStream *ch = tao_cg->client_header (); - *ch << be_nl << "// TAO_IDL - Generated from" << be_nl + *ch << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Generate the out definition (always in the client header) @@ -973,7 +990,7 @@ be_interface::gen_out_defn (char *interface_name) *ch << "private:" << be_idt_nl; *ch << interface_name << "_ptr &ptr_;" << be_uidt_nl; - *ch << "};" << be_nl << be_nl; + *ch << "};"; return 0; } @@ -1009,19 +1026,18 @@ be_interface::gen_out_impl (char *interface_local_name, // Depending upon the data type, there are some differences which we account // for over here. - // Start with whatever was our current indent level. - cs->indent (); + *cs << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; - *cs << "// *************************************************************" + *cs << be_nl << be_nl + << "// *************************************************************" << be_nl << "// " << fname << be_nl - << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl - << "// *************************************************************" - << be_nl << be_nl; + << "// *************************************************************"; // Constructor from a _ptr. - *cs << fname << "::" << lname + *cs << be_nl << be_nl + << fname << "::" << lname << " (" << interface_local_name << "_ptr &p)" << be_nl; *cs << " : ptr_ (p)" << be_nl; @@ -1033,7 +1049,7 @@ be_interface::gen_out_impl (char *interface_local_name, // Constructor from _var &. *cs << fname << "::" << lname << " (" << interface_local_name - << "_var &p) // constructor from _var" << be_nl; + << "_var &p)" << be_nl; *cs << " : ptr_ (p.out ())" << be_nl; *cs << "{" << be_idt_nl; *cs << "CORBA::release (this->ptr_);" << be_nl; @@ -1044,7 +1060,7 @@ be_interface::gen_out_impl (char *interface_local_name, // Copy constructor. *cs << fname << "::" << lname << " (const ::" << interface_full_name - << "_out &p) // copy constructor" << be_nl; + << "_out &p)" << be_nl; *cs << " : ptr_ (ACE_const_cast (" << interface_local_name << "_out &, p).ptr_)" << be_nl; *cs << "{}" << be_nl << be_nl; @@ -1089,7 +1105,7 @@ be_interface::gen_out_impl (char *interface_local_name, // ptr function. *cs << "::" << interface_full_name << "_ptr &" << be_nl; - *cs << fname << "::ptr (void) // ptr" << be_nl; + *cs << fname << "::ptr (void)" << be_nl; *cs << "{" << be_idt_nl; *cs << "return this->ptr_;" << be_uidt_nl; *cs << "}" << be_nl << be_nl; @@ -1100,10 +1116,7 @@ be_interface::gen_out_impl (char *interface_local_name, *cs << fname << "::operator-> (void)" << be_nl; *cs << "{" << be_idt_nl; *cs << "return this->ptr_;" << be_uidt_nl; - *cs << "}" << be_nl << be_nl; - - *cs << "// *************************************************************" - << "\n\n"; + *cs << "}"; return 0; } @@ -1276,9 +1289,9 @@ be_interface::gen_operation_table (const char *flat_name, if (os == 0) { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_ss", - "::", - "visit_interface-", + "be_visitor_interface_ss" + "::" + "visit_interface-" "make_outstream failed\n"), -1); } @@ -1291,9 +1304,9 @@ be_interface::gen_operation_table (const char *flat_name, TAO_OutStream::TAO_GPERF_INPUT) == -1) { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_ss", - "::", - "visit_interface-", + "be_visitor_interface_ss" + "::" + "visit_interface-" "gperf_input.tmp file open failed\n"), -1); } @@ -1360,9 +1373,9 @@ be_interface::gen_operation_table (const char *flat_name, default: ACE_ERROR_RETURN ((LM_ERROR, - "be_interface", - "::", - "gen_operation_table", + "be_interface" + "::" + "gen_operation_table" "unknown op_lookup_strategy\n"), -1); } @@ -1650,11 +1663,31 @@ be_interface::traverse_inheritance_graph ( -1); } - long i; + // If we are doing a component, we check for a parent. + if (bi->node_type () == AST_Decl::NT_component) + { + AST_Component *base = + AST_Component::narrow_from_decl (bi)->base_component (); + + if (base != 0) + { + (void) this->insert_non_dup (base); + + long n_supports = base->n_supports (); + AST_Interface **supports = base->supports (); + + for (long j = 0; j < n_supports; ++j) + { + (void) this->insert_non_dup (supports[j]); + } + } + } // Now check if the dequeued element has any ancestors. If yes, insert // them inside the queue making sure that there are no duplicates. - for (i = 0; i < bi->n_inherits (); ++i) + // If we are doing a component, the inheritance list is actually a + // supports list. + for (long i = 0; i < bi->n_inherits (); ++i) { // Retrieve the next parent from which the dequeued element inherits. AST_Interface *parent = bi->inherits ()[i]; @@ -1690,7 +1723,7 @@ be_interface::gen_gperf_things (const char *flat_name) TAO_OutStream *os = this->strategy_->get_out_stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Generate the correct class definition for the operation lookup @@ -1784,8 +1817,7 @@ be_interface::gen_perfect_hash_class_definition (const char *flat_name) << be_nl << " const TAO_operation_db_entry * lookup (const char *str, unsigned int len);" << be_nl - << "};" - << "\n"; + << "};\n\n"; } // Outputs the class definition for the binary searching. This class @@ -1805,8 +1837,7 @@ be_interface::gen_binary_search_class_definition (const char *flat_name) << be_nl << " const TAO_operation_db_entry * lookup (const char *str);" << be_nl - << "};" - << "\n"; + << "};\n\n"; } // Outputs the class definition for the linear search. This class @@ -1826,8 +1857,7 @@ be_interface::gen_linear_search_class_definition (const char *flat_name) << be_nl << " const TAO_operation_db_entry * lookup (const char *str);" << be_nl - << "};" - << "\n"; + << "};\n\n"; } // We have collected the input (Operations and the corresponding @@ -2190,10 +2220,7 @@ be_interface::gen_skel_helper (be_interface *derived, if (d->node_type () == AST_Decl::NT_op) { - // Start from current indentation level. - os->indent (); - - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR) @@ -2205,7 +2232,7 @@ be_interface::gen_skel_helper (be_interface *derived, << "void *obj," << be_nl << "void *context" << be_nl << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt; } else { // Generate code in the inline file. @@ -2233,7 +2260,7 @@ be_interface::gen_skel_helper (be_interface *derived, << "context" << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl << ");" << be_uidt << be_uidt_nl - << "}\n"; + << "}"; } } else if (d->node_type () == AST_Decl::NT_attr) @@ -2256,7 +2283,7 @@ be_interface::gen_skel_helper (be_interface *derived, << "void *obj," << be_nl << "void *context" << be_nl << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt; } else { // Generate code in the inline file. @@ -2284,14 +2311,12 @@ be_interface::gen_skel_helper (be_interface *derived, << "context" << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl << ");" << be_uidt << be_uidt_nl - << "}\n"; + << "}"; } if (!attr->readonly ()) { - // The set method. - // start from current indentation level - os->indent (); + *os << be_nl << be_nl; if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR) { @@ -2303,7 +2328,7 @@ be_interface::gen_skel_helper (be_interface *derived, << "void *obj," << be_nl << "void *context" << be_nl << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt; } else { // Generate code in the inline file. @@ -2332,7 +2357,7 @@ be_interface::gen_skel_helper (be_interface *derived, << "context" << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl << ");" << be_uidt << be_uidt_nl - << "}\n"; + << "}"; } } } diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp index 522e549f129..47e871fc249 100644 --- a/TAO/TAO_IDL/be/be_interface_fwd.cpp +++ b/TAO/TAO_IDL/be/be_interface_fwd.cpp @@ -21,6 +21,7 @@ #include "be_interface_fwd.h" #include "be_visitor.h" +#include "ast_interface.h" ACE_RCSID (be, be_interface_fwd, @@ -37,7 +38,9 @@ be_interface_fwd::be_interface_fwd (AST_Interface *dummy, : AST_InterfaceFwd (dummy, n), AST_Decl (AST_Decl::NT_interface_fwd, - n) + n), + COMMON_Base (dummy->is_local (), + dummy->is_abstract ()) { // Always the case. this->size_type (AST_Type::VARIABLE); diff --git a/TAO/TAO_IDL/be/be_interface_strategy.cpp b/TAO/TAO_IDL/be/be_interface_strategy.cpp index 11c35748ae8..6f18c73c0b9 100644 --- a/TAO/TAO_IDL/be/be_interface_strategy.cpp +++ b/TAO/TAO_IDL/be/be_interface_strategy.cpp @@ -406,8 +406,10 @@ be_interface_ami_exception_holder_strategy::next_state ( switch (current_state) { case TAO_CodeGen::TAO_VALUETYPE_OBV_CH: + case TAO_CodeGen::TAO_EVENTTYPE_OBV_CH: return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH; case TAO_CodeGen::TAO_VALUETYPE_OBV_CS: + case TAO_CodeGen::TAO_EVENTTYPE_OBV_CS: return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS; default: return current_state; diff --git a/TAO/TAO_IDL/be/be_produce.cpp b/TAO/TAO_IDL/be/be_produce.cpp index 8d993bd5747..7ab9305498a 100644 --- a/TAO/TAO_IDL/be/be_produce.cpp +++ b/TAO/TAO_IDL/be/be_produce.cpp @@ -67,6 +67,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "be_visitor_root.h" #include "be_visitor_ami_pre_proc.h" #include "be_visitor_amh_pre_proc.h" +#include "be_visitor_ccm_pre_proc.h" #include "be_visitor_context.h" #include "be_root.h" #include "be_extern.h" @@ -110,8 +111,7 @@ BE_produce (void) // Context information for the visitor root. be_visitor_context ctx; - // Configure the CodeGen object with the strategy to generate the visitors - // that can produce interpretive or compiled marshaling stubs and skeletons. + // Configure the CodeGen object with the strategy to generate the visitors. tao_cg->config_visitor_factory (); // Get the root node and narrow it down to be the back-end root node. @@ -126,9 +126,21 @@ BE_produce (void) BE_abort (); } + // Make a pass over the AST and introduce + // CCM specific nodes. + be_visitor_ccm_pre_proc ccm_preproc_visitor (&ctx); + + if (root->accept (&ccm_preproc_visitor) == -1) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_produce - " + "CCM preprocessing for Root failed\n")); + BE_abort (); + } + if (be_global->ami_call_back () == I_TRUE) { - // Make a first pass over the AST and introduce + // Make a pass over the AST and introduce // AMI specific interfaces, methods and valuetypes. be_visitor_ami_pre_proc ami_preproc_visitor (&ctx); @@ -136,14 +148,14 @@ BE_produce (void) { ACE_ERROR ((LM_ERROR, "(%N:%l) be_produce - " - "client header for Root failed\n")); + "AMI preprocessing for Root failed\n")); BE_abort (); } } if (be_global->gen_amh_classes () == I_TRUE) { - // Make a first pass over the AST and introduce + // Make a pass over the AST and introduce // AMH specific code be_visitor_amh_pre_proc amh_pre_proc_visitor (&ctx); @@ -151,122 +163,107 @@ BE_produce (void) { ACE_ERROR ((LM_ERROR, "(%N:%l) be_produce - " - "client header for Root failed\n")); + "AMH preprocessing for Root failed\n")); BE_abort (); } } - // Code generation involves six steps because of the six files that we - // generate. - - { - // (1) Generate client header, - // instantiate a visitor context, and set the codegen state - ctx.state (TAO_CodeGen::TAO_ROOT_CH); - - // Get a root visitor. - be_visitor_root_ch root_ch_visitor (&ctx); - - // Generate code for the client header - if (root->accept (&root_ch_visitor) == -1) - { - ACE_ERROR ((LM_ERROR, - "(%N:%l) be_produce - " - "client header for Root failed\n")); - BE_abort (); - } - } - - { - // (2) Generate client inline and - // set the context information. - ctx.reset (); - ctx.state (TAO_CodeGen::TAO_ROOT_CI); - - // Create a visitor. - be_visitor_root_ci root_ci_visitor (&ctx); - - // Generate code for the client inline file. - if (root->accept (&root_ci_visitor) == -1) - { - ACE_ERROR ((LM_ERROR, - "(%N:%l) be_produce - " - "client inline for Root failed\n")); - BE_abort (); - } - } - - { - // (3) Generate client stubs. - ctx.reset (); - ctx.state (TAO_CodeGen::TAO_ROOT_CS); - - // Create a visitor. - be_visitor_root_cs root_cs_visitor (&ctx); - - // Generate code for the client stubs. - if (root->accept (&root_cs_visitor) == -1) - { - ACE_ERROR ((LM_ERROR, - "(%N:%l) be_produce - " - "client stubs for Root failed\n")); - BE_abort (); - } - } - - { + // (1) Generate client header, + // instantiate a visitor context, and set the codegen state + ctx.state (TAO_CodeGen::TAO_ROOT_CH); + + // Get a root visitor. + be_visitor_root_ch root_ch_visitor (&ctx); + + // Generate code for the client header + if (root->accept (&root_ch_visitor) == -1) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_produce - " + "client header for Root failed\n")); + BE_abort (); + } + + // (2) Generate client inline and + // set the context information. + ctx.reset (); + ctx.state (TAO_CodeGen::TAO_ROOT_CI); + + // Create a visitor. + be_visitor_root_ci root_ci_visitor (&ctx); + + // Generate code for the client inline file. + if (root->accept (&root_ci_visitor) == -1) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_produce - " + "client inline for Root failed\n")); + BE_abort (); + } + + // (3) Generate client stubs. + ctx.reset (); + ctx.state (TAO_CodeGen::TAO_ROOT_CS); + + // Create a visitor. + be_visitor_root_cs root_cs_visitor (&ctx); + + // Generate code for the client stubs. + if (root->accept (&root_cs_visitor) == -1) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_produce - " + "client stubs for Root failed\n")); + BE_abort (); + } + // (4) Generate server header. - ctx.reset (); - ctx.state (TAO_CodeGen::TAO_ROOT_SH); - - // Create a visitor. - be_visitor_root_sh root_sh_visitor (&ctx); - - // Generate code for the server header file. - if (root->accept (&root_sh_visitor) == -1) - { - ACE_ERROR ((LM_ERROR, - "(%N:%l) be_produce - " - "server header for Root failed\n")); - BE_abort (); - } - } - - { - // (5) Generate server inline. - ctx.reset (); - ctx.state (TAO_CodeGen::TAO_ROOT_SI); - - // Create a visitor. - be_visitor_root_si root_si_visitor (&ctx); - - // Generate code for the server inline file. - if (root->accept (&root_si_visitor) == -1) - { - ACE_ERROR ((LM_ERROR, - "(%N:%l) be_produce - " - "server inline for Root failed\n")); - BE_abort (); - } - } - - { - // (6) Generate server skeletons - ctx.reset (); - ctx.state (TAO_CodeGen::TAO_ROOT_SS); - - // Create a visitor. - be_visitor_root_ss root_ss_visitor (&ctx); - - // Generate code for the server skeletons. - if (root->accept (&root_ss_visitor) == -1) - { - ACE_ERROR ((LM_ERROR, - "(%N:%l) be_produce - " - "server skeletons for Root failed\n")); - BE_abort (); - } - } + ctx.reset (); + ctx.state (TAO_CodeGen::TAO_ROOT_SH); + + // Create a visitor. + be_visitor_root_sh root_sh_visitor (&ctx); + + // Generate code for the server header file. + if (root->accept (&root_sh_visitor) == -1) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_produce - " + "server header for Root failed\n")); + BE_abort (); + } + + // (5) Generate server inline. + ctx.reset (); + ctx.state (TAO_CodeGen::TAO_ROOT_SI); + + // Create a visitor. + be_visitor_root_si root_si_visitor (&ctx); + + // Generate code for the server inline file. + if (root->accept (&root_si_visitor) == -1) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_produce - " + "server inline for Root failed\n")); + BE_abort (); + } + + // (6) Generate server skeletons + ctx.reset (); + ctx.state (TAO_CodeGen::TAO_ROOT_SS); + + // Create a visitor. + be_visitor_root_ss root_ss_visitor (&ctx); + + // Generate code for the server skeletons. + if (root->accept (&root_ss_visitor) == -1) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_produce - " + "server skeletons for Root failed\n")); + BE_abort (); + } // (7) Generated server template header. if (be_global->gen_tie_classes ()) diff --git a/TAO/TAO_IDL/be/be_scope.cpp b/TAO/TAO_IDL/be/be_scope.cpp index 128ae41716d..02b827c3d8c 100644 --- a/TAO/TAO_IDL/be/be_scope.cpp +++ b/TAO/TAO_IDL/be/be_scope.cpp @@ -3,6 +3,7 @@ // #include "be_scope.h" #include "be_valuetype.h" +#include "be_eventtype.h" #include "be_component.h" #include "be_home.h" #include "be_module.h" @@ -60,6 +61,8 @@ be_scope::decl (void) return be_interface::narrow_from_scope (this); case AST_Decl::NT_valuetype: return be_valuetype::narrow_from_scope (this); + case AST_Decl::NT_eventtype: + return be_eventtype::narrow_from_scope (this); case AST_Decl::NT_component: return be_component::narrow_from_scope (this); case AST_Decl::NT_home: diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp index ec64b202fb6..c266c13a18b 100644 --- a/TAO/TAO_IDL/be/be_structure.cpp +++ b/TAO/TAO_IDL/be/be_structure.cpp @@ -67,6 +67,9 @@ be_structure::gen_var_defn (char *) // Depending upon the data type, there are some differences which // we account for here. + *ch << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Start with whatever was our current indent level. *ch << "class " << be_global->stub_export_macro () << " " << namebuf << be_nl; @@ -99,35 +102,35 @@ be_structure::gen_var_defn (char *) << " *);" << be_nl; // Assignment from _var. - *ch << namebuf << " &operator= (const " << namebuf << " &);" << be_nl; + *ch << namebuf << " &operator= (const " << namebuf << " &);"; // Fixed-size types only. if (this->size_type () == AST_Type::FIXED) { - *ch << "// Fixed-size types only." << be_nl; + *ch << be_nl << be_nl << "// Fixed-size types only." << be_nl; *ch << namebuf << " &operator= (const " << this->local_name () << " &);" << be_nl; } // Arrow operator. - *ch << this->local_name () << " *operator-> (void);" << be_nl; + *ch << be_nl << this->local_name () << " *operator-> (void);" << be_nl; *ch << "const " << this->local_name () - << " *operator-> (void) const;" << be_nl; - *ch << be_nl; + << " *operator-> (void) const;" << be_nl << be_nl; // Other extra types (cast operators, [] operator, and others). *ch << "operator const " << this->local_name () << " &() const;" << be_nl; *ch << "operator " << this->local_name () << " &();" << be_nl; - *ch << "operator " << this->local_name () << " &() const;" << be_nl; + *ch << "operator " << this->local_name () << " &() const;"; if (this->size_type () == AST_Type::VARIABLE) { - *ch << "// Variable-size types only." << be_nl; + *ch << be_nl << be_nl + << "// Variable-size types only." << be_nl; *ch << "operator " << this->local_name () - << " *&();" << be_nl; + << " *&();"; } - *ch << be_nl; + *ch << be_nl << be_nl; *ch << "// in, inout, out, _retn " << be_nl; // The return types of in, out, inout, and _retn are based on the @@ -154,7 +157,7 @@ be_structure::gen_var_defn (char *) // Generate the private section. *ch << "private:" << be_idt_nl; *ch << this->local_name () << " *ptr_;" << be_uidt_nl; - *ch << "};" << be_nl << be_nl; + *ch << "};"; return 0; } @@ -187,6 +190,9 @@ be_structure::gen_var_impl (char *, ci = tao_cg->client_inline (); + *ci << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *ci << "// *************************************************************" << be_nl; *ci << "// Inline operations for class " << fname << be_nl; @@ -196,7 +202,7 @@ be_structure::gen_var_impl (char *, // Default constructor. *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname - << " (void) // default constructor" << be_nl; + << " (void)" << be_nl; *ci << " " << ": ptr_ (0)" << be_nl; *ci << "{}" << be_nl << be_nl; @@ -210,19 +216,23 @@ be_structure::gen_var_impl (char *, // Copy constructor. *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << " (const ::" << fname - << " &p) // copy constructor" << be_nl; + << " &p)" << be_nl; *ci << "{" << be_idt_nl; - *ci << "if (p.ptr_)" << be_nl; - *ci << " ACE_NEW (this->ptr_, " << "::" << this->name () - << " (*p.ptr_));" << be_nl; - *ci << "else" << be_nl; - *ci << " this->ptr_ = 0;" << be_uidt_nl; + *ci << "if (p.ptr_)" << be_idt_nl + << "{" << be_idt_nl; + *ci << "ACE_NEW (this->ptr_, " << "::" << this->name () + << " (*p.ptr_));" << be_uidt_nl + << "}" << be_uidt_nl; + *ci << "else" << be_idt_nl + << "{" << be_idt_nl; + *ci << "this->ptr_ = 0;" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl; *ci << "}" << be_nl << be_nl; // Fixed-size types only. if (this->size_type () == AST_Type::FIXED) { - *ci << "// fixed-size types only" << be_nl; + *ci << "// Fixed-size types only." << be_nl; *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << " (const " << "::" << this->name () << " &p)" << be_nl; @@ -234,13 +244,14 @@ be_structure::gen_var_impl (char *, // Destructor. *ci << "ACE_INLINE" << be_nl; - *ci << fname << "::~" << lname << " (void) // destructor" << be_nl; + *ci << fname << "::~" << lname << " (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "delete this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; // Assignment operator from a pointer. - *ci << "ACE_INLINE " << fname << " &" << be_nl; + *ci << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; *ci << fname << "::operator= (" << this->local_name () << " *_tao_struct_var)" << be_nl; *ci << "{" << be_idt_nl; @@ -250,7 +261,8 @@ be_structure::gen_var_impl (char *, *ci << "}" << be_nl << be_nl; // Assignment operator from _var. - *ci << "ACE_INLINE ::" << fname << " &" << be_nl + *ci << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl << fname << "::operator= (const ::" << fname << " &_tao_struct_var)" << be_nl << "{" << be_idt_nl @@ -340,7 +352,7 @@ be_structure::gen_var_impl (char *, // Variable-size types only. if (this->size_type () == AST_Type::VARIABLE) { - *ci << "// variable-size types only" << be_nl; + *ci << "// Variable-size types only." << be_nl; *ci << "ACE_INLINE" << be_nl; *ci << fname << "::operator " << "::" << this->name () << " *&() // cast " << be_nl; @@ -365,7 +377,7 @@ be_structure::gen_var_impl (char *, // The out is handled differently based on our size type. if (this->size_type () == AST_Type::VARIABLE) { - *ci << "// mapping for variable size " << be_nl; + *ci << "// Mapping for variable size." << be_nl; *ci << "ACE_INLINE " << "::" << this->name () << " *&" << be_nl; *ci << fname << "::out (void)" << be_nl; *ci << "{" << be_idt_nl; @@ -404,7 +416,7 @@ be_structure::gen_var_impl (char *, *ci << fname << "::ptr (void) const" << be_nl; *ci << "{" << be_idt_nl; *ci << "return this->ptr_;" << be_uidt_nl; - *ci << "}" << be_nl << be_nl; + *ci << "}"; return 0; } @@ -429,6 +441,9 @@ be_structure::gen_out_defn (char *) // Generate the out definition (always in the client header). + *ch << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *ch << "class " << be_global->stub_export_macro () << " " << namebuf << be_nl; *ch << "{" << be_nl; @@ -470,8 +485,8 @@ be_structure::gen_out_defn (char *) *ch << "// Assignment from T_var not allowed." << be_nl; *ch << "void operator= (const " << this->local_name () << "_var &);" << be_uidt_nl; + *ch << "};"; - *ch << "};" << be_nl << be_nl; return 0; } @@ -504,6 +519,9 @@ be_structure::gen_out_impl (char *, // Generate the var implementation in the inline file. + *ci << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *ci << "// *************************************************************" << be_nl; *ci << "// Inline operations for class " << fname << be_nl; @@ -523,7 +541,7 @@ be_structure::gen_out_impl (char *, // Constructor from _var &. *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << " (" << this->local_name () - << "_var &p) // constructor from _var" << be_nl; + << "_var &p)" << be_nl; *ci << " : ptr_ (p.out ())" << be_nl; *ci << "{" << be_idt_nl; *ci << "delete this->ptr_;" << be_nl; @@ -533,12 +551,13 @@ be_structure::gen_out_impl (char *, // Copy constructor. *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << " (const ::" << fname - << " &p) // copy constructor" << be_nl; + << " &p)" << be_nl; *ci << " : ptr_ (ACE_const_cast (" << lname << "&, p).ptr_)" << be_nl; *ci << "{}" << be_nl << be_nl; // assignment operator from _out &. - *ci << "ACE_INLINE " << fname << " &" << be_nl; + *ci << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; *ci << fname << "::operator= (const ::" << fname << " &p)" << be_nl; *ci << "{" << be_idt_nl; @@ -549,7 +568,8 @@ be_structure::gen_out_impl (char *, // Assignment from _var is not allowed by a private declaration. // Assignment operator from pointer. - *ci << "ACE_INLINE " << fname << " &" << be_nl; + *ci << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; *ci << fname << "::operator= (" << this->local_name () << " *_tao_struct_out)" << be_nl; *ci << "{" << be_idt_nl; *ci << "this->ptr_ = _tao_struct_out;" << be_nl; @@ -576,7 +596,7 @@ be_structure::gen_out_impl (char *, *ci << fname << "::operator-> (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "return this->ptr_;" << be_uidt_nl; - *ci << "}" << be_nl << be_nl; + *ci << "}"; return 0; } @@ -596,6 +616,12 @@ be_structure::accept (be_visitor *visitor) return visitor->visit_structure (this); } +AST_Field * +be_structure::be_add_field (AST_Field *f) +{ + return this->fe_add_field (f); +} + // Narrowing. IMPL_NARROW_METHODS3 (be_structure, AST_Structure, be_scope, be_type) IMPL_NARROW_FROM_DECL (be_structure) diff --git a/TAO/TAO_IDL/be/be_structure_fwd.cpp b/TAO/TAO_IDL/be/be_structure_fwd.cpp index 872eb2f094a..94e8a173343 100644 --- a/TAO/TAO_IDL/be/be_structure_fwd.cpp +++ b/TAO/TAO_IDL/be/be_structure_fwd.cpp @@ -28,10 +28,12 @@ be_structure_fwd::be_structure_fwd (void) { } -be_structure_fwd::be_structure_fwd (UTL_ScopedName *n) +be_structure_fwd::be_structure_fwd (AST_Structure *dummy, + UTL_ScopedName *n) : be_type (AST_Decl::NT_struct_fwd, n), - AST_StructureFwd (n), + AST_StructureFwd (dummy, + n), AST_Type (AST_Decl::NT_struct_fwd, n), AST_Decl (AST_Decl::NT_struct_fwd, diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp index 49c723372f9..24e76c21aae 100644 --- a/TAO/TAO_IDL/be/be_union.cpp +++ b/TAO/TAO_IDL/be/be_union.cpp @@ -81,7 +81,11 @@ be_union::gen_var_defn (char *) // Depending upon the data type, there are some differences which we account // for over here. - *ch << "class " << be_global->stub_export_macro () + *ch << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *ch << be_nl << be_nl + << "class " << be_global->stub_export_macro () << " " << namebuf << be_nl; *ch << "{" << be_nl; *ch << "public:" << be_idt_nl; @@ -167,7 +171,7 @@ be_union::gen_var_defn (char *) // Generate the private section *ch << "private:" << be_idt_nl; *ch << this->local_name () << " *ptr_;" << be_uidt_nl; - *ch << "};" << be_nl << be_nl; + *ch << "};"; return 0; } @@ -203,6 +207,9 @@ be_union::gen_var_impl (char *, ci = tao_cg->client_inline (); + *ci << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *ci << "// *************************************************************" << be_nl; *ci << "// Inline operations for class " << fname << be_nl; @@ -212,7 +219,7 @@ be_union::gen_var_impl (char *, // Default constructor. *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << - " (void) // default constructor" << be_nl; + " (void)" << be_nl; *ci << " " << ": ptr_ (0)" << be_nl; *ci << "{}" << be_nl << be_nl; @@ -226,19 +233,23 @@ be_union::gen_var_impl (char *, // Copy constructor. *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << " (const ::" << fname - << " &p) // copy constructor" << be_nl; + << " &p)" << be_nl; *ci << "{" << be_idt_nl; - *ci << "if (p.ptr_)" << be_nl; - *ci << " ACE_NEW (this->ptr_, ::" << this->name () - << " (*p.ptr_));" << be_nl; - *ci << "else" << be_nl; - *ci << " this->ptr_ = 0;" << be_uidt_nl; + *ci << "if (p.ptr_)" << be_idt_nl + << "{" << be_idt_nl; + *ci << "ACE_NEW (this->ptr_, ::" << this->name () + << " (*p.ptr_));" << be_uidt_nl + << "}" << be_uidt_nl; + *ci << "else" << be_idt_nl + << "{" << be_idt_nl; + *ci << "this->ptr_ = 0;" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl; *ci << "}" << be_nl << be_nl; // Fixed-size types only. if (this->size_type () == AST_Type::FIXED) { - *ci << "// fixed-size types only" << be_nl; + *ci << "// Fixed-size types only." << be_nl; *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << " (const ::" << this->name () << " &p)" << be_nl; @@ -250,13 +261,14 @@ be_union::gen_var_impl (char *, // Destructor. *ci << "ACE_INLINE" << be_nl; - *ci << fname << "::~" << lname << " (void) // destructor" << be_nl; + *ci << fname << "::~" << lname << " (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "delete this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; // Assignment operator from a pointer. - *ci << "ACE_INLINE ::" << fname << " &" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl; *ci << fname << "::operator= (" << this->local_name () << " *_tao_union_var)" << be_nl; *ci << "{" << be_idt_nl; @@ -266,7 +278,8 @@ be_union::gen_var_impl (char *, *ci << "}" << be_nl << be_nl; // Assignment operator from _var. - *ci << "ACE_INLINE ::" << fname << " &" << be_nl + *ci << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl << fname << "::operator= (const ::" << fname << " &_tao_union_var)" << be_nl << "{" << be_idt_nl @@ -300,8 +313,9 @@ be_union::gen_var_impl (char *, // Fixed-size types only. if (this->size_type () == AST_Type::FIXED) { - *ci << "// fixed-size types only" << be_nl; - *ci << "ACE_INLINE ::" << fname << " &" << be_nl; + *ci << "// Fixed-size types only." << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl; *ci << fname << "::operator= (const ::" << this->name () << " &_tao_union_var)" << be_nl; *ci << "{" << be_idt_nl; @@ -319,34 +333,36 @@ be_union::gen_var_impl (char *, } // Two arrow operators. - *ci << "ACE_INLINE const ::" << this->name () << " *" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "const ::" << this->name () << " *" << be_nl; *ci << fname << "::operator-> (void) const" << be_nl; *ci << "{" << be_idt_nl; *ci << "return this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; - *ci << "ACE_INLINE ::" << this->name () << " *" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << " *" << be_nl; *ci << fname << "::operator-> (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "return this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; // Other extra methods - 3 cast operator (). - *ci << "ACE_INLINE " << be_nl; + *ci << "ACE_INLINE" << be_nl; *ci << fname << "::operator const ::" << this->name () << " &() const // cast" << be_nl; *ci << "{" << be_idt_nl; *ci << "return *this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; - *ci << "ACE_INLINE " << be_nl; + *ci << "ACE_INLINE" << be_nl; *ci << fname << "::operator ::" << this->name () << " &() // cast " << be_nl; *ci << "{" << be_idt_nl; *ci << "return *this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; - *ci << "ACE_INLINE " << be_nl; + *ci << "ACE_INLINE" << be_nl; *ci << fname << "::operator ::" << this->name () << " &() const// cast " << be_nl; *ci << "{" << be_idt_nl; @@ -356,7 +372,7 @@ be_union::gen_var_impl (char *, // Variable-size types only. if (this->size_type () == AST_Type::VARIABLE) { - *ci << "// variable-size types only" << be_nl; + *ci << "// Variable-size types only." << be_nl; *ci << "ACE_INLINE" << be_nl; *ci << fname << "::operator ::" << this->name () << " *&() // cast " << be_nl; @@ -366,13 +382,15 @@ be_union::gen_var_impl (char *, } // in, inout, out, _retn, and ptr. - *ci << "ACE_INLINE const ::" << this->name () << " &" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "const ::" << this->name () << " &" << be_nl; *ci << fname << "::in (void) const" << be_nl; *ci << "{" << be_idt_nl; *ci << "return *this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; - *ci << "ACE_INLINE ::" << this->name () << " &" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << " &" << be_nl; *ci << fname << "::inout (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "return *this->ptr_;" << be_uidt_nl; @@ -381,8 +399,9 @@ be_union::gen_var_impl (char *, // The out and _retn are handled differently based on our size type. if (this->size_type () == AST_Type::VARIABLE) { - *ci << "// mapping for variable size " << be_nl; - *ci << "ACE_INLINE ::" << this->name () << " *&" << be_nl; + *ci << "// Mapping for variable size." << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << " *&" << be_nl; *ci << fname << "::out (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "delete this->ptr_;" << be_nl; @@ -391,7 +410,8 @@ be_union::gen_var_impl (char *, *ci << "}\n\n"; ci->indent (); - *ci << "ACE_INLINE ::" << this->name () << " *" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << " *" << be_nl; *ci << fname << "::_retn (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "::" << this->name () << " *tmp = this->ptr_;" << be_nl; @@ -402,14 +422,16 @@ be_union::gen_var_impl (char *, } else { - *ci << "// mapping for fixed size " << be_nl; - *ci << "ACE_INLINE ::" << this->name () << " &" << be_nl; + *ci << "// Mapping for fixed size. " << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << " &" << be_nl; *ci << fname << "::out (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "return *this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; - *ci << "ACE_INLINE ::" << this->name () << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << be_nl; *ci << fname << "::_retn (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "return *this->ptr_;" << be_uidt_nl; @@ -417,11 +439,12 @@ be_union::gen_var_impl (char *, } // The additional ptr () member function. - *ci << "ACE_INLINE ::" << this->name () << " *" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << " *" << be_nl; *ci << fname << "::ptr (void) const" << be_nl; *ci << "{" << be_idt_nl; *ci << "return this->ptr_;" << be_uidt_nl; - *ci << "}" << be_nl << be_nl; + *ci << "}"; return 0; } @@ -448,7 +471,11 @@ be_union::gen_out_defn (char *) // Generate the out definition (always in the client header). - *ch << "class " << be_global->stub_export_macro () + *ch << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *ch << be_nl << be_nl + << "class " << be_global->stub_export_macro () << " " << namebuf << be_nl; *ch << "{" << be_nl; *ch << "public:" << be_idt_nl; @@ -489,7 +516,7 @@ be_union::gen_out_defn (char *) *ch << "// assignment from T_var not allowed." << be_nl; *ch << "void operator= (const " << this->local_name () << "_var &);" << be_uidt_nl; - *ch << "};" << be_nl << be_nl; + *ch << "};"; return 0; } @@ -525,6 +552,9 @@ be_union::gen_out_impl (char *, // Generate the var implementation in the inline file. + *ci << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *ci << "// *************************************************************" << be_nl; *ci << "// Inline operations for class " << fname << be_nl; @@ -543,7 +573,7 @@ be_union::gen_out_impl (char *, // Constructor from _var &. *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << " (" << this->local_name () - << "_var &p) // constructor from _var" << be_nl; + << "_var &p)" << be_nl; *ci << " : ptr_ (p.out ())" << be_nl; *ci << "{" << be_idt_nl; *ci << "delete this->ptr_;" << be_nl; @@ -553,12 +583,13 @@ be_union::gen_out_impl (char *, // Copy constructor. *ci << "ACE_INLINE" << be_nl; *ci << fname << "::" << lname << " (const ::" << fname - << " &p) // copy constructor" << be_nl; + << " &p)" << be_nl; *ci << " : ptr_ (ACE_const_cast (" << lname << "&, p).ptr_)" << be_nl; *ci << "{}" << be_nl << be_nl; // Assignment operator from _out &. - *ci << "ACE_INLINE ::" << fname << " &" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl; *ci << fname << "::operator= (const ::" << fname << " &p)" << be_nl; *ci << "{" << be_idt_nl; @@ -569,7 +600,8 @@ be_union::gen_out_impl (char *, // Assignment from _var is not allowed by a private declaration. // Assignment operator from pointer. - *ci << "ACE_INLINE ::" << fname << " &" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl; *ci << fname << "::operator= (" << this->local_name () << " *_tao_union_out)" << be_nl; *ci << "{" << be_idt_nl; @@ -578,7 +610,7 @@ be_union::gen_out_impl (char *, *ci << "}" << be_nl << be_nl; // Other extra methods - cast operator (). - *ci << "ACE_INLINE " << be_nl; + *ci << "ACE_INLINE" << be_nl; *ci << fname << "::operator ::" << this->name () << " *&() // cast" << be_nl; *ci << "{" << be_idt_nl; @@ -586,18 +618,20 @@ be_union::gen_out_impl (char *, *ci << "}" << be_nl << be_nl; // ptr function. - *ci << "ACE_INLINE ::" << this->name () << " *&" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << " *&" << be_nl; *ci << fname << "::ptr (void) // ptr" << be_nl; *ci << "{" << be_idt_nl; *ci << "return this->ptr_;" << be_uidt_nl; *ci << "}" << be_nl << be_nl; // operator -> - *ci << "ACE_INLINE ::" << this->name () << " *" << be_nl; + *ci << "ACE_INLINE" << be_nl + << "::" << this->name () << " *" << be_nl; *ci << fname << "::operator-> (void)" << be_nl; *ci << "{" << be_idt_nl; *ci << "return this->ptr_;" << be_uidt_nl; - *ci << "}" << be_nl << be_nl; + *ci << "}"; return 0; } diff --git a/TAO/TAO_IDL/be/be_union_fwd.cpp b/TAO/TAO_IDL/be/be_union_fwd.cpp index 0bdcf6ac257..5ec01dd1592 100644 --- a/TAO/TAO_IDL/be/be_union_fwd.cpp +++ b/TAO/TAO_IDL/be/be_union_fwd.cpp @@ -19,6 +19,7 @@ #include "be_union_fwd.h" #include "be_visitor.h" +#include "ast_union.h" ACE_RCSID (be, be_union_fwd, @@ -28,10 +29,14 @@ be_union_fwd::be_union_fwd (void) { } -be_union_fwd::be_union_fwd (UTL_ScopedName *n) - : be_type (AST_Decl::NT_union_fwd, - n), - AST_UnionFwd (n), +be_union_fwd::be_union_fwd (AST_Union *dummy, + UTL_ScopedName *n) + : be_structure_fwd (dummy, + n), + AST_UnionFwd (dummy, + n), + AST_StructureFwd (dummy, + n), AST_Type (AST_Decl::NT_union_fwd, n), AST_Decl (AST_Decl::NT_union_fwd, diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp index e77664e03b5..50a3662beff 100644 --- a/TAO/TAO_IDL/be/be_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_valuetype.cpp @@ -18,7 +18,6 @@ // // ============================================================================ - #include "be_valuetype.h" #include "be_visitor.h" #include "be_extern.h" @@ -178,7 +177,7 @@ be_valuetype::gen_var_defn (char *local_name) TAO_OutStream *ch = tao_cg->client_header (); - *ch << "// TAO_IDL - Generated from" << be_nl + *ch << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Generate the var definition (always in the client header). @@ -246,7 +245,7 @@ be_valuetype::gen_var_defn (char *local_name) *ch << "private:" << be_idt_nl; *ch << local_name << "* ptr_;" << be_uidt_nl; - *ch << "};" << be_nl << be_nl; + *ch << "};"; return 0; } @@ -295,7 +294,7 @@ be_valuetype::gen_var_impl (char *local_name, // Depending upon the data type, there are some differences which we account // for over here. - *cs << "// TAO_IDL - Generated from" << be_nl + *cs << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *cs << "// *************************************************************" @@ -464,7 +463,7 @@ be_valuetype::gen_var_impl (char *local_name, << ")" << be_uidt_nl << "{" << be_idt_nl << "CORBA::remove_ref (p);" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -487,7 +486,7 @@ be_valuetype::gen_out_defn (char *) ch = tao_cg->client_header (); - *ch << "// TAO_IDL - Generated from" << be_nl + *ch << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Generate the out definition (always in the client header). @@ -531,7 +530,7 @@ be_valuetype::gen_out_defn (char *) *ch << be_uidt_nl; *ch << "private:" << be_idt_nl; *ch << this->local_name () << "* &ptr_;" << be_uidt_nl; - *ch << "};" << be_nl << be_nl; + *ch << "};"; return 0; } @@ -565,7 +564,7 @@ be_valuetype::gen_out_impl (char *, cs = tao_cg->client_stubs (); - *cs << "// TAO_IDL - Generated from" << be_nl + *cs << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Generate the var implementation in the inline file @@ -665,8 +664,7 @@ be_valuetype::gen_out_impl (char *, *cs << "}" << be_nl << be_nl; - *cs << "// *************************************************************" - << be_nl << be_nl; + *cs << "// *************************************************************"; return 0; } @@ -679,7 +677,7 @@ be_valuetype::gen_helper_header (char*, os = tao_cg->client_header (); - *os << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; @@ -693,7 +691,7 @@ be_valuetype::gen_helper_header (char*, *os << be_uidt_nl << "}" << be_nl - << "TAO_NAMESPACE_CLOSE" << be_nl << be_nl; + << "TAO_NAMESPACE_CLOSE"; return 0; } @@ -710,10 +708,10 @@ be_valuetype::gen_helper_inline (char*, // is not getting generated... Actually this is a much bigger // problem. Just hacking it up for the timebeing.. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - *os << "#if defined (__ACE_INLINE__)" << be_nl + *os << "#if defined (__ACE_INLINE__)" << be_nl << be_nl << "TAO_NAMESPACE CORBA" << be_nl << "{" << be_idt_nl @@ -723,8 +721,8 @@ be_valuetype::gen_helper_inline (char*, << this->full_name () << " *);" << be_uidt_nl << "}" << be_nl - << "TAO_NAMESPACE_CLOSE" << be_nl - << "#endif /*__ACE_INLINE__*/"<< be_nl; + << "TAO_NAMESPACE_CLOSE" << be_nl << be_nl + << "#endif /*__ACE_INLINE__*/"; return 0; } @@ -738,7 +736,7 @@ be_valuetype::gen_helper_stubs (char* , os = tao_cg->client_stubs (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "void" << be_nl @@ -757,7 +755,7 @@ be_valuetype::gen_helper_stubs (char* , << "{" << be_idt_nl << "vt->_remove_ref ();" << be_uidt_nl << "}" << be_uidt << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } diff --git a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp index b62641c922b..e936894c802 100644 --- a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp +++ b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp @@ -42,7 +42,9 @@ be_valuetype_fwd::be_valuetype_fwd (AST_Interface *dummy, AST_InterfaceFwd (dummy, n), AST_Decl (AST_Decl::NT_valuetype_fwd, - n) + n), + COMMON_Base (dummy->is_local (), + dummy->is_abstract ()) { } diff --git a/TAO/TAO_IDL/be/be_visitor.cpp b/TAO/TAO_IDL/be/be_visitor.cpp index b25f89f7914..d0864af1986 100644 --- a/TAO/TAO_IDL/be/be_visitor.cpp +++ b/TAO/TAO_IDL/be/be_visitor.cpp @@ -82,6 +82,16 @@ int be_visitor::visit_valuetype_fwd (be_valuetype_fwd *) return 0; } +int be_visitor::visit_eventtype (be_eventtype *) +{ + return 0; +} + +int be_visitor::visit_eventtype_fwd (be_eventtype_fwd *) +{ + return 0; +} + int be_visitor::visit_component (be_component *) { return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument.cpp index 1ffec9f5654..870b7d999fd 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument.cpp @@ -26,6 +26,8 @@ #include "be_enum.h" #include "be_interface.h" #include "be_interface_fwd.h" +#include "be_component.h" +#include "be_component_fwd.h" #include "be_native.h" #include "be_predefined_type.h" #include "be_string.h" @@ -35,6 +37,9 @@ #include "be_sequence.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" +#include "be_eventtype.h" +#include "be_eventtype_fwd.h" +#include "be_home.h" #include "be_operation.h" #include "be_helper.h" #include "utl_identifier.h" diff --git a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp index 33f70ae17a0..45384a20aee 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp @@ -149,6 +149,16 @@ int be_visitor_args_arglist::visit_interface_fwd (be_interface_fwd *node) return 0; } +int be_visitor_args_arglist::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int be_visitor_args_arglist::visit_component_fwd (be_component_fwd *node) +{ + return this->visit_interface_fwd (node); +} + int be_visitor_args_arglist::visit_native (be_native *node) { TAO_OutStream *os = this->ctx_->stream (); @@ -400,3 +410,23 @@ int be_visitor_args_arglist::visit_valuetype_fwd (be_valuetype_fwd *node) return 0; } +int be_visitor_args_arglist::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int be_visitor_args_arglist::visit_eventtype_fwd (be_eventtype_fwd *node) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_arglist::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + + 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 59672368f62..b2e49c724b3 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp @@ -778,3 +778,48 @@ int be_visitor_args_invoke_cs::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int +be_visitor_args_invoke_cs::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_invoke_cs::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_invoke_cs::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_invoke_cs::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_invoke_cs::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + + + + 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 0be2a5f206d..ccaabd5931b 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp @@ -57,7 +57,7 @@ int be_visitor_args_marshal_ss::visit_argument (be_argument *node) // Different types have different mappings when used as in/out or // inout parameters. Let this visitor deal with the type - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -65,8 +65,7 @@ int be_visitor_args_marshal_ss::visit_argument (be_argument *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - *os << "(_tao_in >> "; + *os << be_nl << "(_tao_in >> "; break; case AST_Argument::dir_OUT: break; @@ -80,8 +79,7 @@ int be_visitor_args_marshal_ss::visit_argument (be_argument *node) break; case AST_Argument::dir_INOUT: case AST_Argument::dir_OUT: - os->indent (); - *os << "(_tao_out << "; + *os << be_nl << "(_tao_out << "; break; } } @@ -788,3 +786,46 @@ int be_visitor_args_marshal_ss::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int +be_visitor_args_marshal_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_marshal_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_marshal_ss::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_marshal_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_marshal_ss::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + + diff --git a/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp index 7dea1734128..2fa4e527ac7 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/paramlist.cpp @@ -46,8 +46,6 @@ int be_visitor_args_paramlist::visit_argument (be_argument *node) // Save the argument node. this->ctx_->node (node); - os->indent (); - // We do not put "out" arguments into the arglist. if (this->direction () == AST_Argument::dir_OUT) { 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 2e8ebf3f89e..36f9eabcbcf 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 @@ -229,3 +229,45 @@ be_visitor_args_post_invoke_cs::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int +be_visitor_args_post_invoke_cs::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_post_invoke_cs::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_post_invoke_cs::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_post_invoke_cs::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_post_invoke_cs::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + 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 2c322980928..2895a96e10f 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 @@ -217,7 +217,7 @@ be_visitor_args_pre_invoke_cs::visit_predefined_type (be_predefined_type *node) if (!this->void_return_type ()) { - *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + *os << be_nl << "ACE_NEW_RETURN (" << be_idt << be_idt_nl << arg->local_name () << ".ptr ()," << be_nl << "CORBA::Any," << be_nl; @@ -237,7 +237,7 @@ be_visitor_args_pre_invoke_cs::visit_predefined_type (be_predefined_type *node) << "CORBA::Any"; } - *os << be_uidt_nl << ");" << be_uidt_nl << "\n"; + *os << be_uidt_nl << ");" << be_uidt_nl; break; default: @@ -277,7 +277,7 @@ be_visitor_args_pre_invoke_cs::visit_sequence (be_sequence *node) if (!this->void_return_type ()) { - *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + *os << be_nl << "ACE_NEW_RETURN (" << be_idt << be_idt_nl << arg->local_name () << ".ptr ()," << be_nl << bt->name () << "," << be_nl; @@ -297,7 +297,7 @@ be_visitor_args_pre_invoke_cs::visit_sequence (be_sequence *node) << bt->name (); } - *os << be_uidt_nl << ");" << be_uidt_nl << "\n"; + *os << be_uidt_nl << ");" << be_uidt_nl; break; default: @@ -340,7 +340,7 @@ be_visitor_args_pre_invoke_cs::visit_structure (be_structure *node) if (!this->void_return_type ()) { - *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + *os << be_nl << "ACE_NEW_RETURN (" << be_idt << be_idt_nl << arg->local_name () << ".ptr ()," << be_nl << bt->name () << "," << be_nl; @@ -360,7 +360,7 @@ be_visitor_args_pre_invoke_cs::visit_structure (be_structure *node) << bt->name (); } - *os << be_uidt_nl << ");" << be_uidt_nl << "\n"; + *os << be_uidt_nl << ");" << be_uidt_nl; break; default: @@ -398,7 +398,7 @@ be_visitor_args_pre_invoke_cs::visit_union (be_union *node) if (!this->void_return_type ()) { - *os << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + *os << be_nl << "ACE_NEW_RETURN (" << be_idt << be_idt_nl << arg->local_name () << ".ptr ()," << be_nl << bt->name () << "," << be_nl; @@ -418,7 +418,7 @@ be_visitor_args_pre_invoke_cs::visit_union (be_union *node) << bt->name (); } - *os << be_uidt_nl << ");" << be_uidt_nl << "\n"; + *os << be_uidt_nl << ");" << be_uidt_nl; break; default: @@ -446,3 +446,46 @@ be_visitor_args_pre_invoke_cs::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int +be_visitor_args_pre_invoke_cs::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_pre_invoke_cs::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_pre_invoke_cs::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_pre_invoke_cs::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_pre_invoke_cs::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + + 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 e4c9831a881..9896c17f4f9 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 @@ -452,3 +452,44 @@ int be_visitor_args_request_info_arglist::visit_valuetype_fwd (be_valuetype_fwd return 0; } +int +be_visitor_args_request_info_arglist::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_request_info_arglist::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_request_info_arglist::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_request_info_arglist::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_request_info_arglist::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + 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 993c3d44b18..8ba93c73b82 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 @@ -66,7 +66,7 @@ int be_visitor_args_request_info_ch::visit_argument (be_argument *node) } // As we visit each type we print out the &. - *os << " " << node->local_name () << "_;" << be_nl; + *os << " " << node->local_name () << "_;"; return 0; } @@ -450,3 +450,44 @@ int be_visitor_args_request_info_ch::visit_valuetype_fwd ( return 0; } +int +be_visitor_args_request_info_ch::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_request_info_ch::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_request_info_ch::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_request_info_ch::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_args_request_info_ch::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + 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 ea9a7062592..e99ed0cce59 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 @@ -259,3 +259,37 @@ int be_visitor_args_request_info_result::visit_typedef (be_typedef *) return 0; } + +int +be_visitor_args_request_info_result::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_request_info_result::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_request_info_result::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_request_info_result::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + + 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 049d3e7d874..abaf16de16d 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 @@ -67,7 +67,7 @@ int be_visitor_args_request_info_sh::visit_argument (be_argument *node) } // As we visit each type we print out the &. - *os <<" "<< node->local_name () << "_;" << be_nl; + *os <<" "<< node->local_name () << "_;"; return 0; } @@ -387,3 +387,36 @@ int be_visitor_args_request_info_sh::visit_valuetype_fwd ( return 0; } +int +be_visitor_args_request_info_sh::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_request_info_sh::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_request_info_sh::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_request_info_sh::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + + 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 434f4f02025..2692167cb45 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp @@ -51,6 +51,10 @@ int be_visitor_args_upcall_ss::visit_argument (be_argument *node) -1); } + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl; + // Different types have different mappings when used as in/out or // inout parameters. Let this visitor deal with the type if (bt->accept (this) == -1) @@ -574,3 +578,37 @@ int be_visitor_args_upcall_ss::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int +be_visitor_args_upcall_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_upcall_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_upcall_ss::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_upcall_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + + 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 38783a0c802..20e17732581 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp @@ -53,6 +53,10 @@ int be_visitor_args_vardecl_ss::visit_argument (be_argument *node) -1); } + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl; + // Different types have different mappings when used as in/out or // inout parameters. Let this visitor deal with the type if (bt->accept (this) == -1) @@ -86,27 +90,23 @@ int be_visitor_args_vardecl_ss::visit_array (be_array *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - *os << bt->name () << " " << arg->local_name () << ";" << be_nl << bt->name () << "_forany _tao_forany_" << arg->local_name () << " (" << be_idt << be_idt_nl << arg->local_name () << be_uidt_nl - << ");\n" << be_uidt; + << ");" << be_uidt; break; case AST_Argument::dir_OUT: - os->indent (); - if (node->size_type () == be_type::VARIABLE) { *os << bt->name () << "_var " << arg->local_name () - << ";\n\n"; + << ";"; } else { *os << bt->name () << " " << arg->local_name () - << ";\n\n"; + << ";"; } break; @@ -135,9 +135,7 @@ int be_visitor_args_vardecl_ss::visit_enum (be_enum *node) case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: case AST_Argument::dir_OUT: - os->indent (); - - *os << bt->name () << " " << arg->local_name () << ";\n"; + *os << bt->name () << " " << arg->local_name () << ";"; break; } @@ -164,16 +162,12 @@ int be_visitor_args_vardecl_ss::visit_interface (be_interface *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - - *os << bt->name () << "_var " << arg->local_name () << ";\n"; + *os << bt->name () << "_var " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - *os << bt->name () << "_var " - << arg->local_name () << ";\n"; + << arg->local_name () << ";"; break; } @@ -200,16 +194,12 @@ int be_visitor_args_vardecl_ss::visit_interface_fwd (be_interface_fwd *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - - *os << bt->name () << "_var " << arg->local_name () << ";\n"; + *os << bt->name () << "_var " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - *os << bt->name () << "_var " - << arg->local_name () << ";\n"; + << arg->local_name () << ";"; break; } @@ -237,16 +227,12 @@ int be_visitor_args_vardecl_ss::visit_valuetype (be_valuetype *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - - *os << bt->name () << "_var " << arg->local_name () << ";\n"; + *os << bt->name () << "_var " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - *os << bt->name () << "_var " - << arg->local_name () << ";\n"; + << arg->local_name () << ";"; break; } @@ -273,16 +259,12 @@ int be_visitor_args_vardecl_ss::visit_valuetype_fwd (be_valuetype_fwd *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - - *os << bt->name () << "_var " << arg->local_name () << ";\n"; + *os << bt->name () << "_var " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - *os << bt->name () << "_var " - << arg->local_name () << ";\n"; + << arg->local_name () << ";"; break; } @@ -313,16 +295,12 @@ int be_visitor_args_vardecl_ss::visit_predefined_type (be_predefined_type *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - - *os << bt->name () << " " << arg->local_name () << ";\n"; + *os << bt->name () << " " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - *os << bt->name () << "_var " - << arg->local_name () << ";\n"; + << arg->local_name () << ";"; break; } @@ -334,17 +312,12 @@ int be_visitor_args_vardecl_ss::visit_predefined_type (be_predefined_type *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - *os << bt->name () << "_var " << arg->local_name () - - << ";\n"; + << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - *os << bt->name () << "_var " - << arg->local_name () << ";\n"; + << arg->local_name () << ";"; break; } @@ -356,8 +329,6 @@ int be_visitor_args_vardecl_ss::visit_predefined_type (be_predefined_type *node) case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: case AST_Argument::dir_OUT: - os->indent (); - *os << bt->name () << " " << arg->local_name (); // @@@ (JP) This is a hack for VC7, which gets an internal @@ -369,7 +340,7 @@ int be_visitor_args_vardecl_ss::visit_predefined_type (be_predefined_type *node) *os << " = 0"; } - *os << ";\n"; + *os << ";"; break; } @@ -397,14 +368,10 @@ int be_visitor_args_vardecl_ss::visit_sequence (be_sequence *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - - *os << bt->name () << " " << arg->local_name () << ";\n"; + *os << bt->name () << " " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - *os << bt->name () << "_var " << arg->local_name () << ";" << be_nl; @@ -423,28 +390,24 @@ int be_visitor_args_vardecl_ss::visit_string (be_string *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - if (node->width () == (long) sizeof (char)) { - *os << "CORBA::String_var " << arg->local_name () << ";\n"; + *os << "CORBA::String_var " << arg->local_name () << ";"; } else { - *os << "CORBA::WString_var " << arg->local_name () << ";\n"; + *os << "CORBA::WString_var " << arg->local_name () << ";"; } break; case AST_Argument::dir_OUT: - os->indent (); - if (node->width () == (long )sizeof (char)) { - *os << "CORBA::String_var " << arg->local_name () << ";\n"; + *os << "CORBA::String_var " << arg->local_name () << ";"; } else { - *os << "CORBA::WString_var " << arg->local_name () << ";\n"; + *os << "CORBA::WString_var " << arg->local_name () << ";"; } break; @@ -472,22 +435,18 @@ int be_visitor_args_vardecl_ss::visit_structure (be_structure *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - - *os << bt->name () << " " << arg->local_name () << ";\n"; + *os << bt->name () << " " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - if (node->size_type () == be_type::VARIABLE) { *os << bt->name () << "_var " - << arg->local_name () << ";\n"; + << arg->local_name () << ";"; } else { - *os << bt->name () << " " << arg->local_name () << ";\n"; + *os << bt->name () << " " << arg->local_name () << ";"; } break; @@ -515,23 +474,19 @@ int be_visitor_args_vardecl_ss::visit_union (be_union *node) { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - os->indent (); - - *os << bt->name () << " " << arg->local_name () << ";\n"; + *os << bt->name () << " " << arg->local_name () << ";"; break; case AST_Argument::dir_OUT: - os->indent (); - if (node->size_type () == be_type::VARIABLE) { *os << bt->name () << "_var " - << arg->local_name () << ";\n"; + << arg->local_name () << ";"; } else { - *os << bt->name () << " " << arg->local_name () << ";\n"; + *os << bt->name () << " " << arg->local_name () << ";"; } break; @@ -556,3 +511,37 @@ int be_visitor_args_vardecl_ss::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int +be_visitor_args_vardecl_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_args_vardecl_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_args_vardecl_ss::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_args_vardecl_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + + 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 d91076f394f..3d5eade88a6 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 @@ -48,14 +48,15 @@ be_visitor_array_any_op_ch::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); - // generate the Any <<= and >>= operator declarations - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, const " << node->name () << "_forany &);" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, " - << node->name () << "_forany &);\n"; + << node->name () << "_forany &);"; node->cli_hdr_any_op_gen (1); return 0; 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 c5978e6a98f..23cfd490425 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 @@ -50,12 +50,10 @@ be_visitor_array_any_op_cs::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - // Any <<= and >>= operators. - os->indent (); *os << "void operator<<= (" << be_idt << be_idt_nl << "CORBA::Any &_tao_any," << be_nl << "const " << node->name () << "_forany &_tao_elem" << be_uidt_nl @@ -177,7 +175,7 @@ be_visitor_array_any_op_cs::visit_array (be_array *node) << "}" << be_nl << "ACE_ENDTRY;" << be_nl << be_nl << "return 0;" - << be_uidt_nl << "}\n\n"; + << be_uidt_nl << "}"; node->cli_stub_any_op_gen (1); return 0; 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 d3b499e53b2..6c8eef2d909 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp @@ -41,7 +41,7 @@ int be_visitor_array_ch::visit_array (be_array *node) 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 ())) + if (node->imported () || node->cli_hdr_gen ()) { return 0; } @@ -61,9 +61,8 @@ int be_visitor_array_ch::visit_array (be_array *node) -1); } - *os << be_nl << "// TAO_IDL - Generated from " << be_nl - << "// " __FILE__ << ":" << __LINE__ - << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " __FILE__ << ":" << __LINE__; // Generate the ifdefined macro. os->gen_ifdef_macro (node->flat_name ()); @@ -130,7 +129,7 @@ int be_visitor_array_ch::visit_array (be_array *node) } } - *os << "typedef "; + *os << be_nl << be_nl << "typedef "; if (bt->accept (this) == -1) { @@ -197,7 +196,7 @@ int be_visitor_array_ch::visit_array (be_array *node) -1); } - *os << ";" << be_nl << be_nl; + *os << ";"; // No _var or _out class for an anonymous (non-typedef'd) array. if (this->ctx_->tdef () != 0) @@ -226,8 +225,12 @@ int be_visitor_array_ch::visit_array (be_array *node) } else { - *os << "typedef " << node->local_name () << " " - << node->local_name () << "_out;" << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl + << "typedef " << node->local_name () << " " + << node->local_name () << "_out;"; } } @@ -240,6 +243,11 @@ int be_visitor_array_ch::visit_array (be_array *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl; + // The _alloc, _dup, copy, and free methods. If the node is nested, the // methods become static const char *storage_class = 0; @@ -288,7 +296,7 @@ int be_visitor_array_ch::visit_array (be_array *node) << "const "; *os << node->nested_type_name (scope, "_slice") << " *_tao_from" << be_uidt_nl - << ");" << be_uidt_nl; + << ");" << be_uidt; } else { @@ -319,11 +327,9 @@ int be_visitor_array_ch::visit_array (be_array *node) << "const "; *os << node->nested_type_name (scope, "_slice", "_") << " *_tao_from" << be_uidt_nl - << ");" << be_uidt_nl; + << ");" << be_uidt; } - *os << be_nl; - // Generate the endif macro. os->gen_endif (); @@ -370,7 +376,11 @@ be_visitor_array_ch::gen_var_defn (be_array *node) // Depending upon the data type, there are some differences which we account // for over here. - *os << "class " << be_global->stub_export_macro () + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () << " " << varnamebuf << be_nl; *os << "{" << be_nl; *os << "public:" << be_idt_nl; @@ -443,7 +453,7 @@ be_visitor_array_ch::gen_var_defn (be_array *node) // Generate the private section. *os << "private:" << be_idt_nl; *os << namebuf << "_slice *ptr_;" << be_uidt_nl; - *os << "};" << be_nl << be_nl; + *os << "};"; return 0; } @@ -483,8 +493,12 @@ be_visitor_array_ch::gen_out_defn (be_array *node) node->local_name ()->get_string ()); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " __FILE__ << ":" << __LINE__; + // Generate the out definition (always in the client header). - *os << "class " << be_global->stub_export_macro () + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () << " " << outnamebuf << be_nl; *os << "{" << be_nl; *os << "public:" << be_idt_nl; @@ -515,7 +529,7 @@ be_visitor_array_ch::gen_out_defn (be_array *node) *os << namebuf << "_slice *&ptr_;" << be_nl; *os << "// Assignment from T_var not allowed." << be_nl; *os << "void operator= (const " << namebuf << "_var &);" << be_uidt_nl; - *os << "};" << be_nl << be_nl; + *os << "};"; return 0; } @@ -559,7 +573,11 @@ be_visitor_array_ch::gen_forany_defn (be_array *node) // Depending upon the data type, there are some differences which we account // for over here. - *os << "class " << be_global->stub_export_macro () + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () << " " << foranyname << be_nl; *os << "{" << be_nl; *os << "public:" << be_idt_nl; @@ -577,7 +595,10 @@ be_visitor_array_ch::gen_forany_defn (be_array *node) // Destructor. *os << "~" << foranyname << " (void);" << be_nl << be_nl; - *os << "static void _tao_any_destructor (void*);" << be_nl << be_nl; + if (be_global->any_support ()) + { + *os << "static void _tao_any_destructor (void*);" << be_nl << be_nl; + } // assignment operator from a pointer to slice *os << foranyname << " &operator= (" << namebuf << "_slice *);" @@ -616,7 +637,7 @@ be_visitor_array_ch::gen_forany_defn (be_array *node) *os << "private:" << be_idt_nl; *os << namebuf << "_slice *ptr_;" << be_nl; *os << "CORBA::Boolean nocopy_;" << be_uidt_nl; - *os << "};" << be_nl << be_nl; + *os << "};"; return 0; } 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 3fb26adb236..a818510fe32 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp @@ -220,11 +220,7 @@ be_visitor_array_ci::gen_var_impl (be_array *node) } } - // Generate the var implementation in the inline file. - - os->indent (); - - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" @@ -268,7 +264,8 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "}" << be_nl << be_nl; // assignment operator - *os << "ACE_INLINE " << fname << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; *os << fname << "::operator= (" << nodename << "_slice *p)" << be_nl; *os << "{" << be_idt_nl; @@ -284,13 +281,14 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "}" << be_nl << be_nl; // assignment operator from _var - *os << "ACE_INLINE " << fname << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; *os << fname << "::operator= (const " << fname << " &p)" << be_nl; *os << "{" << be_idt_nl; *os << "if (this != &p)" << be_idt_nl; *os << "{" << be_idt_nl; - *os << nodename << "_free (this->ptr_);" << be_nl; + *os << nodename << "_free (this->ptr_);" << be_nl << be_nl; *os << "// Deep copy." << be_nl; *os << "this->ptr_ =" << be_idt_nl << nodename << "_dup (" << be_idt << be_idt_nl @@ -304,7 +302,7 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "}" << be_nl << be_nl; // other extra methods - cast operators () - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator " << nodename << "_slice * const &() const" << be_nl; *os << "{" << be_idt_nl; @@ -313,7 +311,7 @@ be_visitor_array_ci::gen_var_impl (be_array *node) if (node->size_type () == AST_Type::VARIABLE) { - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator " << nodename << "_slice *&() // cast " << be_nl; *os << "{" << be_idt_nl; @@ -322,7 +320,7 @@ be_visitor_array_ci::gen_var_impl (be_array *node) } // two operator []s instead of -> - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << "const " << nodename << "_slice &" << be_nl; *os << fname << "::operator[] (CORBA::ULong index) const" << be_nl; *os << "{" << be_nl; @@ -340,7 +338,7 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << nodename << "_slice &" << be_nl; *os << fname << "::operator[] (CORBA::ULong index)" << be_nl; *os << "{" << be_idt_nl; @@ -348,7 +346,8 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "}" << be_nl << be_nl; // copy (in case we are a sequence element) - *os << "ACE_INLINE void" << be_nl; + *os << "ACE_INLINE" << be_nl + << "void" << be_nl; *os << fname << "::copy (" << be_idt << be_idt_nl << nodename << "_slice *_tao_to," << be_nl << "const " << nodename << "_slice *_tao_from" << be_uidt_nl @@ -358,7 +357,8 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "}" << be_nl << be_nl; // in, inout, out, and _retn - *os << "ACE_INLINE const " << nodename << "_slice *" << be_nl; + *os << "ACE_INLINE" << be_nl + << "const " << nodename << "_slice *" << be_nl; *os << fname << "::in (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return ACE_const_cast (" << be_idt << be_idt_nl @@ -368,13 +368,15 @@ be_visitor_array_ci::gen_var_impl (be_array *node) << ");" << be_uidt << be_uidt_nl; *os << "}" << be_nl << be_nl; + *os << "ACE_INLINE" << be_nl; + if (node->size_type () == AST_Type::FIXED) { - *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; + *os << nodename << "_slice *" << be_nl; } else { - *os << "ACE_INLINE " << nodename << "_slice * &" << be_nl; + *os << nodename << "_slice * &" << be_nl; } *os << fname << "::inout (void)" << be_nl; @@ -382,7 +384,8 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << nodename << "_slice * &" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice * &" << be_nl; *os << fname << "::out (void)" << be_nl; *os << "{" << be_idt_nl; *os << nodename << "_free (this->ptr_);" << be_nl; @@ -390,7 +393,8 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice *" << be_nl; *os << fname << "::_retn (void)" << be_nl; *os << "{" << be_idt_nl; *os << nodename << "_slice *tmp = this->ptr_;" << be_nl; @@ -399,11 +403,12 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << "}" << be_nl << be_nl; // the additional ptr () member function - *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice *" << be_nl; *os << fname << "::ptr (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}"; return 0; } @@ -475,11 +480,7 @@ be_visitor_array_ci::gen_out_impl (be_array *node) } } - // Generate the out implementation in the inline file. - - os->indent (); - - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" @@ -515,7 +516,8 @@ be_visitor_array_ci::gen_out_impl (be_array *node) *os << "{}" << be_nl << be_nl; // assignment operator from _out & - *os << "ACE_INLINE " << fname << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; *os << fname << "::operator= (const " << fname << " &p)" << be_nl; *os << "{" << be_idt_nl; @@ -527,7 +529,8 @@ be_visitor_array_ci::gen_out_impl (be_array *node) // assignment from _var is not allowed // assignment operator from _ptr - *os << "ACE_INLINE " << fname << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; *os << fname << "::operator= (" << nodename << "_slice *p)" << be_nl; *os << "{" << be_idt_nl; @@ -536,7 +539,7 @@ be_visitor_array_ci::gen_out_impl (be_array *node) *os << "}" << be_nl << be_nl; // other extra methods - cast operator () - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator " << nodename << "_slice *&() // cast" << be_nl; *os << "{" << be_idt_nl; @@ -544,18 +547,20 @@ be_visitor_array_ci::gen_out_impl (be_array *node) *os << "}" << be_nl << be_nl; // ptr function - *os << "ACE_INLINE " << nodename << "_slice *&" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice *&" << be_nl; *os << fname << "::ptr (void) // ptr" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; // operator [] instead of -> - *os << "ACE_INLINE " << nodename << "_slice &" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice &" << be_nl; *os << fname << "::operator[] (CORBA::ULong index)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_[index];" << be_uidt_nl; - *os << "}\n\n"; + *os << "}"; return 0; } @@ -636,7 +641,7 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) os->indent (); // start with whatever was our current indent level - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" @@ -682,14 +687,15 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) // destructor *os << "ACE_INLINE" << be_nl; *os << fname << "::~" << lname << " (void)" << be_nl; - *os << "{" << be_idt_nl; - *os << "// don't do anything" << be_uidt_nl; + *os << "{" << be_nl; *os << "}" << be_nl << be_nl; // assignment operator - *os << "ACE_INLINE " << fname << " &" << be_nl; - *os << fname << "::operator= (" << nodename - << "_slice *p)" << be_nl; + *os << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; + *os << fname << "::operator= (" << be_idt << be_idt_nl + << nodename << "_slice *p" << be_uidt_nl + << ")" << be_uidt_nl; *os << "{" << be_idt_nl; *os << "// Is what we own the same that is being assigned to us?" << be_nl; @@ -703,13 +709,15 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) *os << "}" << be_nl << be_nl; // assignment operator from _forany - *os << "ACE_INLINE " << fname << " &" << be_nl; - *os << fname << "::operator= (const " << fname - << " &p)" << be_nl; + *os << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; + *os << fname << "::operator= (" << be_idt << be_idt_nl + << "const " << fname << " &p" << be_uidt_nl + << ")" << be_uidt_nl; *os << "{" << be_idt_nl; *os << "if (this != &p)" << be_idt_nl; *os << "{" << be_idt_nl; - *os << nodename << "_free (this->ptr_);" << be_nl; + *os << nodename << "_free (this->ptr_);" << be_nl << be_nl; *os << "// Deep copy." << be_nl; *os << "this->ptr_ =" << be_idt_nl << nodename << "_dup (" << be_idt << be_idt_nl @@ -724,14 +732,14 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) *os << "}" << be_nl << be_nl; // other extra methods - cast operators () - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator " << nodename << "_slice * const &() const" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator " << nodename << "_slice *&()" << be_nl; *os << "{" << be_idt_nl; @@ -739,7 +747,7 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) *os << "}" << be_nl << be_nl; // two operator []s instead of -> - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << "const " << nodename << "_slice &" << be_nl; *os << fname << "::operator[] (CORBA::ULong index) const" << be_nl; *os << "{" << be_idt_nl; @@ -759,7 +767,7 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << nodename << "_slice &" << be_nl; *os << fname << "::operator[] (CORBA::ULong index)" << be_nl; *os << "{" << be_idt_nl; @@ -767,7 +775,8 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) *os << "}" << be_nl << be_nl; // in, inout, out, and _retn - *os << "ACE_INLINE const " << nodename << "_slice *" << be_nl; + *os << "ACE_INLINE" << be_nl + << "const " << nodename << "_slice *" << be_nl; *os << fname << "::in (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return ACE_const_cast (" << be_idt << be_idt_nl @@ -776,37 +785,42 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) << ");" << be_uidt << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice *" << be_nl; *os << fname << "::inout (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << nodename << "_slice * &" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice * &" << be_nl; *os << fname << "::out (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice *" << be_nl; *os << fname << "::_retn (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; // the additional ptr () member function - *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; + *os << "ACE_INLINE" << be_nl + << nodename << "_slice *" << be_nl; *os << fname << "::ptr (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; // the additional nocopy member function - *os << "ACE_INLINE CORBA::Boolean" << be_nl; + *os << "ACE_INLINE" << be_nl + << "CORBA::Boolean" << be_nl; *os << fname << "::nocopy (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return this->nocopy_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}"; return 0; } 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 eccd4840dc7..a2825d31bec 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp @@ -106,12 +106,10 @@ int be_visitor_array_cs::visit_array (be_array *node) } } - os->indent (); - - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - if (!node->is_local ()) + if (be_global->any_support ()) { *os << "void " << fname << "_forany" << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl @@ -171,8 +169,9 @@ int be_visitor_array_cs::visit_array (be_array *node) // free method. os->indent (); *os << "void" << be_nl - << fname << "_free (" << fname - << "_slice *_tao_slice)" << be_nl; + << fname << "_free (" << be_idt << be_idt_nl + << fname << "_slice *_tao_slice" << be_uidt_nl + << ")" << be_uidt_nl; *os << "{" << be_idt_nl; *os << "delete [] _tao_slice;" << be_uidt_nl; *os << "}\n\n"; @@ -305,7 +304,7 @@ int be_visitor_array_cs::visit_array (be_array *node) *os << be_uidt_nl << "}" << be_uidt; } - *os << be_uidt_nl << "}" << be_nl << be_nl; + *os << be_uidt_nl << "}"; AST_Decl::NodeType nt = bt->node_type (); @@ -325,7 +324,7 @@ int be_visitor_array_cs::visit_array (be_array *node) } } - // If the array is an anonymous member and if its element type + // If the member's element type // is a declaration (not a reference), we must generate code for // the declaration. if (this->ctx_->alias () == 0 // Not a typedef. 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 a613a1dbaf3..a3feb2230ab 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 @@ -115,6 +115,9 @@ be_visitor_array_cdr_op_ch::visit_array (be_array *node) } } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the CDR << and >> operator declarations. *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const "; @@ -143,11 +146,11 @@ be_visitor_array_cdr_op_ch::visit_array (be_array *node) *os << parent->full_name () << "::_" << node->local_name () - << "_forany &);" << be_nl; + << "_forany &);"; } else { - *os << node->name () << "_forany &);" << be_nl; + *os << node->name () << "_forany &);"; } node->cli_hdr_cdr_op_gen (1); 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 dfcbc34cb6d..2b3bf2efd03 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 @@ -183,9 +183,13 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) // Save the array node for further use. this->ctx_->node (node); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // 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 + *os << "ACE_INLINE" << be_nl + << "CORBA::Boolean operator<< (" << be_idt << be_idt_nl << "TAO_OutputCDR &strm," << be_nl << "const " << fname << "_forany &_tao_array" << be_uidt_nl << ")" << be_uidt_nl @@ -200,13 +204,11 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) -1); } - *os << "}\n\n"; - - // Set the sub state as generating code for the input operator. - os->indent (); + *os << "}" << be_nl << be_nl; this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT); - *os << "ACE_INLINE CORBA::Boolean operator>> (" << be_idt << be_idt_nl + *os << "ACE_INLINE" << be_nl + << "CORBA::Boolean operator>> (" << be_idt << be_idt_nl << "TAO_InputCDR &strm," << be_nl << fname << "_forany &_tao_array" << be_uidt_nl << ")" << be_uidt_nl @@ -221,7 +223,7 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) -1); } - *os << "}" << be_nl << be_nl; + *os << "}"; node->cli_inline_cdr_op_gen (1); return 0; @@ -594,7 +596,8 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) *os << be_nl << "for (CORBA::ULong i" << i << " = 0; i" << i << " < " << expr->ev ()->u.ulval << " && _tao_marshal_flag; i" << i - << "++)" << be_idt_nl; + << "++)" << be_idt_nl + << "{" << be_idt; } else { @@ -610,7 +613,7 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) switch (this->ctx_->sub_state ()) { case TAO_CodeGen::TAO_CDR_INPUT: - *os << "{" << be_idt_nl; + *os << be_nl; // Handle the array of array case, where we need to pass the // forany type. @@ -627,7 +630,7 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) } *os << ", tmp.in ());" << be_nl; - *os << bt->name () << "_free (tmp.inout ());" << be_uidt_nl; + *os << bt->name () << "_free (tmp.inout ());"; } else { @@ -679,14 +682,12 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) break; } - *os << ");" << be_uidt_nl; + *os << ");"; } - *os << "}" << be_nl; - break; case TAO_CodeGen::TAO_CDR_OUTPUT: - *os << "{" << be_idt_nl; + *os << be_nl; // Handle the array of array case, where we need to pass the // forany type. @@ -702,7 +703,7 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) *os << "));" << be_nl; *os << bt->name () << "_forany tmp (tmp_var.inout ());" << be_nl; - *os << "_tao_marshal_flag = (strm << tmp);" << be_uidt_nl; + *os << "_tao_marshal_flag = (strm << tmp);"; } else { @@ -754,11 +755,9 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) break; } - *os << ");" << be_uidt_nl; + *os << ");"; } - *os << "}" << be_nl; - break; default: ACE_ERROR_RETURN ((LM_ERROR, @@ -771,11 +770,10 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) for (i = 0; i < ndims; ++i) { // Decrement indentation as many times as the number of dimensions. - *os << be_uidt; + *os << be_uidt_nl << "}" << be_uidt; } - *os << be_nl; - *os << "return _tao_marshal_flag;" << be_uidt_nl; + *os << be_nl << be_nl << "return _tao_marshal_flag;" << be_uidt_nl; return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp index 6c9264184ce..6008cda0263 100644 --- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp +++ b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp @@ -73,6 +73,7 @@ be_visitor_attribute::visit_attribute (be_attribute *node) get_op.set_name ((UTL_IdList *) node->name ()->copy ()); get_op.set_defined_in (node->defined_in ()); + get_op.be_add_exceptions (node->get_get_exceptions ()); // Get the strategy from the attribute and hand it over // to the operation. @@ -290,6 +291,7 @@ be_visitor_attribute::visit_attribute (be_attribute *node) set_op.set_name ((UTL_IdList *) node->name ()->copy ()); set_op.set_defined_in (node->defined_in ()); set_op.be_add_argument (&arg); + set_op.be_add_exceptions (node->get_set_exceptions ()); // Get the strategy from the attribute and hand it over // to the operation, thereby deleting the old one. diff --git a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp new file mode 100644 index 00000000000..f21dbe01189 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp @@ -0,0 +1,1866 @@ +/** + * @file be_visitor_ccm_pre_proc.cpp + * + * $Id$ + * + * @author Jeff Parsons + */ +//============================================================================= + +#include "be_visitor_ccm_pre_proc.h" +#include "be_visitor_context.h" +#include "be_root.h" +#include "be_operation.h" +#include "be_argument.h" +#include "be_exception.h" +#include "be_structure.h" +#include "be_sequence.h" +#include "be_valuetype.h" +#include "be_module.h" +#include "be_field.h" +#include "be_typedef.h" +#include "be_component.h" +#include "be_eventtype.h" +#include "be_home.h" +#include "be_extern.h" +#include "ast_generator.h" +#include "utl_exceptlist.h" +#include "utl_namelist.h" +#include "utl_err.h" +#include "fe_interface_header.h" +#include "global_extern.h" +#include "nr_extern.h" + +const char *EXCEP_NAMES[] = + { + "AlreadyConnected", + "InvalidConnection", + "NoConnection", + "ExceededConnectionLimit", + "CreateFailure", + "RemoveFailure", + "FinderFailure", + "InvalidKey", + "UnknownKeyValue", + "DuplicateKeyValue", + "CreateFailure", + "FinderFailure" + }; + +const int N_EXCEPS = sizeof (EXCEP_NAMES) / sizeof (char *); +be_exception *EXCEPS[N_EXCEPS]; + +be_visitor_ccm_pre_proc::be_visitor_ccm_pre_proc (be_visitor_context *ctx) + : be_visitor_scope (ctx), + module_id_ ("Components"), + cookie_ (0), + connection_ (0), + connections_ (0), + already_connected_ (0), + invalid_connection_ (0), + no_connection_ (0), + exceeded_connection_limit_ (0), + create_failure_ (0), + remove_failure_ (0), + finder_failure_ (0), + invalid_key_ (0), + unknown_key_value_ (0), + duplicate_key_value_ (0) +{ +} + +be_visitor_ccm_pre_proc::~be_visitor_ccm_pre_proc (void) +{ + this->module_id_.destroy (); +} + +int +be_visitor_ccm_pre_proc::visit_root (be_root *node) +{ + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_root - visit scope failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::visit_module (be_module *node) +{ + if (!node->imported () && this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_module - visit scope failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::visit_component (be_component *node) +{ + if (this->lookup_cookie (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_component - " + "Components::Cookie lookup failed\n"), + -1); + } + + if (this->lookup_exceptions (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_component - " + "component exception lookups failed\n"), + -1); + } + + if (this->gen_provides (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_component - " + "code generation for provides declarations failed\n"), + -1); + } + + if (this->gen_uses (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_component - " + "code generation for uses declarations failed\n"), + -1); + } + + if (this->gen_emits (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_component - " + "code generation for emits declarations failed\n"), + -1); + } + + if (this->gen_publishes (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_component - " + "code generation for publishes declarations failed\n"), + -1); + } + + if (this->gen_consumes (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_component - " + "code generation for consumes declarations failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::visit_home (be_home *node) +{ + AST_Interface *xplicit = this->create_explicit (node); + + if (xplicit == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_home - " + "code generation for explicit interface failed\n"), + -1); + } + + AST_Interface *implicit = this->create_implicit (node); + + if (implicit == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_home - " + "code generation for implicit interface failed\n"), + -1); + } + + if (this->gen_factories (node, xplicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_home - " + "code generation for factories declarations failed\n"), + -1); + } + + if (this->gen_finders (node, xplicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_home - " + "code generation for finders declarations failed\n"), + -1); + } + + if (this->gen_implicit_ops (node, implicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_home - " + "code generation for primary key " + "operations failed\n"), + -1); + } + + if (this->create_equivalent (node, xplicit, implicit) == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_home - " + "code generation for equivalent interface failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::visit_eventtype (be_eventtype *node) +{ + if (this->create_event_consumer (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "visit_eventtype - " + "code generation for consumer failed\n"), + -1); + } + + return 0; +} + +// **************************************************************** + +int +be_visitor_ccm_pre_proc::gen_provides (be_component *node) +{ + ACE_Unbounded_Queue<AST_Component::port_description> &s = node->provides (); + AST_Component::port_description *pd = 0; + AST_Operation *provides_op = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); + ! iter.done (); + iter.advance ()) + { + iter.next (pd); + UTL_ScopedName *op_name = + this->create_scoped_name ("provide_", + pd->id->get_string (), + 0, + node); + ACE_NEW_RETURN (provides_op, + be_operation (pd->impl, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + provides_op->set_defined_in (node); + provides_op->set_name (op_name); + node->be_add_operation (provides_op); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_uses (be_component *node) +{ + ACE_Unbounded_Queue<AST_Component::port_description> &s = node->uses (); + AST_Component::port_description *pd = 0; + AST_Operation *uses_op = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); + ! iter.done (); + iter.advance ()) + { + iter.next (pd); + + if (pd->is_multiple == I_FALSE) + { + if (this->gen_connect_single (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_uses - " + "gen_connect_single failed\n"), + -1); + } + + if (this->gen_disconnect_single (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_uses - " + "gen_disconnect_single failed\n"), + -1); + } + + if (this->gen_get_connection_single (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_uses - " + "gen_get_connection_single failed\n"), + -1); + } + } + else + { + if (this->create_uses_multiple_stuff (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_uses - " + "create_uses_multiple_stuff failed\n"), + -1); + } + + if (this->gen_connect_multiple (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_uses - " + "gen_connect_multiple failed\n"), + -1); + } + + if (this->gen_disconnect_multiple (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_uses - " + "gen_disconnect_multiple failed\n"), + -1); + } + + if (this->gen_get_connection_multiple (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_uses - " + "gen_get_connection_single failed\n"), + -1); + } + } + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_emits (be_component *node) +{ + ACE_Unbounded_Queue<AST_Component::port_description> &s = node->emits (); + AST_Component::port_description *pd = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); + ! iter.done (); + iter.advance ()) + { + iter.next (pd); + + if (this->gen_emits_connect (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_emits - " + "gen_emits_connect failed\n"), + -1); + } + + if (this->gen_emits_disconnect (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_emits - " + "gen_emits_disconnect failed\n"), + -1); + } + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_publishes (be_component *node) +{ + ACE_Unbounded_Queue<AST_Component::port_description> &s = node->publishes (); + AST_Component::port_description *pd = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); + ! iter.done (); + iter.advance ()) + { + iter.next (pd); + + if (this->gen_subscribe (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_publishes - " + "gen_subscribe failed\n"), + -1); + } + + if (this->gen_unsubscribe (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_publishes - " + "gen_unsubscribe failed\n"), + -1); + } + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_consumes (be_component *node) +{ + ACE_Unbounded_Queue<AST_Component::port_description> &s = node->consumes (); + AST_Component::port_description *pd = 0; + AST_Operation *provides_op = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Component::port_description> iter (s); + ! iter.done (); + iter.advance ()) + { + iter.next (pd); + + if (this->gen_get_consumer (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_consumes - " + "gen_consumes_get_connection failed\n"), + -1); + } + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_factories (be_home *node, + AST_Interface *xplicit) +{ + AST_Operation **item = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->factories ()); + ! i.done (); + i.advance ()) + { + i.next (item); + (*item)->set_defined_in (xplicit); + UTL_ScopedName *new_name = + this->create_scoped_name (0, + (*item)->local_name ()->get_string (), + 0, + xplicit); + (*item)->set_name (new_name); + + if ((*item)->be_insert_exception (this->create_failure_) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_factories - " + "exception insertion failed\n"), + -1); + } + + xplicit->be_add_operation (*item); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_finders (be_home *node, + AST_Interface *xplicit) +{ + AST_Operation **item = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Operation *> i (node->finders ()); + ! i.done (); + i.advance ()) + { + i.next (item); + (*item)->set_defined_in (xplicit); + UTL_ScopedName *new_name = + this->create_scoped_name (0, + (*item)->local_name ()->get_string (), + 0, + xplicit); + (*item)->set_name (new_name); + + if ((*item)->be_insert_exception (this->finder_failure_) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_factories - " + "exception insertion failed\n"), + -1); + } + + xplicit->be_add_operation (*item); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_implicit_ops (be_home *node, + AST_Interface *implicit) +{ + if (this->gen_create (node, implicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_implicit_ops - " + "gen_create failed\n"), + -1); + } + + AST_ValueType *pk = node->primary_key (); + + if (pk == 0) + { + return 0; + } + + if (this->gen_find_by_primary_key (node, implicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_implicit_ops - " + "gen_find_by_primary_key failed\n"), + -1); + } + + if (this->gen_remove (node, implicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_implicit_ops - " + "gen_remove failed\n"), + -1); + } + + if (this->gen_get_primary_key (node, implicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_implicit_ops - " + "gen_get_primary_key failed\n"), + -1); + } + + return 0; +} + +// ************************************************************** + +int +be_visitor_ccm_pre_proc::gen_connect_single ( + be_component *node, + AST_Component::port_description *pd + ) +{ + if (pd == 0) + { + return -1; + } + + UTL_ScopedName *op_full_name = + this->create_scoped_name ("connect_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (be_global->void_type (), + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_defined_in (node); + op->set_name (op_full_name); + Identifier arg_id ("conxn"); + UTL_ScopedName arg_name (&arg_id, + 0); + be_argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + pd->impl, + &arg_name), + -1); + arg_id.destroy (); + op->be_add_argument (arg); + + UTL_ExceptList *tail = 0; + ACE_NEW_RETURN (tail, + UTL_ExceptList (this->invalid_connection_, + 0), + -1); + UTL_ExceptList *connect_single = 0; + ACE_NEW_RETURN (connect_single, + UTL_ExceptList (this->already_connected_, + tail), + -1); + op->be_add_exceptions (connect_single); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_disconnect_single ( + be_component *node, + AST_Component::port_description *pd + ) +{ + if (pd == 0) + { + return -1; + } + + UTL_ScopedName *op_full_name = + this->create_scoped_name ("disconnect_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (pd->impl, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_full_name); + op->set_defined_in (node); + UTL_ExceptList *disconnect_single = 0; + ACE_NEW_RETURN (disconnect_single, + UTL_ExceptList (this->no_connection_, + 0), + -1); + op->be_add_exceptions (disconnect_single); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_get_connection_single ( + be_component *node, + AST_Component::port_description *pd + ) +{ + if (pd == 0) + { + return -1; + } + + UTL_ScopedName *op_full_name = + this->create_scoped_name ("get_connection_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (pd->impl, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_full_name); + op->set_defined_in (node); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_connect_multiple ( + be_component *node, + AST_Component::port_description *pd + ) +{ + if (pd == 0) + { + return -1; + } + + UTL_ScopedName *op_full_name = + this->create_scoped_name ("connect_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (this->cookie_, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_full_name); + op->set_defined_in (node); + Identifier arg_id ("connection"); + UTL_ScopedName arg_name (&arg_id, + 0); + be_argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + pd->impl, + &arg_name), + -1); + arg_id.destroy (); + op->be_add_argument (arg); + UTL_ExceptList *tail = 0; + ACE_NEW_RETURN (tail, + UTL_ExceptList (this->invalid_connection_, + 0), + -1); + UTL_ExceptList *connect_multiple = 0; + ACE_NEW_RETURN (connect_multiple, + UTL_ExceptList (this->exceeded_connection_limit_, + tail), + -1); + op->be_add_exceptions (connect_multiple); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_disconnect_multiple ( + be_component *node, + AST_Component::port_description *pd + ) +{ + if (pd == 0) + { + return -1; + } + + UTL_ScopedName *op_full_name = + this->create_scoped_name ("disconnect_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (pd->impl, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_full_name); + op->set_defined_in (node); + Identifier arg_id ("ck"); + UTL_ScopedName arg_name (&arg_id, + 0); + be_argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + this->cookie_, + &arg_name), + -1); + arg_id.destroy (); + op->be_add_argument (arg); + UTL_ExceptList *disconnect_multiple = 0; + ACE_NEW_RETURN (disconnect_multiple, + UTL_ExceptList (this->invalid_connection_, + 0), + -1); + op->be_add_exceptions (disconnect_multiple); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_get_connection_multiple ( + be_component *node, + AST_Component::port_description *pd + ) +{ + if (pd == 0) + { + return -1; + } + + UTL_ScopedName *op_full_name = + this->create_scoped_name ("get_connection_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (this->connections_, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_full_name); + op->set_defined_in (node); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_push_op (be_eventtype *node, + AST_Interface *consumer) +{ + UTL_ScopedName *op_full_name = + this->create_scoped_name ("push_", + node->local_name (), + 0, + consumer); + be_operation *push_op = 0; + ACE_NEW_RETURN (push_op, + be_operation (be_global->void_type (), + AST_Operation::OP_noflags, + 0, + I_FALSE, + I_FALSE), + -1); + push_op->set_defined_in (consumer); + push_op->set_name (op_full_name); + ACE_CString arg_string ("the_", + 0, + 0); + arg_string += node->local_name (); + Identifier arg_id (arg_string.fast_rep ()); + UTL_ScopedName arg_name (&arg_id, + 0); + be_argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + node, + &arg_name), + -1); + arg_id.destroy (); + push_op->be_add_argument (arg); + consumer->be_add_operation (push_op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_subscribe (be_component *node, + AST_Component::port_description *pd) +{ + UTL_ScopedName *op_name = + this->create_scoped_name ("subscribe_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (this->cookie_, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_defined_in (node); + op->set_name (op_name); + + AST_Interface *i = this->lookup_consumer (pd); + + if (i == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_subscribe - " + "consumer lookup failed\n"), + -1); + } + + Identifier arg_id ("consumer"); + UTL_ScopedName arg_name (&arg_id, + 0); + be_argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + i, + &arg_name), + -1); + op->be_add_argument (arg); + UTL_ExceptList *subscribe = 0; + ACE_NEW_RETURN (subscribe, + UTL_ExceptList (this->exceeded_connection_limit_, + 0), + -1); + op->be_add_exceptions (subscribe); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_unsubscribe (be_component *node, + AST_Component::port_description *pd) +{ + AST_Interface *i = this->lookup_consumer (pd); + + if (i == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_unsubscribe - " + "consumer lookup failed\n"), + -1); + } + + UTL_ScopedName *op_name = + this->create_scoped_name ("unsubscribe_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (i, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_defined_in (node); + op->set_name (op_name); + Identifier arg_id ("ck"); + UTL_ScopedName arg_name (&arg_id, + 0); + be_argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + this->cookie_, + &arg_name), + -1); + op->be_add_argument (arg); + UTL_ExceptList *unsubscribe = 0; + ACE_NEW_RETURN (unsubscribe, + UTL_ExceptList (this->invalid_connection_, + 0), + -1); + op->be_add_exceptions (unsubscribe); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_emits_connect ( + be_component *node, + AST_Component::port_description *pd + ) +{ + UTL_ScopedName *op_name = + this->create_scoped_name ("connect_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (be_global->void_type (), + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_name); + op->set_defined_in (node); + AST_Interface *i = this->lookup_consumer (pd); + + if (i == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_emits_connect - " + "consumer lookup failed\n"), + -1); + } + + Identifier arg_id ("consumer"); + UTL_ScopedName arg_name (&arg_id, + 0); + be_argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + i, + &arg_name), + -1); + op->be_add_argument (arg); + UTL_ExceptList *emits_connect = 0; + ACE_NEW_RETURN (emits_connect, + UTL_ExceptList (this->already_connected_, + 0), + -1); + op->be_add_exceptions (emits_connect); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_emits_disconnect ( + be_component *node, + AST_Component::port_description *pd + ) +{ + AST_Interface *i = this->lookup_consumer (pd); + + if (i == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_emits_disconnect - " + "consumer lookup failed\n"), + -1); + } + + UTL_ScopedName *op_name = + this->create_scoped_name ("disconnect_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (i, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_name); + op->set_defined_in (node); + UTL_ExceptList *emits_disconnect = 0; + ACE_NEW_RETURN (emits_disconnect, + UTL_ExceptList (this->no_connection_, + 0), + -1); + op->be_add_exceptions (emits_disconnect); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_get_consumer ( + be_component *node, + AST_Component::port_description *pd + ) +{ + AST_Interface *i = this->lookup_consumer (pd); + + if (i == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "gen_consumes_get_connection - " + "consumer lookup failed\n"), + -1); + } + + UTL_ScopedName *op_name = + this->create_scoped_name ("get_consumer_", + pd->id->get_string (), + 0, + node); + be_operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (i, + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_name); + op->set_defined_in (node); + node->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_create (be_home *node, + AST_Interface *implicit) +{ + UTL_ScopedName *op_name = this->create_scoped_name (0, + "create", + 0, + implicit); + AST_Operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (node->managed_component (), + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_name); + AST_ValueType *pk = node->primary_key (); + UTL_ExceptList *exceps = 0; + ACE_NEW_RETURN (exceps, + UTL_ExceptList (this->create_failure_, + 0), + -1); + + if (pk != 0) + { + Identifier arg_id ("key"); + UTL_ScopedName arg_name (&arg_id, + 0); + AST_Argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + pk, + &arg_name), + -1); + arg_id.destroy (); + op->be_add_argument (arg); + UTL_ExceptList *tail = 0; + ACE_NEW_RETURN (tail, + UTL_ExceptList (this->invalid_key_, + 0), + -1); + UTL_ExceptList *middle = 0; + ACE_NEW_RETURN (middle, + UTL_ExceptList (this->duplicate_key_value_, + tail), + -1); + exceps->nconc (middle); + } + + op->be_add_exceptions (exceps); + op->set_defined_in (implicit); + implicit->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_find_by_primary_key (be_home *node, + AST_Interface *implicit) +{ + UTL_ScopedName *op_name = this->create_scoped_name (0, + "find_by_primary_key", + 0, + implicit); + AST_Operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (node->managed_component (), + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_name); + AST_ValueType *pk = node->primary_key (); + Identifier arg_id ("key"); + UTL_ScopedName arg_name (&arg_id, + 0); + AST_Argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + pk, + &arg_name), + -1); + arg_id.destroy (); + op->be_add_argument (arg); + UTL_ExceptList *tail = 0; + ACE_NEW_RETURN (tail, + UTL_ExceptList (this->invalid_key_, + 0), + -1); + UTL_ExceptList *middle = 0; + ACE_NEW_RETURN (middle, + UTL_ExceptList (this->unknown_key_value_, + tail), + -1); + UTL_ExceptList *exceps = 0; + ACE_NEW_RETURN (exceps, + UTL_ExceptList (this->finder_failure_, + middle), + -1); + op->be_add_exceptions (exceps); + op->set_defined_in (implicit); + implicit->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_remove (be_home *node, + AST_Interface *implicit) +{ + UTL_ScopedName *op_name = this->create_scoped_name (0, + "remove", + 0, + implicit); + AST_Operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (be_global->void_type (), + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_name); + AST_ValueType *pk = node->primary_key (); + Identifier arg_id ("key"); + UTL_ScopedName arg_name (&arg_id, + 0); + AST_Argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + pk, + &arg_name), + -1); + arg_id.destroy (); + op->be_add_argument (arg); + UTL_ExceptList *tail = 0; + ACE_NEW_RETURN (tail, + UTL_ExceptList (this->invalid_key_, + 0), + -1); + UTL_ExceptList *middle = 0; + ACE_NEW_RETURN (middle, + UTL_ExceptList (this->unknown_key_value_, + tail), + -1); + UTL_ExceptList *exceps = 0; + ACE_NEW_RETURN (exceps, + UTL_ExceptList (this->remove_failure_, + middle), + -1); + op->be_add_exceptions (exceps); + op->set_defined_in (implicit); + implicit->be_add_operation (op); + return 0; +} + +int +be_visitor_ccm_pre_proc::gen_get_primary_key (be_home *node, + AST_Interface *implicit) +{ + UTL_ScopedName *op_name = this->create_scoped_name (0, + "get_primary_key", + 0, + implicit); + AST_Operation *op = 0; + ACE_NEW_RETURN (op, + be_operation (node->primary_key (), + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + op->set_name (op_name); + Identifier arg_id ("comp"); + UTL_ScopedName arg_name (&arg_id, + 0); + AST_Argument *arg = 0; + ACE_NEW_RETURN (arg, + be_argument (AST_Argument::dir_IN, + node->managed_component (), + &arg_name), + -1); + arg_id.destroy (); + op->be_add_argument (arg); + op->set_defined_in (implicit); + implicit->be_add_operation (op); + return 0; +} + +// ******************************************************************** + +int +be_visitor_ccm_pre_proc::lookup_cookie (be_component *node) +{ + if (this->cookie_ == 0) + { + Identifier local_id ("Cookie"); + UTL_ScopedName local_name (&local_id, + 0); + Identifier module_id ("Components"); + UTL_ScopedName cookie_name (&module_id, + &local_name); + AST_Decl *d = node->lookup_by_name (&cookie_name, + I_TRUE); + local_id.destroy (); + module_id.destroy (); + + if (d == 0) + { + idl_global->err ()->lookup_error (&cookie_name); + return -1; + } + + this->cookie_ = be_valuetype::narrow_from_decl (d); + + if (this->cookie_ == 0) + { + idl_global->err ()->valuetype_expected (d); + return -1; + } + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::lookup_exceptions (be_component *node) +{ + int status = 0; + + for (int i = 0; i < N_EXCEPS; ++i) + { + status = this->lookup_one_exception (node, + EXCEP_NAMES[i], + EXCEPS[i]); + + if (status == -1) + { + return -1; + } + } + + this->already_connected_ = EXCEPS[0]; + this->invalid_connection_ = EXCEPS[1]; + this->no_connection_ = EXCEPS[2]; + this->exceeded_connection_limit_ = EXCEPS[3]; + this->create_failure_ = EXCEPS[4]; + this->remove_failure_ = EXCEPS[5]; + this->finder_failure_ = EXCEPS[6]; + this->invalid_key_ = EXCEPS[7]; + this->unknown_key_value_ = EXCEPS[8]; + this->duplicate_key_value_ = EXCEPS[9]; + + return 0; +} + +int +be_visitor_ccm_pre_proc::lookup_one_exception (be_component *node, + const char *name, + be_exception *&result) +{ + Identifier id (name); + UTL_ScopedName local_name (&id, + 0); + UTL_ScopedName scoped_name (&this->module_id_, + &local_name); + AST_Decl *d = node->lookup_by_name (&scoped_name, + I_TRUE); + id.destroy (); + + if (d == 0) + { + idl_global->err ()->lookup_error (&scoped_name); + return -1; + } + + result = be_exception::narrow_from_decl (d); + + if (result == 0) + { + return -1; + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::create_uses_multiple_stuff ( + be_component *node, + AST_Component::port_description *pd + ) +{ + if (this->create_uses_multiple_struct (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "create_uses_multiple_stuff - " + "create_uses_multiple_struct failed\n"), + -1); + } + + if (this->create_uses_multiple_sequence (node, pd) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "create_uses_multiple_stuff - " + "create_uses_multiple_sequence failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::create_uses_multiple_struct ( + be_component *node, + AST_Component::port_description *pd + ) +{ + ACE_CString name (pd->id->get_string (), + 0, + 0); + name += "Connection"; + Identifier id (name.fast_rep ()); + UTL_ScopedName sn (&id, + 0); + ACE_NEW_RETURN (this->connection_, + be_structure (&sn, + 0, + 0), + -1); + this->connection_->set_defined_in (node); + + Identifier o_id ("objref"); + UTL_ScopedName o_sn (&o_id, + 0); + AST_Field *m_objref = 0; + ACE_NEW_RETURN (m_objref, + be_field (pd->impl, + &o_sn), + -1); + o_id.destroy (); + + if (this->connection_->be_add_field (m_objref) == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "create_uses_multiple_struct - " + "be_add_field failed\n"), + -1); + } + + Identifier v_id ("ck"); + UTL_ScopedName v_sn (&v_id, + 0); + AST_Field *m_ck = 0; + ACE_NEW_RETURN (m_ck, + be_field (this->cookie_, + &v_sn), + -1); + + if (this->connection_->be_add_field (m_ck) == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "create_uses_multiple_struct - " + "be_add_field failed\n"), + -1); + } + + if (node->be_add_structure (this->connection_) == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "create_uses_multiple_struct - " + "be_add_structure failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::create_uses_multiple_sequence ( + be_component *node, + AST_Component::port_description *pd + ) +{ + unsigned long bound = 0; + ACE_NEW_RETURN (this->connections_, + be_sequence (idl_global->gen ()->create_expr (bound), + this->connection_, + 0, + 0, + 0), + -1); + ACE_CString base_name (pd->id->get_string (), + 0, + 0); + base_name += "Connections"; + Identifier id (base_name.fast_rep ()); + UTL_ScopedName sn (&id, + 0); + AST_Typedef *td = 0; + ACE_NEW_RETURN (td, + be_typedef (this->connections_, + &sn, + 0, + 0), + -1); + td->set_defined_in (node); + + if (node->be_add_typedef (td) == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ccm_pre_proc::" + "create_uses_multiple_sequence - " + "be_add_typedef failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) +{ + AST_Interface *event_consumer = 0; + UTL_Scope *s = node->defined_in (); + AST_Module *m = AST_Module::narrow_from_scope (s); + + UTL_ScopedName *consumer_name = + this->create_scoped_name (0, + node->local_name (), + "Consumer", + ScopeAsDecl (node->defined_in ())); + + if (node->n_inherits () == 0 + || node->inherits ()[0]->node_type () == AST_Decl::NT_valuetype) + { + Identifier parent_id ("EventConsumerBase"); + UTL_ScopedName parent_local_name (&parent_id, + 0); + UTL_ScopedName parent_full_name (&this->module_id_, + &parent_local_name); + UTL_NameList parent_list (&parent_full_name, + 0); + FE_InterfaceHeader header (0, + &parent_list, + I_FALSE, + I_FALSE, + I_TRUE); + ACE_NEW_RETURN (event_consumer, + be_interface (0, + header.inherits (), + header.n_inherits (), + header.inherits_flat (), + header.n_inherits_flat (), + I_FALSE, + I_FALSE), + -1); + parent_id.destroy (); + } + else + { + const char *tmp = node->inherits ()[0]->local_name ()->get_string (); + ACE_CString parent_name_base (tmp, + 0, + 0); + parent_name_base += "Consumer"; + Identifier *parent_id = 0; + ACE_NEW_RETURN (parent_id, + Identifier (parent_name_base.fast_rep ()), + -1); + UTL_ScopedName *parent_local_name = 0; + ACE_NEW_RETURN (parent_local_name, + UTL_ScopedName (parent_id, + 0), + -1); + UTL_ScopedName *parent_full_name = + (UTL_ScopedName *)m->name ()->copy (); + parent_full_name->nconc (parent_local_name); + UTL_NameList parent_list (parent_full_name, + 0); + FE_InterfaceHeader header (0, + &parent_list, + I_FALSE, + I_FALSE, + I_TRUE); + ACE_NEW_RETURN (event_consumer, + be_interface (0, + header.inherits (), + header.n_inherits (), + header.inherits_flat (), + header.n_inherits_flat (), + I_FALSE, + I_FALSE), + -1); + parent_full_name->destroy (); + } + + event_consumer->set_defined_in (s); + event_consumer->set_name (consumer_name); + m->be_add_interface (event_consumer); + return this->gen_push_op (node, + event_consumer); +} + +AST_Interface * +be_visitor_ccm_pre_proc::lookup_consumer (AST_Component::port_description *pd) +{ + ACE_CString rettype_string (pd->impl->local_name ()->get_string ()); + rettype_string += "Consumer"; + Identifier rettype_id (rettype_string.fast_rep ()); + AST_Decl *d = pd->impl->defined_in ()->lookup_by_name_local (&rettype_id, + 0); + rettype_id.destroy (); + + if (d == 0) + { + return 0; + } + + AST_Interface *i = AST_Interface::narrow_from_decl (d); + + if (i == 0) + { + idl_global->err ()->interface_expected (d); + return 0; + } + + return i; +} + +AST_Interface * +be_visitor_ccm_pre_proc::create_explicit (be_home *node) +{ + UTL_NameList *parent_list = this->compute_inheritance (node); + FE_InterfaceHeader header (0, + parent_list, + I_FALSE, + I_FALSE, + I_TRUE); + parent_list->destroy (); + UTL_ScopedName *explicit_name = + this->create_scoped_name (0, + node->local_name (), + "Explicit", + ScopeAsDecl (node->defined_in ())); + AST_Interface *i = 0; + ACE_NEW_RETURN (i, + be_interface (0, + header.inherits (), + header.n_inherits (), + header.inherits_flat (), + header.n_inherits_flat (), + I_FALSE, + I_FALSE), + 0); + i->set_name (explicit_name); + i->set_defined_in (node->defined_in ()); + + // Reuse the home's decls in the explicit interface. No need + // to check for name clashes, redefinition, etc. because it + // has already been done in the home and the explicit interface + // is empty at this point. Later addition of factory and finder + // operations will do these checks to make sure they don't + // clash with the other decls. + for (UTL_ScopeActiveIterator iter (node, UTL_Scope::IK_decls); + ! iter.is_done (); + iter.next ()) + { + AST_Decl *d = iter.item (); + d->set_defined_in (i); + UTL_ScopedName *new_name = + this->create_scoped_name (0, + d->local_name ()->get_string (), + 0, + i); + d->set_name (new_name); + i->add_to_scope (d); + } + + AST_Module *m = AST_Module::narrow_from_scope (node->defined_in ()); + m->be_add_interface (i); + return i; +} + +AST_Interface * +be_visitor_ccm_pre_proc::create_implicit (be_home *node) +{ + Identifier parent_id ("KeylessCCMHome"); + UTL_ScopedName parent_local_name (&parent_id, + 0); + UTL_ScopedName parent_full_name (&this->module_id_, + &parent_local_name); + UTL_NameList parent_list (&parent_full_name, + 0); + UTL_ScopedName *implicit_name = + this->create_scoped_name (0, + node->local_name (), + "Implicit", + ScopeAsDecl (node->defined_in ())); + UTL_NameList *parent_list_ptr = 0; + + if (node->primary_key () == 0) + { + parent_list_ptr = &parent_list; + } + + FE_InterfaceHeader header (0, + parent_list_ptr, + I_FALSE, + I_FALSE, + I_TRUE); + parent_id.destroy (); + AST_Interface *i = 0; + ACE_NEW_RETURN (i, + be_interface (0, + header.inherits (), + header.n_inherits (), + header.inherits_flat (), + header.n_inherits_flat (), + I_FALSE, + I_FALSE), + 0); + i->set_name (implicit_name); + i->set_defined_in (node->defined_in ()); + AST_Module *m = AST_Module::narrow_from_scope (node->defined_in ()); + m->be_add_interface (i); + return i; +} + +AST_Interface * +be_visitor_ccm_pre_proc::create_equivalent (be_home *node, + AST_Interface *xplicit, + AST_Interface *implicit) +{ + UTL_Scope *s = node->defined_in (); + UTL_ScopedName *equiv_name = + this->create_scoped_name (0, + node->local_name (), + 0, + ScopeAsDecl (s)); + UTL_NameList tail (implicit->name (), + 0); + UTL_NameList parent_list (xplicit->name (), + &tail); + FE_InterfaceHeader header (0, + &parent_list, + I_FALSE, + I_FALSE, + I_TRUE); + AST_Interface *retval = 0; + ACE_NEW_RETURN (retval, + be_interface (0, + header.inherits (), + header.n_inherits (), + header.inherits_flat (), + header.n_inherits_flat (), + I_FALSE, + I_FALSE), + 0); + retval->set_name (equiv_name); + retval->set_defined_in (s); + UTL_ScopedName *unmangled_name = ACE_static_cast (UTL_ScopedName *, + node->name ()->copy ()); + UTL_ScopedName *mangled_name = + this->create_scoped_name (0, + node->local_name (), + "_tao_home_name_extension", + ScopeAsDecl (s)); + node->set_name (mangled_name); + AST_Module *m = AST_Module::narrow_from_scope (s); + m->be_add_interface (retval); + node->set_name (unmangled_name); + return retval; +} + +UTL_ScopedName * +be_visitor_ccm_pre_proc::create_scoped_name (const char *prefix, + const char *local_name, + const char *suffix, + AST_Decl *parent) +{ + ACE_CString local_string (prefix, + 0, + 0); + local_string += local_name; + local_string += suffix; + Identifier *local_id = 0; + ACE_NEW_RETURN (local_id, + Identifier (local_string.fast_rep ()), + 0); + UTL_ScopedName *last_segment = 0; + ACE_NEW_RETURN (last_segment, + UTL_ScopedName (local_id, + 0), + 0); + UTL_ScopedName *full_name = + ACE_static_cast (UTL_ScopedName *, + parent->name ()->copy ()); + full_name->nconc (last_segment); + return full_name; +} + +UTL_NameList * +be_visitor_ccm_pre_proc::compute_inheritance (be_home *node) +{ + UTL_NameList *retval = 0; + + if (node->base_home () == 0) + { + Identifier *local_id = 0; + ACE_NEW_RETURN (local_id, + Identifier ("CCMHome"), + 0); + UTL_ScopedName *local_name = 0; + ACE_NEW_RETURN (local_name, + UTL_ScopedName (local_id, + 0), + 0); + UTL_ScopedName *full_name = 0; + ACE_NEW_RETURN (full_name, + UTL_ScopedName (this->module_id_.copy (), + local_name), + 0); + ACE_NEW_RETURN (retval, + UTL_NameList (full_name, + 0), + 0); + + } + else + { + UTL_ScopedName *parent_name = + ACE_static_cast (UTL_ScopedName *, + node->base_home ()->name ()->copy ()); + ACE_NEW_RETURN (retval, + UTL_NameList (parent_name, + 0), + 0); + } + + long n_supports = node->n_inherits (); + UTL_ScopedName *supported_name = 0; + UTL_NameList *conc_value = 0; + + for (long i = 0; i < n_supports; ++i) + { + supported_name = + ACE_static_cast (UTL_ScopedName *, + node->inherits ()[i]->name ()->copy ()); + ACE_NEW_RETURN (conc_value, + UTL_NameList (supported_name, + 0), + 0); + retval->nconc (conc_value); + } + + return retval; +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component.cpp b/TAO/TAO_IDL/be/be_visitor_component.cpp index baa86583374..3db3df2e7f7 100644 --- a/TAO/TAO_IDL/be/be_visitor_component.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component.cpp @@ -11,15 +11,47 @@ // be_visitor_component.cpp // // = DESCRIPTION -// Visitors for generation of code for Component +// Visitors for generation of code for Component. // // = AUTHOR // Jeff Parsons // // ============================================================================ +#include "be_component.h" +#include "be_attribute.h" +#include "be_typedef.h" +#include "be_operation.h" +#include "be_structure.h" +#include "be_typedef.h" +#include "ast_argument.h" + #include "be_visitor_component.h" +#include "be_visitor_attribute.h" +#include "be_visitor_operation.h" +#include "be_visitor_interface.h" +#include "be_visitor_structure.h" +#include "be_visitor_typedef.h" +#include "be_visitor_typecode.h" #include "be_visitor_context.h" +#include "be_helper.h" +#include "be_extern.h" +#include "idl_defines.h" + +#include "be_visitor_component/component.cpp" +#include "be_visitor_component/component_ch.cpp" +#include "be_visitor_component/component_ci.cpp" +#include "be_visitor_component/component_cs.cpp" +#include "be_visitor_component/component_sh.cpp" +#include "be_visitor_component/component_si.cpp" +#include "be_visitor_component/component_ss.cpp" +#include "be_visitor_component/component_ih.cpp" +#include "be_visitor_component/component_is.cpp" +#include "be_visitor_component/any_op_ch.cpp" +#include "be_visitor_component/any_op_cs.cpp" +#include "be_visitor_component/cdr_op_ch.cpp" +#include "be_visitor_component/cdr_op_ci.cpp" +#include "be_visitor_component/cdr_op_cs.cpp" ACE_RCSID (be, be_visitor_component, diff --git a/TAO/TAO_IDL/be/be_visitor_component/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component/any_op_ch.cpp new file mode 100644 index 00000000000..905778c25f5 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/any_op_ch.cpp @@ -0,0 +1,47 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for Any operators for an Component in the client +// header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + any_op_ch, + "$Id$") + +// *************************************************************************** +// Interface visitor for generating Any operator declarations in the client header +// *************************************************************************** + +be_visitor_component_any_op_ch::be_visitor_component_any_op_ch +(be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_any_op_ch::~be_visitor_component_any_op_ch (void) +{ +} + +int +be_visitor_component_any_op_ch::visit_component (be_component *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH); + be_visitor_interface_any_op_ch visitor (&ctx); + return visitor.visit_interface (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_component/any_op_cs.cpp new file mode 100644 index 00000000000..e9a210125f2 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/any_op_cs.cpp @@ -0,0 +1,47 @@ +// $id: any_op_cs.cpp,v 1.12 1998/10/30 19:46:55 levine Exp $ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_cs.cpp +// +// = DESCRIPTION +// Visitor generating code for Any operators for Component in the stubs +// file. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + any_op_cs, + "$Id$") + +// *************************************************************************** +// Interface visitor for generating Any operator declarations in the client +// stubs file +// *************************************************************************** + +be_visitor_component_any_op_cs::be_visitor_component_any_op_cs ( + be_visitor_context *ctx + ) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_any_op_cs::~be_visitor_component_any_op_cs (void) +{ +} + +int +be_visitor_component_any_op_cs::visit_component (be_component *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS); + be_visitor_interface_any_op_cs visitor (&ctx); + return visitor.visit_interface (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ch.cpp new file mode 100644 index 00000000000..8b700b395b9 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ch.cpp @@ -0,0 +1,48 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for CDR operators for components. This uses +// compiled marshaling. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + cdr_op_ch, + "$Id$") + +// *************************************************************************** +// Interface visitor for generating CDR operator declarations in the client header +// *************************************************************************** + +be_visitor_component_cdr_op_ch::be_visitor_component_cdr_op_ch ( + be_visitor_context *ctx + ) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_cdr_op_ch::~be_visitor_component_cdr_op_ch (void) +{ +} + +int +be_visitor_component_cdr_op_ch::visit_component (be_component *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH); + be_visitor_interface_cdr_op_ch visitor (&ctx); + return visitor.visit_interface (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ci.cpp new file mode 100644 index 00000000000..214aff3c953 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/cdr_op_ci.cpp @@ -0,0 +1,48 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ci.cpp +// +// = DESCRIPTION +// Visitor generating code for CDR operators for components +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + cdr_op_ci, + "$Id$") + +// *************************************************************************** +// Component visitor for generating CDR operator declarations in the client +// stubs file +// *************************************************************************** + +be_visitor_component_cdr_op_ci::be_visitor_component_cdr_op_ci ( + be_visitor_context *ctx + ) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_cdr_op_ci::~be_visitor_component_cdr_op_ci (void) +{ +} + +int +be_visitor_component_cdr_op_ci::visit_component (be_component *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI); + be_visitor_interface_cdr_op_ci visitor (&ctx); + return visitor.visit_interface (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_component/cdr_op_cs.cpp new file mode 100644 index 00000000000..c56ed53aeeb --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/cdr_op_cs.cpp @@ -0,0 +1,43 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_cs.cpp +// +// = DESCRIPTION +// Visitor generating code for CDR operators for components +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + cdr_op_cs, + "$Id$") + +be_visitor_component_cdr_op_cs::be_visitor_component_cdr_op_cs ( + be_visitor_context *ctx + ) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_cdr_op_cs::~be_visitor_component_cdr_op_cs (void) +{ +} + +int +be_visitor_component_cdr_op_cs::visit_component (be_component *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS); + be_visitor_interface_cdr_op_cs visitor (&ctx); + return visitor.visit_interface (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component.cpp b/TAO/TAO_IDL/be/be_visitor_component/component.cpp new file mode 100644 index 00000000000..0028c436a6d --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component.cpp @@ -0,0 +1,429 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component.cpp +// +// = DESCRIPTION +// Visitor generating code for Components. This is a generic visitor. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + component, + "$Id$") + +// ****************************************************** +// Generic Component visitor +// ****************************************************** + +be_visitor_component::be_visitor_component (be_visitor_context *ctx) + : be_visitor_interface (ctx) +{ +} + +be_visitor_component::~be_visitor_component (void) +{ +} + +int +be_visitor_component::visit_attribute (be_attribute *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); + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_COMPONENT_CH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_CH); + break; + case TAO_CodeGen::TAO_COMPONENT_CS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_CS); + break; + case TAO_CodeGen::TAO_COMPONENT_SH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SH); + break; + case TAO_CodeGen::TAO_COMPONENT_IH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_IH); + break; + case TAO_CodeGen::TAO_COMPONENT_SS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SS); + break; + case TAO_CodeGen::TAO_COMPONENT_IS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_IS); + break; + case TAO_CodeGen::TAO_COMPONENT_ANY_OP_CH: + case TAO_CodeGen::TAO_COMPONENT_ANY_OP_CS: + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CH: + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CI: + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CS: + case TAO_CodeGen::TAO_COMPONENT_CI: + case TAO_CodeGen::TAO_COMPONENT_SI: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_attribute - " + "Bad context state\n: "), + -1); + } + } + + // Same visitor for all the above cases where an action is taken. + be_visitor_attribute visitor (&ctx); + + if (node->accept (&visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_attribute - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_component::visit_operation (be_operation *node) +{ + // Instantiate a visitor context with a copy of our context. This info + // 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_COMPONENT_CH: + ctx.state (TAO_CodeGen::TAO_OPERATION_CH); + break; + case TAO_CodeGen::TAO_COMPONENT_CS: + ctx.state (TAO_CodeGen::TAO_OPERATION_CS); + break; + case TAO_CodeGen::TAO_COMPONENT_SH: + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SH); + be_visitor_operation_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_IH: + { + ctx.state (TAO_CodeGen::TAO_OPERATION_IH); + be_visitor_operation_ih visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_SS: + { + ctx.state (TAO_CodeGen::TAO_OPERATION_SS); + be_visitor_operation_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_IS: + { + ctx.state (TAO_CodeGen::TAO_OPERATION_IS); + be_visitor_operation_is visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_ANY_OP_CH: + case TAO_CodeGen::TAO_COMPONENT_ANY_OP_CS: + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CH: + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CI: + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CS: + case TAO_CodeGen::TAO_COMPONENT_CI: + case TAO_CodeGen::TAO_COMPONENT_SI: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_operation - " + "Bad context state\n"), + -1); + } + } + + if (status == 0) + { + return 0; + } + else if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "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. + be_visitor *visitor = tao_cg->make_visitor (&ctx); + + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_operation - " + "NUL visitor\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_operation - " + "failed to accept visitor\n"), + -1); + } + + delete visitor; + visitor = 0; + + // Do additional code generation is necessary. + // Note, this call is delegated to the strategy connected to + // the node. + 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)); + + // Grab the appropriate visitor. + visitor = tao_cg->make_visitor (&ctx); + + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_operation - " + "NUL visitor\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_operation - " + "failed to accept visitor\n"), + -1); + } + + delete visitor; + visitor = 0; + } + + return 0; +} + +int +be_visitor_component::visit_structure (be_structure *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_COMPONENT_CH: + { + ctx.state (TAO_CodeGen::TAO_STRUCT_CH); + be_visitor_structure_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CI: + { + ctx.state (TAO_CodeGen::TAO_STRUCT_CI); + be_visitor_structure_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CS: + { + ctx.state (TAO_CodeGen::TAO_STRUCT_CS); + be_visitor_structure_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CH); + be_visitor_structure_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_ANY_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CS); + be_visitor_structure_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH); + be_visitor_structure_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI); + be_visitor_structure_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS); + be_visitor_structure_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_SH: + case TAO_CodeGen::TAO_COMPONENT_IH: + case TAO_CodeGen::TAO_COMPONENT_IS: + case TAO_CodeGen::TAO_COMPONENT_SI: + case TAO_CodeGen::TAO_COMPONENT_SS: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_structure - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_structure - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_component::visit_typedef (be_typedef *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_COMPONENT_CH: + { + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CH); + be_visitor_typedef_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CI: + { + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CI); + be_visitor_typedef_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CS: + { + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CS); + be_visitor_typedef_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH); + be_visitor_typedef_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_ANY_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS); + be_visitor_typedef_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH); + be_visitor_typedef_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI); + be_visitor_typedef_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_CDR_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS); + be_visitor_typedef_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_COMPONENT_SH: + case TAO_CodeGen::TAO_COMPONENT_IH: + case TAO_CodeGen::TAO_COMPONENT_IS: + case TAO_CodeGen::TAO_COMPONENT_SI: + case TAO_CodeGen::TAO_COMPONENT_SS: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_typedef - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component::" + "visit_typedef - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp new file mode 100644 index 00000000000..f65c76fd284 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp @@ -0,0 +1,341 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for Components in the client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + component_ch, + "$Id$") + +// ****************************************************** +// Component visitor for client header +// ****************************************************** + +be_visitor_component_ch::be_visitor_component_ch (be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_ch::~be_visitor_component_ch (void) +{ +} + +int +be_visitor_component_ch::visit_component (be_component *node) +{ + if (node->cli_hdr_gen () || node->imported ()) + { + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + // == STEP 1: generate the class name and class names we inherit == + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + // Generate the ifdefined macro for the _ptr type. + os->gen_ifdef_macro (node->flat_name (), + "_ptr"); + + // The following two are required to be under the ifdef macro to avoid + // multiple declarations. + + // Forward declaration. + *os << be_nl << be_nl << "class " << node->local_name () << ";"; + // Generate the _ptr declaration. + *os << be_nl << "typedef " << node->local_name () << " *" + << node->local_name () << "_ptr;"; + + os->gen_endif (); + + // Generate the ifdefined macro for the var type. + os->gen_ifdef_macro (node->flat_name (), "_var"); + + // Generate the _var declaration. + if (node->gen_var_defn () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface_ch::" + "visit_interface - " + "codegen for _var failed\n"), + -1); + } + + os->gen_endif (); + + // Generate the ifdef macro for the _out class. + os->gen_ifdef_macro (node->flat_name (), + "_out"); + + // Generate the _out declaration. + if (node->gen_out_defn () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface_ch::" + "visit_interface - " + "codegen for _out failed\n"), + -1); + } + + // Generate the endif macro. + os->gen_endif (); + + // The above code could have been executed by the forward declaration + // as long as it wasn't imported. The code below can only be + // executed by an interface definition, also non-imported. + if (node->imported ()) + { + return 0; + } + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + // Now the interface definition itself. + os->gen_ifdef_macro (node->flat_name ()); + + if (!node->is_local () && !node->is_abstract ()) + { + // Forward class declarations. + *os << be_nl << be_nl + << "class " << node->base_proxy_impl_name () << ";" << be_nl + << "class " << node->remote_proxy_impl_name () << ";" << be_nl + << "class " << node->base_proxy_broker_name () << ";" << be_nl + << "class " << node->remote_proxy_broker_name () << ";" + << be_nl << be_nl; + } + + // Now generate the class definition. + *os << "class " << be_global->stub_export_macro () + << " " << node->local_name () << be_idt_nl + << ": public virtual " ; + + AST_Component *parent = node->base_component (); + + if (parent != 0) + { + *os << parent->name (); + } + else + { + *os << "Components::CCMObject"; + } + + long nsupports = node->n_inherits (); + + if (nsupports > 0) + { + *os << be_idt; + + for (long i = 0; i < nsupports; ++i) + { + *os << ", " << be_nl + << "public virtual " << node->supports()[i]->name (); + } + + *os << be_uidt; + } + + *os << be_uidt_nl + << "{" << be_nl + << "public:" << be_idt_nl + + // Generate the _ptr_type and _var_type typedefs. + << "typedef " << node->local_name () << "_ptr _ptr_type;" + << be_nl + << "typedef " << node->local_name () << "_var _var_type;" + << be_nl; + + // Generate the static _duplicate, _narrow, and _nil operations. + *os << "// The static operations." << be_nl + << "static " << node->local_name () << "_ptr " << "_duplicate (" + << node->local_name () << "_ptr obj);" << be_nl << be_nl + << "static " << node->local_name () << "_ptr " + << "_narrow (" << be_idt << be_idt_nl + << "Components::CCMObject_ptr obj" << be_nl + << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + *os << "static " << node->local_name () << "_ptr " + << "_unchecked_narrow (" << be_idt << be_idt_nl + << "Components::CCMObject_ptr obj" << be_nl + << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // This method is defined in the header file to workaround old + // g++ problems. + *os << "static " << node->local_name () << "_ptr _nil (void)" + << be_idt_nl << "{" << be_idt_nl + << "return (" << node->local_name () + << "_ptr)0;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + + if (be_global->any_support ()) + { + *os << "static void _tao_any_destructor (void *);"; + } + + // 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. + + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component_ch::" + "visit_component - " + "codegen for scope failed\n"), + -1); + } + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl + << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl + << "const char *type_id" << be_nl + << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ");" << be_uidt; + + // The _tao_QueryInterface method. + *os << be_nl << be_nl + << "virtual void *_tao_QueryInterface (ptr_arith_t type);"; + + // The _interface_repository_id method. + *os << be_nl << be_nl + << "virtual const char* _interface_repository_id (void) const;"; + + // Add the Proxy Broker member variable. + *os << be_uidt_nl << be_nl + << "private:" << be_idt_nl + << node->base_proxy_broker_name () << " *" + << "the" << node->base_proxy_broker_name () + << "_;"; + + *os << be_uidt_nl << be_nl + << "protected:" << be_idt; + + // Generate the "protected" constructor so that users cannot + // instantiate us. + + *os << be_nl + << node->local_name () << " (int collocated = 0);"; + + *os << be_nl << be_nl + << "// These methods travese the inheritance tree and set the" + << be_nl + << "// parents piece of the given class in the right mode." + << be_nl + << "virtual void " << node->flat_name () + << "_setup_collocation (int collocated);"; + + *os << be_nl << be_nl + << node->local_name () + << " (" << be_idt << be_idt_nl << "TAO_Stub *objref, " << be_nl + << "CORBA::Boolean _tao_collocated = 0," << be_nl + << "TAO_Abstract_ServantBase *servant = 0" << be_uidt_nl + << ");" << be_uidt; + + // Friends declarations. + *os << be_nl << be_nl + << "friend class " << node->remote_proxy_impl_name () << ";" + << be_nl + << "friend class " << node->thru_poa_proxy_impl_name () << ";" + << be_nl + << "friend class " << node->direct_proxy_impl_name () << ";"; + + // Protected destructor. + *os << be_nl << be_nl + << "virtual ~" << node->local_name () << " (void);"; + + // Private copy constructor and assignment operator. These are not + // allowed, hence they are private. + *os << be_uidt_nl << be_nl + << "private:" << be_idt_nl; + *os << node->local_name () << " (const " + << node->local_name () << " &);" + << be_nl + << "void operator= (const " << node->local_name () << " &);"; + + *os << be_uidt_nl + << "};" << be_nl << be_nl; + + // Smart Proxy related classes. + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH); + be_visitor_interface_smart_proxy_ch sp_visitor (&ctx); + + if (node->accept (&sp_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_ch::" + "visit_component - " + "codegen for smart proxy classes failed\n"), + -1); + } + + // Proxy Implementation Declaration. + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH); + be_visitor_interface_proxy_impls_ch spi_visitor (&ctx); + + if (node->accept (&spi_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_ch::" + "visit_component - " + "codegen for Proxy Broker classes failed\n"), + -1); + } + + // Proxy Broker Declaration. + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH); + be_visitor_interface_proxy_brokers_ch pb_visitor (&ctx); + + if (node->accept (&pb_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_ch::" + "visit_component - " + "codegen for Proxy Broker classes failed\n"), + -1); + } + + os->gen_endif (); + + if (be_global->tc_support ()) + { + ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL); + be_visitor_typecode_decl td_visitor (&ctx); + + if (node->accept (&td_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component_ch::" + "visit_component - " + "TypeCode declaration failed\n"), + -1); + } + } + + node->cli_hdr_gen (I_TRUE); + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp new file mode 100644 index 00000000000..6dd43654f82 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp @@ -0,0 +1,59 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_ci.cpp +// +// = DESCRIPTION +// Visitor generating code for Components in the client inline. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + component_ci, + "$Id$") + +// ****************************************************** +// Component visitor for client inline +// ****************************************************** + +be_visitor_component_ci::be_visitor_component_ci (be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_ci::~be_visitor_component_ci (void) +{ +} + +int +be_visitor_component_ci::visit_component (be_component *node) +{ + if (node->imported () || node->cli_inline_gen ()) + { + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl; + + os->gen_ifdef_macro (node->flat_name (), ""); + + // Generate the constructor from stub and servant. + node->gen_stub_ctor (os); + + os->gen_endif (); + node->cli_inline_gen (I_TRUE); + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp new file mode 100644 index 00000000000..b859beb47a0 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp @@ -0,0 +1,449 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_cs.cpp +// +// = DESCRIPTION +// Visitor generating code for Components in the client stub. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + component_cs, + "$Id$") + +// ****************************************************** +// Component visitor for client stub +// ****************************************************** + +be_visitor_component_cs::be_visitor_component_cs (be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_cs::~be_visitor_component_cs (void) +{ +} + +int +be_visitor_component_cs::visit_component (be_component *node) +{ + if (node->cli_stub_gen () || node->imported ()) + { + return 0; + } + + be_type *bt; + + // Set the right type. + if (this->ctx_->alias ()) + { + bt = this->ctx_->alias (); + } + else + { + bt = node; + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // Global functions to allow non-defined forward declared interfaces + // access to some methods in the full definition. + *os << node->full_name () << "_ptr" << be_nl + << "tao_" << node->flat_name () + << "_duplicate (" << be_idt << be_idt_nl + << node->full_name () << "_ptr p" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "return " << node->full_name () + << "::_duplicate (p);" << be_uidt_nl + << "}" << be_nl << be_nl; + + *os << "void" << be_nl + << "tao_" << node->flat_name () + << "_release (" << be_idt << be_idt_nl + << node->full_name () << "_ptr p" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "CORBA::release (p);" << be_uidt_nl + << "}" << be_nl << be_nl; + + *os << node->full_name () << "_ptr" << be_nl + << "tao_" << node->flat_name () + << "_nil (" << be_idt << be_idt_nl + << "void" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "return " << node->full_name () + << "::_nil ();" << be_uidt_nl + << "}" << be_nl << be_nl; + + *os << node->full_name () << "_ptr" << be_nl + << "tao_" << node->flat_name () + << "_narrow (" << be_idt << be_idt_nl + << "Components::CCMObject_ptr p" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "return " << node->full_name () + << "::_narrow (p ACE_ENV_ARG_PARAMETER);" + << be_uidt_nl + << "}" << be_nl << be_nl; + + *os << "Components::CCMObject_ptr " << be_nl + << "tao_" << node->flat_name () + << "_upcast (" << be_idt << be_idt_nl + << "void *src" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << node->full_name () << " **tmp =" << be_idt_nl + << "ACE_static_cast (" << node->full_name () + << " **, src);" << be_uidt_nl + << "return *tmp;" << be_uidt_nl + << "}" << be_nl << be_nl; + + // Generate the _var class. + if (node->gen_var_impl () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component_cs::" + "visit_component - " + "codegen for _var failed\n"), + -1); + } + + // Generate the _out class. + if (node->gen_out_impl () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component_cs::" + "visit_component - " + "codegen for _out failed\n"), + -1); + } + + be_visitor_context ctx (*this->ctx_); + + // Interceptor classes. The interceptors helper classes must be + // defined before the interface operations because they are used in + // the implementation of said operations. + + ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS); + be_visitor_interface_interceptors_cs ii_visitor (&ctx); + + if (node->accept (&ii_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_cs::" + "visit_component - " + "codegen for interceptors classes failed\n"), + -1); + } + + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS); + be_visitor_interface_remote_proxy_impl_cs irpi_visitor (&ctx); + + if (node->accept (&irpi_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_cs::" + "visit_component - " + "codegen for Base Proxy Broker class failed\n"), + -1); + } + + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS); + be_visitor_interface_remote_proxy_broker_cs irpb_visitor (&ctx); + + if (node->accept (&irpb_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_cs::" + "visit_component - " + "codegen for Base Proxy Broker class failed\n"), + -1); + } + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // Generate the destructor and default constructor. + *os << node->name () << "::~" << node->local_name () + << " (void)" << be_nl; + *os << "{}" << be_nl << be_nl; + + *os << node->name () << "::" << node->local_name () + << " (int collocated)" << be_nl + << "{" << be_idt_nl + << "this->" << node->flat_name () + << "_setup_collocation (collocated);" << be_uidt_nl + << be_uidt << "}" << be_nl << be_nl; + + // Collocation setup method. + *os << "void" << be_nl + << node->name () << "::" << node->flat_name () + << "_setup_collocation (int collocated)" << be_nl + << "{" << be_idt_nl + << "if (collocated)" << be_idt_nl + << "this->the" << node->base_proxy_broker_name () + << "_ =" << be_idt_nl + << "::" << node->flat_client_enclosing_scope () + << node->base_proxy_broker_name () + << "_Factory_function_pointer (this);" + << be_uidt << be_uidt_nl + << "else" << be_idt_nl + << "this->the" << node->base_proxy_broker_name () + << "_ =" << be_idt_nl + << "::" << node->full_remote_proxy_broker_name () + << "::the" << node->remote_proxy_broker_name () + << " ();" << be_uidt << be_uidt; + + AST_Component *base = node->base_component (); + + if (base != 0) + { + *os << be_nl + << "this->" << base->flat_name () + << "_setup_collocation" << " (collocated);"; + } + + *os << be_uidt_nl << "}" << be_nl << be_nl; + + if (be_global->any_support ()) + { + *os << "void " << be_nl + << node->name () + << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl + << "{" << be_idt_nl + << node->local_name () << " *tmp = ACE_static_cast (" + << node->local_name () << " *, _tao_void_pointer);" << be_nl + << "CORBA::release (tmp);" << be_uidt_nl + << "}" << be_nl << be_nl; + } + + // The _narrow method. + *os << node->full_name () << "_ptr" << be_nl << node->full_name () + << "::_narrow (" << be_idt << be_idt_nl + << "Components::CCMObject_ptr obj" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "if (CORBA::is_nil (obj))" << be_idt_nl + << "{" << be_idt_nl + << "return " << bt->nested_type_name (this->ctx_->scope ()) + << "::_nil ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "CORBA::Boolean is_a =" << be_idt_nl + << "obj->_is_a (" << be_idt << be_idt_nl + << "\"" << node->repoID () << "\"" << be_nl + << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl + << "ACE_CHECK_RETURN (" << bt->nested_type_name (this->ctx_->scope ()) + << "::_nil ());" << be_nl << be_nl + << "if (is_a == 0)" << be_idt_nl + << "{" << be_idt_nl + << "return " << bt->nested_type_name (this->ctx_->scope ()) + << "::_nil ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "return " << bt->nested_type_name (this->ctx_->scope ()) + << "::_unchecked_narrow (obj ACE_ENV_ARG_PARAMETER);" << be_uidt_nl + << "}" << be_nl << be_nl; + + this->gen_unchecked_narrow (node, + bt, + os); + + // The _duplicate method + *os << node->full_name () << "_ptr" << be_nl + << node->full_name () << "::_duplicate (" + << bt->nested_type_name (this->ctx_->scope ()) + << "_ptr obj)" << be_nl + << "{" << be_idt_nl + << "if (! CORBA::is_nil (obj))" << be_idt_nl + << "{" << be_idt_nl + << "obj->_add_ref ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "return obj;" << be_uidt_nl + << "}" << be_nl << be_nl; + + // The is_a method. + *os << "CORBA::Boolean" << be_nl + << node->full_name () << "::_is_a (" << be_idt << be_idt_nl + << "const char *value" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "if (" << be_idt << be_idt_nl; + + AST_Component *ancestor = node; + + while (ancestor != 0) + { + *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl + << "(char *)value," << be_nl + << "\"" << ancestor->repoID () << "\"" << be_uidt_nl + << ") ||" << be_uidt_nl; + + ancestor = ancestor->base_component (); + } + + *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl + << "(char *)value," << be_nl + << "\"IDL:omg.org/Components/CCMObject:1.0\"" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << " )" << be_nl + << "{" << be_idt_nl + << "return 1; // success using local knowledge" << be_uidt_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl + << "{" << be_idt_nl + << "return this->CORBA_Object::_is_a (" << be_idt << be_idt_nl + << "value" << be_nl + << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_nl << be_nl; + + // Generate code for the elements of the component. + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component_cs::" + "visit_component - " + "codegen for scope failed\n"), + -1); + } + + // Smart Proxy classes. + if (be_global->gen_smart_proxies ()) + { + ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS); + be_visitor_interface_smart_proxy_cs isp_visitor (&ctx); + + if (node->accept (&isp_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_cs::" + "visit_component - " + "codegen for smart proxy classes failed\n"), + -1); + } + } + + if (be_global->tc_support ()) + { + ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN); + ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE); + be_visitor_typecode_defn tc_visitor (&ctx); + + if (node->accept (&tc_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_component_cs::" + "visit_component - " + "TypeCode definition failed\n"), + -1); + } + } + + return 0; +} + +void +be_visitor_component_cs::gen_unchecked_narrow (be_component *node, + be_type *bt, + TAO_OutStream *os) +{ + *os << node->full_name () << "_ptr " << be_nl + << node->full_name () << "::_unchecked_narrow (" + << be_idt << be_idt_nl + << "Components::CCMObject_ptr obj" << be_nl + << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl + << ")" << be_uidt_nl + << "{" << be_idt_nl + << "if (CORBA::is_nil (obj))" << be_idt_nl + << "{" << be_idt_nl + << "return " << bt->nested_type_name (this->ctx_->scope ()) + << "::_nil ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "TAO_Stub* stub = obj->_stubobj ();" << be_nl << be_nl + << "if (stub != 0)" << be_idt_nl + << "{" << be_idt_nl + << "stub->_incr_refcnt ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + + // Declare the default proxy. + *os << bt->nested_type_name (this->ctx_->scope ()) + << "_ptr default_proxy = " + << bt->nested_type_name (this->ctx_->scope ()) + <<"::_nil ();" << be_nl << be_nl; + + // If the policy didtates that the proxy be collocated, use the + // function to create one. + *os << "if (" << be_idt << be_idt_nl + << "!CORBA::is_nil (stub->servant_orb_var ().ptr ()) &&" << be_nl + << "stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects () &&" + << be_nl + << "obj->_is_collocated () &&" << be_nl + << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () + << "_Factory_function_pointer != 0" << be_uidt_nl << ")" + << be_nl << "{" + << be_idt_nl + << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + << "default_proxy," << be_nl + << "::" << bt->name () + << " (" << be_idt << be_idt_nl + << "stub," << be_nl + << "1," << be_nl + << "obj->_servant ()" << be_uidt_nl << ")," << be_uidt_nl + << bt->nested_type_name (this->ctx_->scope ()) + << "::_nil ()" << be_uidt_nl << ");" + << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + + + // The default proxy will either be returned else be transformed to + // a smart one! + *os << "if (CORBA::is_nil (default_proxy))" << be_idt_nl + << "{" << be_idt_nl + << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + << "default_proxy," << be_nl + << "::" << bt->name () << " (" << be_idt << be_idt_nl + << "stub," << be_nl + << "0," << be_nl + << "obj->_servant ()" << be_uidt_nl + << ")," << be_uidt_nl + << bt->nested_type_name (this->ctx_->scope ()) + << "::_nil ()" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + + if (be_global->gen_smart_proxies ()) + { + *os << "return TAO_" << node->flat_name () + << "_PROXY_FACTORY_ADAPTER::instance ()->create_proxy (default_proxy);" + << be_uidt_nl; + } + else + { + *os << "return default_proxy;" << be_uidt_nl; + } + + *os << "}" << be_nl << be_nl; +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp new file mode 100644 index 00000000000..53eb109f002 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp @@ -0,0 +1,43 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_ih.cpp +// +// = DESCRIPTION +// Visitor generating code for Interfaces in the implementation header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + component_ih, + "$Id$") + +// ************************************************************ +// Interface visitor for implementation header. +// ************************************************************ + +be_visitor_component_ih::be_visitor_component_ih (be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_ih::~be_visitor_component_ih (void) +{ +} + +int +be_visitor_component_ih::visit_component (be_component *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_IH); + be_visitor_interface_ih visitor (&ctx); + return visitor.visit_interface (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp new file mode 100644 index 00000000000..f19947c965f --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp @@ -0,0 +1,44 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_is.cpp +// +// = DESCRIPTION +// Visitor generating code for Components +// in the implementation skeletons file. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +// ************************************************************ +// Component visitor for implementation skeletons. +// ************************************************************ + +ACE_RCSID (be_visitor_component, + component_is, + "$Id$") + +be_visitor_component_is::be_visitor_component_is (be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_is::~be_visitor_component_is (void) +{ +} + +int +be_visitor_component_is::visit_component (be_component *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_IS); + be_visitor_interface_is visitor (&ctx); + return visitor.visit_interface (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp new file mode 100644 index 00000000000..80392e6076b --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp @@ -0,0 +1,318 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_sh.cpp +// +// = DESCRIPTION +// Visitor generating code for Components in the server header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + component_sh, + "$Id$") + +// ****************************************************** +// Component visitor for server header +// ****************************************************** + +be_visitor_component_sh::be_visitor_component_sh (be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_sh::~be_visitor_component_sh (void) +{ +} + +int +be_visitor_component_sh::visit_component (be_component *node) +{ + if (node->srv_hdr_gen () + || node->imported () + || node->is_abstract ()) + { + return 0; + } + + if (be_global->gen_amh_classes ()) + { + be_visitor_amh_interface_sh amh_intf (this->ctx_); + + if (amh_intf.visit_interface (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_sh::" + "visit_component - " + "codegen for AMH classes failed\n"), + -1); + } + } + + TAO_OutStream *os = this->ctx_->stream (); + ACE_CString class_name; + + // We shall have a POA_ prefix only if we are at the topmost level. + if (!node->is_nested ()) + { + // We are outermost. + class_name += "POA_"; + class_name += node->local_name (); + } + else + { + class_name += node->local_name (); + } + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // Generate the skeleton class name. + *os << "class " << class_name.c_str () << ";" << be_nl; + + // Generate the _ptr declaration. + *os << "typedef " << class_name.c_str () << " *" << class_name.c_str () + << "_ptr;" << be_nl << be_nl; + + // Forward class declarations. + if (be_global->gen_thru_poa_collocation ()) + { + *os << "class " << node->thru_poa_proxy_impl_name () << ";" << be_nl; + } + + if (be_global->gen_direct_collocation ()) + { + *os << "class " << node->direct_proxy_impl_name () << ";" << be_nl; + } + + if (be_global->gen_thru_poa_collocation () + || be_global->gen_direct_collocation ()) + { + *os << "class " << node->strategized_proxy_broker_name () + << ";" << be_nl; + } + + *os << be_nl; + + // Now generate the class definition. + *os << "class " << be_global->skel_export_macro () + << " " << class_name.c_str () << be_idt_nl << ": " << be_idt; + + int has_concrete_parent = 0; + + AST_Component *base = node->base_component (); + + if (base != 0) + { + has_concrete_parent = 1; + + *os << "public virtual POA_" << base->name (); + } + + long nsupports = node->n_inherits (); + AST_Interface **supports = node->supports (); + AST_Interface *supported = 0; + + for (long i = 0; i < nsupports; ++i) + { + supported = supports[i]; + + if (supported->is_abstract ()) + { + continue; + } + + if (has_concrete_parent) + { + *os << "," << be_nl; + } + + *os << "public virtual POA_" << supported->name (); + + has_concrete_parent = 1; + } + + if (has_concrete_parent == 0) + { + *os << "public virtual PortableServer::ServantBase"; + } + + *os << be_uidt << be_uidt_nl + << "{" << be_nl + << "protected:" << be_idt_nl; + + // Default constructor. + *os << class_name.c_str () << " (void);" << be_uidt_nl << be_nl + << "public:" << be_idt_nl; + + // Copy constructor and destructor. + *os << class_name.c_str () << " (const " + << class_name.c_str () << "& rhs);" << be_nl + << "virtual ~" << class_name.c_str () << " (void);" << be_nl << be_nl; + + // _is_a + *os << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl + << "const char* logical_type_id" << be_nl + << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // _downcast + *os << "virtual void* _downcast (" << be_idt << be_idt_nl + << "const char* logical_type_id" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // Add a skeleton for our _is_a method. + *os << "static void _is_a_skel (" << be_idt << be_idt_nl + << "TAO_ServerRequest &req," << be_nl + << "void *servant," << be_nl + << "void *servant_upcall" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // Add a skeleton for our _non_existent method. + *os << "static void _non_existent_skel (" << be_idt << be_idt_nl + << "TAO_ServerRequest &req," << be_nl + << "void *servant," << be_nl + << "void *servant_upcall" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // Add a skeleton for our _interface method. + *os << "static void _interface_skel (" << be_idt << be_idt_nl + << "TAO_ServerRequest &req," << be_nl + << "void *servant," << be_nl + << "void *servant_upcall" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // Add a skeleton for our _component method. + *os << "static void _component_skel (" << be_idt << be_idt_nl + << "TAO_ServerRequest &req," << be_nl + << "void *obj," << be_nl + << "void *servant_upcall" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // Add the dispatch method. + *os << "virtual void _dispatch (" << be_idt << be_idt_nl + << "TAO_ServerRequest &req," << be_nl + << "void *_servant_upcall" << be_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // _this + *os << "::" << node->full_name () << " *_this (" << be_idt << be_idt_nl + << "ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // _interface_repository_id + *os << "virtual const char* _interface_repository_id " + << "(void) const;"; + + // Generate code for elements in the scope (e.g., operations). + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_sh::" + "visit_component - " + "codegen for scope failed\n"), + -1); + } + + // Generate skeletons for operations of our base classes. These + // skeletons just cast the pointer to the appropriate type + // before invoking the call. + int status = + node->traverse_inheritance_graph ( + be_interface::gen_skel_helper, + os + ); + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_sh::" + "visit_component - " + "inheritance graph traversal failed\n"), + -1); + } + + *os << be_uidt_nl << "};" << be_nl << be_nl; + + // Generate the embedded RequestInfo classes per operation. + // This is to be used by interceptors. + be_visitor_context ctx (*this->ctx_); + + if (be_global->gen_thru_poa_collocation () + || be_global->gen_direct_collocation ()) + { + ctx = *this->ctx_; + // Generate strategized proxy broker. + ctx.state (TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH); + be_visitor_interface_strategized_proxy_broker_sh ispb_visitor (&ctx); + + if (node->accept (&ispb_visitor) == -1) + { + ACE_ERROR_RETURN (( + LM_ERROR, + "be_visitor_component_sh::" + "visit_component - " + "codegen for thru_poa_collocated class failed\n" + ), + -1 + ); + } + } + + ctx = *this->ctx_; + + // Generate the collocated class. + if (be_global->gen_thru_poa_collocation ()) + { + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH); + be_visitor_interface_thru_poa_proxy_impl_sh itppi_visitor (&ctx); + + if (node->accept (&itppi_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_component_sh::" + "visit_component - " + "codegen for thru_poa_collocated class failed\n"), + -1); + } + } + + ctx = *this->ctx_; + + if (be_global->gen_direct_collocation ()) + { + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH); + be_visitor_interface_direct_proxy_impl_sh idpi_visitor (&ctx); + + if (node->accept (&idpi_visitor) == -1) + { + ACE_ERROR_RETURN (( + LM_ERROR, + "be_visitor_component_sh::" + "visit_component - " + "codegen for thru_poa_collocated class failed\n" + ), + -1 + ); + } + } + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp new file mode 100644 index 00000000000..2aed521e7ff --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp @@ -0,0 +1,45 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_si.cpp +// +// = DESCRIPTION +// Visitor generating code for Components in the server inline. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + component_si, + "$Id$") + +// ****************************************************** +// Component visitor for server inline +// ****************************************************** + +be_visitor_component_si::be_visitor_component_si (be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_si::~be_visitor_component_si (void) +{ +} + +int +be_visitor_component_si::visit_component (be_component *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_SI); + be_visitor_interface_si visitor (&ctx); + return visitor.visit_interface (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp new file mode 100644 index 00000000000..8fa2d2d88c3 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp @@ -0,0 +1,43 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_si.cpp +// +// = DESCRIPTION +// Visitor generating code for Components in the server skeleton. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component, + component_ss, + "$Id$") + +// ****************************************************** +// Component visitor for server skeleton +// ****************************************************** + +be_visitor_component_ss::be_visitor_component_ss (be_visitor_context *ctx) + : be_visitor_component (ctx) +{ +} + +be_visitor_component_ss::~be_visitor_component_ss (void) +{ +} + +int +be_visitor_component_ss::visit_component (be_component *node) +{ + // TODO + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd.cpp index 97746d88aa2..ff74772f398 100644 --- a/TAO/TAO_IDL/be/be_visitor_component_fwd.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component_fwd.cpp @@ -18,9 +18,18 @@ // // ============================================================================ +#include "be_component_fwd.h" +#include "be_helper.h" + #include "be_visitor_component_fwd.h" +#include "be_visitor_interface_fwd.h" #include "be_visitor_context.h" +#include "be_visitor_component_fwd/component_fwd_ch.cpp" +#include "be_visitor_component_fwd/any_op_ch.cpp" +#include "be_visitor_component_fwd/cdr_op_ch.cpp" +#include "be_visitor_component_fwd/cdr_op_ci.cpp" + ACE_RCSID (be, be_visitor_component_fwd, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd/any_op_ch.cpp new file mode 100644 index 00000000000..6265ec59819 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component_fwd/any_op_ch.cpp @@ -0,0 +1,50 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for Any operators for a forward declared +// component in the client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component_fwd, + any_op_ch, + "$Id$") + +// *************************************************************************** +// Generates Any operator declarations in the client header +// *************************************************************************** + +be_visitor_component_fwd_any_op_ch::be_visitor_component_fwd_any_op_ch ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_component_fwd_any_op_ch::~be_visitor_component_fwd_any_op_ch (void) +{ +} + +int +be_visitor_component_fwd_any_op_ch::visit_component_fwd ( + be_component_fwd *node + ) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_ANY_OP_CH); + be_visitor_interface_fwd_any_op_ch visitor (&ctx); + return visitor.visit_interface_fwd (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ch.cpp new file mode 100644 index 00000000000..dbaf7ae2962 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ch.cpp @@ -0,0 +1,49 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for CDR operators for forward declared +// components. This uses compiled marshaling. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component_fwd, + cdr_op_ch, + "$Id$") + +// *************************************************************************** +// Forward declared component visitor for generating CDR operator declarations +// in the client header. Called if this node is not later defined in the file. +// *************************************************************************** + +be_visitor_component_fwd_cdr_op_ch::be_visitor_component_fwd_cdr_op_ch ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_component_fwd_cdr_op_ch::~be_visitor_component_fwd_cdr_op_ch (void) +{ +} + +int +be_visitor_component_fwd_cdr_op_ch::visit_component_fwd (be_component_fwd *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CH); + be_visitor_interface_fwd_cdr_op_ch visitor (&ctx); + return visitor.visit_interface_fwd (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ci.cpp new file mode 100644 index 00000000000..a8881b73401 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component_fwd/cdr_op_ci.cpp @@ -0,0 +1,53 @@ +// +// $Id$ +// + +// ================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ci.cpp +// +// = DESCRIPTION +// Visitor generating code for CDR operators for forward +// declarations of components. This uses compiled marshaling. +// +// = AUTHOR +// Jeff Parsons +// +// ================================================================ + +ACE_RCSID (be_visitor_component_fwd, + cdr_op_ci, + "$Id$") + +// **************************************************************** +// Interface visitor for generating CDR operator declarations in the +// client header +// **************************************************************** + +be_visitor_component_fwd_cdr_op_ci::be_visitor_component_fwd_cdr_op_ci ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_component_fwd_cdr_op_ci::~be_visitor_component_fwd_cdr_op_ci ( + void + ) +{ +} + +int +be_visitor_component_fwd_cdr_op_ci::visit_component_fwd ( + be_component_fwd *node + ) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI); + be_visitor_interface_fwd_cdr_op_ci visitor (&ctx); + return visitor.visit_interface_fwd (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_component_fwd/component_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component_fwd/component_fwd_ch.cpp new file mode 100644 index 00000000000..74a63aee491 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_component_fwd/component_fwd_ch.cpp @@ -0,0 +1,49 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_fwd_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for Component_Fwd node in the client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_component_fwd, + component_fwd_ch, + "$Id$") + +// ******************************************************************** +// Visitor implementation for the Component_Fwd type +// This one for the client header file +// ******************************************************************** + +be_visitor_component_fwd_ch::be_visitor_component_fwd_ch ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_component_fwd_ch::~be_visitor_component_fwd_ch (void) +{ +} + +// Visit the component_fwd_ch node and its scope. +int +be_visitor_component_fwd_ch::visit_component_fwd (be_component_fwd *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CH); + be_visitor_interface_fwd_ch visitor (&ctx); + return visitor.visit_interface_fwd (node); +} 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 67099d736cc..b9c75e6ecb5 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_ch.cpp @@ -48,13 +48,14 @@ be_visitor_constant_ch::visit_constant (be_constant *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // If we are defined in the outermost scope, then the value is assigned // to us here itself, else it will be in the *.cpp file. -// if (be_global->gen_inline_constants ()) + *os << be_nl << be_nl; + if (! node->is_nested () || node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { @@ -87,16 +88,9 @@ be_visitor_constant_ch::visit_constant (be_constant *node) } *os << " " << node->local_name (); - - if (!node->is_nested ()) - { - // We were defined at the outermost scope. So we put the value - // in the header itself. - *os << " = " << node->constant_value (); - } } - *os << ";" << be_nl << be_nl; + *os << ";"; node->cli_hdr_gen (I_TRUE); return 0; 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 4db768a4fd4..d60696b0bd3 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp @@ -55,9 +55,11 @@ be_visitor_constant_cs::visit_constant (be_constant *node) { // For those constants not defined in the outermost scope, // or in a module, they get assigned to their values in the source file. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; - *os << "const "; + *os << be_nl << be_nl + << "const "; if (node->et () == AST_Expression::EV_enum) { @@ -70,7 +72,7 @@ be_visitor_constant_cs::visit_constant (be_constant *node) *os << " " << node->name () << " = " << node->constant_value () - << ";\n\n"; + << ";"; } node->cli_stub_gen (I_TRUE); 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 39c00c5a786..42f22c4611c 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 @@ -47,16 +47,17 @@ be_visitor_enum_any_op_ch::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Generate the Any <<= and >>= operators. - *os << be_global->stub_export_macro () << " void" + *os << be_nl << be_nl + << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, " << node->name () << ");" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, " - << node->name () << " &);" << be_nl << be_nl; + << node->name () << " &);"; node->cli_hdr_any_op_gen (1); return 0; 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 334c8cccd83..4b9029c5bc4 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 @@ -48,9 +48,11 @@ be_visitor_enum_any_op_cs::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the Any <<= and >>= operator declarations // Any <<= and >>= operators. - os->indent (); *os << "void operator<<= (CORBA::Any &_tao_any, " << node->name () << " _tao_elem)" << be_nl << "{" << be_idt_nl @@ -89,7 +91,7 @@ be_visitor_enum_any_op_cs::visit_enum (be_enum *node) << "}" << be_nl << "ACE_ENDTRY;" << be_nl << "return 0;" << be_uidt_nl - << "}\n\n"; + << "}"; node->cli_stub_any_op_gen (1); return 0; 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 a0161e9cb06..dd7dc2169d0 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 @@ -46,15 +46,16 @@ be_visitor_enum_cdr_op_ch::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // generate the CDR << and >> operators - os->indent (); *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const " << node->name () << " &);" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>> (TAO_InputCDR &, " - << node->name () << " &);\n"; + << node->name () << " &);"; node->cli_hdr_cdr_op_gen (1); return 0; 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 cab73d5328c..dc6c41e6b63 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 @@ -47,16 +47,19 @@ be_visitor_enum_cdr_op_ci::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); - // Generate CDR << and >> operators. - os->indent (); - *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, " + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << "ACE_INLINE" << be_nl + << "CORBA::Boolean operator<< (TAO_OutputCDR &strm, " << "const " << node->name () << " &_tao_enumval)" << be_nl << "{" << be_idt_nl << "CORBA::ULong _tao_temp = _tao_enumval;" << be_nl << "return strm << _tao_temp;" << be_uidt_nl - << "}\n\n"; + << "}" << be_nl << be_nl; - *os << "ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, " + *os << "ACE_INLINE" << be_nl + << "CORBA::Boolean operator>> (TAO_InputCDR &strm, " << node->name () << " &_tao_enumval)" << be_nl << "{" << be_idt_nl << "CORBA::ULong _tao_temp = 0;" << be_nl @@ -67,7 +70,7 @@ be_visitor_enum_cdr_op_ci::visit_enum (be_enum *node) << ", _tao_temp);" << be_uidt_nl << "}" << be_uidt_nl << be_nl << "return _tao_result;" << be_uidt_nl - << "}\n\n"; + << "}"; node->cli_inline_cdr_op_gen (1); return 0; 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 61cae521526..d7384b3666c 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/enum_ch.cpp @@ -53,7 +53,7 @@ be_visitor_enum_ch::visit_enum (be_enum *node) // Comma to be generated by the scope visitor. this->ctx_->comma (1); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "enum " << node->local_name () << be_nl; @@ -74,13 +74,10 @@ be_visitor_enum_ch::visit_enum (be_enum *node) // As per the ORBOS spec, we need the following typedef *os << "typedef " << node->local_name () << " &" << node->local_name () - << "_out;" << be_nl << be_nl; + << "_out;"; - if (!node->is_local ()) + if (be_global->tc_support ()) { - // By using a visitor to declare and define the TypeCode, we have - // the added advantage to conditionally not generate any code. This - // will be based on the command line options. This is still TO-DO. be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL); be_visitor_typecode_decl visitor (&ctx); diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype.cpp new file mode 100644 index 00000000000..a2f3b77b20e --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype.cpp @@ -0,0 +1,47 @@ + +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_visitor_eventtype.cpp +// +// = DESCRIPTION +// Concrete visitor for the Eventtype class +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#include "ace/SString.h" + +#include "be_eventtype.h" + +#include "be_visitor_eventtype.h" +#include "be_visitor_valuetype.h" +#include "be_visitor_context.h" +#include "be_helper.h" + +#include "be_visitor_eventtype/eventtype_ch.cpp" +#include "be_visitor_eventtype/eventtype_ci.cpp" +#include "be_visitor_eventtype/eventtype_cs.cpp" +#include "be_visitor_eventtype/eventtype_sh.cpp" +#include "be_visitor_eventtype/eventtype_si.cpp" +#include "be_visitor_eventtype/eventtype_ss.cpp" +#include "be_visitor_eventtype/eventtype_obv_ch.cpp" +#include "be_visitor_eventtype/eventtype_obv_ci.cpp" +#include "be_visitor_eventtype/eventtype_obv_cs.cpp" +#include "be_visitor_eventtype/any_op_ch.cpp" +#include "be_visitor_eventtype/any_op_cs.cpp" +#include "be_visitor_eventtype/cdr_op_ch.cpp" +#include "be_visitor_eventtype/cdr_op_ci.cpp" +#include "be_visitor_eventtype/cdr_op_cs.cpp" + +ACE_RCSID (be, + be_visitor_eventtype, + "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/any_op_ch.cpp new file mode 100644 index 00000000000..ee9ad8114ea --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/any_op_ch.cpp @@ -0,0 +1,47 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating Any operators for Eventtypes in the client header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + any_op_ch, + "$Id$") + +// ****************************************************** +// Eventtype visitor for Any operators in the client header +// ****************************************************** + +be_visitor_eventtype_any_op_ch::be_visitor_eventtype_any_op_ch ( + be_visitor_context *ctx + ) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_any_op_ch::~be_visitor_eventtype_any_op_ch (void) +{ +} + +int +be_visitor_eventtype_any_op_ch::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH); + be_visitor_valuetype_any_op_ch visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/any_op_cs.cpp new file mode 100644 index 00000000000..afd3ee3f1fb --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/any_op_cs.cpp @@ -0,0 +1,47 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_cs.cpp +// +// = DESCRIPTION +// Visitor generating Any operators for Eventtypes in the client source +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + any_op_cs, + "$Id$") + +// ****************************************************** +// Eventtype visitor for Any operators in the client source +// ****************************************************** + +be_visitor_eventtype_any_op_cs::be_visitor_eventtype_any_op_cs ( + be_visitor_context *ctx + ) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_any_op_cs::~be_visitor_eventtype_any_op_cs (void) +{ +} + +int +be_visitor_eventtype_any_op_cs::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS); + be_visitor_valuetype_any_op_cs visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_ch.cpp new file mode 100644 index 00000000000..37cfe88d0db --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_ch.cpp @@ -0,0 +1,47 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating CDR operators for Eventtypes in the client header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + cdr_op_ch, + "$Id$") + +// ****************************************************** +// Eventtype visitor for CDR operators in the client header +// ****************************************************** + +be_visitor_eventtype_cdr_op_ch::be_visitor_eventtype_cdr_op_ch ( + be_visitor_context *ctx + ) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_cdr_op_ch::~be_visitor_eventtype_cdr_op_ch (void) +{ +} + +int +be_visitor_eventtype_cdr_op_ch::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH); + be_visitor_valuetype_cdr_op_ch visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_ci.cpp new file mode 100644 index 00000000000..e74a25cbaa6 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_ci.cpp @@ -0,0 +1,47 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ci.cpp +// +// = DESCRIPTION +// Visitor generating CDR operators for Eventtypes in the client inline +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + cdr_op_ci, + "$Id$") + +// ****************************************************** +// Eventtype visitor for CDR operators in the client inline +// ****************************************************** + +be_visitor_eventtype_cdr_op_ci::be_visitor_eventtype_cdr_op_ci ( + be_visitor_context *ctx + ) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_cdr_op_ci::~be_visitor_eventtype_cdr_op_ci (void) +{ +} + +int +be_visitor_eventtype_cdr_op_ci::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI); + be_visitor_valuetype_cdr_op_ci visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_cs.cpp new file mode 100644 index 00000000000..57d12119f84 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/cdr_op_cs.cpp @@ -0,0 +1,47 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_cs.cpp +// +// = DESCRIPTION +// Visitor generating CDR operators for Eventtypes in the client source +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + cdr_op_cs, + "$Id$") + +// ****************************************************** +// Eventtype visitor for CDR operators in the client source +// ****************************************************** + +be_visitor_eventtype_cdr_op_cs::be_visitor_eventtype_cdr_op_cs ( + be_visitor_context *ctx + ) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_cdr_op_cs::~be_visitor_eventtype_cdr_op_cs (void) +{ +} + +int +be_visitor_eventtype_cdr_op_cs::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS); + be_visitor_valuetype_cdr_op_cs visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ch.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ch.cpp new file mode 100644 index 00000000000..4744504c2c7 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ch.cpp @@ -0,0 +1,69 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the client header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_ch, + "$Id$") + +// ****************************************************** +// Eventtype visitor for client header +// ****************************************************** + +be_visitor_eventtype_ch::be_visitor_eventtype_ch (be_visitor_context *ctx) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_ch::~be_visitor_eventtype_ch (void) +{ +} + +int +be_visitor_eventtype_ch::visit_eventtype (be_eventtype *node) +{ + if (node->cli_hdr_gen () || node->imported ()) + { + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + // All we do in this is generate a forward declaration of the + // corresponding consumer interface class. + *os << be_nl << be_nl << "class " << node->local_name () << "Consumer;"; + + // Generate the ifdefined macro for the _ptr type. + os->gen_ifdef_macro (node->flat_name (), "Consumer_ptr"); + + // Generate the _ptr typedef. + *os << be_nl << be_nl + << "typedef " << node->local_name () << "Consumer *" << node->local_name () + << "Consumer_ptr;"; + + os->gen_endif (); + + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CH); + be_visitor_valuetype_ch visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ci.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ci.cpp new file mode 100644 index 00000000000..26b703e8156 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ci.cpp @@ -0,0 +1,45 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_ci.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the client inline +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_ci, + "$Id$") + +// ****************************************************** +// Eventtype visitor for client inline +// ****************************************************** + +be_visitor_eventtype_ci::be_visitor_eventtype_ci (be_visitor_context *ctx) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_ci::~be_visitor_eventtype_ci (void) +{ +} + +int +be_visitor_eventtype_ci::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CI); + be_visitor_valuetype_ci visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_cs.cpp new file mode 100644 index 00000000000..8a81117e1a7 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_cs.cpp @@ -0,0 +1,45 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_cs.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the client source +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_cs, + "$Id$") + +// ****************************************************** +// Eventtype visitor for client source +// ****************************************************** + +be_visitor_eventtype_cs::be_visitor_eventtype_cs (be_visitor_context *ctx) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_cs::~be_visitor_eventtype_cs (void) +{ +} + +int +be_visitor_eventtype_cs::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_CS); + be_visitor_valuetype_cs visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_ch.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_ch.cpp new file mode 100644 index 00000000000..99d5fd7e3fa --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_ch.cpp @@ -0,0 +1,52 @@ + +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_obv_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the client header +// OBV_ class +// (see C++ mapping OMG 20.17) +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_obv_ch, + "$Id$") + +// ****************************************************** +// Eventtype visitor for client header +// ****************************************************** + +be_visitor_eventtype_obv_ch::be_visitor_eventtype_obv_ch ( + be_visitor_context *ctx + ) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_obv_ch::~be_visitor_eventtype_obv_ch (void) +{ +} + + +// OBV_ class must be in OBV_ namespace. +int +be_visitor_eventtype_obv_ch::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CH); + be_visitor_valuetype_obv_ch visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_ci.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_ci.cpp new file mode 100644 index 00000000000..a875f18c37c --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_ci.cpp @@ -0,0 +1,52 @@ + +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_obv_ci.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the client inline +// OBV_ class +// (see C++ mapping OMG 20.17) +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_obv_ci, + "$Id$") + +// ****************************************************** +// Eventtype visitor for client inline +// ****************************************************** + +be_visitor_eventtype_obv_ci::be_visitor_eventtype_obv_ci ( + be_visitor_context *ctx + ) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_obv_ci::~be_visitor_eventtype_obv_ci (void) +{ +} + + +// OBV_ class must be in OBV_ namespace. +int +be_visitor_eventtype_obv_ci::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CI); + be_visitor_valuetype_obv_ci visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_cs.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_cs.cpp new file mode 100644 index 00000000000..f64338ed528 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_obv_cs.cpp @@ -0,0 +1,52 @@ + +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_obv_cs.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the client stub +// OBV_ class +// (see C++ mapping OMG 20.17) +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_obv_cs, + "$Id$") + +// ****************************************************** +// Eventtype visitor for client stub +// ****************************************************** + +be_visitor_eventtype_obv_cs::be_visitor_eventtype_obv_cs ( + be_visitor_context *ctx + ) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_obv_cs::~be_visitor_eventtype_obv_cs (void) +{ +} + + +// OBV_ class must be in OBV_ namespace. +int +be_visitor_eventtype_obv_cs::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_OBV_CS); + be_visitor_valuetype_obv_cs visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_sh.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_sh.cpp new file mode 100644 index 00000000000..2897e28c9e1 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_sh.cpp @@ -0,0 +1,45 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_sh.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the server header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_sh, + "$Id$") + +// ****************************************************** +// Eventtype visitor for server header +// ****************************************************** + +be_visitor_eventtype_sh::be_visitor_eventtype_sh (be_visitor_context *ctx) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_sh::~be_visitor_eventtype_sh (void) +{ +} + +int +be_visitor_eventtype_sh::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_SH); + be_visitor_valuetype_sh visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_si.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_si.cpp new file mode 100644 index 00000000000..a3f1041ea89 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_si.cpp @@ -0,0 +1,45 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_si.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the server inline +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_si, + "$Id$") + +// ****************************************************** +// Eventtype visitor for server inline +// ****************************************************** + +be_visitor_eventtype_si::be_visitor_eventtype_si (be_visitor_context *ctx) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_si::~be_visitor_eventtype_si (void) +{ +} + +int +be_visitor_eventtype_si::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_SI); + be_visitor_valuetype_si visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ss.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ss.cpp new file mode 100644 index 00000000000..689ec9a3627 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype/eventtype_ss.cpp @@ -0,0 +1,45 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_ss.cpp +// +// = DESCRIPTION +// Visitor generating code for Eventtypes in the server source +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype, + eventtype_ss, + "$Id$") + +// ****************************************************** +// Eventtype visitor for server source +// ****************************************************** + +be_visitor_eventtype_ss::be_visitor_eventtype_ss (be_visitor_context *ctx) + : be_visitor_valuetype (ctx) +{ +} + +be_visitor_eventtype_ss::~be_visitor_eventtype_ss (void) +{ +} + +int +be_visitor_eventtype_ss::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_SS); + be_visitor_valuetype_ss visitor (&ctx); + return visitor.visit_valuetype (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd.cpp new file mode 100644 index 00000000000..39c79aff083 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd.cpp @@ -0,0 +1,35 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_visitor_eventtype_fwd.cpp +// +// = DESCRIPTION +// Visitors for generation of code for Eventtype_Fwd +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#include "be_eventtype_fwd.h" + +#include "be_visitor_eventtype_fwd.h" +#include "be_visitor_valuetype_fwd.h" +#include "be_visitor_context.h" + +#include "be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp" +#include "be_visitor_eventtype_fwd/any_op_ch.cpp" +#include "be_visitor_eventtype_fwd/cdr_op_ch.cpp" +#include "be_visitor_eventtype_fwd/cdr_op_ci.cpp" + +ACE_RCSID (be, + be_visitor_eventtype_fwd, + "$Id$") + diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/any_op_ch.cpp new file mode 100644 index 00000000000..1c59727c4c8 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/any_op_ch.cpp @@ -0,0 +1,44 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating Any operators for EventTypeFwd node in the +// client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype_fwd, + any_op_ch, + "$Id$") + +be_visitor_eventtype_fwd_any_op_ch::be_visitor_eventtype_fwd_any_op_ch ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_eventtype_fwd_any_op_ch::~be_visitor_eventtype_fwd_any_op_ch (void) +{ +} + +int +be_visitor_eventtype_fwd_any_op_ch::visit_eventtype_fwd (be_eventtype_fwd *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_ANY_OP_CH); + be_visitor_valuetype_fwd_any_op_ch visitor (&ctx); + return visitor.visit_valuetype_fwd (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/cdr_op_ch.cpp new file mode 100644 index 00000000000..9bc1231c8f4 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/cdr_op_ch.cpp @@ -0,0 +1,44 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_fwd_cdr_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating CDR operators for EventTypeFwd node in the +// client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype_fwd, + eventtype_fwd_cdr_op_ch, + "$Id$") + +be_visitor_eventtype_fwd_cdr_op_ch::be_visitor_eventtype_fwd_cdr_op_ch ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_eventtype_fwd_cdr_op_ch::~be_visitor_eventtype_fwd_cdr_op_ch (void) +{ +} + +int +be_visitor_eventtype_fwd_cdr_op_ch::visit_eventtype_fwd (be_eventtype_fwd *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CH); + be_visitor_valuetype_fwd_cdr_op_ch visitor (&ctx); + return visitor.visit_valuetype_fwd (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/cdr_op_ci.cpp new file mode 100644 index 00000000000..303c88f4bcd --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/cdr_op_ci.cpp @@ -0,0 +1,44 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ci.cpp +// +// = DESCRIPTION +// Visitor generating CDR operators for EventTypeFwd node in the +// client inline. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype_fwd, + cdr_op_ci, + "$Id$") + +be_visitor_eventtype_fwd_cdr_op_ci::be_visitor_eventtype_fwd_cdr_op_ci ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_eventtype_fwd_cdr_op_ci::~be_visitor_eventtype_fwd_cdr_op_ci (void) +{ +} + +int +be_visitor_eventtype_fwd_cdr_op_ci::visit_eventtype_fwd (be_eventtype_fwd *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CDR_OP_CI); + be_visitor_valuetype_fwd_cdr_op_ci visitor (&ctx); + return visitor.visit_valuetype_fwd (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp new file mode 100644 index 00000000000..41a304a1e8c --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp @@ -0,0 +1,43 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_fwd_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for EventTypeFwd node in the client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_eventtype_fwd, + eventtype_fwd_ch, + "$Id$") + +be_visitor_eventtype_fwd_ch::be_visitor_eventtype_fwd_ch ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_eventtype_fwd_ch::~be_visitor_eventtype_fwd_ch (void) +{ +} + +int +be_visitor_eventtype_fwd_ch::visit_eventtype_fwd (be_eventtype_fwd *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CH); + be_visitor_valuetype_fwd_ch visitor (&ctx); + return visitor.visit_valuetype_fwd (node); +} 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 4a1c5f1b35a..6da03378b3e 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 @@ -48,10 +48,11 @@ be_visitor_exception_any_op_ch::visit_exception (be_exception *node) TAO_OutStream *os = this->ctx_->stream (); - // Generate the Any <<= and >>= operator declarations.. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; - *os << be_global->stub_export_macro () << " void" + *os << be_nl << be_nl + << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, const " << node->name () << " &); // copying version" << be_nl; *os << be_global->stub_export_macro () << " void" @@ -62,7 +63,7 @@ be_visitor_exception_any_op_ch::visit_exception (be_exception *node) << node->name () << " *&); // deprecated\n"; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, const " - << node->name () << " *&);\n"; + << node->name () << " *&);"; // All we have to do is to visit the scope and generate code. 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 d53cb630aa0..39ee52ea74f 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 @@ -49,12 +49,10 @@ be_visitor_exception_any_op_cs::visit_exception (be_exception *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - // Any <<= and >>= operators. - // Copying insertion operator. *os << "// Copying insertion." << be_nl @@ -245,7 +243,7 @@ be_visitor_exception_any_op_cs::visit_exception (be_exception *node) << "}" << be_nl << "ACE_ENDTRY;" << be_nl << be_nl << "return 0;" << be_uidt_nl - << "}\n\n"; + << "}"; // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) 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 4fb5a4f291f..ece5f6de4bc 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 @@ -48,15 +48,16 @@ be_visitor_exception_cdr_op_ch::visit_exception (be_exception *node) TAO_OutStream *os = this->ctx_->stream (); - // Generate the CDR << and >> operator declarations. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; - *os << be_global->stub_export_macro () << " CORBA::Boolean" + *os << be_nl << be_nl + << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const " << node->name () << " &);" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>> (TAO_InputCDR &, " - << node->name () << " &);\n"; + << node->name () << " &);"; // Set the substate as generating code for the types defined in our scope. @@ -71,8 +72,6 @@ be_visitor_exception_cdr_op_ch::visit_exception (be_exception *node) -1); } - *os << be_nl; - node->cli_hdr_cdr_op_gen (1); return 0; } 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 28fe2a3b1bb..ec5ee86e862 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 @@ -67,10 +67,14 @@ be_visitor_exception_cdr_op_ci::visit_exception (be_exception *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Set the sub state as generating code for the output operator. this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT); - *os << "ACE_INLINE" << be_nl + *os << be_nl << be_nl + << "ACE_INLINE" << be_nl << "CORBA::Boolean operator<< (" << be_idt << be_idt_nl << "TAO_OutputCDR &strm," << be_nl << "const " << node->name () << " &_tao_aggregate" << be_uidt_nl @@ -194,7 +198,7 @@ be_visitor_exception_cdr_op_ci::visit_exception (be_exception *node) *os << "return 1;" << be_uidt_nl; } - *os << "}" << be_nl << be_nl; + *os << "}"; node->cli_inline_cdr_op_gen (1); return 0; 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 5894e7b4d1a..460f96a72fb 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp @@ -47,12 +47,12 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_macro (node->flat_name ()); - *os << "class " << be_global->stub_export_macro () + *os << be_nl << be_nl << "class " << be_global->stub_export_macro () << " " << node->local_name () << " : public CORBA::UserException" << be_nl; *os << "{" << be_nl @@ -78,9 +78,13 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) // Assignment operator. *os << node->local_name () << " &operator= (const " - << node->local_name () << " &);\n" << be_nl; + << node->local_name () << " &);" << be_nl << be_nl; + + if (be_global->any_support ()) + { + *os << "static void _tao_any_destructor (void *);" << be_nl << be_nl; + } - *os << "static void _tao_any_destructor (void*);\n" << be_nl; *os << "static " << node->local_name () << " *_downcast (CORBA::Exception *);" << be_nl; @@ -97,7 +101,7 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) << "virtual void _tao_decode (" << be_idt << be_idt_nl << "TAO_InputCDR &" << be_nl << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + << ");" << be_uidt; // Generate constructor that takes each member as a parameter. We need a // new state. Such a constructor exists if we have members. @@ -117,12 +121,16 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) } } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + if (be_global->tc_support ()) { - *os << be_nl <<"virtual CORBA::TypeCode_ptr _type (void) const;"; + *os << be_nl << be_nl + << "virtual CORBA::TypeCode_ptr _type (void) const;"; } - *os << be_uidt_nl << "};" << be_nl << be_nl; + *os << be_uidt_nl << "};"; if (be_global->tc_support ()) { 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 dd6ffb31917..676c51401bc 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ci.cpp @@ -39,30 +39,21 @@ be_visitor_exception_ci::~be_visitor_exception_ci (void) // visit the Exception node and its scope int be_visitor_exception_ci::visit_exception (be_exception *node) { - TAO_OutStream *os = this->ctx_->stream (); - - if (!node->cli_inline_gen () && !node->imported ()) + if (node->cli_inline_gen () || node->imported ()) { - os = this->ctx_->stream (); - os->indent (); - - *os << "// *************************************************************" - << be_nl; - *os << "// Inline operations for exception " << node->name () << be_nl; - *os << "// *************************************************************\n\n"; - - // Generate inline code required of any anonymous types of members. - if (this->visit_scope (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_exception::" - "visit_exception -" - "code for inline failed\n"), - -1); - } + return 0; + } - node->cli_inline_gen (I_TRUE); + // Generate inline code required of any anonymous types of members. + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_exception::" + "visit_exception -" + "code for inline failed\n"), + -1); } + node->cli_inline_gen (I_TRUE); return 0; } 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 50498fa9201..2f68fc0afd4 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp @@ -59,11 +59,10 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) -1); } - *os << "// TAO_IDL - Generated from " << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Default constructor. - *os << "// Default constructor." << be_nl; *os << node->name () << "::" << node->local_name () << " (void)" << be_idt_nl; *os << ": CORBA_UserException (" << be_idt << be_idt << be_idt_nl @@ -74,15 +73,12 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) *os << "}" << be_nl << be_nl; // Destructor. - *os << "// Destructor - all members are of self managing types." - << be_nl; *os << node->name () << "::~" << node->local_name () << " (void)" << be_nl; *os << "{" << be_nl; *os << "}" << be_nl << be_nl; // Copy constructor. - *os << "// Copy constructor." << be_nl; *os << node->name () << "::" << node->local_name () << " (const ::" << node->name () << " &_tao_excp)" << be_idt_nl; *os << ": CORBA_UserException (" << be_idt << be_idt << be_idt_nl @@ -115,7 +111,6 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) << "}" << be_nl << be_nl; // Assignment operator. - *os << "// Assignment operator." << be_nl; *os << node->name () << "&" << be_nl; *os << node->name () << "::operator= (const ::" << node->name () << " &_tao_excp)" << be_nl @@ -141,14 +136,17 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) << "return *this;" << be_uidt_nl << "}" << be_nl << be_nl; - *os << "void " - << node->name () - << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl - << "{" << be_idt_nl - << node->local_name () << " *tmp = ACE_static_cast (" - << node->local_name () << "*, _tao_void_pointer);" << be_nl - << "delete tmp;" << be_uidt_nl - << "}" << be_nl << be_nl; + if (be_global->any_support ()) + { + *os << "void " + << node->name () + << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl + << "{" << be_idt_nl + << node->local_name () << " *tmp = ACE_static_cast (" + << node->local_name () << "*, _tao_void_pointer);" << be_nl + << "delete tmp;" << be_uidt_nl + << "}" << be_nl << be_nl; + } *os << node->name () << " *" << be_nl; *os << node->name () << "::_downcast (CORBA::Exception *exc)" << be_nl; @@ -185,12 +183,12 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) << "0" << be_uidt_nl << ");" << be_uidt_nl << "return result;" << be_uidt_nl - << "}\n" << be_nl; + << "}" << be_nl << be_nl; - *os << "void " << node->name () << "::_raise ()" << be_nl + *os << "void " << node->name () << "::_raise (void)" << be_nl << "{" << be_idt_nl << "TAO_RAISE (*this);" << be_uidt_nl - << "}\n" << be_nl; + << "}" << be_nl << be_nl; *os << "void " << node->name () << "::_tao_encode (" << be_idt << be_idt_nl; @@ -333,7 +331,7 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) << "::_type (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return ::" << node->tc_name () << ";" << be_uidt_nl; - *os << "}" << be_nl; + *os << "}"; } if (be_global->tc_support ()) 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 dac93c08e41..c4281f40ac7 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp @@ -62,6 +62,11 @@ int be_visitor_exception_ctor::visit_exception (be_exception *node) TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl; + if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH) { *os << node->local_name (); @@ -84,11 +89,11 @@ int be_visitor_exception_ctor::visit_exception (be_exception *node) if (this->ctx_->state () == TAO_CodeGen::TAO_EXCEPTION_CTOR_CH) { - *os << be_uidt_nl << ");" << be_uidt_nl; + *os << be_uidt_nl << ");" << be_uidt; } else { - *os << be_uidt_nl << ")" << be_uidt_nl; + *os << be_uidt_nl << ")" << be_uidt; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp index 2a228ffe01d..84e541a3035 100644 --- a/TAO/TAO_IDL/be/be_visitor_factory.cpp +++ b/TAO/TAO_IDL/be/be_visitor_factory.cpp @@ -33,6 +33,8 @@ #include "be_visitor_valuetype/valuetype_ch.h" #include "be_visitor_valuetype/valuetype_obv_ch.h" #include "be_visitor_valuetype/valuetype_obv_cs.h" +#include "be_visitor_eventtype/eventtype_obv_ch.h" +#include "be_visitor_eventtype/eventtype_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" @@ -78,6 +80,16 @@ TAO_Visitor_Factory::make_visitor (be_visitor_context *ctx) be_visitor_valuetype_obv_cs (ctx), 0); break; + case TAO_CodeGen::TAO_EVENTTYPE_OBV_CH: + ACE_NEW_RETURN (retval, + be_visitor_eventtype_obv_ch (ctx), + 0); + break; + case TAO_CodeGen::TAO_EVENTTYPE_OBV_CS: + ACE_NEW_RETURN (retval, + be_visitor_eventtype_obv_cs (ctx), + 0); + break; case TAO_CodeGen::TAO_OPERATION_CH: ACE_NEW_RETURN (retval, be_visitor_operation_ch (ctx), diff --git a/TAO/TAO_IDL/be/be_visitor_field.cpp b/TAO/TAO_IDL/be/be_visitor_field.cpp index 4e7c67ef3c0..26726796307 100644 --- a/TAO/TAO_IDL/be/be_visitor_field.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field.cpp @@ -26,6 +26,10 @@ #include "be_interface_fwd.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" +#include "be_component.h" +#include "be_component_fwd.h" +#include "be_eventtype.h" +#include "be_eventtype_fwd.h" #include "be_predefined_type.h" #include "be_sequence.h" #include "be_string.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 d2f9ccaafbf..7f1da0613bd 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp @@ -56,6 +56,8 @@ be_visitor_field_ch::visit_field (be_field *node) this->ctx_->node (node); + *os << be_nl; + if (bt->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -66,7 +68,7 @@ be_visitor_field_ch::visit_field (be_field *node) } // Now output the field name. - *os << " " << node->local_name () << ";" << be_nl; + *os << " " << node->local_name () << ";"; return 0; } @@ -626,3 +628,37 @@ be_visitor_field_ch::visit_union (be_union *node) return 0; } + +int +be_visitor_field_ch::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_field_ch::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_field_ch::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_field_ch::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + + diff --git a/TAO/TAO_IDL/be/be_visitor_home.cpp b/TAO/TAO_IDL/be/be_visitor_home.cpp index 4d887c5377f..216b5b01892 100644 --- a/TAO/TAO_IDL/be/be_visitor_home.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home.cpp @@ -18,8 +18,13 @@ // // ============================================================================ +#include "be_home.h" + #include "be_visitor_home.h" #include "be_visitor_context.h" +#include "be_helper.h" + +#include "be_visitor_home/home_ch.cpp" ACE_RCSID (be, be_visitor_home, diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_ch.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_ch.cpp new file mode 100644 index 00000000000..b9a3b18a2e8 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_home/home_ch.cpp @@ -0,0 +1,64 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// home_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for Component Home node in the client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_home, + home_ch, + "$Id$") + +be_visitor_home_ch::be_visitor_home_ch ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_home_ch::~be_visitor_home_ch (void) +{ +} + +int +be_visitor_home_ch::visit_home (be_home *node) +{ + if (node->cli_hdr_gen () || node->imported ()) + { + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + // All we do in this is generate a forward declaration of the class. + *os << be_nl << be_nl << "class " << node->local_name () << ";"; + + // Generate the ifdefined macro for the _ptr type. + os->gen_ifdef_macro (node->flat_name (), "_ptr"); + + // Generate the _ptr typedef. + *os << be_nl << be_nl + << "typedef " << node->local_name () << " *" << node->local_name () + << "_ptr;"; + + os->gen_endif (); + + node->cli_hdr_gen (I_TRUE); + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp index b517d8d5492..656fac4592e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp @@ -30,13 +30,12 @@ #include "be_union_fwd.h" #include "be_typedef.h" #include "be_predefined_type.h" +#include "be_component.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" @@ -47,6 +46,7 @@ #include "be_visitor_union.h" #include "be_visitor_union_fwd.h" #include "be_visitor_operation.h" +#include "be_visitor_typecode.h" #include "be_visitor_context.h" #include "be_visitor_interface/interface.cpp" @@ -69,7 +69,6 @@ #include "be_visitor_interface/smart_proxy_cs.cpp" #include "be_visitor_interface/ami_interface_ch.cpp" #include "be_visitor_interface/interceptors_cs.cpp" -#include "be_visitor_interface/interceptors_sh.cpp" #include "be_visitor_interface/interceptors_ss.cpp" // Proxy Brokers 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 04515619513..8ba0d0e6dc1 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 @@ -37,7 +37,6 @@ int be_visitor_amh_rh_interface_sh::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); - os->indent (); // Generate the skeleton class name, use the AMH-node name as a // basis, this is AMH_<InterfaceName>ResponseHandler... @@ -52,6 +51,9 @@ be_visitor_amh_rh_interface_sh::visit_interface (be_interface *node) rh_skel_class_name = "POA_TAO_"; } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + rh_skel_class_name += rh_base_class_name.c_str (); *os << "class " << rh_skel_class_name.c_str () << ";" << be_nl; @@ -59,7 +61,7 @@ be_visitor_amh_rh_interface_sh::visit_interface (be_interface *node) // Generate the _ptr declaration. *os << "typedef " << rh_skel_class_name.c_str () << " *" << rh_skel_class_name.c_str() - << "_ptr;" << be_nl; + << "_ptr;" << be_nl << be_nl; ACE_CString inherit_client_parent = node->client_enclosing_scope (); inherit_client_parent += rh_base_class_name; @@ -75,11 +77,7 @@ be_visitor_amh_rh_interface_sh::visit_interface (be_interface *node) *os << be_uidt_nl << "{" << be_nl << "public:" << be_idt_nl << rh_skel_class_name.c_str () << " (TAO_ServerRequest &sr);" << be_nl - << "virtual ~" << rh_skel_class_name.c_str () << " (void);\n" - << be_nl; - - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl; + << "virtual ~" << rh_skel_class_name.c_str () << " (void);"; // Generate code for elements in the scope (e.g., operations). if (this->visit_scope (node) == -1) 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 dc7226d6d82..82426c28074 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 @@ -67,8 +67,8 @@ be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node) ACE_CString rh_skel_class_name (rh_skel_class_name_prefix); rh_skel_class_name += node->local_name (); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << rh_skel_full_scope_name.c_str() << "::" << be_nl @@ -77,17 +77,14 @@ be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node) << " : TAO_AMH_Response_Handler (sr)" << be_nl << " , " << node->full_name () << " ()" << be_nl << "{" << be_nl - << "}\n\n"; - - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl; + << "}" << be_nl << be_nl; *os << rh_skel_full_scope_name.c_str() << "::" << be_nl << " ~" << rh_skel_class_name.c_str() << " (void)" << be_nl; *os << "{" << be_nl; - *os << "}\n\n"; + *os << "}"; // Generate code for elements in the scope (e.g., operations) @@ -102,7 +99,5 @@ be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node) -1); } - *os << "\n\n"; - return 0; } 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 4d690cdb2b6..2898d832522 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp @@ -46,7 +46,9 @@ be_visitor_amh_interface_sh::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); ACE_CString class_name; - os->indent (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // We shall have a POA_ prefix only if we are at the topmost level. if (!node->is_nested ()) @@ -66,7 +68,7 @@ be_visitor_amh_interface_sh::visit_interface (be_interface *node) // Generate the _ptr declaration. *os << "typedef " << class_name.c_str () << " *" << class_name.c_str () - << "_ptr;" << be_nl; + << "_ptr;" << be_nl << be_nl; // Now generate the class definition. *os << "class " << be_global->skel_export_macro () 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 8f33e20956a..66b994cd74d 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp @@ -66,13 +66,13 @@ be_visitor_amh_interface_ss::this_method (be_interface *node) this->generate_full_skel_name (node); const char *full_skel_name = full_skel_name_holder.c_str (); - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << non_amh_name.c_str() << "*" << be_nl << full_skel_name << "::_this (ACE_ENV_SINGLE_ARG_DECL)" << be_nl - << "{" << be_idt_nl // idt = 1 + << "{" << be_idt_nl << "TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER);" << be_nl << "ACE_CHECK_RETURN (0);" << be_nl << be_nl; @@ -80,18 +80,18 @@ be_visitor_amh_interface_ss::this_method (be_interface *node) *os << "CORBA::Object_ptr tmp = CORBA::Object::_nil ();" << be_nl << be_nl << "if (stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects ())" - << be_idt_nl // idt = 2 + << be_idt_nl << "ACE_NEW_RETURN (tmp, CORBA::Object (stub, 1, this), 0);" - << be_uidt_nl // idt = 1 + << be_uidt_nl << "else" - << be_idt_nl // idt = 2 + << be_idt_nl << "ACE_NEW_RETURN (tmp, CORBA::Object (stub, 0, this), 0);" - << be_uidt_nl << be_nl // idt = 1 + << be_uidt_nl << be_nl << "CORBA::Object_var obj = tmp;" << be_nl << be_nl; *os << "return " << "::" << non_amh_name.c_str() << "::_unchecked_narrow (obj.in ());" - << be_uidt_nl // idt = 0 - << "}" << be_nl; + << be_uidt_nl + << "}"; } @@ -104,8 +104,9 @@ be_visitor_amh_interface_ss::dispatch_method (be_interface *node) this->generate_full_skel_name (node); const char *full_skel_name = full_skel_name_holder.c_str (); - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "void" << be_nl << full_skel_name << "::_dispatch (" << be_idt << be_idt_nl << "TAO_ServerRequest &req," << be_nl @@ -119,7 +120,7 @@ be_visitor_amh_interface_ss::dispatch_method (be_interface *node) << "this" << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl << ");" << be_uidt << be_uidt_nl - << "}" << be_nl; + << "}"; } int 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 11c5e47e19c..ee0f4219ad8 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 @@ -54,12 +54,13 @@ be_visitor_ami_interface_ch::visit_interface (be_interface *node) os->gen_ifdef_macro (node->replacement ()->flat_name (), "_ptr"); // Forward declaration. - *os << "class " << node->replacement ()->local_name () << ";" << be_nl; + *os << be_nl << be_nl + << "class " << node->replacement ()->local_name () << ";" << be_nl; // Generate the _ptr declaration. *os << "typedef " << node->replacement ()->local_name () << " *" << node->replacement ()->local_name () - << "_ptr;" << be_nl << be_nl; + << "_ptr;"; os->gen_endif (); return 0; 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 c0ddcab6ee3..3f35c0062b1 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 @@ -48,13 +48,12 @@ be_visitor_interface_any_op_ch::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Generate the Any <<= and >>= operator declarations. os->indent (); - *os << "// Any operators for interface " << node->name () << be_nl; *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, " << node->name () << "_ptr); // copying" << be_nl; @@ -63,7 +62,7 @@ be_visitor_interface_any_op_ch::visit_interface (be_interface *node) << "_ptr *); // non-copying" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, " - << node->name () << "_ptr &);\n"; + << node->name () << "_ptr &);"; // All we have to do is to visit the scope and generate code. if (this->visit_scope (node) == -1) @@ -77,6 +76,5 @@ be_visitor_interface_any_op_ch::visit_interface (be_interface *node) node->cli_hdr_any_op_gen (1); - return 0; } 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 f01a6cf7b99..8facca9766f 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 @@ -48,7 +48,7 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; if (node->is_local ()) @@ -229,7 +229,7 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) *os << node->full_name () << "," << node->full_name () << "_var>" << be_uidt_nl - << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */\n\n"; + << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */"; // All we have to do is to visit the scope and generate code. if (!node->is_local ()) 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 2de0f8bf792..f006fb845da 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 @@ -72,3 +72,11 @@ be_visitor_interface_base_proxy_broker_ch::visit_interface ( return 0; } + +int be_visitor_interface_base_proxy_broker_ch::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + 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 9717c686dda..111de786694 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 @@ -39,9 +39,25 @@ be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node) << " " << node->base_proxy_impl_name () << be_idt_nl << ": "; - int n_parents = node->n_inherits (); int has_concrete_parent = 0; + if (node->node_type () == AST_Decl::NT_component) + { + be_component *bc = be_component::narrow_from_decl (node); + AST_Component *ac_base = bc->base_component (); + + if (ac_base != 0) + { + has_concrete_parent = 1; + be_component *bc_base = be_component::narrow_from_decl (ac_base); + + *os << "public virtual " + << bc_base->full_base_proxy_impl_name (); + } + } + + int n_parents = node->n_inherits (); + if (n_parents > 0) { *os << be_idt; @@ -77,15 +93,14 @@ be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node) if (has_concrete_parent == 0) { - *os << "public virtual TAO_Object_Proxy_Impl" << be_uidt << be_uidt_nl; + *os << "public virtual TAO_Object_Proxy_Impl" << be_uidt_nl; } *os << "{" << be_nl << "public:" << be_idt_nl; // idt = 1 // Destructor Declaration. - *os << "virtual ~" << node->base_proxy_impl_name () << " (void) { }" - << be_nl; + *os << "virtual ~" << node->base_proxy_impl_name () << " (void) {}"; if (this->visit_scope (node) == -1) { @@ -96,7 +111,7 @@ be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node) -1); } - *os << be_uidt_nl; + *os << be_uidt_nl << be_nl; // Constructor Declaration. *os << "protected:" << be_idt_nl // idt = 1 @@ -166,3 +181,11 @@ be_visitor_interface_base_proxy_impl_ch::gen_abstract_ops_helper ( return 0; } +int be_visitor_interface_base_proxy_impl_ch::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + + 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 908ffbb73f3..1ede6cefe3b 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 @@ -51,21 +51,19 @@ be_visitor_interface_cdr_op_ch::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // 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; *os << be_global->stub_export_macro () << " CORBA::Boolean " << "operator>> (TAO_InputCDR &, " - << node->full_name () << "_ptr &);\n"; + << node->full_name () << "_ptr &);"; // Set the substate as generating code for the types defined in our scope. - this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_SCOPE); + this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE); if (this->visit_scope (node) == -1) { @@ -76,6 +74,7 @@ be_visitor_interface_cdr_op_ch::visit_interface (be_interface *node) -1); } + this->ctx_->sub_state (TAO_CodeGen::TAO_SUB_STATE_UNKNOWN); 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 a46d835851e..e354790ea44 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 @@ -68,7 +68,7 @@ be_visitor_interface_cdr_op_ci::visit_interface (be_interface *node) // defined). // - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Generate the CDR << and >> operator declarations. @@ -84,7 +84,7 @@ be_visitor_interface_cdr_op_ci::visit_interface (be_interface *node) << be_idt << be_idt_nl << "TAO_InputCDR &," << be_nl << node->full_name () << "_ptr &" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt;; node->cli_inline_cdr_decl_gen (1); } 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 b25161cd35a..7316f099677 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 @@ -59,7 +59,7 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Set the sub state as generating code for the output operator. @@ -75,6 +75,10 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) { *os << "CORBA::AbstractBase_ptr"; } + else if (node->node_type () == AST_Decl::NT_component) + { + *os << "Components::CCMObject_ptr"; + } else { *os << "CORBA::Object_ptr"; @@ -82,7 +86,7 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) *os << " _tao_corba_obj = _tao_objref;" << be_nl; *os << "return (strm << _tao_corba_obj);" << be_uidt_nl - << "}\n\n"; + << "}" << be_nl << be_nl; // Set the substate as generating code for the input operator. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT); @@ -97,14 +101,19 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) if (node->is_abstract ()) { - *os << "CORBA::AbstractBase_var obj;" << be_nl << be_nl; + *os << "CORBA::AbstractBase_var obj;"; + } + else if (node->node_type () == AST_Decl::NT_component) + { + *os << "Components::CCMObject_var obj;"; } else { - *os << "CORBA::Object_var obj;" << be_nl << be_nl; + *os << "CORBA::Object_var obj;"; } - *os << "if ((strm >> obj.inout ()) == 0)" << be_idt_nl + *os << be_nl << be_nl + << "if ((strm >> obj.inout ()) == 0)" << be_idt_nl << "{" << be_idt_nl << "return 0;" << be_uidt_nl << "}" << be_uidt_nl << be_nl @@ -150,7 +159,7 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) << "}" << be_nl << "ACE_ENDTRY;" << be_nl << "return 0;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}"; node->cli_stub_cdr_op_gen (1); return 0; 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 a00dbf149c2..383146411ab 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 @@ -68,7 +68,7 @@ be_visitor_interface_direct_proxy_impl_sh::visit_interface ( *os << node->direct_proxy_impl_name () << " (void);" << be_nl << be_nl; // Dtor - *os << "virtual ~" << node->direct_proxy_impl_name () << " (void) { }" << be_nl << be_nl; + *os << "virtual ~" << node->direct_proxy_impl_name () << " (void) {}"; if (this->visit_scope (node) == -1) { @@ -143,3 +143,10 @@ be_visitor_interface_direct_proxy_impl_sh::gen_abstract_ops_helper ( return 0; } +int be_visitor_interface_direct_proxy_impl_sh::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + 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 1ba64f475f6..4a8985f03e1 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 @@ -123,3 +123,11 @@ be_visitor_interface_direct_proxy_impl_ss::gen_abstract_ops_helper ( return 0; } +int be_visitor_interface_direct_proxy_impl_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + + 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 a057a06fa96..9e3c33b8f36 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_cs.cpp @@ -52,19 +52,15 @@ int be_visitor_interface_interceptors_cs::visit_interface (be_interface *node) // elements of its scope. We depend on the front-end to have made sure // that only legal syntactic elements appear in our scope. - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; - os->indent (); - - *os << "\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl; + *os << "\n\n#if (TAO_HAS_INTERCEPTORS == 1)"; // 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, @@ -74,11 +70,16 @@ int be_visitor_interface_interceptors_cs::visit_interface (be_interface *node) -1); } - *os << "#endif /* TAO_HAS_INTERCEPTORS */\n"; + *os << "\n\n#endif /* TAO_HAS_INTERCEPTORS */\n"; return 0; } +int be_visitor_interface_interceptors_cs::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + int be_visitor_interface_interceptors_cs::gen_abstract_ops_helper ( be_interface *node, diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_sh.cpp deleted file mode 100644 index 9171ffc89b7..00000000000 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_sh.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// interceptors_sh.cpp -// -// = DESCRIPTION -// This provides code generation for interceptor classes for an -// interface in the server header. -// -// = AUTHOR -// Kirthika Parameswaran <kirthika@cs.wustl.edu> -// -// ============================================================================ - -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 (ctx) -{ -} - -be_visitor_interface_interceptors_sh::~be_visitor_interface_interceptors_sh ( - void - ) -{ -} - -int be_visitor_interface_interceptors_sh::visit_interface (be_interface *) -{ - return 0; -} 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 6860fc7faf7..97c6d6073bc 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ss.cpp @@ -49,12 +49,13 @@ int be_visitor_interface_interceptors_ss::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + << "// " << __FILE__ << ":" << __LINE__; // 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 << "#if (TAO_HAS_INTERCEPTORS == 1)\n"; + *os << be_nl << be_nl + << "#if (TAO_HAS_INTERCEPTORS == 1)"; os->reset (); @@ -70,12 +71,18 @@ int be_visitor_interface_interceptors_ss::visit_interface (be_interface *node) -1); } - *os << "#endif /* TAO_HAS_INTERCEPTORS */\n"; + *os << "\n\n#endif /* TAO_HAS_INTERCEPTORS */\n"; return 0; } int +be_visitor_interface_interceptors_ss::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int be_visitor_interface_interceptors_ss::gen_abstract_ops_helper ( be_interface *node, be_interface *base, diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp index 9947f290e92..163d47d9693 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp @@ -648,7 +648,6 @@ be_visitor_interface::visit_exception (be_exception *node) int be_visitor_interface::visit_operation (be_operation *node) { - // Instantiate a visitor context with a copy of our context. This info // will be modified ased on what type of node we are visiting be_visitor_context ctx (*this->ctx_); 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 d00bc773b7f..4e3a8417bef 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp @@ -18,8 +18,6 @@ // // ============================================================================ -#include "be_visitor_typecode/typecode_decl.h" - ACE_RCSID (be_visitor_interface, interface_ch, "$Id$") @@ -50,22 +48,21 @@ be_visitor_interface_ch::visit_interface (be_interface *node) // == STEP 1: generate the class name and class names we inherit == - *os << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Generate the ifdefined macro for the _ptr type. os->gen_ifdef_macro (node->flat_name (), "_ptr"); - // The following two are required to be under the ifdef macro to avoid // multiple declarations. // Forward declaration. - *os << "class " << node->local_name () << ";" << be_nl; + *os << be_nl << be_nl << "class " << node->local_name () << ";"; // Generate the _ptr declaration. - *os << "typedef " << node->local_name () << " *" - << node->local_name () << "_ptr;" << be_nl; + *os << be_nl << "typedef " << node->local_name () << " *" + << node->local_name () << "_ptr;"; os->gen_endif (); @@ -109,25 +106,25 @@ be_visitor_interface_ch::visit_interface (be_interface *node) return 0; } - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Now the interface definition itself. os->gen_ifdef_macro (node->flat_name ()); if (!node->is_local () && !node->is_abstract ()) { - // Forward class declaration - *os << "// Forward Classes Declaration." << be_nl + // Forward class declarations. + *os << be_nl << be_nl << "class " << node->base_proxy_impl_name () << ";" << be_nl << "class " << node->remote_proxy_impl_name () << ";" << be_nl << "class " << node->base_proxy_broker_name () << ";" << be_nl - << "class " << node->remote_proxy_broker_name () << ";" - << be_nl << be_nl; + << "class " << node->remote_proxy_broker_name () << ";"; } // Now generate the class definition. - *os << "class " << be_global->stub_export_macro () + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () << " " << node->local_name () << be_idt_nl << ": " ; @@ -165,7 +162,8 @@ be_visitor_interface_ch::visit_interface (be_interface *node) *os << "," << be_nl; } } - else if (node->is_abstract ()) + + if (node->is_abstract ()) { *os << "public virtual CORBA::AbstractBase" << be_uidt_nl; } @@ -242,14 +240,14 @@ be_visitor_interface_ch::visit_interface (be_interface *node) if (node->is_abstract ()) { - *os << "static foo_ptr _downcast (CORBA::AbstractBase_ptr abs);" + *os << "static " << node->local_name () + << "_ptr _downcast (CORBA::AbstractBase_ptr abs);" << be_nl << be_nl; } - // No Any operator for local interfaces. - if (! node->is_local () && be_global->any_support ()) + if (be_global->any_support ()) { - *os << "static void _tao_any_destructor (void*);" << be_nl << be_nl; + *os << "static void _tao_any_destructor (void *);"; } // Generate code for the interface definition by traversing thru the @@ -265,7 +263,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node) -1); } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // If we inherit from both CORBA::Object and CORBA::AbstractBase, @@ -321,7 +319,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node) *os << "// These methods travese the inheritance tree and set the" << be_nl - << "// parents piece of the given class in the right mode" + << "// parents piece of the given class in the right mode." << be_nl << "virtual void " << node->flat_name () << "_setup_collocation (int collocated);" << be_nl << be_nl; @@ -385,12 +383,14 @@ be_visitor_interface_ch::visit_interface (be_interface *node) ctx = *this->ctx_; *os << be_uidt_nl; - *os << "};" << be_nl << be_nl; + *os << "};"; // Don't support smart proxies for local interfaces. // @@@ (JP) This is TODO for abstract interfaces. if (! node->is_local () && ! node->is_abstract ()) { + *os << be_nl << be_nl; + // Smart Proxy related classes. ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH); be_visitor_interface_smart_proxy_ch sp_visitor (&ctx); 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 af50193a815..9a83fb4d255 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp @@ -64,14 +64,15 @@ be_visitor_interface_ci::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_macro (node->flat_name (), ""); if (node->is_abstract ()) { - *os << "ACE_INLINE" << be_nl + *os << be_nl << be_nl + << "ACE_INLINE" << be_nl << node->name () << "::" << node->local_name () << " (void)" << be_idt_nl << ": CORBA_AbstractBase ()" << be_uidt_nl @@ -92,7 +93,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node) << ")" << be_nl << ": CORBA_AbstractBase (objref, _tao_collocated, servant)" << be_uidt_nl - << "{}" << be_nl; + << "{}"; } else { @@ -101,6 +102,6 @@ be_visitor_interface_ci::visit_interface (be_interface *node) } os->gen_endif (); - + node->cli_inline_gen (I_TRUE); return 0; } 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 a7c10d4e2a1..55c58f195c8 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -18,8 +18,6 @@ // // ============================================================================ -#include "be_visitor_typecode/typecode_defn.h" - ACE_RCSID (be_visitor_interface, interface_cs, "$Id$") @@ -59,7 +57,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Initialize the static narrrowing helper variable. @@ -136,11 +134,12 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << "ACE_static_cast (" << node->full_name () << " **, src);" << be_uidt_nl << "return *tmp;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; if (node->has_mixed_parentage ()) { - *os << "void" << be_nl + *os << be_nl << be_nl + << "void" << be_nl << "CORBA::release (" << node->name () << "_ptr p)" << be_nl << "{" << be_idt_nl << "CORBA::AbstractBase_ptr abs = p;" << be_nl @@ -152,7 +151,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << "{" << be_idt_nl << "CORBA::Object_ptr obj = p;" << be_nl << "return CORBA::is_nil (obj);" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; } // Generate the _var class. @@ -222,28 +221,31 @@ be_visitor_interface_cs::visit_interface (be_interface *node) } } - *os << "// TAO_IDL - Generated from " << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; if (node->is_local ()) { - *os << node->name () << "::" << node->local_name () + *os << be_nl << be_nl + << node->name () << "::" << node->local_name () << " (void)" << be_nl - << "{}" << be_nl << be_nl; + << "{}"; } if (! node->is_abstract () && ! node->is_local ()) { // Generate the destructor and default constructor. - *os << node->name () << "::" << node->local_name () + *os << be_nl << be_nl + << node->name () << "::" << node->local_name () << " (int collocated)" << be_nl << "{" << be_idt_nl << "this->" << node->flat_name () << "_setup_collocation (collocated);" << be_uidt_nl - << be_uidt << "}" << be_nl << be_nl; + << be_uidt << "}"; // Collocation setup method. - *os << "void" << be_nl + *os << be_nl << be_nl + << "void" << be_nl << node->name () << "::" << node->flat_name () << "_setup_collocation (int collocated)" << be_nl << "{" << be_idt_nl @@ -290,23 +292,21 @@ be_visitor_interface_cs::visit_interface (be_interface *node) } } - *os << be_uidt_nl << "}" << be_nl << be_nl; + *os << be_uidt_nl << "}"; } - *os << node->name () << "::~" << node->local_name () + *os << be_nl << be_nl << node->name () << "::~" << node->local_name () << " (void)" << be_nl; *os << "{}" << be_nl << be_nl; - // Then generate the code for the static methods - // Local interfaces don't have any operators. - if (! node->is_local ()) + if (be_global->any_support ()) { *os << "void " << be_nl << node->name () << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl << "{" << be_idt_nl << node->local_name () << " *tmp = ACE_static_cast (" - << node->local_name () << "*, _tao_void_pointer);" << be_nl + << node->local_name () << " *, _tao_void_pointer);" << be_nl << "CORBA::release (tmp);" << be_uidt_nl << "}" << be_nl << be_nl; } @@ -439,18 +439,13 @@ be_visitor_interface_cs::visit_interface (be_interface *node) // Generate the is_a method (not supported on local objects). if (! node->is_local ()) { - os->indent (); - *os << "CORBA::Boolean" << be_nl << node->full_name () << "::_is_a (" << be_idt << be_idt_nl << "const char *value" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl << ")" << be_uidt_nl - << "{\n"; - - os->incr_indent (); - - *os << "if (" << be_idt << be_idt_nl; + << "{" << be_idt_nl + << "if (" << be_idt << be_idt_nl; int status = node->traverse_inheritance_graph (be_interface::is_a_helper, @@ -461,7 +456,8 @@ be_visitor_interface_cs::visit_interface (be_interface *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_cs::" "visit_interface - " - "_is_a method codegen failed\n"), -1); + "_is_a method codegen failed\n"), + -1); } if (node->is_abstract () || node->has_mixed_parentage ()) @@ -509,12 +505,10 @@ be_visitor_interface_cs::visit_interface (be_interface *node) } *os << "}" << be_uidt << be_uidt_nl - << "}\n\n"; + << "}" << be_nl << be_nl; } // Generating _tao_QueryInterface method. - os->indent (); - *os << "void *" << node->full_name () << "::_tao_QueryInterface (ptr_arith_t type)" << be_nl << "{" << be_idt_nl @@ -580,7 +574,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << "{" << be_idt_nl << "return \"" << node->repoID () << "\";" << be_uidt_nl - << "}" << be_uidt_nl << be_nl; + << "}"; // Generate code for the elements of the interface. if (this->visit_scope (node) == -1) @@ -595,7 +589,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) if (! node->is_abstract ()) { // Smart Proxy classes. - if (! node->is_local ()) + if (! node->is_local () && be_global->gen_smart_proxies ()) { be_visitor_context ctx (*this->ctx_); @@ -713,7 +707,6 @@ be_visitor_interface_cs::gen_concrete_unchecked_narrow (be_interface *node, << "::_nil ();" << be_uidt_nl << "}" << be_uidt_nl << be_nl; - if (! node->is_local ()) { // Remote _unchecked_narrow implementation. 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 1dbd41d5731..7699b813f07 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp @@ -1,4 +1,4 @@ -// Id:$ +// $Id$ // ============================================================================ // 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 cb14fe10d2b..5c1392eb3d8 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -38,7 +38,9 @@ be_visitor_interface_sh::~be_visitor_interface_sh (void) int be_visitor_interface_sh::visit_interface (be_interface *node) { - if (node->srv_hdr_gen () || node->imported () || node->is_abstract ()) + if (node->srv_hdr_gen () + || node->imported () + || node->is_abstract ()) { return 0; } @@ -58,12 +60,14 @@ be_visitor_interface_sh::visit_interface (be_interface *node) if (this->generate_amh_classes (node) == -1) { - return -1; + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_sh::" + "visit_interface - " + "codegen for AMH classes failed\n"), + -1); } TAO_OutStream *os = this->ctx_->stream (); - - os->indent (); ACE_CString class_name; // We shall have a POA_ prefix only if we are at the topmost level. @@ -86,11 +90,9 @@ be_visitor_interface_sh::visit_interface (be_interface *node) // Generate the _ptr declaration. *os << "typedef " << class_name.c_str () << " *" << class_name.c_str () - << "_ptr;" << be_nl; - - // Forward class declaration. - *os << "// Forward Classes Declaration" << be_nl; + << "_ptr;" << be_nl << be_nl; + // Forward class declarations. if (be_global->gen_thru_poa_collocation ()) { *os << "class " << node->thru_poa_proxy_impl_name () << ";" << be_nl; @@ -118,27 +120,24 @@ be_visitor_interface_sh::visit_interface (be_interface *node) AST_Interface *parent = 0; int has_concrete_parent = 0; - if (n_parents > 0) + for (int i = 0; i < n_parents; ++i) { - for (int i = 0; i < n_parents; ++i) + parent = node->inherits ()[i]; + + if (parent->is_abstract ()) { - parent = node->inherits ()[i]; - - if (parent->is_abstract ()) - { - continue; - } - - if (has_concrete_parent == 1) - { - *os << "," << be_nl; - } - - *os << "public virtual " << "POA_" - << parent->name (); - - has_concrete_parent = 1; + continue; } + + if (has_concrete_parent == 1) + { + *os << "," << be_nl; + } + + *os << "public virtual " << "POA_" + << parent->name (); + + has_concrete_parent = 1; } if (has_concrete_parent == 0) @@ -150,22 +149,27 @@ be_visitor_interface_sh::visit_interface (be_interface *node) *os << be_uidt << be_uidt_nl << "{" << be_nl - << "protected:" << be_idt_nl - << class_name.c_str () << " (void);\n" << be_uidt_nl + << "protected:" << be_idt_nl; + + // Default constructor. + *os << class_name.c_str () << " (void);" << be_uidt_nl << be_nl << "public:" << be_idt_nl; - // No copy constructor for locality constraint interface. - *os << class_name.c_str () << " (const " << class_name.c_str () << "& rhs);" << be_nl - << "virtual ~" << class_name.c_str () << " (void);\n\n" - << be_nl - << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl + // Copy constructor and destructor. + *os << class_name.c_str () << " (const " + << class_name.c_str () << "& rhs);" << be_nl + << "virtual ~" << class_name.c_str () << " (void);" << be_nl << be_nl; + + // _is_a + *os << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl << "const char* logical_type_id" << be_nl << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");\n" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; + // _downcast *os << "virtual void* _downcast (" << be_idt << be_idt_nl << "const char* logical_type_id" << be_uidt_nl - << ");\n" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; // Add a skeleton for our _is_a method. *os << "static void _is_a_skel (" << be_idt << be_idt_nl @@ -173,7 +177,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) << "void *servant," << be_nl << "void *servant_upcall" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl - << ");\n" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; // Add a skeleton for our _non_existent method. *os << "static void _non_existent_skel (" << be_idt << be_idt_nl @@ -181,7 +185,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) << "void *servant," << be_nl << "void *servant_upcall" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl - << ");\n" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; // Add a skeleton for our _interface method. *os << "static void _interface_skel (" << be_idt << be_idt_nl @@ -189,7 +193,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) << "void *servant," << be_nl << "void *servant_upcall" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl - << ");\n" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; // Add a skeleton for our _component method. *os << "static void _component_skel (" << be_idt << be_idt_nl @@ -197,21 +201,21 @@ be_visitor_interface_sh::visit_interface (be_interface *node) << "void *obj," << be_nl << "void *servant_upcall" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl - << ");\n" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; // Add the dispatch method. *os << "virtual void _dispatch (" << be_idt << be_idt_nl << "TAO_ServerRequest &req," << be_nl << "void *_servant_upcall" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl - << ");\n" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; this->this_method (node); // The _interface_repository_id method. *os << be_nl << "virtual const char* _interface_repository_id " - << "(void) const;\n\n"; + << "(void) const;"; // Generate code for elements in the scope (e.g., operations). if (this->visit_scope (node) == -1) @@ -223,8 +227,6 @@ be_visitor_interface_sh::visit_interface (be_interface *node) -1); } - *os << "\n"; - // Generate skeletons for operations of our base classes. These // skeletons just cast the pointer to the appropriate type // before invoking the call. @@ -243,23 +245,11 @@ be_visitor_interface_sh::visit_interface (be_interface *node) -1); } + *os << be_uidt_nl << "};"; + // Generate the embedded RequestInfo classes per operation. // This is to be used by interceptors. be_visitor_context ctx (*this->ctx_); - // Interceptor related classes. - ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH); - be_visitor_interface_interceptors_sh ii_visitor (&ctx); - - if (node->accept (&ii_visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_ch::" - "visit_interface - " - "codegen for interceptor classes failed\n"), - -1); - } - - *os << be_uidt_nl << "};\n\n"; if (be_global->gen_thru_poa_collocation () || be_global->gen_direct_collocation ()) @@ -322,7 +312,6 @@ be_visitor_interface_sh::visit_interface (be_interface *node) } } - *os << "\n"; return 0; } @@ -388,7 +377,7 @@ be_visitor_interface_sh::this_method (be_interface *node) // Print out the _this() method. *os << "::" << node->full_name () << " *_this (" << be_idt << be_idt_nl << "ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");\n" << be_uidt; + << ");" << be_uidt << be_nl; } int 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 18261ecdc24..0cc52dff024 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -94,7 +94,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) -1); } - *os << be_nl << "// TAO_IDL - Generated from " << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Find if we are at the top scope or inside some module, @@ -120,7 +120,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "{" << be_idt_nl << "this->optable_ = &tao_" << flat_name << "_optable;" << be_uidt_nl - << "}\n\n"; + << "}" << be_nl << be_nl; // find if we are at the top scope or inside some module *os << full_skel_name << "::" @@ -147,7 +147,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) << local_name_prefix << node_local_name << " (void)" << be_nl; *os << "{" << be_nl; - *os << "}\n\n"; + *os << "}"; // Generate code for elements in the scope (e.g., operations). if (this->visit_scope (node) == -1) @@ -159,11 +159,10 @@ be_visitor_interface_ss::visit_interface (be_interface *node) -1); } - *os << "// TAO_IDL - Generated from " << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Generate code for the _is_a skeleton. - os->indent (); *os << "void " << full_skel_name << "::_is_a_skel (" << be_idt << be_idt_nl << "TAO_ServerRequest &_tao_server_request, " << be_nl @@ -176,7 +175,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << full_skel_name << " *_tao_impl = (" << full_skel_name << " *) _tao_servant;" << be_nl; *os << "CORBA::Boolean _tao_retval = 0;" << be_nl; - *os << "CORBA::String_var value;" << be_nl; + *os << "CORBA::String_var value;" << be_nl << be_nl; *os << "if (!(_tao_in >> value.out ()))" << be_idt_nl; if (be_global->use_raw_throw ()) @@ -193,7 +192,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "ACE_CHECK;" << be_nl << be_nl; *os << "_tao_server_request.init_reply ();" << be_nl; *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" - << be_nl; + << be_nl << be_nl; *os << "if (!(_tao_out << CORBA::Any::from_boolean (_tao_retval)))" << be_idt_nl; @@ -226,7 +225,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "ACE_CHECK;" << be_nl << be_nl; *os << "_tao_server_request.init_reply ();" << be_nl; *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" - << be_nl; + << be_nl << be_nl; *os << "if (!(_tao_out << CORBA::Any::from_boolean (_tao_retval)))" << be_idt_nl; @@ -239,7 +238,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl; } - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // Generate code for the _interface skeleton. *os << "void " << full_skel_name @@ -287,7 +286,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) << "{" << be_idt_nl << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt_nl << "}" << be_uidt << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // Generate code for the _component skeleton. *os << "void " << full_skel_name @@ -306,18 +305,22 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "ACE_CHECK;" << be_nl << be_nl; *os << "_tao_server_request.init_reply ();" << be_nl; *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" - << be_nl; + << be_nl << be_nl; *os << "if (!(_tao_out << _tao_retval._retn ()))" << be_idt_nl; if (be_global->use_raw_throw ()) - *os << "throw CORBA::MARSHAL ();" << be_uidt << be_uidt_nl; + { + *os << "throw CORBA::MARSHAL ();" << be_uidt << be_uidt_nl; + } else - *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl; - *os << "}\n\n"; + { + *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl; + } + + *os << "}" << be_nl << be_nl; // Generate code for the _is_a override. - os->indent (); *os << "CORBA::Boolean " << full_skel_name << "::_is_a (" << be_idt << be_idt_nl @@ -393,17 +396,13 @@ be_visitor_interface_ss::visit_interface (be_interface *node) << be_nl; *os << "{" << be_idt_nl; *os << "return \"" << node->repoID () << "\";" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; // Print out dispatch method. this->dispatch_method (node); - *os << be_nl; - this->this_method (node); - *os << "\n\n"; - return 0; } @@ -475,7 +474,7 @@ be_visitor_interface_ss::this_method (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // the _this () operation. @@ -521,7 +520,7 @@ be_visitor_interface_ss::this_method (be_interface *node) << "return " << "::" << node->full_name () << "::_unchecked_narrow (obj.in ());" << be_uidt_nl - << "}" << be_nl; + << "}"; } void @@ -529,7 +528,7 @@ be_visitor_interface_ss::dispatch_method (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "void " << node->full_skel_name () @@ -544,7 +543,7 @@ be_visitor_interface_ss::dispatch_method (be_interface *node) << " this" << be_nl << " ACE_ENV_ARG_PARAMETER);" << be_uidt_nl; - *os << "}" << be_nl; + *os << "}"; } int @@ -595,7 +594,7 @@ be_visitor_interface_ss::generate_proxy_classes (be_interface *node) -1); } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl; // Proxy Broker Factory Function. @@ -604,13 +603,13 @@ be_visitor_interface_ss::generate_proxy_classes (be_interface *node) << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_function (CORBA::Object_ptr obj)" << be_nl - << "{" << be_idt_nl // idt = 1 + << "{" << be_idt_nl << "ACE_UNUSED_ARG (obj);" << be_nl << "return ::" << node->full_strategized_proxy_broker_name () << "::" <<"the" << node->strategized_proxy_broker_name () - << "();" << be_uidt_nl // idt = 0 + << "();" << be_uidt_nl << "}" << be_nl << be_nl; // Proxy Broker Function Pointer Initializer. @@ -618,17 +617,17 @@ be_visitor_interface_ss::generate_proxy_classes (be_interface *node) << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_Initializer (long)" << be_nl - << "{" << be_idt_nl // idt = 1 + << "{" << be_idt_nl << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_function_pointer = " - << be_idt_nl // idt = 2 + << be_idt_nl << node->flat_client_enclosing_scope () << node->base_proxy_broker_name () << "_Factory_function;" - << be_uidt_nl // idt = 1 + << be_uidt_nl << be_nl - << "return 0;" << be_uidt_nl // idt = 0 + << "return 0;" << be_uidt_nl << "}" << be_nl << be_nl; @@ -678,7 +677,6 @@ be_visitor_interface_ss::generate_proxy_classes (be_interface *node) } } - os->decr_indent (0); return 0; } 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 b4eb6beabfc..05fbdcdfbb4 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 @@ -33,7 +33,7 @@ be_visitor_interface_proxy_brokers_ch::visit_interface (be_interface *node) *os << "// The Proxy Brokers are used by each interface to get" << be_nl << "// the right proxy for performing a call. In the new " << be_nl << "// collocation scheme, the proxy to be used can vary on" << be_nl - << "// a call by call basis." << be_nl << be_nl; + << "// a call by call basis." << be_nl; // Code Generation for the proxy brokers base class. be_visitor_context ctx (*this->ctx_); @@ -64,3 +64,11 @@ be_visitor_interface_proxy_brokers_ch::visit_interface (be_interface *node) return 0; } + +int be_visitor_interface_proxy_brokers_ch::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + 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 1b6c171cf05..ae043a1c56e 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 @@ -63,3 +63,10 @@ be_visitor_interface_proxy_impls_ch::visit_interface (be_interface *node) return 0; } + +int be_visitor_interface_proxy_impls_ch::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} 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 e197ce1bc46..f0f00ab4c50 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 @@ -82,8 +82,14 @@ be_visitor_interface_remote_proxy_broker_ch::visit_interface ( *os << "//" << be_nl << "// End Remote Proxy Broker Declaration " << be_nl - << "///////////////////////////////////////////////////////////////////////" - << be_nl << be_nl; + << "///////////////////////////////////////////////////////////////////////"; return 0; } + +int be_visitor_interface_remote_proxy_broker_ch::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} 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 d2b53e17245..9f168671ad0 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 @@ -83,18 +83,24 @@ be_visitor_interface_remote_proxy_broker_cs::visit_interface ( *os << node->full_base_proxy_impl_name () << "&" << be_nl <<node->full_remote_proxy_broker_name () << "::" - << "select_proxy (" << be_idt_nl + << "select_proxy (" << be_idt << be_idt_nl << "::" << node->full_name () << " *" << be_nl << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl // idt = 1 << "return this->remote_proxy_impl_;" - << be_uidt_nl << "}" << be_nl << be_nl; + << be_uidt_nl << "}"; - *os << be_nl + *os << be_nl << be_nl << "//" << be_nl << "// End Remote & Base Proxy Broker Implementation" << be_nl - << "///////////////////////////////////////////////////////////////////////" - << be_nl << be_nl; + << "///////////////////////////////////////////////////////////////////////"; return 0; } + +int be_visitor_interface_remote_proxy_broker_cs::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} 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 c43cf1a98a2..492664ab7b8 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 @@ -43,6 +43,21 @@ be_visitor_interface_remote_proxy_impl_ch::visit_interface ( << "," << be_idt_nl << "public virtual " << "TAO_Remote_Object_Proxy_Impl"; + if (node->node_type () == AST_Decl::NT_component) + { + be_component *bc = be_component::narrow_from_decl (node); + AST_Component *ac_base = bc->base_component (); + + if (ac_base != 0) + { + be_component *bc_base = be_component::narrow_from_decl (ac_base); + + *os << "," << be_nl + << "public virtual " + << bc_base->full_remote_proxy_impl_name (); + } + } + int nparents = node->n_inherits (); if (nparents > 0) @@ -71,8 +86,7 @@ be_visitor_interface_remote_proxy_impl_ch::visit_interface ( << be_nl << be_nl; // Destructor Declaration. - *os << "virtual ~" << node->remote_proxy_impl_name () << " (void) { }" - << be_nl; + *os << "virtual ~" << node->remote_proxy_impl_name () << " (void) {}"; if (this->visit_scope (node) == -1) { @@ -147,3 +161,10 @@ be_visitor_interface_remote_proxy_impl_ch::gen_abstract_ops_helper ( return 0; } +int be_visitor_interface_remote_proxy_impl_ch::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + 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 8d9f84ac942..d0fc791e803 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 @@ -53,8 +53,7 @@ be_visitor_interface_remote_proxy_impl_cs::visit_interface ( // Generate the code for the Remote Proxy Impl. // operations - *os << "// Remote Implementation of the IDL interface methods" - << be_nl << be_nl; + *os << "// Remote Implementation of the IDL interface methods"; if (this->visit_scope (node) == -1) { @@ -65,7 +64,7 @@ be_visitor_interface_remote_proxy_impl_cs::visit_interface ( -1); } - *os << be_nl + *os << be_nl << be_nl << "//" << be_nl << "// End Base & Remote Proxy Implemeentation. " << be_nl << "///////////////////////////////////////////////////////////////////////" @@ -139,3 +138,11 @@ be_visitor_interface_remote_proxy_impl_cs::gen_abstract_ops_helper ( return 0; } +int be_visitor_interface_remote_proxy_impl_cs::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + + 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 7452a474649..4aaaa23f465 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 @@ -40,12 +40,9 @@ be_visitor_interface_smart_proxy_ch::~be_visitor_interface_smart_proxy_ch (void) int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) { - if (be_global->gen_smart_proxies ()) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; if (this->ctx_->alias ()) @@ -206,3 +203,9 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) return 0; } + +int be_visitor_interface_smart_proxy_ch::visit_component (be_interface *node) +{ + return this->visit_interface (node); +} + 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 7aae252e8a2..b943d0260ca 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 @@ -83,10 +83,10 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) << node->flat_name () << "_Default_Proxy_Factory (void)" << be_nl << be_uidt << be_uidt << "{" << be_nl - << "}\n\n"; + << "}"; - os->indent (); - *os << node->full_name () << "_ptr" << be_nl << be_uidt << be_uidt; + *os << be_nl << be_nl + << node->full_name () << "_ptr" << be_nl << be_uidt << be_uidt; *os << scope->full_name (); // Only if there exists any nesting "::" is needed! @@ -100,11 +100,11 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl << ")" << be_uidt << be_uidt_nl << "{" << be_idt_nl - << "return proxy;" << be_uidt << be_uidt_nl - << "}\n\n"; + << "return proxy;" << be_uidt_nl + << "}"; - os->indent (); - *os << scope->full_name (); + *os << be_nl << be_nl + << scope->full_name (); // Only if there exists any nesting "::" is needed! if (node->is_nested ()) @@ -206,29 +206,29 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) << "{" << be_idt_nl << "ACE_MT (ACE_GUARD_RETURN (" << "TAO_SYNCH_RECURSIVE_MUTEX, ace_mon," << be_idt_nl - << "this->lock_, 0));" <<be_uidt_nl<<be_nl - << "// To take care of those <unchecked_narrow> methods where we "<<be_nl - << "// want to override the smart proxy factory if there exists one."<<be_nl - << "if (this->disable_factory_ == 1)"<<be_idt_nl - << "{"<<be_idt_nl - << "this->disable_factory_ = 0;"<<be_nl - << "return proxy;"<<be_uidt_nl - << "}"<<be_uidt_nl<<be_nl - << "// Verify that an <proxy_factory_> is available else make one."<<be_nl + << "this->lock_, 0));" << be_uidt_nl << be_nl + << "// To take care of those <unchecked_narrow> methods where we " << be_nl + << "// want to override the smart proxy factory if there exists one." << be_nl + << "if (this->disable_factory_ == 1)" << be_idt_nl + << "{" << be_idt_nl + << "this->disable_factory_ = 0;" << be_nl + << "return proxy;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "// Verify that an <proxy_factory_> is available else make one." << be_nl << "if (" <<"this->proxy_factory_ == 0)" << be_idt_nl << "ACE_NEW_RETURN (" - << "this->proxy_factory_," << be_idt <<be_idt_nl + << "this->proxy_factory_," << be_idt << be_idt_nl << "TAO_" << node->flat_name () - << "_Default_Proxy_Factory (0), "<< be_nl + << "_Default_Proxy_Factory (0), " << be_nl << " 0);" << be_uidt_nl << be_uidt_nl << be_uidt_nl << "return " << "this->proxy_factory_->create_proxy (proxy);" << be_uidt << be_uidt_nl - << "}\n\n"; + << "}"; - os->indent (); - *os << scope->full_name (); + *os << be_nl << be_nl + << scope->full_name (); // Only if there exists any nesting "::" is needed! if (node->is_nested ()) @@ -337,3 +337,11 @@ int be_visitor_interface_smart_proxy_cs::visit_interface (be_interface *node) return 0; } + +int be_visitor_interface_smart_proxy_cs::visit_component ( + be_interface *node + ) +{ + return this->visit_interface (node); +} + 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 152974f5126..d172186b094 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 @@ -29,7 +29,7 @@ be_visitor_interface_strategized_proxy_broker_sh::visit_interface ( // Generate the class declaration. os->indent (); - *os << be_nl + *os << be_nl << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << "// Strategized Proxy Broker Declaration " << be_nl @@ -90,9 +90,9 @@ be_visitor_interface_strategized_proxy_broker_sh::visit_interface ( << " *the" << node->strategized_proxy_broker_name () << " (void);" << be_uidt_nl; - *os << "};" << be_nl << be_nl; + *os << "};"; - *os << be_nl + *os << be_nl << be_nl << "//" << be_nl << "// End Strategized Proxy Broker Declaration " << be_nl << "///////////////////////////////////////////////////////////////////////" @@ -100,3 +100,11 @@ be_visitor_interface_strategized_proxy_broker_sh::visit_interface ( return 0; } + +int be_visitor_interface_strategized_proxy_broker_sh::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + 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 53669d2c205..2d553173a64 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 @@ -53,21 +53,22 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface ( // Constructor Implementation. *os << node->full_strategized_proxy_broker_name () << "::" << node->strategized_proxy_broker_name () << " (void)" << be_nl - << "{" << be_idt_nl // idt = 1 + << "{" << be_idt_nl << "for (int i = 0; i < TAO_Collocation_Strategies::CS_LAST; ++i)" - << be_idt_nl // idt = 2 - << "this->proxy_cache_[i] = 0;" - << be_uidt_nl // idt = 1 - << be_uidt_nl // idt = 0 + << be_idt_nl + << "{" << be_idt_nl + << "this->proxy_cache_[i] = 0;" << be_uidt_nl + << "}" + << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; // Destructor Implementation. *os << node->full_strategized_proxy_broker_name () << "::~" << node->strategized_proxy_broker_name () << " (void)" << be_nl - << "{" << be_idt_nl // idt = 1 + << "{" << be_idt_nl << "for (int i = 0; i < TAO_Collocation_Strategies::CS_LAST; ++i)" - << be_idt_nl // idt = 2 - << "{" << be_idt_nl // idt =3 + << be_idt_nl + << "{" << be_idt_nl << "delete this->proxy_cache_[i];" << be_nl << be_nl << "// Hack to prevent bug mentioned in 1204. Refer to 1204" @@ -75,124 +76,129 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface ( << "// for details.." << be_nl << "this->proxy_cache_[i] = 0;" - << be_uidt_nl // idt = 2 + << be_uidt_nl << "}" - - << be_uidt_nl // idt = 1 - << be_uidt_nl // idt = 0 + << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; // select_proxy impementation *os << node->full_base_proxy_impl_name () << "&" << be_nl <<node->full_strategized_proxy_broker_name () << "::" << "select_proxy (" - << be_idt << be_idt_nl // idt = 2 + << be_idt << be_idt_nl << "::" << node->full_name () << " *object" << be_nl << "ACE_ENV_ARG_DECL" - << be_uidt_nl // idt = 1 + << be_uidt_nl << ")" - << be_uidt_nl // idt = 0 + << be_uidt_nl << "{" - << be_idt_nl // idt = 1 + << be_idt_nl << "int strategy =" - << be_idt_nl // idt = 2 + << be_idt_nl << "TAO_ORB_Core::collocation_strategy (object ACE_ENV_ARG_PARAMETER);" - << be_nl + << be_uidt_nl << "ACE_CHECK_RETURN (*this->proxy_cache_[strategy]);" - << be_uidt_nl << be_nl // idt = 1 + << be_nl << be_nl << "if (this->proxy_cache_[strategy] != 0)" - << be_idt_nl // idt = 2 - << "return *this->proxy_cache_[strategy];" - << be_uidt_nl << be_nl // idt = 1 + << be_idt_nl + << "{" << be_idt_nl + << "return *this->proxy_cache_[strategy];" << be_uidt_nl + << "}" + << be_uidt_nl << be_nl << "this->create_proxy (strategy ACE_ENV_ARG_PARAMETER);" << be_nl << "ACE_CHECK_RETURN (*this->proxy_cache_[strategy]);" << be_nl << be_nl - << "return *this->proxy_cache_[strategy];" << be_nl - << be_uidt_nl // idt = 0 + << "return *this->proxy_cache_[strategy];" + << be_uidt_nl << "}" << be_nl << be_nl; // create_proxy implementation *os << "void " << be_nl <<node->full_strategized_proxy_broker_name () << "::" << "create_proxy (" - << be_idt << be_idt_nl // idt = 2 + << be_idt << be_idt_nl << "int strategy" << be_nl << "ACE_ENV_ARG_DECL" - << be_uidt_nl // idt = 1 + << be_uidt_nl << ")" - << be_uidt_nl // idt = 0 + << be_uidt_nl << "{" - << be_idt_nl // idt = 1 + << be_idt_nl << "ACE_GUARD (TAO_SYNCH_MUTEX, guard, this->mutex_);" << be_nl << be_nl << "if (this->proxy_cache_[strategy] == 0)" - << be_idt_nl // idt = 2 + << be_idt_nl << "{" - << be_idt_nl // idt = 3 + << be_idt_nl << "switch (strategy)" - << be_idt_nl // idt = 4 + << be_idt_nl << "{" << be_nl; if (be_global->gen_thru_poa_collocation ()) { *os << "case TAO_Collocation_Strategies::CS_THRU_POA_STRATEGY:" - << be_idt_nl // idt = 5 + << be_idt_nl << "ACE_NEW_THROW_EX (" - << be_idt << be_idt_nl //idt = 7 + << be_idt << be_idt_nl << "this->proxy_cache_[strategy]," << be_nl << node->full_thru_poa_proxy_impl_name () << "," << be_nl << "CORBA::NO_MEMORY ()" - << be_uidt << be_uidt_nl // idt = 5 + << be_uidt << be_uidt_nl << ");" << be_nl << "ACE_CHECK;" << be_nl << "break;" - << be_nl << be_uidt_nl; // idt = 4 + << be_nl << be_uidt_nl; } if (be_global->gen_direct_collocation ()) { *os << "case TAO_Collocation_Strategies::CS_DIRECT_STRATEGY:" - << be_idt_nl // idt = 5 + << be_idt_nl << "ACE_NEW_THROW_EX (" - << be_idt << be_idt_nl //idt = 7 + << be_idt << be_idt_nl << "this->proxy_cache_[strategy]," << be_nl << node->full_direct_proxy_impl_name () << "," << be_nl << "CORBA::NO_MEMORY ()" - << be_uidt << be_uidt_nl // idt = 5 + << be_uidt << be_uidt_nl << ");" << be_nl << "ACE_CHECK;" << be_nl << "break;" - << be_nl << be_uidt_nl; // idt = 4 + << be_nl << be_uidt_nl; } *os << "case TAO_Collocation_Strategies::CS_REMOTE_STRATEGY:" << be_nl << "default:" - << be_idt_nl // idt = 5 + << be_idt_nl << "ACE_NEW_THROW_EX (" - << be_idt << be_idt_nl //idt = 7 + << be_idt << be_idt_nl << "this->proxy_cache_[strategy]," << be_nl << "::" << node->full_remote_proxy_impl_name () << "," << be_nl << "CORBA::NO_MEMORY ()" - << be_uidt << be_uidt_nl // idt = 5 + << be_uidt << be_uidt_nl << ");" << be_nl << "ACE_CHECK;" << be_nl << "break;" - << be_uidt_nl // idt = 4 - << be_uidt_nl // idt = 3 + << be_uidt_nl << "}" - << be_uidt_nl // idt = 2 - << be_uidt_nl // idt = 1 + << be_uidt << be_uidt_nl << "}" - << be_uidt_nl // idt = 0 - << "}" << be_nl << be_nl; + << be_uidt << be_uidt_nl + << "}" << be_nl; *os << be_nl << "//" << be_nl << "// End Strategized Proxy Broker Implementation" << be_nl - << "///////////////////////////////////////////////////////////////////////" - << be_nl << be_nl; + << "///////////////////////////////////////////////////////////////////////"; return 0; } + +int be_visitor_interface_strategized_proxy_broker_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + 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 3516857ae54..ed1b26abd4e 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 @@ -74,7 +74,7 @@ be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface ( // Dtor *os << "virtual ~" << node->thru_poa_proxy_impl_name () - << " (void) { }" << be_nl << be_nl; + << " (void) {}"; if (this->visit_scope (node) == -1) { @@ -89,8 +89,7 @@ be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface ( *os << be_nl << "//" << be_nl << "// ThruPOA Proxy Impl. Declaration" << be_nl - << "///////////////////////////////////////////////////////////////////////" - << be_nl << be_nl; + << "///////////////////////////////////////////////////////////////////////"; return 0; @@ -150,3 +149,11 @@ be_visitor_interface_thru_poa_proxy_impl_sh::gen_abstract_ops_helper ( return 0; } +int be_visitor_interface_thru_poa_proxy_impl_sh::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + + 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 1a6264ba044..e228dc61a5c 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 @@ -31,9 +31,9 @@ be_visitor_interface_thru_poa_proxy_impl_ss::visit_interface ( << "///////////////////////////////////////////////////////////////////////" << be_nl << "// ThruPOA Proxy Implementation\n" - << "//\n\n"; + << "//"; - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Ctor Implementation @@ -43,8 +43,7 @@ be_visitor_interface_thru_poa_proxy_impl_ss::visit_interface ( // Generate the code for the ThruPOA Proxy Impl. // operations - *os << "// ThruPOA Implementation of the IDL interface methods" - << be_nl << be_nl; + *os << "// ThruPOA Implementation of the IDL interface methods"; if (this->visit_scope (node) == -1) { @@ -57,8 +56,7 @@ be_visitor_interface_thru_poa_proxy_impl_ss::visit_interface ( *os << "//\n" << "// End ThruPOA Proxy Implementation\n" - << "///////////////////////////////////////////////////////////////////////" - << "\n\n"; + << "///////////////////////////////////////////////////////////////////////"; return 0; @@ -129,3 +127,11 @@ be_visitor_interface_thru_poa_proxy_impl_ss::gen_abstract_ops_helper ( return 0; } +int be_visitor_interface_thru_poa_proxy_impl_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + + 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 8421f97c59d..0afb0659eab 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp @@ -41,14 +41,14 @@ be_visitor_interface_tie_sh::~be_visitor_interface_tie_sh (void) int be_visitor_interface_tie_sh::visit_interface (be_interface *node) { - static char namebuf [NAMEBUFSIZE]; - static char tiename [NAMEBUFSIZE]; - if (node->imported () || node->is_abstract ()) { return 0; } + static char namebuf [NAMEBUFSIZE]; + static char tiename [NAMEBUFSIZE]; + ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); @@ -83,9 +83,7 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node) } // Now generate the class definition. - os->indent (); - - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// TIE class: Refer to CORBA v2.2, Section 20.34.4" << be_nl; @@ -97,10 +95,13 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node) << "// the T& ctor" << be_nl << tiename << " (T &t, PortableServer::POA_ptr poa);" << be_nl << "// ctor taking a POA" << be_nl - << tiename << " (T *tp, CORBA::Boolean release=1);" << be_nl + << tiename << " (T *tp, CORBA::Boolean release = 1);" << be_nl << "// ctor taking pointer and an ownership flag" << be_nl - << tiename << " (T *tp, PortableServer::POA_ptr poa, " - << "CORBA::Boolean release=1);" << be_nl + << tiename << " (" << be_idt << be_idt_nl + << "T *tp," << be_nl + << "PortableServer::POA_ptr poa," << be_nl + << "CORBA::Boolean release = 1" << be_uidt_nl + << ");" << be_uidt_nl << "// ctor with T*, ownership flag and a POA" << be_nl << "~" << tiename << " (void);" << be_nl << "// dtor" << be_nl << be_nl @@ -109,7 +110,7 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node) << "// return the underlying object" << be_nl << "void _tied_object (T &obj);" << be_nl << "// set the underlying object" << be_nl - << "void _tied_object (T *obj, CORBA::Boolean release=1);" << be_nl + << "void _tied_object (T *obj, CORBA::Boolean release = 1);" << be_nl << "// set the underlying object and the ownership flag" << be_nl << "CORBA::Boolean _is_owner (void);" << be_nl << "// do we own it" << be_nl @@ -118,7 +119,7 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node) << "// overridden ServantBase operations" << be_nl << "PortableServer::POA_ptr _default_POA (" << be_idt << be_idt_nl << "ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");" << be_uidt << "\n"; + << ");" << be_uidt; int status = node->traverse_inheritance_graph ( @@ -135,21 +136,26 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node) -1); } - os->decr_indent (1); - - *os << "private:" << be_idt_nl + *os << be_uidt_nl << be_nl + << "private:" << be_idt_nl << "T *ptr_;" << be_nl << "PortableServer::POA_var poa_;" << be_nl << "CORBA::Boolean rel_;" << be_nl << be_nl << "// copy and assignment are not allowed" << be_nl << tiename << " (const " << tiename << " &);" << be_nl << "void operator= (const " << tiename << " &);" << be_uidt_nl - << "};\n\n"; + << "};"; return 0; } int +be_visitor_interface_tie_sh::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int be_visitor_interface_tie_sh::method_helper (be_interface *, be_interface *node, TAO_OutStream *os) 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 560b8213187..d38b20d2726 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp @@ -42,12 +42,13 @@ be_visitor_interface_tie_si::~be_visitor_interface_tie_si (void) int be_visitor_interface_tie_si::visit_interface (be_interface *node) { - if (node->srv_inline_gen () || node->imported () || node->is_abstract ()) + if (node->srv_inline_gen () + || node->imported () + || node->is_abstract ()) { return 0; } - TAO_OutStream *os; static char fulltiename [NAMEBUFSIZE]; static char localtiename [NAMEBUFSIZE]; static char localskelname [NAMEBUFSIZE]; @@ -62,8 +63,6 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) '\0', NAMEBUFSIZE); - os = this->ctx_->stream (); - // Generate the skeleton class name which will be used to determine the TIE // class name. @@ -91,19 +90,16 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) node->local_name ()); } - *os << "// TAO_IDL - Generated from" << be_nl + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; if (node->is_nested ()) { - *os << "#if defined (ACE_HAS_USING_KEYWORD)\n\n"; + *os << "#if defined (ACE_HAS_USING_KEYWORD)" << be_nl << be_nl; } - os->indent (); - - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl << be_nl; - *os << "template <class T> ACE_INLINE" << be_nl << fulltiename << "<T>::" << localtiename << " (T &t)" << be_nl << "\t: ptr_ (&t)," << be_nl @@ -139,7 +135,10 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) *os << "template <class T> ACE_INLINE" << be_nl << fulltiename << "<T>::~" << localtiename << " (void)" << be_nl << "{" << be_idt_nl - << "if (this->rel_) delete this->ptr_;" << be_uidt_nl + << "if (this->rel_)" << be_idt_nl + << "{" << be_idt_nl + << "delete this->ptr_;" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; *os << "template <class T> ACE_INLINE T *" << be_nl @@ -151,7 +150,10 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) *os << "template <class T> ACE_INLINE void" << be_nl << fulltiename << "<T>::_tied_object (T &obj)" << be_nl << "{" << be_idt_nl - << "if (this->rel_) delete this->ptr_;" << be_nl + << "if (this->rel_)" << be_idt_nl + << "{" << be_idt_nl + << "delete this->ptr_;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "this->ptr_ = &obj;" << be_nl << "this->rel_ = 0;" << be_uidt_nl << "}" << be_nl << be_nl; @@ -160,7 +162,10 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) << fulltiename << "<T>::_tied_object (T *obj, " << "CORBA::Boolean release)" << be_nl << "{" << be_idt_nl - << "if (this->rel_) delete this->ptr_;" << be_nl + << "if (this->rel_)" << be_idt_nl + << "{" << be_idt_nl + << "delete this->ptr_;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "this->ptr_ = obj;" << be_nl << "this->rel_ = release;" << be_uidt_nl << "}" << be_nl << be_nl; @@ -183,11 +188,12 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) << "<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL)" << be_nl << "{" << be_idt_nl << "if (!CORBA::is_nil (this->poa_.in ()))" << be_idt_nl - << "return PortableServer::POA::_duplicate (this->poa_.in ());\n" - << be_uidt_nl + << "{" << be_idt_nl + << "return PortableServer::POA::_duplicate (this->poa_.in ());" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return this->" << localskelname << "::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);" << be_uidt_nl - << "}\n\n"; + << "}"; int status = node->traverse_inheritance_graph ( @@ -206,13 +212,19 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) if (node->is_nested ()) { - *os << "#endif /* ACE_HAS_USING_KEYWORD */\n\n"; + *os << "\n\n#endif /* ACE_HAS_USING_KEYWORD */"; } return 0; } int +be_visitor_interface_tie_si::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int be_visitor_interface_tie_si::method_helper (be_interface *derived, be_interface *node, TAO_OutStream *os) @@ -236,7 +248,7 @@ be_visitor_interface_tie_si::method_helper (be_interface *derived, { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_tie_sh::" + "be_visitor_interface_tie_si::" "method_helper\n"), -1); } diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp index a042bdc1498..0818c2bee1e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd.cpp @@ -20,14 +20,13 @@ #include "be_interface_fwd.h" #include "be_interface.h" +#include "be_helper.h" +#include "be_extern.h" #include "be_visitor_interface_fwd.h" #include "be_visitor_context.h" -#include "be_helper.h" -#include "be_extern.h" #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" 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 eafc335ad18..f7c297f2789 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 @@ -61,15 +61,18 @@ be_visitor_interface_fwd_any_op_ch::visit_interface_fwd ( TAO_OutStream *os = this->ctx_->stream (); - // Generate the Any <<= and >>= operator declarations. - os->indent (); - *os << "// Any operators for interface " << node->name () << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << be_global->stub_export_macro () << " void" + << " operator<<= (CORBA::Any &, " << node->name () + << "_ptr); // copying" << be_nl; *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, " << node->name () - << "_ptr);" << be_nl; + << "_ptr *); // non-copying" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, " - << node->name () << " *&);\n"; + << node->name () << " *&);"; node->cli_hdr_any_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 34b287aa202..8d99e8abaf9 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 @@ -55,8 +55,8 @@ be_visitor_interface_fwd_cdr_op_ci::visit_interface_fwd ( TAO_OutStream *os = this->ctx_->stream (); - // generate the CDR << and >> operator declarations - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean operator<< (" << be_idt << be_idt_nl @@ -68,7 +68,7 @@ be_visitor_interface_fwd_cdr_op_ci::visit_interface_fwd ( << be_idt << be_idt_nl << "TAO_InputCDR &," << be_nl << node->name () << "_ptr &" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt; node->cli_inline_cdr_decl_gen (1); 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 7984871f1ee..dba8cd37da6 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 @@ -49,15 +49,19 @@ be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // All we do in this is generate a forward declaration of the class. - *os << "class " << node->local_name () << ";" << be_nl; + *os << be_nl << be_nl << "class " << node->local_name () << ";"; // Generate the ifdefined macro for the _ptr type. os->gen_ifdef_macro (node->flat_name (), "_ptr"); // Generate the _ptr typedef. - *os << "typedef " << node->local_name () << " *" << node->local_name () - << "_ptr;" << be_nl; + *os << be_nl << be_nl + << "typedef " << node->local_name () << " *" << node->local_name () + << "_ptr;"; os->gen_endif (); 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 deleted file mode 100644 index 8fa023edc4b..00000000000 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ci.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// -// $Id$ -// - -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// interface_fwd_ci.cpp -// -// = DESCRIPTION -// Visitor generating code for Interface_Fwd node in the client inline. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -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_decl (ctx) -{ -} - -be_visitor_interface_fwd_ci::~be_visitor_interface_fwd_ci (void) -{ -} - -int -be_visitor_interface_fwd_ci::visit_interface_fwd (be_interface_fwd *) -{ - // _var and _out class generation for interfaces has been moved to the - // .cpp file - nothing to do here at the moment. - - return 0; -} diff --git a/TAO/TAO_IDL/be/be_visitor_module.cpp b/TAO/TAO_IDL/be/be_visitor_module.cpp index 6028e016bb0..6a8bfc29f89 100644 --- a/TAO/TAO_IDL/be/be_visitor_module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module.cpp @@ -31,6 +31,11 @@ #include "be_union_fwd.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" +#include "be_eventtype.h" +#include "be_eventtype_fwd.h" +#include "be_component.h" +#include "be_component_fwd.h" +#include "be_home.h" #include "be_extern.h" #include "be_helper.h" #include "utl_err.h" @@ -48,6 +53,11 @@ #include "be_visitor_union_fwd.h" #include "be_visitor_valuetype.h" #include "be_visitor_valuetype_fwd.h" +#include "be_visitor_eventtype.h" +#include "be_visitor_eventtype_fwd.h" +#include "be_visitor_component.h" +#include "be_visitor_component_fwd.h" +#include "be_visitor_home.h" #include "be_visitor_context.h" #include "be_visitor_module/module.cpp" diff --git a/TAO/TAO_IDL/be/be_visitor_module/module.cpp b/TAO/TAO_IDL/be/be_visitor_module/module.cpp index db31834b964..9411cf4a63c 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module.cpp @@ -493,13 +493,6 @@ be_visitor_module::visit_interface_fwd (be_interface_fwd *node) status = node->accept (&visitor); break; } - case TAO_CodeGen::TAO_MODULE_CI: - { - ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CI); - be_visitor_interface_fwd_ci visitor (&ctx); - status = node->accept (&visitor); - break; - } case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: { ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI); @@ -523,6 +516,7 @@ be_visitor_module::visit_interface_fwd (be_interface_fwd *node) } case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: + case TAO_CodeGen::TAO_MODULE_CI: case TAO_CodeGen::TAO_MODULE_CS: case TAO_CodeGen::TAO_MODULE_SH: case TAO_CodeGen::TAO_MODULE_SI: @@ -683,10 +677,10 @@ be_visitor_module::visit_valuetype_fwd (be_valuetype_fwd *node) status = node->accept (&visitor); break; } - case TAO_CodeGen::TAO_MODULE_CI: + case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: { - ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CI); - be_visitor_valuetype_fwd_ci visitor (&ctx); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_ANY_OP_CH); + be_visitor_valuetype_fwd_any_op_ch visitor (&ctx); status = node->accept (&visitor); break; } @@ -705,8 +699,8 @@ be_visitor_module::visit_valuetype_fwd (be_valuetype_fwd *node) break; } case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: - case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: + case TAO_CodeGen::TAO_MODULE_CI: case TAO_CodeGen::TAO_MODULE_CS: case TAO_CodeGen::TAO_MODULE_SH: case TAO_CodeGen::TAO_MODULE_SI: @@ -737,6 +731,431 @@ be_visitor_module::visit_valuetype_fwd (be_valuetype_fwd *node) } int +be_visitor_module::visit_eventtype (be_eventtype *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_MODULE_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CH); + be_visitor_eventtype_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CI: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CI); + be_visitor_eventtype_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CS: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CS); + be_visitor_eventtype_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CDR_OP_CH); + be_visitor_eventtype_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CDR_OP_CI); + be_visitor_eventtype_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CDR_OP_CS); + be_visitor_eventtype_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_ANY_OP_CH); + be_visitor_eventtype_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_ANY_OP_CS); + be_visitor_eventtype_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_SH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_SH); + be_visitor_eventtype_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_SI: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_SI); + be_visitor_eventtype_si visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_SS: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_SS); + be_visitor_eventtype_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_IH: + case TAO_CodeGen::TAO_MODULE_IS: + return 0; // nothing to do. + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_eventtype - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_eventtype - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_module::visit_eventtype_fwd (be_eventtype_fwd *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_MODULE_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_FWD_CH); + be_visitor_eventtype_fwd_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_FWD_ANY_OP_CH); + be_visitor_eventtype_fwd_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_FWD_CDR_OP_CH); + be_visitor_eventtype_fwd_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_FWD_CDR_OP_CI); + be_visitor_eventtype_fwd_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: + case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: + case TAO_CodeGen::TAO_MODULE_CI: + case TAO_CodeGen::TAO_MODULE_CS: + case TAO_CodeGen::TAO_MODULE_SH: + case TAO_CodeGen::TAO_MODULE_SI: + case TAO_CodeGen::TAO_MODULE_SS: + case TAO_CodeGen::TAO_MODULE_IH: + case TAO_CodeGen::TAO_MODULE_IS: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_eventtype_fwd - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_eventtype_fwd - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_module::visit_component (be_component *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_MODULE_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CH); + be_visitor_component_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CI: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CI); + be_visitor_component_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CS); + be_visitor_component_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CDR_OP_CH); + be_visitor_component_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CDR_OP_CI); + be_visitor_component_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CDR_OP_CS); + be_visitor_component_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_ANY_OP_CH); + be_visitor_component_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_ANY_OP_CS); + be_visitor_component_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_SH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_SH); + be_visitor_component_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_SI: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_SI); + be_visitor_component_si visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_SS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_SS); + be_visitor_component_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_IH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_IH); + be_visitor_component_ih visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_IS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_IS); + be_visitor_component_is visitor (&ctx); + status = node->accept (&visitor); + break; + } + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_component - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_component - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_module::visit_component_fwd (be_component_fwd *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_MODULE_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_FWD_CH); + be_visitor_component_fwd_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_FWD_CDR_OP_CH); + be_visitor_component_fwd_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_FWD_CDR_OP_CI); + be_visitor_component_fwd_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: + case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: + case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: + case TAO_CodeGen::TAO_MODULE_CI: + case TAO_CodeGen::TAO_MODULE_CS: + case TAO_CodeGen::TAO_MODULE_SH: + case TAO_CodeGen::TAO_MODULE_SI: + case TAO_CodeGen::TAO_MODULE_SS: + case TAO_CodeGen::TAO_MODULE_IH: + case TAO_CodeGen::TAO_MODULE_IS: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_component_fwd - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_component_fwd - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_module::visit_home (be_home *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_MODULE_CH: + { + be_visitor_home_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_CI: + case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: + case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: + case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: + case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: + case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: + case TAO_CodeGen::TAO_MODULE_CS: + case TAO_CodeGen::TAO_MODULE_SH: + case TAO_CodeGen::TAO_MODULE_SI: + case TAO_CodeGen::TAO_MODULE_SS: + case TAO_CodeGen::TAO_MODULE_IH: + case TAO_CodeGen::TAO_MODULE_IS: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_structure - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_home - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int be_visitor_module::visit_structure (be_structure *node) { // Instantiate a visitor context with a copy of our context. This info 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 85e5719acc8..b81d4327173 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp @@ -41,14 +41,12 @@ be_visitor_module_ch::visit_module (be_module *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - os->indent (); - *os << "TAO_NAMESPACE " << " " << node->local_name () << be_nl - << "{" << be_idt_nl; + << "{" << be_idt; // Generate code for the module definition by traversing thru the // elements of its scope. We depend on the front-end to have made sure @@ -62,11 +60,11 @@ be_visitor_module_ch::visit_module (be_module *node) -1); } - *os << be_uidt_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_uidt_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl; *os << be_nl - << "}\nTAO_NAMESPACE_CLOSE // module " << node->name () << "\n\n"; + << "}\nTAO_NAMESPACE_CLOSE // module " << node->name (); } 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 69277ece870..f235917d488 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp @@ -38,51 +38,49 @@ int be_visitor_module_sh::visit_module (be_module *node) { // Not generated and not imported. - if (!node->srv_hdr_gen () && !node->imported ()) + if (node->srv_hdr_gen () || node->imported ()) { - TAO_OutStream *os = this->ctx_->stream (); - - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + return 0; + } - // Generate the skeleton class name. + TAO_OutStream *os = this->ctx_->stream (); - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - // Now generate the class definition. The prefix POA_ is prepended to our - // name only if we are the outermost module. - *os << "TAO_NAMESPACE "; + // Generate the skeleton class name. - if (!node->is_nested ()) - { - // We are outermost module. - *os << " POA_" << node->local_name () << be_nl; - } - else - { - // We are inside another module. - *os << " " << node->local_name () << be_nl; - } + // Now generate the class definition. The prefix POA_ is prepended to our + // name only if we are the outermost module. + *os << "TAO_NAMESPACE "; - *os << "{\n" << be_idt; + if (!node->is_nested ()) + { + // We are outermost module. + *os << " POA_" << node->local_name () << be_nl; + } + else + { + // We are inside another module. + *os << " " << node->local_name () << be_nl; + } - 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); - } + *os << "{" << be_idt_nl; - os->decr_indent (); + 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); + } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - *os << "}" << be_nl << "TAO_NAMESPACE_CLOSE // module " - << node->name () << "\n\n"; - } + *os << "}" << be_nl << "TAO_NAMESPACE_CLOSE // module " + << node->name (); return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index d8096fb0927..7017329c857 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -35,6 +35,11 @@ #include "be_union.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" +#include "be_component.h" +#include "be_component_fwd.h" +#include "be_eventtype.h" +#include "be_eventtype_fwd.h" +#include "be_home.h" #include "be_extern.h" #include "be_helper.h" #include "utl_identifier.h" 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 2296a5d4c65..d4bc04e549e 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 @@ -66,8 +66,9 @@ be_visitor_amh_rh_operation_sh::visit_operation (be_operation *node) -1); } - // Step 1 : Generate return type: always void - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "virtual void "; // Step 2: Generate the method name @@ -100,7 +101,7 @@ be_visitor_amh_rh_operation_sh::visit_operation (be_operation *node) -1); } - *os << ";" << be_nl; + *os << ";"; return 0; } 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 43982f6d1d7..7365c32eea2 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 @@ -64,9 +64,10 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node) buf = 0; // Step 1 : Generate return type: always void - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl - << "void" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << "void" << be_nl << response_handler_implementation_name.c_str () << "::"; // Check if we are an attribute node in disguise @@ -155,9 +156,7 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node) ACE_ASSERT (idx != ACE_String_Base_Const::npos); operation_name[idx] = '\0'; - *os << "{" << be_idt_nl - << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl + *os << be_nl << "{" << be_idt_nl << "ACE_TRY" << be_nl << "{" << be_idt_nl << "holder->raise_" << operation_name.c_str () @@ -166,29 +165,29 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node) << "}" << be_nl << "ACE_CATCH (CORBA::Exception, ex)" << be_nl << "{" << be_nl - << " this->_tao_rh_send_exception (ex ACE_ENV_ARG_PARAMETER);" << be_nl + << " this->_tao_rh_send_exception (ex ACE_ENV_ARG_PARAMETER);" + << be_nl << " ACE_CHECK;" << be_nl << "}" << be_nl << "ACE_ENDTRY;" << be_uidt_nl - << "}\n" << be_nl; + << "}"; } else { // Step 3: Generate actual code for the method - *os << "{" << be_idt_nl - << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl - << "this->_tao_rh_init_reply (ACE_ENV_SINGLE_ARG_PARAMETER);\n" << be_nl << be_nl; + *os << be_nl << "{" << be_idt_nl + << "this->_tao_rh_init_reply (ACE_ENV_SINGLE_ARG_PARAMETER);" + << be_nl << be_nl; this->marshal_params (node); *os << be_nl - << "this->_tao_rh_send_reply (ACE_ENV_SINGLE_ARG_PARAMETER);" << be_uidt_nl - << "}\n" << be_nl; + << "this->_tao_rh_send_reply (ACE_ENV_SINGLE_ARG_PARAMETER);" + << be_uidt_nl + << "}"; } return 0; - } @@ -204,7 +203,7 @@ be_visitor_amh_rh_operation_ss::marshal_params (be_operation *node) this->has_param_type (node, AST_Argument::dir_INOUT)) { // marshal the in and inout arguments - *os << "if (!(\n" << be_idt; + *os << "if (!(" << be_idt << be_idt_nl; // Marshal each in and inout argument. ctx = *this->ctx_; @@ -221,7 +220,7 @@ be_visitor_amh_rh_operation_ss::marshal_params (be_operation *node) -1); } - *os << be_nl << "))" << be_idt_nl; + *os << be_uidt_nl << "))" << be_nl; // If marshaling fails, raise exception. if (this->gen_raise_exception (0, @@ -233,7 +232,7 @@ be_visitor_amh_rh_operation_ss::marshal_params (be_operation *node) -1); } - *os << be_uidt << be_uidt; + *os << be_uidt_nl; } return 0; 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 086e4a10e77..4697813c5de 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp @@ -110,7 +110,7 @@ be_visitor_amh_operation_sh::visit_operation (be_operation *node) *os << be_uidt_nl << "))" << be_uidt; } - *os << " = 0;" << be_nl << be_nl; + *os << " = 0;"; return 0; } @@ -168,9 +168,8 @@ be_visitor_amh_operation_sh::generate_shared_prologue ( const char *skel_prefix ) { - os->indent (); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "static void " << skel_prefix << node->local_name () @@ -179,7 +178,7 @@ be_visitor_amh_operation_sh::generate_shared_prologue ( << "void *_tao_obj," << be_nl << "void *_tao_servant_upcall" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt_nl << be_nl; // We need the interface node in which this operation was defined. However, // if this operation node was an attribute node in disguise, we get this @@ -204,7 +203,6 @@ be_visitor_amh_operation_sh::generate_shared_prologue ( } // Step 1 : Generate return type: always void - os->indent (); *os << "virtual void "; // Step 2: Generate the method name 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 10e8da9bfac..db0fc0530aa 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp @@ -80,8 +80,8 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) *os << be_nl << "TAO_InputCDR &_tao_in =" - << " _tao_server_request.incoming ();\n" << be_nl - << "if (!(1" << be_idt_nl; + << " _tao_server_request.incoming ();" << be_nl << be_nl + << "if (!(" << be_idt << be_idt; // Marshal each in and inout argument. be_visitor_context marshal_ctx = *this->ctx_; @@ -90,6 +90,7 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) be_visitor_args_marshal_ss marshal_visitor (&marshal_ctx); marshal_visitor.set_fixed_direction (AST_Argument::dir_IN); + int i = 0; for (UTL_ScopeActiveIterator sj (node, UTL_Scope::IK_decls); !sj.is_done (); @@ -104,7 +105,10 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) continue; } - *os << "&& "; + if (i++ != 0) + { + *os << " &&"; + } if (marshal_visitor.visit_argument (argument) == -1) { @@ -114,11 +118,9 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) "codegen for demarshal failed\n"), -1); } - - *os << be_nl; } - *os << "))" << be_nl; + *os << be_uidt_nl << "))" << be_nl; // If marshaling fails, raise exception. if (this->gen_raise_exception (0, @@ -130,7 +132,7 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) -1); } - *os << be_uidt << "\n"; + *os << be_uidt_nl; } if (this->generate_shared_section (node, os) == -1) @@ -145,12 +147,13 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) visitor.set_fixed_direction (AST_Argument::dir_IN); for (UTL_ScopeActiveIterator i (node, UTL_Scope::IK_decls); - !i.is_done (); - i.next ()) + !i.is_done ();) { be_argument *argument = be_argument::narrow_from_decl (i.item ()); + i.next (); + if (argument == 0 || argument->direction () == AST_Argument::dir_OUT) { @@ -167,11 +170,9 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node) "codegen for upcall args failed\n"), -1); } - - *os << be_nl; } - *os << "ACE_ENV_ARG_PARAMETER"; + *os << be_nl << "ACE_ENV_ARG_PARAMETER"; } if (this->generate_shared_epilogue (os) == -1) @@ -230,9 +231,9 @@ be_visitor_amh_operation_ss::visit_attribute (be_attribute *node) *os << be_nl << "TAO_InputCDR &_tao_in =" - << " _tao_server_request.incoming ();\n" - << be_nl - << "if (!(\n" << be_idt; + << " _tao_server_request.incoming ();" + << be_nl << be_nl + << "if (!(" << be_idt_nl; { be_visitor_context ctx (*this->ctx_); @@ -258,7 +259,7 @@ be_visitor_amh_operation_ss::visit_attribute (be_attribute *node) -1); } - *os << be_uidt << "\n"; + *os << be_uidt_nl; if (this->generate_shared_section (node, os) == -1) { @@ -281,8 +282,8 @@ be_visitor_amh_operation_ss::generate_shared_prologue (be_decl *node, TAO_OutStream *os, const char *skel_prefix) { - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // We need the interface node in which this operation was defined. However, // if this operation node was an attribute node in disguise, we get this @@ -307,7 +308,6 @@ be_visitor_amh_operation_ss::generate_shared_prologue (be_decl *node, delete [] buf; buf = 0; - os->indent (); *os << "void" << be_nl << amh_skel_name.c_str () << "::" << skel_prefix @@ -327,8 +327,8 @@ be_visitor_amh_operation_ss::generate_shared_prologue (be_decl *node, *os << amh_skel_name.c_str () << " *_tao_impl =" << be_idt_nl << "ACE_static_cast (" << be_idt << be_idt_nl << amh_skel_name.c_str () << " *," << be_nl - << "_tao_object_reference" << be_uidt << be_uidt_nl - << ");\n" << be_uidt; + << "_tao_object_reference" << be_uidt_nl + << ");" << be_uidt << be_uidt; return 0; } @@ -354,14 +354,19 @@ be_visitor_amh_operation_ss::generate_shared_section (be_decl *node, buf = 0; *os << be_nl << response_handler_name.c_str () - << "_var _tao_rh =" << be_idt_nl - << "new " << response_handler_implementation_name.c_str () - << " (_tao_server_request);\n" << be_uidt; + << "_ptr _tao_rh_ptr;" << be_nl + << "ACE_NEW (" << be_idt << be_idt_nl + << "_tao_rh_ptr," << be_nl + << response_handler_implementation_name.c_str () + << " (_tao_server_request)" << be_uidt_nl + << ");" << be_uidt_nl + << response_handler_name.c_str () << "_var _tao_rh = _tao_rh_ptr;" + << be_nl; // Make the upcall. *os << be_nl << "_tao_impl->" - << node->local_name () << " (_tao_rh.in ()" - << be_idt << be_idt_nl; + << node->local_name () << " (" << be_idt << be_idt_nl + << "_tao_rh.in ()"; return 0; } @@ -371,7 +376,7 @@ be_visitor_amh_operation_ss::generate_shared_epilogue (TAO_OutStream *os) { *os << be_uidt_nl << ");" << be_uidt << be_uidt_nl - << "}\n\n"; + << "}"; return 0; } 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 a5966a04455..eb0f4a3f692 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp @@ -51,8 +51,12 @@ be_visitor_operation_ami_ch::visit_operation (be_operation *node) TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Every operation is declared virtual in the client code. - *os << "virtual "; + *os << be_nl << be_nl + << "virtual "; // STEP I: Return type is void. *os << "void "; 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 37e52f8374d..46068040f3e 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp @@ -68,10 +68,12 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node) TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Generate the return type mapping. Return type is simply void. - *os << "void" << be_nl; + *os << be_nl << be_nl + << "void" << be_nl; // Generate the operation name. @@ -200,10 +202,10 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node) } // No return values. - *os << "return;"; + *os << be_nl << "return;"; } // end of if (!native) - *os << be_uidt_nl << "}\n\n"; + *os << be_uidt_nl << "}"; return 0; } @@ -388,8 +390,8 @@ be_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node, { *os << be_nl << "TAO_OutputCDR &_tao_out = _tao_call.out_stream ();" - << be_nl - << "if (!(\n" << be_idt << be_idt << be_idt; + << be_nl << be_nl + << "if (!(" << be_idt << be_idt_nl; // Marshal each in and inout argument. ctx = *this->ctx_; @@ -409,7 +411,7 @@ be_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node, ); } - *os << be_uidt << be_uidt_nl + *os << be_uidt_nl << "))" << be_nl; // If marshaling fails, raise exception. @@ -429,9 +431,9 @@ be_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node, *os << be_uidt; } - *os << be_nl + *os << be_nl << be_nl << "int _invoke_status =" << be_idt_nl - << "_tao_call.invoke (ACE_ENV_SINGLE_ARG_PARAMETER);" << be_uidt; + << "_tao_call.invoke (ACE_ENV_SINGLE_ARG_PARAMETER);"; *os << be_uidt_nl; @@ -450,8 +452,8 @@ be_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node, << "{" << be_nl << " _tao_call.restart_flag (1);" << be_nl << " continue;" <<be_nl - << "}"<< be_uidt_nl - << "if (_invoke_status != TAO_INVOKE_OK)" << be_nl + << "}"<< be_uidt_nl << be_nl + << "if (_invoke_status != TAO_INVOKE_OK)" << be_idt_nl << "{" << be_idt_nl; int status = @@ -469,9 +471,9 @@ be_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node, } *os << be_uidt_nl - << "}" << be_nl - << "break;" << be_nl - << be_uidt_nl << "}" << be_nl; + << "}" << be_uidt_nl << be_nl + << "break;" << be_uidt_nl + << "}" << be_nl; // Return type is void and we are going to worry about OUT or INOUT // parameters. Return from here. 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 9b0eb3d35b6..ba20ee36122 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 @@ -52,7 +52,8 @@ be_visitor_operation_ami_handler_reply_stub_operation_ch::visit_operation ( if (!node->has_native ()) { // Next line. - *os << "static void "; + *os << be_nl << be_nl + << "static void "; // Check if we are an attribute node in disguise if (this->ctx_->attribute ()) @@ -77,7 +78,7 @@ be_visitor_operation_ami_handler_reply_stub_operation_ch::visit_operation ( *os << be_nl << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + << ");" << be_uidt; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp index 6e6bee2d9b2..3d15b3b810d 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp @@ -44,8 +44,7 @@ be_visitor_operation_arglist::visit_operation (be_operation *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << " (" << be_idt - << be_idt_nl; + *os << " (" << be_idt << be_idt_nl; int arg_emitted = 0; @@ -87,7 +86,7 @@ be_visitor_operation_arglist::visit_operation (be_operation *node) } *os << be_uidt_nl - << ")"; // idt = 0 + << ")"; // Now generate the throw specs. if (this->gen_throw_spec (node) == -1) @@ -106,26 +105,26 @@ be_visitor_operation_arglist::visit_operation (be_operation *node) case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH: if (node->is_local ()) { - *os << " = 0;" << be_nl << be_nl; + *os << " = 0;"; } else { - *os << ";" << be_nl << be_nl; + *os << ";"; } break; case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH: - *os << ";" << be_nl << be_nl; + *os << ";"; break; case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH: case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH: // Each method is pure virtual in the server header. - *os << " = 0;" << be_nl << be_nl; + *os << " = 0;"; break; case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS: case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS: default: - *os << be_nl; + break; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp index 3a8ff384e61..b90d69e0231 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp @@ -49,7 +49,6 @@ be_visitor_operation_argument::post_process (be_decl *bd) switch (this->ctx_->state ()) { case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: - case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: if (!this->last_node (bd)) @@ -58,6 +57,13 @@ be_visitor_operation_argument::post_process (be_decl *bd) } break; + case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS: + if (!this->last_node (bd)) + { + *os << ","; + } + + break; default: break; } @@ -94,11 +100,11 @@ be_visitor_operation_argument::visit_operation (be_operation *node) // whether the operation node has parameters. if (node->argument_count () > 0) { - *os << " ACE_ENV_ARG_PARAMETER"; + *os << be_nl << "ACE_ENV_ARG_PARAMETER"; } else { - *os << "ACE_ENV_SINGLE_ARG_PARAMETER"; + *os << be_nl << "ACE_ENV_SINGLE_ARG_PARAMETER"; } break; 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 ec59c0045c8..3ee13e69a64 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp @@ -66,7 +66,7 @@ be_visitor_operation_argument_marshal::pre_process (be_decl *bd) { if (this->last_arg_printed_ != be_visitor_operation_argument_marshal::TAO_ARG_NONE) - *os << " &&\n"; + *os << " &&"; } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -78,13 +78,13 @@ be_visitor_operation_argument_marshal::pre_process (be_decl *bd) { if (this->last_arg_printed_ != be_visitor_operation_argument_marshal::TAO_ARG_NONE) - *os << " &&\n"; + *os << " &&"; } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { if (this->last_arg_printed_ != be_visitor_operation_argument_marshal::TAO_ARG_NONE) - *os << " &&\n"; + *os << " &&"; } break; case AST_Argument::dir_OUT: @@ -96,7 +96,7 @@ be_visitor_operation_argument_marshal::pre_process (be_decl *bd) { if (this->last_arg_printed_ != be_visitor_operation_argument_marshal::TAO_ARG_NONE) - *os << " &&\n"; + *os << " &&"; } break; } @@ -164,6 +164,7 @@ be_visitor_operation_argument_marshal::post_process (be_decl *bd) "Bad sub state\n"), -1); } + return 0; } @@ -199,13 +200,13 @@ be_visitor_args_decl::visit_array (be_array *node) // retrieve the field node be_argument *f = this->ctx_->be_node_as_argument (); + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_args_decl::" "visit_array - " - "cannot retrieve argument node\n" - ), + "cannot retrieve argument node\n"), -1); } 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 5d02b51fea8..7a9777992de 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 @@ -20,6 +20,9 @@ int be_visitor_operation_base_proxy_impl_ch::visit_operation (be_operation *node TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "virtual "; // STEP I: generate the return type. 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 b5eeb05802b..2a6a379501f 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_arglist.cpp @@ -68,14 +68,14 @@ be_visitor_operation_interceptors_arglist::visit_operation ( case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CS: case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SS: { - *os << " ACE_ENV_ARG_PARAMETER"; + *os << be_nl << "ACE_ENV_ARG_PARAMETER"; break; } case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CS: case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SS: { // Last argument - is always CORBA::Environment. - *os << " ACE_ENV_ARG_DECL_NOT_USED"; + *os << be_nl << "ACE_ENV_ARG_DECL_NOT_USED"; break; } case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CH: @@ -84,7 +84,7 @@ be_visitor_operation_interceptors_arglist::visit_operation ( // @@ Do it for all cases i.e arg count > = 0 // Last argument - is always CORBA::Environment. - *os << " ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl; + *os << be_nl << "ACE_ENV_ARG_DECL_WITH_DEFAULTS"; break; } default: @@ -136,7 +136,7 @@ be_visitor_operation_interceptors_arglist::pre_process (be_decl *bd) // If we are not the last node in the list of arguments, generate a comma // else decide if we are generating code to support true exceptions - in // which case there will not be any CORBA::Environment parameter. - *os << "," << be_nl; + *os << ","; break; } case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CH: @@ -204,6 +204,10 @@ be_visitor_operation_interceptors_arglist::visit_argument (be_argument *node) ctx.scope (intf); int status = 0; + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl; + switch (this->ctx_->state ()) { case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CH: 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 2c84d1e4fec..10cb47be685 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp @@ -72,10 +72,11 @@ be_visitor_operation_interceptors_cs::generate_class_declaration ( // Generate the ClientRequestInfo object per operation to // be used by the interceptors. - // Start with the current indentation level. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; - *os << "class TAO_ClientRequestInfo_" << node->flat_name (); + *os << be_nl << be_nl + << "class TAO_ClientRequestInfo_" << node->flat_name (); // We need the interface node in which this operation was defined. However, // if this operation node was an attribute node in disguise, we get this @@ -326,7 +327,7 @@ be_visitor_operation_interceptors_cs::generate_class_declaration ( } } - *os << " &);\n" << be_nl; + *os << " &);"; // Need to generate the args as reference memebers... // Generate the member list with the appropriate mapping. For these @@ -361,6 +362,8 @@ be_visitor_operation_interceptors_cs::generate_class_declaration ( // void since we can't have a private member to be of void type. if (!this->void_return_type (bt)) { + *os << be_nl << be_nl; + ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_RETTYPE_CH); be_visitor_operation_interceptors_info_rettype toiir_visitor (&ctx); @@ -374,14 +377,10 @@ be_visitor_operation_interceptors_cs::generate_class_declaration ( -1); } - *os << " _result;" << be_uidt_nl; - } - else - { - *os << be_uidt_nl; + *os << " _result;"; } - *os << "};\n" << be_nl; + *os << be_uidt_nl << "};"; return 0; } @@ -392,16 +391,17 @@ be_visitor_operation_interceptors_cs::generate_class_definition ( be_operation *node ) { - // Start with the current indentation level. - os->indent (); - be_type *bt = 0; be_visitor_context ctx (*this->ctx_); // Save the node. this->ctx_->node (node); - *os << "TAO_ClientRequestInfo_"<< node->flat_name (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl + << "TAO_ClientRequestInfo_"<< node->flat_name (); // We need the interface node in which this operation was defined. However, // if this operation node was an attribute node in disguise, we get this @@ -580,7 +580,7 @@ be_visitor_operation_interceptors_cs::generate_class_definition ( || (!(this->has_param_type (node, AST_Argument::dir_IN)) && !(this->has_param_type (node, AST_Argument::dir_INOUT)))) { - *os << "return parameter_list;" << be_uidt_nl; + *os << "return parameter_list;"; } else { @@ -597,7 +597,7 @@ be_visitor_operation_interceptors_cs::generate_class_definition ( << "parameter_list->length (" << parameter_count << ");" << be_nl; - *os << "CORBA::ULong len = 0;" << be_nl << be_nl; + *os << "CORBA::ULong len = 0;"; // The insertion operator is different for different nodes. We // change our scope to go to the argument scope to be able to @@ -632,14 +632,14 @@ be_visitor_operation_interceptors_cs::generate_class_definition ( } } - *os << be_uidt_nl << "}\n\n"; - - os->decr_indent (); + *os << be_uidt_nl << "}"; // ----------------------------------------------------------------- // PortableInterceptor::ClientRequestInfo::exceptions() // ----------------------------------------------------------------- - *os << "Dynamic::ExceptionList *" << be_nl; + + *os << be_nl << be_nl + << "Dynamic::ExceptionList *" << be_nl; *os << "TAO_ClientRequestInfo_" << node->flat_name (); @@ -909,9 +909,9 @@ be_visitor_operation_interceptors_cs::generate_class_definition ( *os << " result)" << be_uidt << be_uidt << be_uidt_nl << "{" << be_idt_nl - << "// update the result " << be_nl + << "// Update the result. " << be_nl << "this->_result = result;" << be_uidt_nl - << "}\n\n"; + << "}"; } return 0; 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 5a244b36f95..6094412d1f5 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 @@ -310,7 +310,9 @@ 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) +be_visitor_operation_interceptors_info_rettype::visit_valuetype_fwd ( + be_valuetype_fwd *node + ) { TAO_OutStream *os = this->ctx_->stream (); be_type *bt; @@ -329,3 +331,42 @@ be_visitor_operation_interceptors_info_rettype::visit_valuetype_fwd (be_valuetyp return 0; } +int +be_visitor_operation_interceptors_info_rettype::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_interceptors_info_rettype::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_interceptors_info_rettype::visit_eventtype ( + be_eventtype *node + ) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_interceptors_info_rettype::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_interceptors_info_rettype::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} 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 817be665329..a59b31a49bb 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_result.cpp @@ -93,11 +93,9 @@ be_visitor_operation_interceptors_result::visit_interface_fwd (be_interface_fwd int be_visitor_operation_interceptors_result::visit_valuetype (be_valuetype *) { - // Not supported since TAO doesnt support Any operators for valuetype yet. + TAO_OutStream *os = this->ctx_->stream (); // get output stream - // TAO_OutStream *os = this->ctx_->stream (); // get output stream - - // *os << "(*result_any) <<= this->_result;" << be_nl; + *os << "(*result_any) <<= this->_result;" << be_nl; return 0; } @@ -105,11 +103,9 @@ be_visitor_operation_interceptors_result::visit_valuetype (be_valuetype *) int be_visitor_operation_interceptors_result::visit_valuetype_fwd (be_valuetype_fwd *) { - // Not supported since TAO doesnt support Any operators for valuetype yet. + TAO_OutStream *os = this->ctx_->stream (); // get output stream - // TAO_OutStream *os = this->ctx_->stream (); // get output stream - - // *os << "(*result_any) <<= this->_result;" << be_nl; + *os << "(*result_any) <<= this->_result;" << be_nl; return 0; } @@ -232,3 +228,41 @@ be_visitor_operation_interceptors_result::visit_typedef (be_typedef *node) return 0; } + +int +be_visitor_operation_interceptors_result::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_interceptors_result::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_interceptors_result::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_interceptors_result::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_interceptors_result::visit_home ( + be_home *node + ) +{ + return this->visit_interface (node); +} + + 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 ce6431704a0..e6cee89736a 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp @@ -70,10 +70,14 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( // save the node. this->ctx_->node (node); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Generate the ServerRequestInfo object per operation to // be used by the interecptors. - *os << "class TAO_ServerRequestInfo_"<< node->flat_name (); + *os << be_nl << be_nl + << "class TAO_ServerRequestInfo_"<< node->flat_name (); // We need the interface node in which this operation was defined. However, // if this operation node was an attribute node in disguise, we get this @@ -413,7 +417,7 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( *os << " _result;"; } - *os << be_uidt_nl << "};" << be_nl << be_nl; + *os << be_uidt_nl << "};"; return 0; } @@ -430,8 +434,8 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( // Save the node. this->ctx_->node (node); - // Start with the current indentation level. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // ----------------------------------------------------------------- // Constructor @@ -439,7 +443,8 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( // Generate the ServerRequestInfo object definition per operation // to be used by the interceptors. - *os << "TAO_ServerRequestInfo_" << node->flat_name (); + *os << be_nl << be_nl + << "TAO_ServerRequestInfo_" << node->flat_name (); // We need the interface node in which this operation was defined. However, // if this operation node was an attribute node in disguise, we get this @@ -562,13 +567,13 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( -1); } - os->decr_indent (); - *os << be_nl << "{}\n\n"; + *os << be_uidt_nl << "{}"; // ----------------------------------------------------------------- // PortableInterceptor::ServerRequestInfo::arguments() // ----------------------------------------------------------------- - *os << "Dynamic::ParameterList *" << be_nl; + *os << be_nl << be_nl + << "Dynamic::ParameterList *" << be_nl; *os << "TAO_ServerRequestInfo_"<<node->flat_name (); @@ -630,7 +635,7 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( else { *os << "Dynamic::ParameterList_var safe_parameter_list = " - << "parameter_list;" << be_nl; + << "parameter_list;"; // Precompute the length of the Dynamic::ParameterList. This is // a nice optimization since it reduces the number of additional @@ -639,10 +644,11 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( // sequence for each parameter. *os << be_nl - << "parameter_list->length (" << parameter_count << ");" - << be_nl; + << "parameter_list->length (" << parameter_count << ");"; - *os << "CORBA::ULong len = 0;" << be_nl << be_nl; + *os << be_nl << "CORBA::ULong len = 0;"; + + *os << be_nl; // The insertion operator is different for different nodes. We // change our scope to go to the argument scope to be able to @@ -664,14 +670,13 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( << "return safe_parameter_list._retn ();" << be_uidt_nl; } - *os << "}\n\n"; - - os->decr_indent (); + *os << "}"; // ----------------------------------------------------------------- // PortableInterceptor::ServerRequestInfo::exceptions() // ----------------------------------------------------------------- - *os << "Dynamic::ExceptionList *" << be_nl; + *os << be_nl << be_nl + << "Dynamic::ExceptionList *" << be_nl; *os << "TAO_ServerRequestInfo_"<<node->flat_name (); @@ -761,14 +766,13 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( } } - *os << be_uidt_nl << "}\n\n" << be_nl; - - os->decr_indent (); + *os << be_uidt_nl << "}"; // ----------------------------------------------------------------- // PortableInterceptor::ServerRequestInfo::result() // ----------------------------------------------------------------- - *os << "CORBA::Any * " << be_nl; + *os << be_nl << be_nl + << "CORBA::Any * " << be_nl; *os << "TAO_ServerRequestInfo_"<< node->flat_name (); @@ -869,12 +873,13 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( } } - *os << be_uidt_nl << "}\n\n"; + *os << be_uidt_nl << "}"; // ----------------------------------------------------------------- // PortableInterceptor::ServerRequestInfo::target_most_derived_interface() // ----------------------------------------------------------------- - *os << "char *" << be_nl; + *os << be_nl << be_nl + << "char *" << be_nl; *os << "TAO_ServerRequestInfo_"<< node->flat_name (); @@ -916,12 +921,13 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( << "{" << be_idt_nl << "return" << be_idt_nl << "CORBA::string_dup (this->_tao_impl->_interface_repository_id ());" - << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; + << be_uidt << be_uidt_nl << "}"; // ----------------------------------------------------------------- // PortableInterceptor::ServerRequestInfo::target_is_a() // ----------------------------------------------------------------- - *os << "CORBA::Boolean" << be_nl; + *os << be_nl << be_nl + << "CORBA::Boolean" << be_nl; *os << "TAO_ServerRequestInfo_"<< node->flat_name (); @@ -962,10 +968,9 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( << "ACE_THROW_SPEC ((CORBA::SystemException))" << be_uidt_nl << "{" << be_idt_nl << "return this->_tao_impl->_is_a (id ACE_ENV_ARG_PARAMETER);" - << be_uidt_nl << "}" << be_nl << be_nl; + << be_uidt_nl << "}"; // ----------------------------------------------------------------- - os->decr_indent (); // Update the result. bt = be_type::narrow_from_decl (node->return_type ()); @@ -984,6 +989,7 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( // type. if (!this->void_return_type (bt)) { + *os << be_nl << be_nl; *os << "void " << be_nl; *os << "TAO_ServerRequestInfo_" << node->flat_name (); @@ -1034,12 +1040,11 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( -1); } - os->indent (); *os << " result)" << be_uidt << be_uidt << be_uidt_nl << "{" << be_idt_nl << "// Update the result." << be_nl << " this->_result = result;" << be_uidt_nl - << "}\n\n"; + << "}"; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp index 733673cf99c..aa8fdb67a2f 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp @@ -217,7 +217,15 @@ be_visitor_operation::gen_environment_decl (int argument_emitted, env_decl = "ACE_ENV_ARG_DECL"; } - *os << be_nl; + TAO_CodeGen::CG_STATE cgs = this->ctx_->state (); + + if (node->argument_count () > 0 + || cgs == TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH + || cgs == TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH + || cgs == TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS) + { + *os << be_nl; + } switch (this->ctx_->state ()) { @@ -291,7 +299,8 @@ be_visitor_operation::gen_raise_exception (be_type *return_type, if (is_void) { - *os << ");\n"; + *os << ");"; + return 0; } @@ -312,7 +321,8 @@ be_visitor_operation::gen_raise_exception (be_type *return_type, -1); } - *os << ");\n"; + *os << ");"; + return 0; } @@ -393,14 +403,18 @@ be_visitor_operation::gen_stub_operation_body ( target = "this"; } + *os << be_nl << "{" << be_idt_nl; + + const char *env = this->gen_environment_var (); + + if (ACE_OS::strcmp ("", env) != 0) + { + *os << env << be_nl; + } + // Generate the actual code for the stub. However, if any of the argument // types is "native", we flag a MARSHAL exception. // last argument - is always ACE_ENV_ARG_PARAMETER - *os << "{" << be_idt_nl; - *os << this->gen_environment_var () << "\n"; - - // Generate any pre stub info if and only if none of our parameters is of - // the native type. if (!node->has_native ()) { // native type does not exist. @@ -435,6 +449,11 @@ be_visitor_operation::gen_stub_operation_body ( -1); } + if (node->void_return_type () == 0) + { + *os << be_nl; + } + if (node->has_native ()) // native exists => no stub { if (this->gen_raise_exception (return_type, @@ -473,11 +492,7 @@ be_visitor_operation::gen_stub_operation_body ( ); } - *os << be_uidt; - - os->indent (); - - *os << "}" << be_uidt_nl << be_nl; + *os << be_uidt_nl << "}" << be_uidt_nl; // Do any pre marshal and invoke processing with return type. This // includes allocating memory, initialization. @@ -540,6 +555,8 @@ be_visitor_operation::gen_stub_operation_body ( nt = t->node_type (); } + *os << be_nl << be_nl; + // Now generate the normal successful return statement. if (return_type->size_type () == AST_Type::VARIABLE || nt == AST_Decl::NT_array) @@ -553,7 +570,7 @@ be_visitor_operation::gen_stub_operation_body ( } } // end of if (!native) - *os << be_uidt_nl << "}\n\n"; + *os << be_uidt_nl << "}"; return 0; } @@ -563,24 +580,18 @@ be_visitor_operation::gen_pre_stub_info ( be_operation *node ) { - // Check if this operation raises any exceptions. In that case, we must - // generate a list of exception typecodes. This is not valid for - // attributes. - if (!this->ctx_->attribute ()) - { - be_visitor_context ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS); - be_visitor_operation_exceptlist_cs visitor (&ctx); + be_visitor_context ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS); + be_visitor_operation_exceptlist_cs visitor (&ctx); - if (node->accept (&visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) " - "be_visitor_operation_cs::" - "gen_pre_stub_info - " - "Exceptionlist generation error\n"), - -1); - } + if (node->accept (&visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) " + "be_visitor_operation_cs::" + "gen_pre_stub_info - " + "Exceptionlist generation error\n"), + -1); } return 0; @@ -844,7 +855,7 @@ be_visitor_operation::gen_marshal_and_invoke ( -1); } - *os << be_uidt_nl << be_nl; + *os << be_uidt_nl; *os << "}" << be_uidt_nl << be_nl; } else @@ -924,8 +935,7 @@ be_visitor_operation::gen_marshal_and_invoke ( << ")" << be_uidt_nl << be_nl << "continue;" << be_uidt_nl - << "}" << be_uidt_nl - << be_nl; + << "}" << be_uidt; // If we reach here, we are ready to proceed. // the code below this is for twoway operations only. @@ -980,10 +990,10 @@ be_visitor_operation::gen_marshal_and_invoke ( // Check if there was a user exception, else demarshal the // return val (if any) and parameters (if any) that came with // the response message. - *os << be_nl + *os << be_nl << be_nl << "TAO_InputCDR &_tao_in = _tao_call.inp_stream ();" << be_nl << be_nl - << "if (!(" << be_idt << be_idt_nl; + << "if (!(" << be_idt << be_idt; if (!this->void_return_type (bt)) { @@ -1261,7 +1271,7 @@ be_visitor_operation::gen_marshal_and_invoke ( *os << "\n#endif /* TAO_HAS_INTERCEPTORS */" << be_nl; *os << be_nl << "break;" << be_uidt_nl - << "}" << be_uidt_nl << be_nl; + << "}" << be_uidt; return 0; } 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 af66778bbf7..6a4db01e572 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp @@ -42,7 +42,7 @@ be_visitor_operation_ch::visit_operation (be_operation *node) this->ctx_->node (node); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Every operation is declared virtual in the client code. 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 4cea8a38b26..40656926263 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp @@ -76,7 +76,8 @@ be_visitor_operation_cs::visit_operation (be_operation *node) return 0; } - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Retrieve the operation return type. be_type *bt = be_type::narrow_from_decl (node->return_type ()); @@ -122,6 +123,8 @@ be_visitor_operation_cs::visit_operation (be_operation *node) -1); } + *os << be_nl; + // @@@ (JP) No collocation for abstract interface operations yet. We // are generating the code as if there were no proxies, and using // the (concrete interface's) stub info that we got over the wire. @@ -245,15 +248,15 @@ be_visitor_operation_cs::visit_operation (be_operation *node) be_decl *decl = be_decl::narrow_from_decl (d); *os << "," << be_nl - << decl->local_name(); + << decl->local_name (); } if (!be_global->exception_support ()) { - *os << " ACE_ENV_ARG_PARAMETER"; + *os << be_nl << "ACE_ENV_ARG_PARAMETER"; } - *os << be_uidt_nl << ");" << be_uidt << be_uidt_nl << "}\n\n"; + *os << be_uidt_nl << ");" << be_uidt << be_uidt_nl << "}"; } return 0; 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 be08e30a904..63145f078a4 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp @@ -40,7 +40,7 @@ be_visitor_operation_ih::visit_operation (be_operation *node) this->ctx_->node (node); // save the node // every operation is declared virtual in the client code - *os << "virtual "; + *os << be_nl << be_nl << "virtual "; // STEP I: generate the return type be_type *bt = be_type::narrow_from_decl (node->return_type ()); @@ -86,6 +86,8 @@ be_visitor_operation_ih::visit_operation (be_operation *node) -1); } + *os << be_uidt; + return 0; } 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 d6261d65ab4..677e7c3da98 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp @@ -41,9 +41,7 @@ be_visitor_operation_sh::visit_operation (be_operation *node) TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); - os->indent (); - - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "virtual "; @@ -95,7 +93,8 @@ be_visitor_operation_sh::visit_operation (be_operation *node) // if there was no "native" type. if (!node->has_native ()) { - *os << "static void "; + *os << be_nl << be_nl + << "static void "; // Check if we are an attribute node in disguise. if (this->ctx_->attribute ()) @@ -117,7 +116,7 @@ be_visitor_operation_sh::visit_operation (be_operation *node) << "void *_tao_servant," << be_nl << "void *_tao_servant_upcall" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl - << ");" << be_uidt << "\n"; + << ");" << be_uidt; } return 0; 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 f49b31cd612..a4df3e3a546 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp @@ -96,10 +96,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) -1); } - // Generate the signature of the static skeleton. - os->indent (); - - *os << "// TAO_IDL - Generated from " << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "void " << intf->full_skel_name () << "::"; @@ -117,6 +114,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) *os << "_get_"; } } + *os << node->local_name () << "_skel (" << be_idt << be_idt_nl << "TAO_ServerRequest &_tao_server_request," << be_nl @@ -201,7 +199,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) } // Fish out the interceptors. - *os << "\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl; + *os << "\n\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl; // Cast the Servant_Upcall pointer. *os << "TAO_Object_Adapter::Servant_Upcall *_tao_upcall =" << be_idt_nl @@ -332,7 +330,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) if (!be_global->exception_support ()) { - *os << "TAO_INTERCEPTOR_CHECK;" << be_nl; + *os << "TAO_INTERCEPTOR_CHECK;"; } // Update the result. @@ -349,7 +347,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) // Invoke the send_reply() or send_other() interception point, and // check for exception. - *os << "\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl; + *os << "\n\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl; // Close scope for "if (!_tao_vfr.location_forwarded ()" *os << be_uidt_nl @@ -507,7 +505,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) << "&& !_tao_server_request.sync_with_server ())" << be_uidt_nl << "{" << be_idt_nl << "_tao_server_request.init_reply ();" << be_uidt_nl - << "}" << be_uidt_nl << be_nl; + << "}" << be_uidt; } // Marshal outgoing parameters. @@ -520,10 +518,10 @@ be_visitor_operation_ss::visit_operation (be_operation *node) -1); } - *os << "// In case _tao_servant_upcall is not used in this function" + *os << be_nl << be_nl << "// In case _tao_servant_upcall is not used in this function" << be_nl << "ACE_UNUSED_ARG (_tao_servant_upcall);" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}";; return 0; } @@ -596,10 +594,8 @@ be_visitor_operation_ss::gen_demarshal_params (be_operation *node, if (this->has_param_type (node, AST_Argument::dir_IN) || this->has_param_type (node, AST_Argument::dir_INOUT)) { - os->indent (); - // demarshal the in and inout arguments - *os << "if (!(\n" << be_idt; + *os << be_nl << be_nl << "if (!(" << be_idt << be_idt; // Marshal each in and inout argument. ctx = *this->ctx_; @@ -616,7 +612,7 @@ be_visitor_operation_ss::gen_demarshal_params (be_operation *node, -1); } - *os << be_uidt_nl << "))\n" << be_idt; + *os << be_uidt_nl << "))" << be_nl; // If marshaling fails, raise exception. int status = this->gen_raise_exception (0, @@ -632,8 +628,7 @@ be_visitor_operation_ss::gen_demarshal_params (be_operation *node, -1); } - *os << be_uidt << "\n"; - + *os << be_uidt; }; return 0; @@ -652,7 +647,7 @@ be_visitor_operation_ss::gen_marshal_params (be_operation *node, // We will be here only if we are 2way // first initialize a reply message - *os << "_tao_server_request.init_reply ();" << be_nl << be_nl; + *os << "_tao_server_request.init_reply ();"; // We still need the following check because we maybe 2way and yet have no // parameters and a void return type. @@ -693,9 +688,10 @@ be_visitor_operation_ss::gen_marshal_params (be_operation *node, -1); } - *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" + *os << be_nl << be_nl + << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl << be_nl; - *os << "if (!(\n" << be_idt << be_idt; + *os << "if (!(" << be_idt << be_idt; if (!this->void_return_type (bt)) { @@ -722,7 +718,7 @@ be_visitor_operation_ss::gen_marshal_params (be_operation *node, if (!this->void_return_type (bt)) { // We have already printed the return val. SO put a &&. - *os << " &&\n"; + *os << " &&"; } // Marshal each in and inout argument. @@ -741,7 +737,7 @@ be_visitor_operation_ss::gen_marshal_params (be_operation *node, } } - *os << be_uidt_nl << "))\n"; + *os << be_uidt_nl << "))" << be_nl; // If marshaling fails, raise exception. int status = this->gen_raise_exception (0, @@ -757,7 +753,7 @@ be_visitor_operation_ss::gen_marshal_params (be_operation *node, -1); } - *os << be_uidt_nl; + *os << be_uidt; return 0; } 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 6d2e814446b..fd1dd846946 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 @@ -20,6 +20,9 @@ int be_visitor_operation_proxy_impl_xh::visit_operation (be_operation *node) TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "virtual "; // STEP I: generate the return type. 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 b7a7780c60e..2b1b6b6af4f 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 @@ -28,7 +28,7 @@ be_visitor_operation_remote_proxy_impl_cs::post_process (be_decl *bd) if (!this->last_node (bd)) { - *os << ",\n"; + *os << "," << be_nl; } return 0; @@ -39,21 +39,16 @@ be_visitor_operation_remote_proxy_impl_cs::visit_operation ( be_operation *node ) { - TAO_OutStream *os = this->ctx_->stream (); - be_type *bt; - be_visitor_context ctx; - - this->ctx_->node (node); - if (node->is_local ()) { return 0; } - os->indent (); + TAO_OutStream *os = this->ctx_->stream (); + this->ctx_->node (node); // Retrieve the operation return type. - bt = be_type::narrow_from_decl (node->return_type ()); + be_type *bt = be_type::narrow_from_decl (node->return_type ()); if (!bt) { @@ -64,8 +59,11 @@ be_visitor_operation_remote_proxy_impl_cs::visit_operation ( -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the return type mapping (same as in the header file) - ctx = *this->ctx_; + be_visitor_context ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS); be_visitor_operation_rettype ort_visitor (&ctx); diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp index ff0c96d5d75..a92df07a4c2 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp @@ -346,3 +346,34 @@ be_visitor_operation_rettype::visit_valuetype_fwd (be_valuetype_fwd *node) return 0; } +int +be_visitor_operation_rettype::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_rettype::visit_component_fwd (be_component_fwd *node) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_rettype::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_rettype::visit_eventtype_fwd (be_eventtype_fwd *node) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_rettype::visit_home (be_home *node) +{ + return this->visit_interface (node); +} + + 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 073f6dd5d97..9c9b6bc892f 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 @@ -185,3 +185,42 @@ be_visitor_operation_rettype_assign_ss::visit_union (be_union *) return 0; } + +int +be_visitor_operation_rettype_assign_ss::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_rettype_assign_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_rettype_assign_ss::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_rettype_assign_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_rettype_assign_ss::visit_home (be_home *node) +{ + return this->visit_interface (node); +} + + + 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 8ce8cf18421..f2b911da827 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_is.cpp @@ -163,3 +163,74 @@ be_visitor_operation_rettype_is::visit_union (be_union *) return 0; } + +int +be_visitor_operation_rettype_is::visit_valuetype (be_valuetype *) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *os << "return 0;" << be_nl; + + return 0; +} + +int +be_visitor_operation_rettype_is::visit_valuetype_fwd (be_valuetype_fwd *) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *os << "return 0;" << be_nl; + + return 0; +} + +int +be_visitor_operation_rettype_is::visit_eventtype (be_eventtype *) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *os << "return 0;" << be_nl; + + return 0; +} + +int +be_visitor_operation_rettype_is::visit_eventtype_fwd (be_eventtype_fwd *) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *os << "return 0;" << be_nl; + + return 0; +} + +int +be_visitor_operation_rettype_is::visit_component (be_component *) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *os << "return 0;" << be_nl; + + return 0; +} + +int +be_visitor_operation_rettype_is::visit_component_fwd (be_component_fwd *) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *os << "return 0;" << be_nl; + + return 0; +} + +int +be_visitor_operation_rettype_is::visit_home (be_home *) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *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 ee688d485cb..0bbd976350d 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 @@ -62,7 +62,9 @@ int be_visitor_operation_rettype_marshal_ss::visit_operation ( // Different types have different mappings when used as in/out or // inout parameters. Let this visitor deal with the type - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl; if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -501,3 +503,39 @@ int be_visitor_operation_rettype_marshal_ss::visit_typedef (be_typedef *node) this->ctx_->alias (0); return 0; } + +int +be_visitor_operation_rettype_marshal_ss::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_rettype_marshal_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_rettype_marshal_ss::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_rettype_marshal_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_rettype_marshal_ss::visit_home (be_home *node) +{ + return this->visit_interface (node); +} + + 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 f6dfc8e7e3f..b458ea6f7e8 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 @@ -47,7 +47,7 @@ be_visitor_operation_rettype_post_invoke_cs::visit_array (be_array *node) *os << bt->name () << "_forany _tao_retval_forany (" << be_idt << be_idt_nl << "_tao_retval.inout ()" << be_uidt_nl - << ");" << be_uidt_nl; + << ");" << 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 ca2f69c51e4..e4a75873062 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 @@ -53,7 +53,7 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_array (be_array *node) bt = node; } - *os << "{" << be_idt_nl + *os << be_nl << "{" << be_idt_nl << bt->name () << "_slice *tmp;" << be_nl << "ACE_ALLOCATOR_RETURN (tmp, " << bt->name () << "_alloc (), _tao_retval._retn ());" << be_nl @@ -77,6 +77,19 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_interface_fwd (be_interface_fw } int +be_visitor_operation_rettype_pre_invoke_cs::visit_valuetype (be_valuetype *) +{ + // Don't do anything. This is the overriding action. + return 0; +} + +int +be_visitor_operation_rettype_pre_invoke_cs::visit_valuetype_fwd (be_valuetype_fwd *) +{ + return 0; +} + +int be_visitor_operation_rettype_pre_invoke_cs:: visit_predefined_type (be_predefined_type *node) { @@ -86,7 +99,7 @@ visit_predefined_type (be_predefined_type *node) { case AST_PredefinedType::PT_any: - *os << "{" << be_idt_nl + *os << be_nl << "{" << 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 @@ -115,9 +128,7 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_sequence (be_sequence *node) bt = node; } - os->indent (); - - *os << "{" << be_idt_nl + *os << be_nl << "{" << be_idt_nl << bt->name () << " *tmp;" << be_nl << "ACE_NEW_RETURN (tmp, " << bt->name () << ", _tao_retval._retn ());" << be_nl @@ -144,8 +155,7 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_structure (be_structure *node) if (node->size_type () == be_type::VARIABLE) { - os->indent (); - *os << "{" << be_idt_nl + *os << be_nl << "{" << be_idt_nl << bt->name () << " *tmp;" << be_nl << "ACE_NEW_RETURN (tmp, " << bt->name () << ", _tao_retval._retn ());" << be_nl @@ -191,9 +201,7 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_union (be_union *node) if (node->size_type () == be_type::VARIABLE) { - os->indent (); - - *os << "{" << be_idt_nl + *os << be_nl << "{" << be_idt_nl << bt->name () << " *tmp;" << be_nl << "ACE_NEW_RETURN (tmp, " << bt->name () << ", _tao_retval._retn ());" << be_nl @@ -204,3 +212,41 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_union (be_union *node) return 0; } +int +be_visitor_operation_rettype_pre_invoke_cs::visit_component ( + be_component *node + ) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_rettype_pre_invoke_cs::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_rettype_pre_invoke_cs::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_rettype_pre_invoke_cs::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_rettype_pre_invoke_cs::visit_home (be_home *node) +{ + return this->visit_interface (node); +} + + + 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 84e0d9b0de3..28eb42544aa 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 @@ -199,3 +199,39 @@ be_visitor_operation_rettype_return_cs::visit_union (be_union *node) return 0; } + +int +be_visitor_operation_rettype_return_cs::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_rettype_return_cs::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_rettype_return_cs::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_rettype_return_cs::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_rettype_return_cs::visit_home (be_home *node) +{ + return this->visit_interface (node); +} + + 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 ddfae38a161..9e7c70612f6 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 @@ -54,10 +54,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_array (be_array *node) bt = node; } - os->indent (); - *os << bt->name () << "_var _tao_retval;"; - *os << be_nl; return 0; } @@ -77,12 +74,8 @@ be_visitor_operation_rettype_vardecl_cs::visit_enum (be_enum *node) bt = node; } - os->indent (); - *os << bt->name () << " _tao_retval = (" << bt->name () << ")0;"; - *os << be_nl << be_nl; - return 0; } @@ -101,21 +94,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface (be_interface *node) bt = node; } - os->indent (); - if (node->is_defined ()) { *os << bt->name () << "_var _tao_retval (" - << bt->name () << "::_nil ());\n\n"; + << bt->name () << "::_nil ());"; } else { *os << bt->name () << "_var _tao_retval (" - << " tao_" << node->flat_name () << "_nil ());\n\n"; + << " tao_" << node->flat_name () << "_nil ());"; } - *os << be_nl; - return 0; } @@ -136,21 +125,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface_fwd ( bt = node; } - os->indent (); - if (node->is_defined ()) { *os << bt->name () << "_var _tao_retval (" - << bt->name () << "::_nil ());\n\n"; + << bt->name () << "::_nil ());"; } else { *os << bt->name () << "_var _tao_retval (" - << " tao_" << node->flat_name () << "_nil ());\n\n"; + << " tao_" << node->flat_name () << "_nil ());"; } - *os << be_nl; - return 0; } @@ -169,10 +154,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype (be_valuetype *node) bt = node; } - os->indent (); - - *os << "::" << bt->name () << "_var _tao_retval;\n\n" - << be_nl; + *os << "::" << bt->name () << "_var _tao_retval;"; return 0; } @@ -192,9 +174,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd * bt = node; } - os->indent (); - *os << "::" << bt->name () << "_var _tao_retval;\n\n" - << be_nl; + *os << "::" << bt->name () << "_var _tao_retval;"; return 0; } @@ -216,8 +196,6 @@ be_visitor_operation_rettype_vardecl_cs::visit_predefined_type ( bt = node; } - os->indent (); - switch (node->pt ()) { case AST_PredefinedType::PT_pseudo: @@ -248,8 +226,6 @@ be_visitor_operation_rettype_vardecl_cs::visit_predefined_type ( break; } - *os << be_nl; - return 0; } @@ -270,9 +246,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_sequence (be_sequence *node) bt = node; } - os->indent (); - - *os << bt->name () << "_var _tao_retval;\n" << be_nl; + *os << bt->name () << "_var _tao_retval;"; return 0; } @@ -282,8 +256,6 @@ be_visitor_operation_rettype_vardecl_cs::visit_string (be_string *node) { TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - os->indent (); - if (node->width () == (long) sizeof (char)) { *os << "CORBA::String_var _tao_retval;"; @@ -293,7 +265,6 @@ be_visitor_operation_rettype_vardecl_cs::visit_string (be_string *node) *os << "CORBA::WString_var _tao_retval;"; } - *os << be_nl << be_nl; return 0; } @@ -312,20 +283,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_structure (be_structure *node) bt = node; } - os->indent (); - // Based on whether we are variable or not, we return a pointer or the // aggregate type. if (node->size_type () == AST_Type::VARIABLE) { - *os << bt->name () << "_var _tao_retval;" << be_nl; + *os << bt->name () << "_var _tao_retval;"; } else { *os << bt->name () << " _tao_retval;" << be_nl; // @@ This seems like a waste of time! - *os << "ACE_OS::memset (&_tao_retval, 0, sizeof (_tao_retval));" - << be_nl; + *os << "ACE_OS::memset (&_tao_retval, 0, sizeof (_tao_retval));"; } return 0; @@ -364,8 +332,6 @@ be_visitor_operation_rettype_vardecl_cs::visit_union (be_union *node) bt = node; } - os->indent (); - // Based on whether we are variable or not, we return a pointer or the // aggregate type. if (node->size_type () == AST_Type::VARIABLE) @@ -377,6 +343,40 @@ be_visitor_operation_rettype_vardecl_cs::visit_union (be_union *node) *os << bt->name () << " _tao_retval;"; } - *os << be_nl; return 0; } + +int +be_visitor_operation_rettype_vardecl_cs::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_rettype_vardecl_cs::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_rettype_vardecl_cs::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_rettype_vardecl_cs::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_rettype_vardecl_cs::visit_home (be_home *node) +{ + return this->visit_interface (node); +} + 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 5f1ae49f1a6..93d5d2ade50 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 @@ -56,7 +56,8 @@ be_visitor_operation_rettype_vardecl_ss::visit_array (be_array *node) bt = node; } - *os << "::" << bt->name () << "_var _tao_retval;\n\n"; + *os << "::" << bt->name () << "_var _tao_retval;"; + return 0; } @@ -76,7 +77,7 @@ be_visitor_operation_rettype_vardecl_ss::visit_enum (be_enum *node) bt = node; } - *os << "::" << bt->name () << " _tao_retval;\n"; + *os << "::" << bt->name () << " _tao_retval;"; return 0; } @@ -85,7 +86,7 @@ be_visitor_operation_rettype_vardecl_ss::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "::" << node->name () << "_var _tao_retval;\n"; + *os << "::" << node->name () << "_var _tao_retval;"; return 0; } @@ -95,7 +96,7 @@ visit_interface_fwd (be_interface_fwd *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "::" << node->name () << "_var _tao_retval;\n"; + *os << "::" << node->name () << "_var _tao_retval;"; return 0; } @@ -105,7 +106,7 @@ be_visitor_operation_rettype_vardecl_ss::visit_valuetype (be_valuetype *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "::" << node->name () << "_var _tao_retval;\n"; + *os << "::" << node->name () << "_var _tao_retval;"; return 0; } @@ -115,7 +116,7 @@ visit_valuetype_fwd (be_valuetype_fwd *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "::" << node->name () << "_var _tao_retval;\n"; + *os << "::" << node->name () << "_var _tao_retval;"; return 0; } @@ -139,23 +140,23 @@ visit_predefined_type (be_predefined_type *node) { case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_object: - *os << bt->name () << "_var _tao_retval;\n"; + *os << bt->name () << "_var _tao_retval;"; break; case AST_PredefinedType::PT_any: - *os << bt->name () << "_var _tao_retval;\n"; + *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;\n"; + << " _tao_retval = ACE_CDR_LONG_DOUBLE_INITIALIZER;"; break; case AST_PredefinedType::PT_longlong: *os << bt->name () - << " _tao_retval = ACE_CDR_LONGLONG_INITIALIZER;\n"; + << " _tao_retval = ACE_CDR_LONGLONG_INITIALIZER;"; break; default: - *os << bt->name () << " _tao_retval = 0;\n"; + *os << bt->name () << " _tao_retval = 0;"; break; } return 0; @@ -179,7 +180,7 @@ be_visitor_operation_rettype_vardecl_ss::visit_sequence (be_sequence *node) bt = node; } - *os << "::" << bt->name () << "_var _tao_retval;\n"; + *os << "::" << bt->name () << "_var _tao_retval;"; return 0; } @@ -190,11 +191,11 @@ be_visitor_operation_rettype_vardecl_ss::visit_string (be_string *node) if (node->width () == (long) sizeof (char)) { - *os << "CORBA::String_var _tao_retval;\n"; + *os << "CORBA::String_var _tao_retval;"; } else { - *os << "CORBA::WString_var _tao_retval;\n"; + *os << "CORBA::WString_var _tao_retval;"; } return 0; @@ -220,11 +221,11 @@ be_visitor_operation_rettype_vardecl_ss::visit_structure (be_structure *node) // aggregate type. if (node->size_type () == AST_Type::VARIABLE) { - *os << "::" << bt->name () << "_var _tao_retval;\n"; + *os << "::" << bt->name () << "_var _tao_retval;"; } else { - *os << "::" << bt->name () << " _tao_retval;\n"; + *os << "::" << bt->name () << " _tao_retval;"; } return 0; @@ -268,14 +269,48 @@ be_visitor_operation_rettype_vardecl_ss::visit_union (be_union *node) // aggregate type. if (node->size_type () == AST_Type::VARIABLE) { - *os << "::" << bt->name () << "_var _tao_retval;\n"; + *os << "::" << bt->name () << "_var _tao_retval;"; } else { - *os << "::" << bt->name () << " _tao_retval;\n"; + *os << "::" << bt->name () << " _tao_retval;"; } return 0; } +int +be_visitor_operation_rettype_vardecl_ss::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int +be_visitor_operation_rettype_vardecl_ss::visit_eventtype_fwd ( + be_eventtype_fwd *node + ) +{ + return this->visit_valuetype_fwd (node); +} + +int +be_visitor_operation_rettype_vardecl_ss::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int +be_visitor_operation_rettype_vardecl_ss::visit_component_fwd ( + be_component_fwd *node + ) +{ + return this->visit_interface_fwd (node); +} + +int +be_visitor_operation_rettype_vardecl_ss::visit_home (be_home *node) +{ + return this->visit_interface (node); +} + 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 4095cfabd90..d2c0e74a7ee 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 @@ -63,6 +63,9 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( ); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // STEP 2: generate the return type mapping (same as in the header file) be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS); @@ -98,7 +101,7 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( -1); } - *os << "{" << be_idt << be_nl; + *os << be_nl << "{" << be_idt << be_nl; if (!be_global->exception_support ()) { @@ -121,14 +124,12 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( if (!this->void_return_type (bt)) { - os->indent (); - *os << "ACE_UNUSED_ARG (_tao_retval);" << be_nl; + *os << be_nl << "ACE_UNUSED_ARG (_tao_retval);"; } } - // os->indent (); - - *os <<"TAO_Object_Adapter::Servant_Upcall servant_upcall (" + *os << be_nl + << "TAO_Object_Adapter::Servant_Upcall servant_upcall (" << be_idt << be_idt_nl << "_collocated_tao_target_->_stubobj ()" << "->servant_orb_var ()->orb_core ()" @@ -137,7 +138,23 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( << "CORBA::Object_var forward_to;" << be_nl << "servant_upcall.prepare_for_upcall (" << be_idt << be_idt_nl << "_collocated_tao_target_->_object_key ()," << be_nl - << "\"" << node->original_local_name () << "\"," << be_nl + << "\""; + + // Check if we are an attribute node in disguise. + if (this->ctx_->attribute ()) + { + // Now check if we are a "get" or "set" operation. + if (node->nmembers () == 1) + { + *os << "_set_"; + } + else + { + *os << "_get_"; + } + } + + *os << node->original_local_name () << "\"," << be_nl << "forward_to.out ()"; if (!be_global->exception_support ()) @@ -214,7 +231,7 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( return -1; } - *os << "}\n\n"; + *os << "}"; return 0; } 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 ea3cc13e472..f28dddd463d 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/tie_sh.cpp @@ -44,8 +44,6 @@ be_visitor_operation_tie_sh::visit_operation (be_operation *node) TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); - os->indent (); - // STEP I: generate the return type. be_type *bt = be_type::narrow_from_decl (node->return_type ()); @@ -58,6 +56,9 @@ be_visitor_operation_tie_sh::visit_operation (be_operation *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS); be_visitor_operation_rettype oro_visitor (&ctx); 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 131fe85fbde..4539860019e 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp @@ -64,7 +64,9 @@ int be_visitor_operation_tie_si::visit_operation (be_operation *node) -1); } - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "template <class T> ACE_INLINE\n"; // Generate the return type mapping (same as in the header file). @@ -99,7 +101,7 @@ int be_visitor_operation_tie_si::visit_operation (be_operation *node) -1); } - *os << "{" << be_idt_nl; + *os << be_nl << "{" << be_idt_nl; be_predefined_type *pdt = be_predefined_type::narrow_from_decl (bt); @@ -108,7 +110,7 @@ int be_visitor_operation_tie_si::visit_operation (be_operation *node) *os << "return "; } - *os << "this->ptr_->" << node->local_name () << " (" << be_idt << "\n"; + *os << "this->ptr_->" << node->local_name () << " (" << be_idt; ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS); @@ -125,7 +127,7 @@ int be_visitor_operation_tie_si::visit_operation (be_operation *node) *os << be_uidt_nl; *os << ");" << be_uidt_nl; - *os << "}\n\n"; + *os << "}"; return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_root.cpp b/TAO/TAO_IDL/be/be_visitor_root.cpp index f50ee1cb45e..aed1dba18d4 100644 --- a/TAO/TAO_IDL/be/be_visitor_root.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root.cpp @@ -30,6 +30,11 @@ #include "be_union_fwd.h" #include "be_valuetype.h" #include "be_valuetype_fwd.h" +#include "be_eventtype.h" +#include "be_eventtype_fwd.h" +#include "be_component.h" +#include "be_component_fwd.h" +#include "be_home.h" #include "be_helper.h" #include "be_extern.h" @@ -47,6 +52,11 @@ #include "be_visitor_union_fwd.h" #include "be_visitor_valuetype.h" #include "be_visitor_valuetype_fwd.h" +#include "be_visitor_eventtype.h" +#include "be_visitor_eventtype_fwd.h" +#include "be_visitor_component.h" +#include "be_visitor_component_fwd.h" +#include "be_visitor_home.h" #include "be_visitor_context.h" #include "be_visitor_root/root.cpp" 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 70e1676f577..067f4a28a6d 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/cdr_op.cpp @@ -44,7 +44,10 @@ be_visitor_root_cdr_op::visit_root (be_root *node) if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_CDR_OP_CH) { - *os << be_nl << "#ifndef __ACE_INLINE__" << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << "#ifndef __ACE_INLINE__"; } if (this->visit_scope (node) == -1) @@ -57,8 +60,10 @@ be_visitor_root_cdr_op::visit_root (be_root *node) if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_CDR_OP_CH) { - *os << be_nl - << "#endif /* __ACE_INLINE__ */\n\n"; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << "#endif /* __ACE_INLINE__ */"; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_root/root.cpp b/TAO/TAO_IDL/be/be_visitor_root/root.cpp index 68ee260a2ec..71c23453f66 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root.cpp @@ -73,38 +73,41 @@ int be_visitor_root::visit_root (be_root *node) if (size > 0) { - *os << "// Proxy Broker Factory function pointer declarations." - << be_nl; - *os << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl + << "// Proxy Broker Factory function pointer declarations." + << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; } for (index = 0; index < size; ++index) { be_global->non_local_interfaces.dequeue_head (i); - *os << "extern " << be_global->stub_export_macro () << be_nl + *os << be_nl << be_nl + << "extern " << be_global->stub_export_macro () << be_nl << i->full_base_proxy_broker_name () << " *" << be_nl << "(*" << i->flat_client_enclosing_scope () << i->base_proxy_broker_name () << "_Factory_function_pointer) (" << be_idt << be_idt_nl << "CORBA::Object_ptr obj" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + << ");" << be_uidt; } size = be_global->non_defined_interfaces.size (); if (size > 0) { - *os << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; } for (index = 0; index < size; ++index) { be_global->non_defined_interfaces.dequeue_head (ifwd); + *os << be_nl << be_nl; + if (ifwd->is_valuetype ()) { *os << "// External declarations for undefined valuetype" @@ -123,7 +126,7 @@ int be_visitor_root::visit_root (be_root *node) << "tao_" << ifwd->flat_name () << "_remove_ref (" << be_idt << be_idt_nl << ifwd->full_name () << " *" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + << ");" << be_uidt; } else { @@ -162,7 +165,7 @@ int be_visitor_root::visit_root (be_root *node) << "tao_" << ifwd->flat_name () << "_upcast (" << be_idt << be_idt_nl << "void *" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + << ");" << be_uidt; } } @@ -170,7 +173,7 @@ int be_visitor_root::visit_root (be_root *node) if (size > 0) { - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Overrides of CORBA::release and CORBA::is_nil for" @@ -196,7 +199,7 @@ int be_visitor_root::visit_root (be_root *node) { *os << be_uidt_nl << "}" << be_nl - << "TAO_NAMESPACE_CLOSE" << be_nl << be_nl; + << "TAO_NAMESPACE_CLOSE"; } } @@ -436,6 +439,7 @@ be_visitor_root::visit_constant (be_constant *node) case TAO_CodeGen::TAO_ROOT_SI: case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -519,6 +523,7 @@ be_visitor_root::visit_enum (be_enum *node) case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IS: case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -612,8 +617,9 @@ be_visitor_root::visit_exception (be_exception *node) case TAO_CodeGen::TAO_ROOT_SH: case TAO_CodeGen::TAO_ROOT_SI: case TAO_CodeGen::TAO_ROOT_SS: - case TAO_CodeGen::TAO_ROOT_IS: - case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -838,13 +844,6 @@ be_visitor_root::visit_interface_fwd (be_interface_fwd *node) status = node->accept (&visitor); break; } - case TAO_CodeGen::TAO_ROOT_CI: - { - ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CI); - be_visitor_interface_fwd_ci visitor (&ctx); - status = node->accept (&visitor); - break; - } case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: { ctx.state (TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI); @@ -868,12 +867,14 @@ be_visitor_root::visit_interface_fwd (be_interface_fwd *node) } case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: + case TAO_CodeGen::TAO_ROOT_CI: case TAO_CodeGen::TAO_ROOT_CS: case TAO_CodeGen::TAO_ROOT_SH: case TAO_CodeGen::TAO_ROOT_SI: case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IS: case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -1029,10 +1030,10 @@ be_visitor_root::visit_valuetype_fwd (be_valuetype_fwd *node) status = node->accept (&visitor); break; } - case TAO_CodeGen::TAO_ROOT_CI: + case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: { - ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_CI); - be_visitor_valuetype_fwd_ci visitor (&ctx); + ctx.state (TAO_CodeGen::TAO_VALUETYPE_FWD_ANY_OP_CH); + be_visitor_valuetype_fwd_any_op_ch visitor (&ctx); status = node->accept (&visitor); break; } @@ -1051,14 +1052,15 @@ be_visitor_root::visit_valuetype_fwd (be_valuetype_fwd *node) break; } case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: - case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: + case TAO_CodeGen::TAO_ROOT_CI: case TAO_CodeGen::TAO_ROOT_CS: case TAO_CodeGen::TAO_ROOT_SH: case TAO_CodeGen::TAO_ROOT_SI: case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IS: case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -1083,6 +1085,431 @@ be_visitor_root::visit_valuetype_fwd (be_valuetype_fwd *node) } int +be_visitor_root::visit_eventtype (be_eventtype *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_ROOT_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CH); + be_visitor_eventtype_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CI: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CI); + be_visitor_eventtype_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CS: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CS); + be_visitor_eventtype_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CDR_OP_CH); + be_visitor_eventtype_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CDR_OP_CI); + be_visitor_eventtype_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_CDR_OP_CS); + be_visitor_eventtype_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_ANY_OP_CH); + be_visitor_eventtype_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_ANY_OP_CS); + be_visitor_eventtype_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_SH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_SH); + be_visitor_eventtype_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_SI: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_SI); + be_visitor_eventtype_si visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_SS: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_SS); + be_visitor_eventtype_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_TIE_SH: + return 0; // nothing to do. + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_eventtype - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_eventtype - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_root::visit_eventtype_fwd (be_eventtype_fwd *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_ROOT_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_FWD_CH); + be_visitor_eventtype_fwd_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_FWD_ANY_OP_CH); + be_visitor_eventtype_fwd_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_FWD_CDR_OP_CH); + be_visitor_eventtype_fwd_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_FWD_CDR_OP_CI); + be_visitor_eventtype_fwd_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: + case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: + case TAO_CodeGen::TAO_ROOT_CI: + case TAO_CodeGen::TAO_ROOT_CS: + case TAO_CodeGen::TAO_ROOT_SH: + case TAO_CodeGen::TAO_ROOT_SI: + case TAO_CodeGen::TAO_ROOT_SS: + case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_TIE_SH: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_eventtype_fwd - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_module::" + "visit_eventtype_fwd - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_root::visit_component (be_component *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_ROOT_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CH); + be_visitor_component_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CI: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CI); + be_visitor_component_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CS); + be_visitor_component_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CDR_OP_CH); + be_visitor_component_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CDR_OP_CI); + be_visitor_component_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_CDR_OP_CS); + be_visitor_component_cdr_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_ANY_OP_CH); + be_visitor_component_any_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_ANY_OP_CS); + be_visitor_component_any_op_cs visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_SH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_SH); + be_visitor_component_sh visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_SI: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_SI); + be_visitor_component_si visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_SS: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_SS); + be_visitor_component_ss visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_TIE_SH: + return 0; // nothing to do. + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root::" + "visit_component - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root::" + "visit_component - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_root::visit_component_fwd (be_component_fwd *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_ROOT_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_FWD_CH); + be_visitor_component_fwd_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_FWD_CDR_OP_CI); + be_visitor_component_fwd_cdr_op_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_FWD_ANY_OP_CH); + be_visitor_component_fwd_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: + { + ctx.state (TAO_CodeGen::TAO_COMPONENT_FWD_CDR_OP_CH); + be_visitor_component_fwd_cdr_op_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: + case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: + case TAO_CodeGen::TAO_ROOT_CI: + case TAO_CodeGen::TAO_ROOT_CS: + case TAO_CodeGen::TAO_ROOT_SH: + case TAO_CodeGen::TAO_ROOT_SI: + case TAO_CodeGen::TAO_ROOT_SS: + case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_TIE_SH: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root::" + "visit_component_fwd - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root::" + "visit_component_fwd - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int +be_visitor_root::visit_home (be_home *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); + int status = 0; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_ROOT_CH: + { + be_visitor_home_ch visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_ROOT_CI: + case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: + case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: + case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: + case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: + case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: + case TAO_CodeGen::TAO_ROOT_CS: + case TAO_CodeGen::TAO_ROOT_SH: + case TAO_CodeGen::TAO_ROOT_SI: + case TAO_CodeGen::TAO_ROOT_SS: + case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_TIE_SH: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root::" + "visit_home - " + "Bad context state\n"), + -1); + } + } + + if (status == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root::" + "visit_home - " + "failed to accept visitor\n"), + -1); + } + + return 0; +} + +int be_visitor_root::visit_module (be_module *node) { // Instantiate a visitor context with a copy of our context. This info @@ -1278,6 +1705,7 @@ be_visitor_root::visit_structure (be_structure *node) case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IS: case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -1331,6 +1759,7 @@ be_visitor_root::visit_structure_fwd (be_structure_fwd *node) case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IH: case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -1426,6 +1855,7 @@ be_visitor_root::visit_union (be_union *node) case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IS: case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -1479,6 +1909,7 @@ be_visitor_root::visit_union_fwd (be_union_fwd *node) case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IH: case TAO_CodeGen::TAO_ROOT_IS: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { @@ -1574,6 +2005,7 @@ be_visitor_root::visit_typedef (be_typedef *node) case TAO_CodeGen::TAO_ROOT_SS: case TAO_CodeGen::TAO_ROOT_IS: case TAO_CodeGen::TAO_ROOT_IH: + case TAO_CodeGen::TAO_ROOT_TIE_SH: return 0; // nothing to be done default: { 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 979e52c743b..695f5aaf168 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp @@ -76,15 +76,6 @@ be_visitor_root_sth::visit_scope (be_scope *node) -1); } - AST_Decl::NodeType nt = d->node_type (); - - // These are the only types we're interested in. - if (nt != AST_Decl::NT_module - && nt != AST_Decl::NT_interface) - { - continue; - } - be_decl *bd = be_decl::narrow_from_decl (d); // Set the scope node as "node" in which the code is being @@ -125,11 +116,9 @@ be_visitor_root_sth::visit_module (be_module *node) { // If the line below is not true, we don't want to // see 'TAO_NAMESPACE' or anything in it. - *os << "#if defined (ACE_HAS_USING_KEYWORD)\n"; + *os << "#if defined (ACE_HAS_USING_KEYWORD)" << be_nl; } - os->indent (); - // Now generate the class definition. The prefix POA_ is prepended to our // name only if we are the outermost module. *os << "TAO_NAMESPACE "; @@ -145,7 +134,7 @@ be_visitor_root_sth::visit_module (be_module *node) *os << " POA_" << node->local_name () << be_nl; } - *os << "{\n" << be_idt; + *os << "{" << be_idt; if (this->visit_scope (node) == -1) { @@ -156,13 +145,12 @@ be_visitor_root_sth::visit_module (be_module *node) -1); } - os->decr_indent (); - *os << "}" << be_nl << "TAO_NAMESPACE_CLOSE // module " - << node->name () << "\n"; + *os << be_uidt_nl << "}" << be_nl << "TAO_NAMESPACE_CLOSE // module " + << node->name (); if (!node->is_nested ()) { - *os << "#endif /* ACE_HAS_USING_KEYWORD */\n\n"; + *os << "\n#endif /* ACE_HAS_USING_KEYWORD */"; } return 0; @@ -196,3 +184,10 @@ be_visitor_root_sth::visit_interface (be_interface *node) return 0; } + +int +be_visitor_root_sth::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + diff --git a/TAO/TAO_IDL/be/be_visitor_scope.cpp b/TAO/TAO_IDL/be/be_visitor_scope.cpp index 1b473fa8395..a50a4c17c14 100644 --- a/TAO/TAO_IDL/be/be_visitor_scope.cpp +++ b/TAO/TAO_IDL/be/be_visitor_scope.cpp @@ -145,7 +145,6 @@ be_visitor_scope::next_elem (be_decl *elem, "(%N:%l) be_visitor_scope::next_elem - " "bad scope\n"), -1); - } successor = 0; 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 20dfd17d723..495d8ed0dfd 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 @@ -48,8 +48,10 @@ be_visitor_sequence_any_op_ch::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the Any <<= and >>= operators. - os->indent (); *os << be_global->stub_export_macro (); *os << " void" << " operator<<= (CORBA::Any &, const "; @@ -69,7 +71,7 @@ be_visitor_sequence_any_op_ch::visit_sequence (be_sequence *node) *os << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, const "; *os << node->name (); - *os << " *&);\n"; + *os << " *&);"; node->cli_hdr_any_op_gen (1); return 0; 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 36a77410f5a..57652f06d40 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 @@ -49,10 +49,7 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); - // Any <<= and >>= operators. - os->indent (); - - *os << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; @@ -262,7 +259,7 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node) << "}" << be_nl << "ACE_ENDTRY;" << be_nl << be_nl << "return 0;" << be_uidt_nl - << "}\n\n"; + << "}"; } node->cli_stub_any_op_gen (1); 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 4c860142bf7..84feb113dcd 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 @@ -53,16 +53,20 @@ be_visitor_sequence_cdr_op_ch::visit_sequence (be_sequence *node) be_type *bt = be_type::narrow_from_decl (node); be_typedef *tdef = be_typedef::narrow_from_decl (bt); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // If we're an anonymous sequence, we must protect against // being declared more than once. if (!tdef) { - *os << "\n#if !defined _TAO_CDR_OP_" + *os << "\n\n#if !defined _TAO_CDR_OP_" << node->flat_name () << "_H_" << be_nl - << "#define _TAO_CDR_OP_" << node->flat_name () << "_H_\n\n"; + << "#define _TAO_CDR_OP_" << node->flat_name () << "_H_"; } - *os << be_global->stub_export_macro () << " CORBA::Boolean" + *os << be_nl << be_nl + << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (" << be_idt << be_idt_nl << "TAO_OutputCDR &," << be_nl << "const " << node->name () << " &" << be_uidt_nl @@ -71,12 +75,13 @@ be_visitor_sequence_cdr_op_ch::visit_sequence (be_sequence *node) << " operator>> (" << be_idt << be_idt_nl << "TAO_InputCDR &," << be_nl << node->name () << " &" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt; if (!tdef) { - *os << "#endif /* _TAO_CDR_OP_" - << node->flat_name () << "_H_ */\n\n"; + *os << be_nl << be_nl + << "#endif /* _TAO_CDR_OP_" + << node->flat_name () << "_H_ */"; } node->cli_hdr_cdr_op_gen (1); 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 bc92dc2684a..9a37a785340 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 @@ -80,30 +80,35 @@ be_visitor_sequence_cdr_op_ci::visit_sequence (be_sequence *node) be_type *bt = be_type::narrow_from_decl (node); be_typedef *tdef = be_typedef::narrow_from_decl (bt); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // If we're an anonymous sequence, we must protect against // being declared more than once. if (!tdef) { - *os << "\n#if !defined _TAO_CDR_OP_" + *os << "\n\n#if !defined _TAO_CDR_OP_" << node->flat_name () << "_I_" << be_nl - << "#define _TAO_CDR_OP_" << node->flat_name () << "_I_\n\n"; + << "#define _TAO_CDR_OP_" << node->flat_name () << "_I_"; + } - *os << "CORBA::Boolean " << be_global->stub_export_macro () + *os << be_nl << be_nl + << "CORBA::Boolean " << be_global->stub_export_macro () << " operator<< (" << be_idt << be_idt_nl << "TAO_OutputCDR &," << be_nl << "const " << node->name () << " &" << be_uidt_nl - << ");" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; *os << "CORBA::Boolean " << be_global->stub_export_macro () << " operator>> (" << be_idt << be_idt_nl << "TAO_InputCDR &," << be_nl << node->name () << " &" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt; if (!tdef) { - *os << "#endif /* _TAO_CDR_OP_" - << node->flat_name () << "_I_ */\n\n"; + *os << "\n\n" << "#endif /* _TAO_CDR_OP_" + << node->flat_name () << "_I_ */"; } node->cli_inline_cdr_op_gen (1); 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 d8a96f412ee..e5f3a2f42ca 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 @@ -99,7 +99,7 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) // Save the sequence node for further use. this->ctx_->node (node); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // If we're an anonymous sequence, we must protect against @@ -191,7 +191,7 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) { // We are dealing with a bounded sequence. Check if we are within // bounds. - *os << "if (_tao_seq_len <= _tao_sequence.maximum ())" << be_nl + *os << "if (_tao_seq_len <= _tao_sequence.maximum ())" << be_idt_nl << "{" << be_idt_nl; } } @@ -241,13 +241,13 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) *os << "}" << be_uidt_nl << be_nl << "return 0;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; if (!this->ctx_->tdef ()) { - *os << "#endif /* _TAO_CDR_OP_" - << node->flat_name () << "_CPP_ */" - << be_uidt_nl << be_uidt_nl; + *os << be_nl << be_nl + << "#endif /* _TAO_CDR_OP_" + << node->flat_name () << "_CPP_ */"; } node->cli_stub_cdr_op_gen (1); 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 85b529b7ab1..f4455fd2e63 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 @@ -39,7 +39,7 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node) } // Generate the class name. - be_type *pt; + be_type *pt; if (bt->node_type () == AST_Decl::NT_typedef) { @@ -58,18 +58,20 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH); be_visitor_sequence_base visitor (&ctx); + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // !! Branching in either compile time template instantiation // or manual template instantiation. - os->gen_ifdef_AHETI(); - + os->gen_ifdef_AHETI (); os->gen_ifdef_macro (class_name); - *os << "class TAO_EXPORT_MACRO " << class_name - << " : public TAO_Bounded_Base_Sequence" << be_nl + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () + << " " << class_name << be_idt_nl + << ": public TAO_Bounded_Base_Sequence" << be_uidt_nl << "{" << be_nl - << "public:" << be_idt_nl - << "// = Initialization and termination methods." << be_nl - << be_nl; + << "public:" << be_idt_nl; // Default constructor. *os << class_name << " (void);" << be_nl; @@ -172,12 +174,13 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node) *os << "virtual void _shrink_buffer (" << be_idt << be_idt_nl << "CORBA::ULong nl," << be_nl << "CORBA::ULong ol" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + << ");" << be_uidt; if (! (is_pseudo_object || nt == AST_Decl::NT_valuetype)) { // Pseudo objects do not require these methods. - *os << "virtual void _downcast (" << be_idt << be_idt_nl + *os << be_nl << be_nl + << "virtual void _downcast (" << be_idt << be_idt_nl << "void* target," << be_nl << "CORBA_Object *src" << be_nl << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl @@ -185,7 +188,7 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node) *os << "virtual CORBA_Object* _upcast (void *src) const;"; } - *os << be_uidt_nl << "};" << be_nl; + *os << be_uidt_nl << "};"; os->gen_endif (); 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 465b9c6d0f2..e7c64a091f2 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 @@ -101,24 +101,26 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Branching in either compile time template instantiation // or manual template instatiation. os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // First generate the static methods since they are used by others. Since // they are inlined, their definition needs to come before their use else // some compilers give lots of warnings. // allocbuf - *os << "ACE_INLINE "; bt->accept (&visitor); + *os << be_nl << be_nl + << "ACE_INLINE "; + + bt->accept (&visitor); + *os << " **" << be_nl; - *os << full_class_name << "::allocbuf (CORBA::ULong /* length */) " - << "// Allocate storage for a sequence.." << be_nl + *os << full_class_name << "::allocbuf (CORBA::ULong /* length */) " << be_nl << "{" << be_idt_nl; // The accept is here the first time used and if an @@ -134,7 +136,6 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) } *os <<" **buf = 0;" << be_nl - << be_nl << "ACE_NEW_RETURN (buf, "; bt->accept (&visitor); @@ -215,7 +216,6 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) << be_nl; // Constructor. - *os << "// default ctor" << be_nl; *os << "ACE_INLINE" << be_nl << full_class_name << "::" << class_name << " (void)" << be_idt_nl << " : TAO_Bounded_Base_Sequence (" << node->max_size () @@ -226,48 +226,53 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) // Constructor. *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name - << " (CORBA::ULong length," << be_idt_nl; + << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "CORBA::ULong length," << be_nl; bt->accept (&visitor); *os <<"* *value," << be_nl - << "CORBA::Boolean release)" << be_uidt_nl - << "// Constructor from data." << be_nl - << " : TAO_Bounded_Base_Sequence (" << node->max_size () - << ", length, value, release)" << be_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_nl + << ": TAO_Bounded_Base_Sequence (" << node->max_size () + << ", length, value, release)" << be_uidt_nl << "{" << be_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // Constructor. *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name << " (const " - << class_name << " &rhs)" << be_nl - << "// Copy constructor." << be_idt_nl + << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_nl << ": TAO_Bounded_Base_Sequence (rhs)" << be_uidt_nl << "{" << be_idt_nl - << "if (rhs.buffer_ != 0)" << be_nl + << "if (rhs.buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<" **tmp1 = allocbuf (" << node->max_size () << ");" << be_nl; + *os <<" **tmp1 =" << be_idt_nl + << class_name << "::allocbuf (" << node->max_size () << ");" + << be_uidt_nl << be_nl; - bt->accept(&visitor); + bt->accept (&visitor); - *os <<" ** const tmp2 = ACE_reinterpret_cast ("; + *os <<" ** const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "** ACE_CAST_CONST, rhs.buffer_);" << be_nl + *os << "** ACE_CAST_CONST, rhs.buffer_);" << be_uidt_nl << be_nl << "for (CORBA::ULong i = 0; i < rhs.length_; i++)" << be_idt_nl << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_valuetype) { *os << "if (tmp2[i] != 0)" << be_idt_nl + << "{" << be_idt_nl << "tmp2[i]->_add_ref ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "tmp1[i] = tmp2[i];"; } else @@ -289,41 +294,44 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) *os << be_uidt_nl << "}" << be_uidt_nl << be_nl << "this->buffer_ = tmp1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl << "this->buffer_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_uidt << be_uidt_nl + << "}" << be_nl << be_nl; // Assignment operator. *os << "ACE_INLINE " << full_class_name << " &" << be_nl - << full_class_name << "::operator= (const " - << class_name << " &rhs)" << be_nl - << "// Assignment from another Bounded sequence." << be_nl + << full_class_name << "::operator= (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl << "if (this == &rhs)" << be_idt_nl + << "{" << be_idt_nl << "return *this;" << be_uidt_nl - << be_nl - << "if (this->release_ && this->buffer_ != 0)" << be_nl + << "}" << be_uidt_nl << be_nl + << "if (this->release_ && this->buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<" **tmp = ACE_reinterpret_cast ("; + *os <<" **tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " **, this->buffer_);" << be_nl - << be_nl + *os << " **, this->buffer_);" << be_uidt_nl << be_nl << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_valuetype) { *os << "if (tmp[i] != 0)" << be_idt_nl + << "{" << be_idt_nl << "tmp[i]->_remove_ref ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "tmp[i] = 0;"; } else if (bt_is_defined) @@ -344,36 +352,41 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) *os << be_uidt_nl << "}" << be_uidt << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt_nl << "else" << be_idt_nl - << "this->buffer_ = " << class_name - << "::allocbuf (rhs.maximum_);" << be_uidt_nl - << be_nl - << "TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl - << be_nl; + << "{" << be_idt_nl + << "this->buffer_ =" << be_idt_nl + << class_name + << "::allocbuf (rhs.maximum_);" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl << be_nl; bt->accept (&visitor); - *os <<" **tmp1 = ACE_reinterpret_cast ("; + *os <<" **tmp1 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " **, this->buffer_);" << be_nl; + *os << " **, this->buffer_);" << be_uidt_nl << be_nl; bt->accept (&visitor); - *os <<" ** const tmp2 = ACE_reinterpret_cast ("; + *os <<" ** const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_nl + *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_uidt_nl << be_nl << "for (CORBA::ULong i=0; i < rhs.length_; ++i)" << be_idt_nl << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_valuetype) { *os << "if (tmp2[i] != 0)" << be_idt_nl + << "{" << be_idt_nl << "tmp2[i]->_add_ref ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "tmp1[i] = tmp2[i];"; } else @@ -395,10 +408,8 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) *os << be_uidt_nl << "}" << be_uidt_nl << be_nl << "return *this;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; - // operator[]. be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt); int is_pseudo_object = @@ -407,135 +418,138 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) && prim->pt () == AST_PredefinedType::PT_pseudo; // operator[]. + + *os << "ACE_INLINE" << be_nl; + if (is_pseudo_object) { - *os << "ACE_INLINE TAO_Pseudo_Object_Manager<"; + *os << "TAO_Pseudo_Object_Manager<"; } else { if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "ACE_INLINE TAO_Valuetype_Manager<"; + *os << "TAO_Valuetype_Manager<"; } else if (node->base_type ()->is_abstract ()) { - *os << "ACE_INLINE TAO_Abstract_Manager<"; + *os << "TAO_Abstract_Manager<"; } else { - *os << "ACE_INLINE TAO_Object_Manager<"; + *os << "TAO_Object_Manager<"; } } *os << bt->name () << "," << bt->name () << "_var>" << be_nl - << full_class_name << "::operator[] (CORBA::ULong index) const" - << " // Read-write accessor." << be_nl + << full_class_name << "::operator[] (CORBA::ULong index) const" << be_nl << "{" << be_idt_nl << "ACE_ASSERT (index < this->maximum_);" << be_nl; bt->accept (&visitor); - *os <<" **const tmp = ACE_reinterpret_cast ("; + *os <<" **const tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " ** ACE_CAST_CONST, this->buffer_);" << be_nl; + *os << " ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl + << "return "; if (is_pseudo_object) { - *os << "return TAO_Pseudo_Object_Manager<"; + *os << "TAO_Pseudo_Object_Manager<"; } else { if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "return TAO_Valuetype_Manager<"; + *os << "TAO_Valuetype_Manager<"; } else if (node->base_type()->is_abstract ()) { - *os << "return TAO_Abstract_Manager<"; + *os << "TAO_Abstract_Manager<"; } else { - *os << "return TAO_Object_Manager<"; + *os << "TAO_Object_Manager<"; } } *os << bt->name () << "," << bt->name () << "_var> " << "(tmp + index, this->release_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // get_buffer - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; bt->accept (&visitor); *os << " **" << be_nl; - *os << full_class_name << "::get_buffer (CORBA::Boolean orphan)" - << be_nl + *os << full_class_name << "::get_buffer (CORBA::Boolean orphan)" << be_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os << " **result = 0;" << be_nl - << "if (orphan == 0)" << be_nl + *os << " **result = 0;" << be_nl << be_nl + << "if (orphan == 0)" << be_idt_nl << "{" << be_idt_nl << "// We retain ownership." << be_nl - << "if (this->buffer_ == 0)" << be_nl + << "if (this->buffer_ == 0)" << be_idt_nl << "{" << be_idt_nl - << "result = " << class_name << "::allocbuf (this->maximum_);" - << be_nl + << "result =" << be_idt_nl + << class_name << "::allocbuf (this->maximum_);" << be_uidt_nl << "this->buffer_ = result;" << be_nl << "this->release_ = 1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl - << "result = ACE_reinterpret_cast ("; + << "result =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "**, this->buffer_);" << be_uidt_nl + *os << "**, this->buffer_);" << be_uidt << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl - << "else // if (orphan == 1)" << be_nl + << "else // if (orphan == 1)" << be_idt_nl << "{" << be_idt_nl - << "if (this->release_ != 0)" << be_nl + << "if (this->release_ != 0)" << be_idt_nl << "{" << be_idt_nl - << "// We set the state back to default and relinquish" << be_nl - << "// ownership." << be_nl - << "result = ACE_reinterpret_cast("; - + << "// We set the state back to default and relinquish ownership." + << be_nl + << "result =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "**,this->buffer_);" << be_nl + + *os << "**, this->buffer_);" << be_uidt_nl << "this->maximum_ = 0;" << be_nl << "this->length_ = 0;" << be_nl << "this->buffer_ = 0;" << be_nl << "this->release_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return result;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // get_buffer. - *os << "ACE_INLINE const "; + *os << "ACE_INLINE" << be_nl + << "const "; bt->accept (&visitor); *os << "* *" << be_nl << full_class_name << "::get_buffer (void) const" << be_nl << "{" << be_idt_nl - << "return ACE_reinterpret_cast(const "; + << "return ACE_reinterpret_cast (const "; bt->accept (&visitor); *os << " ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}"; os->gen_endif (); 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 14e7c6a4703..3b907c8f82a 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 @@ -101,21 +101,21 @@ be_visitor_sequence_cs::gen_bounded_obj_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Branching in either compile time template instantiation // or manual template instatiation. os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // First generate the static methods since they are used by others. Since // they are inlined, their definition needs to come before their use else // some compilers give lots of warnings. // Allocate_buffer. - *os << "// The Base_Sequence functions, please see tao/sequence.h" + *os << be_nl << be_nl + << "// The Base_Sequence functions, please see tao/sequence.h" << be_nl << "void " << be_nl << full_class_name << "::_allocate_buffer (CORBA::ULong length)" @@ -134,7 +134,9 @@ be_visitor_sequence_cs::gen_bounded_obj_sequence (be_sequence *node) << full_class_name << "::_deallocate_buffer (void)" << be_nl << "{" << be_idt_nl << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl - << "return;" << be_uidt_nl; + << "{" << be_idt_nl + << "return;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; bt->accept (&visitor); 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 8a4c1dd9f63..a78426c616e 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 @@ -60,19 +60,20 @@ be_visitor_sequence_ch::gen_bounded_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; // !! branching in either compile time template instantiation // or manual template instatiation os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - *os << "class TAO_EXPORT_MACRO " << class_name << be_idt_nl + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () + << " " << class_name << be_idt_nl << ": public TAO_Bounded_Base_Sequence" << be_uidt_nl << "{" << be_nl - << "public:" << be_idt_nl - << "// = Initialization and termination methods." << be_nl; + << "public:" << be_idt_nl; // default Constructor *os << class_name << " (void);" << be_nl; @@ -162,11 +163,11 @@ be_visitor_sequence_ch::gen_bounded_sequence (be_sequence *node) << "CORBA::Boolean release = 0" << be_uidt_nl << ");" << be_uidt << be_uidt_nl; - *os << "};" << be_nl; + *os << "};"; - os->gen_endif (); // endif macro + os->gen_endif (); - // generate #endif for AHETI + // generate #endif for AHETI. os->gen_endif_AHETI(); return 0; 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 12c65e6b954..35f818231b3 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 @@ -100,14 +100,13 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; // !! Branching in either compile time template instantiation // or manual template instatiation os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // First generate the static methods since they are used by others. Since // they are inlined, their definition needs to come before their use else @@ -115,8 +114,8 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) // Static Operations. // allocbuf. - *os << "// = Static operations." << be_nl - << "ACE_INLINE "; + *os << be_nl << be_nl + << "ACE_INLINE" << be_nl; // The accept is used the first time here, and if an // error occurs, it will occur here. Later, no check @@ -131,8 +130,7 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) } *os << " *" << be_nl - << full_class_name << "::allocbuf (CORBA::ULong) " - << "// Allocate storage for the sequence." << be_nl + << full_class_name << "::allocbuf (CORBA::ULong) " << be_nl << "{" << be_idt_nl; bt->accept (&visitor); @@ -153,7 +151,7 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) bt->accept (&visitor); - *os << " *buffer) // Free the sequence." << be_nl + *os << " *buffer)" << be_nl << "{" << be_idt_nl << "delete [] buffer;" << be_uidt_nl << "}" << be_nl @@ -162,7 +160,6 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) // Default constructor. *os << "ACE_INLINE" << be_nl << full_class_name << "::" << class_name << " (void)" << be_nl - << "// Default constructor." << be_nl << " : TAO_Bounded_Base_Sequence (" << node->max_size () << ", 0)" << be_nl << "{" << be_nl @@ -171,14 +168,14 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) // Constructor. *os << "ACE_INLINE" << be_nl; - *os << full_class_name << "::" << class_name - << " (CORBA::ULong length," << be_idt_nl; + *os << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "CORBA::ULong length," << be_nl; bt->accept (&visitor); *os <<" *data," << be_nl - << "CORBA::Boolean release)" << be_uidt_nl - << "// Constructor using the data and memory management flag." << be_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_uidt_nl << " : TAO_Bounded_Base_Sequence (" << node->max_size () << ", length, data, release)" << be_nl << "{" << be_nl @@ -188,104 +185,112 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) // Constructor. *os << "ACE_INLINE" << be_nl << full_class_name << "::" << class_name - << " (const " << class_name << " &rhs)" << be_nl - << "// Copy constructor." << be_idt_nl + << " (const " << class_name << " &rhs)" << be_idt_nl << ": TAO_Bounded_Base_Sequence (rhs)" << be_uidt_nl << "{" << be_idt_nl - << "if (rhs.buffer_ != 0)" << be_nl + << "if (rhs.buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<" *tmp1 = " << class_name << "::allocbuf (" << node->max_size () - << ");" << be_nl - << be_nl; + *os <<" *tmp1 =" << be_idt_nl + << class_name << "::allocbuf (" << node->max_size () + << ");" << be_uidt_nl << be_nl; bt->accept (&visitor); - *os <<" * const tmp2 = ACE_reinterpret_cast ("; + *os <<" * const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_nl - << be_nl - << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl; + *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_uidt_nl << be_nl + << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl + << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_array) { bt->accept (&visitor); - *os << "_var::copy (tmp1[i], tmp2[i]);" << be_uidt_nl; + *os << "_var::copy (tmp1[i], tmp2[i]);"; } else { - *os << "tmp1[i] = tmp2[i];" << be_uidt_nl; + *os << "tmp1[i] = tmp2[i];"; } + *os << be_uidt_nl + << "}" << be_uidt_nl; + *os << be_nl << "this->buffer_ = tmp1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl << "this->buffer_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; // operator=. - *os << "ACE_INLINE " << full_class_name << " &" << be_nl - << full_class_name << "::operator= (const " - << class_name << " &rhs)" << be_nl - << "// Assignment operator. " << be_nl + *os << "ACE_INLINE" << be_nl + << full_class_name << " &" << be_nl + << full_class_name << "::operator= (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl << "if (this == &rhs)" << be_idt_nl + << "{" << be_idt_nl << "return *this;" << be_uidt_nl - << be_nl - << "if (this->release_ && this->buffer_ != 0)" << be_nl - << "{" << be_nl - << "}" << be_nl - << "else" << be_idt_nl - << "this->buffer_ = " << class_name - << "::allocbuf (rhs.maximum_);" << be_uidt_nl - << be_nl - <<"TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl - << be_nl; + << "}" << be_uidt_nl << be_nl + << "if (! this->release_ || this->buffer_ == 0)" << be_idt_nl + << "{" << be_idt_nl + << "this->buffer_ =" << be_idt_nl + << class_name + << "::allocbuf (rhs.maximum_);" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl + <<"TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl << be_nl; bt->accept (&visitor); - *os <<"* tmp1 = ACE_reinterpret_cast ("; + *os <<"* tmp1 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " *, this->buffer_);" << be_nl; + *os << " *, this->buffer_);" << be_uidt_nl << be_nl; bt->accept (&visitor); - *os <<"* const tmp2 = ACE_reinterpret_cast ("; + *os <<"* const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_nl - << be_nl - << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl; + *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_uidt_nl << be_nl + << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl + << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_array) { bt->accept (&visitor); - *os << "_var::copy (tmp1[i], tmp2[i]);" << be_uidt_nl; + *os << "_var::copy (tmp1[i], tmp2[i]);"; } else { - *os << "tmp1[i] = tmp2[i];" << be_uidt_nl; + *os << "tmp1[i] = tmp2[i];"; } + *os << be_uidt_nl + << "}" << be_uidt_nl; + *os << be_nl << "return *this;" << be_uidt_nl << "}" << be_nl << be_nl; // Accessors. - *os << "// = Accessors." << be_nl; - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; bt->accept (&visitor); @@ -296,14 +301,17 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) bt->accept (&visitor); - *os <<" *tmp = ACE_reinterpret_cast ("; + *os <<" *tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "*,this->buffer_);" << be_nl + *os << "*, this->buffer_);" << be_uidt_nl << "return tmp[i];" << be_uidt_nl - << "}" << be_nl; - *os << "ACE_INLINE const "; + << "}" << be_nl << be_nl; + + *os << "ACE_INLINE" << be_nl + << "const "; bt->accept (&visitor); @@ -316,17 +324,18 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) bt->accept (&visitor); - *os << "* tmp = ACE_reinterpret_cast (const "; + *os << "* tmp =" << be_idt_nl + << "ACE_reinterpret_cast (const "; bt->accept (&visitor); - *os << "* ACE_CAST_CONST,this->buffer_);" << be_nl + *os << "* ACE_CAST_CONST, this->buffer_);" << be_uidt_nl << "return tmp[i];" << be_uidt_nl << "}" << be_nl << be_nl; // get_buffer. - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; bt->accept (&visitor); @@ -336,89 +345,95 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) bt->accept (&visitor); - *os << " *result = 0;" << be_nl - << "if (orphan == 0)" << be_nl + *os << " *result = 0;" << be_nl << be_nl + << "if (orphan == 0)" << be_idt_nl << "{" << be_idt_nl << "// We retain ownership." << be_nl - << "if (this->buffer_ == 0)" << be_nl + << "if (this->buffer_ == 0)" << be_idt_nl << "{" << be_idt_nl - << "result = " << class_name << "::allocbuf (this->maximum_);" << be_nl + << "result =" << be_idt_nl + << class_name << "::allocbuf (this->maximum_);" << be_uidt_nl << "this->buffer_ = result;" << be_nl << "this->release_ = 1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl - << "result = ACE_reinterpret_cast ("; + << "result =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "*, this->buffer_);" << be_uidt_nl + *os << "*, this->buffer_);" << be_uidt << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl - << "else // if (orphan == 1)" << be_nl + << "else // if (orphan == 1)" << be_idt_nl << "{" << be_idt_nl - << "if (this->release_ != 0)" << be_nl + << "if (this->release_ != 0)" << be_idt_nl << "{" << be_idt_nl - << "// We set the state back to default and relinquish" << be_nl - << "// ownership." << be_nl - << "result = ACE_reinterpret_cast("; + << "// We set the state back to default and relinquish ownership." + << be_nl + << "result =" << be_idt_nl + << "ACE_reinterpret_cast("; bt->accept (&visitor); - *os << "*,this->buffer_);" << be_nl + *os << "*, this->buffer_);" << be_uidt_nl << "this->maximum_ = 0;" << be_nl << "this->length_ = 0;" << be_nl << "this->buffer_ = 0;" << be_nl << "this->release_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return result;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // get_buffer. - *os << "ACE_INLINE const "; + *os << "ACE_INLINE" << be_nl + << "const "; bt->accept (&visitor); *os << " *" << be_nl << full_class_name << "::get_buffer (void) const" << be_nl << "{" << be_idt_nl - << "return ACE_reinterpret_cast(const "; + << "return ACE_reinterpret_cast (const "; bt->accept (&visitor); *os << " * ACE_CAST_CONST, this->buffer_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // replace. - *os << "ACE_INLINE void " << be_nl - << full_class_name << "::replace (CORBA::ULong max," << be_idt_nl + *os << "ACE_INLINE" << be_nl + << "void " << be_nl + << full_class_name << "::replace (" << be_idt << be_idt_nl + << "CORBA::ULong max," << be_nl << "CORBA::ULong length," << be_nl; bt->accept (&visitor); *os <<" *data," << be_nl - << "CORBA::Boolean release)" << be_uidt_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl << "this->maximum_ = max;" << be_nl - << "this->length_ = length;" << be_nl - << "if (this->buffer_ && this->release_ == 1)" << be_nl + << "this->length_ = length;" << be_nl << be_nl + << "if (this->buffer_ && this->release_ == 1)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<"* tmp = ACE_reinterpret_cast("; + *os <<"* tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "* ACE_CAST_CONST, this->buffer_);" << be_nl + *os << "* ACE_CAST_CONST, this->buffer_);" << be_uidt_nl << class_name << "::freebuf (tmp);" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt_nl << be_nl << "this->buffer_ = data;" << be_nl << "this->release_ = release;" << be_uidt_nl - << "}" << be_nl; + << "}"; os->gen_endif (); 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 bff0ecd7d6a..df8221e77ec 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 @@ -83,15 +83,14 @@ be_visitor_sequence_cs::gen_bounded_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // allocate_buffer - *os << "void " << be_nl + *os << be_nl << be_nl << "void " << be_nl << full_class_name << "::_allocate_buffer (CORBA::ULong /* length */)" << be_nl << "// allocate a buffer of the requested length. " @@ -109,7 +108,9 @@ be_visitor_sequence_cs::gen_bounded_sequence (be_sequence *node) << "// deallocate the buffer" << be_nl << "{" << be_idt_nl << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl - << "return;" << be_uidt_nl; + << "{" << be_idt_nl + << "return;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; bt->accept (&visitor); 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 77aa4f0f9a7..c646832a0df 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 @@ -29,17 +29,18 @@ be_visitor_sequence_ch::gen_bounded_str_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); const char *class_name = node->instance_name (); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - *os << "class TAO_EXPORT_MACRO " << class_name << be_idt_nl + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () + << " " << class_name << be_idt_nl << ": public TAO_Bounded_Base_Sequence" << be_uidt_nl << "{" << be_nl - << "public:" << be_idt_nl - << "// = Initialization and termination methods." << be_nl; + << "public:" << be_idt_nl; // constructor *os << class_name << " (void);" << be_nl; @@ -101,12 +102,12 @@ be_visitor_sequence_ch::gen_bounded_str_sequence (be_sequence *node) << "CORBA::ULong ol" << be_uidt_nl << ");" << be_uidt << be_uidt_nl; - *os << "};" << be_nl; + *os << "};"; - os->gen_endif (); // endif macro + os->gen_endif (); - // generate #endif for AHETI - os->gen_endif_AHETI(); + // generate #endif for AHETI. + os->gen_endif_AHETI (); return 0; } 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 1d812a7a7ed..517b1e262d5 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 @@ -52,44 +52,50 @@ be_visitor_sequence_ci::gen_bounded_str_sequence (be_sequence *node) class_name); } - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // first generate the static methods since they are used by others. Since // they are inlined, their definition needs to come before their use else // some compilers (e.g., g++) produce lots of warnings. // allocbuf - *os << "ACE_INLINE char **" << be_nl + *os << be_nl << be_nl + << "ACE_INLINE" << be_nl + << "char **" << be_nl << full_class_name << "::allocbuf (CORBA::ULong /* length */)" << be_nl << "{" << be_idt_nl << "char **buf = 0;" << be_nl - << "ACE_NEW_RETURN (buf, char *[" << node->max_size () << "], 0);" << be_nl - << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; i++)" << be_idt_nl + << "ACE_NEW_RETURN (buf, char *[" << node->max_size () << "], 0);" + << be_nl << be_nl + << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; ++i)" + << be_idt_nl + << "{" << be_idt_nl << "buf[i] = 0;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return buf;" << be_uidt_nl << "}" << be_nl << be_nl; // freebuf - *os << "ACE_INLINE void " << be_nl + *os << "ACE_INLINE" << be_nl + << "void " << be_nl << full_class_name << "::freebuf (char **buffer)" << be_nl << "{" << be_idt_nl - << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; ++i)" << be_nl + << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; ++i)" + << be_idt_nl << "{" << be_idt_nl - << "if (buffer[i] != 0)" << be_nl + << "if (buffer[i] != 0)" << be_idt_nl << "{" << be_idt_nl << "CORBA::string_free (buffer[i]);" << be_nl << "buffer[i] = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "delete [] buffer;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // constructor *os << "ACE_INLINE" << be_nl @@ -102,123 +108,145 @@ be_visitor_sequence_ci::gen_bounded_str_sequence (be_sequence *node) // constructor *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name << " (CORBA::ULong length," << be_idt_nl + << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "CORBA::ULong length," << be_nl << "char* *value," << be_nl - << "CORBA::Boolean release)" << be_uidt_nl - << " : TAO_Bounded_Base_Sequence (" << node->max_size () << ", length, value, release)" << be_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_nl + << ": TAO_Bounded_Base_Sequence (" << node->max_size () + << ", length, value, release)" << be_uidt_nl << "{" << be_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // constructor *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name << " (const " - << class_name << " &rhs)" << be_idt_nl + << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_nl << ": TAO_Bounded_Base_Sequence (rhs)" << be_uidt_nl << "{" << be_idt_nl - << "if (rhs.buffer_ != 0)" << be_nl + << "if (rhs.buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl - << "char **tmp1 = " << class_name << "::allocbuf (this->maximum_);" << be_nl - << "char ** const tmp2 = ACE_reinterpret_cast (char ** ACE_CAST_CONST, rhs.buffer_);" << be_nl - << be_nl + << "char **tmp1 ="<< be_idt_nl + << class_name << "::allocbuf (this->maximum_);" << be_uidt_nl + << "char ** const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast (char ** ACE_CAST_CONST, rhs.buffer_);" + << be_uidt_nl << be_nl << "for (CORBA::ULong i=0; i < rhs.length_; i++)" << be_idt_nl + << "{" << be_idt_nl << "tmp1[i] = CORBA::string_dup (tmp2[i]);" << be_uidt_nl - << be_nl + << "}" << be_uidt_nl << be_nl << "this->buffer_ = tmp1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl << "this->buffer_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_uidt << be_uidt_nl + << "}" << be_nl << be_nl; // operator= - *os << "ACE_INLINE " << full_class_name << "& " << be_nl - << full_class_name << "::operator= (const " - << class_name << " &rhs)" << be_nl + *os << "ACE_INLINE" << be_nl + << full_class_name << "& " << be_nl + << full_class_name << "::operator= (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl << "if (this == &rhs)" << be_idt_nl + << "{" << be_idt_nl << "return *this;" << be_uidt_nl - << be_nl - << "if (this->release_ && this->buffer_ != 0)" << be_nl + << "}" << be_uidt_nl << be_nl + << "if (this->release_ && this->buffer_ != 0)" << be_idt_nl << "{ " << be_idt_nl - << "char **tmp = ACE_reinterpret_cast (char **, this->buffer_);" << be_nl - << be_nl - << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_nl + << "char **tmp =" << be_idt_nl + << "ACE_reinterpret_cast (char **, this->buffer_);" + << be_uidt_nl << be_nl + << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl << "{" << be_idt_nl << "CORBA::string_free (tmp[i]);" << be_nl << "tmp[i] = 0;" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl << "else" << be_idt_nl - << "this->buffer_ = " << class_name << "::allocbuf (rhs.maximum_);" << be_uidt_nl - << be_nl - << "TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl - << be_nl - << "char **tmp1 = ACE_reinterpret_cast (char **, this->buffer_);" << be_nl - << "char ** const tmp2 = ACE_reinterpret_cast (char ** ACE_CAST_CONST, rhs.buffer_);" << be_nl - << be_nl + << "{" << be_idt_nl + << "this->buffer_ =" << be_idt_nl + << class_name << "::allocbuf (rhs.maximum_);" + << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl << be_nl + << "char **tmp1 =" << be_idt_nl + << "ACE_reinterpret_cast (char **, this->buffer_);" + << be_uidt_nl << be_nl + << "char ** const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast (char ** ACE_CAST_CONST, rhs.buffer_);" + << be_uidt_nl << be_nl << "for (CORBA::ULong i = 0; i < rhs.length_; i++)" << be_idt_nl + << "{" << be_idt_nl << "tmp1[i] = CORBA::string_dup (tmp2[i]);" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return *this;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // operator[] - *os << "ACE_INLINE TAO_SeqElem_String_Manager " << be_nl + *os << "ACE_INLINE" << be_nl + << "TAO_SeqElem_String_Manager " << be_nl << full_class_name << "::operator[] (CORBA::ULong index) const" << be_nl - << "// read-write accessor" << be_nl << "{" << be_idt_nl << "ACE_ASSERT (index < this->maximum_);" << be_nl - << "char **const tmp = ACE_reinterpret_cast (char ** ACE_CAST_CONST, this->buffer_);" << be_nl - << "return TAO_SeqElem_String_Manager (tmp + index, this->release_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "char **const tmp =" << be_idt_nl + << "ACE_reinterpret_cast (char ** ACE_CAST_CONST, this->buffer_);" + << be_uidt_nl + << "return TAO_SeqElem_String_Manager (tmp + index, this->release_);" + << be_uidt_nl + << "}" << be_nl << be_nl; // get_buffer - *os << "ACE_INLINE char**" << be_nl + *os << "ACE_INLINE" << be_nl + << "char**" << be_nl << full_class_name << "::get_buffer (CORBA::Boolean orphan)" << be_nl << "{" << be_idt_nl - << "char **result = 0;" << be_nl - << "if (orphan == 0)" << be_nl + << "char **result = 0;" << be_nl << be_nl + << "if (orphan == 0)" << be_idt_nl << "{" << be_idt_nl << "// We retain ownership. " << be_nl - << "if (this->buffer_ == 0)" << be_nl + << "if (this->buffer_ == 0)" << be_idt_nl << "{" << be_idt_nl - << "result = " << class_name << "::allocbuf (this->maximum_);" << be_nl + << "result =" << be_idt_nl + << class_name << "::allocbuf (this->maximum_);" << be_uidt_nl << "this->buffer_ = result;" << be_nl << "this->release_ = 1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl - << "result = ACE_reinterpret_cast (char **, this->buffer_);" << be_uidt_nl + << "result =" << be_idt_nl + << "ACE_reinterpret_cast (char **, this->buffer_);" + << be_uidt << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl - << "else // if (orphan == 1)" << be_nl + << "else // if (orphan == 1)" << be_idt_nl << "{" << be_idt_nl - << "if (this->release_ != 0)" << be_nl + << "if (this->release_ != 0)" << be_idt_nl << "{" << be_idt_nl - << "// We set state back to default and relinquish" << be_nl - << "// ownership." << be_nl - << "result = ACE_reinterpret_cast (char **, this->buffer_);" << be_nl + << "// We set state back to default and relinquish ownership." << be_nl + << "result =" << be_idt_nl + << "ACE_reinterpret_cast (char **, this->buffer_);" << be_uidt_nl << "this->maximum_ = 0;" << be_nl << "this->length_ = 0;" << be_nl << "this->buffer_ = 0;" << be_nl << "this->release_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return result;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // get_buffer - *os << "ACE_INLINE const char**" << be_nl + *os << "ACE_INLINE" << be_nl + << "const char**" << be_nl << full_class_name << "::get_buffer (void) const" << be_nl << "{" << be_idt_nl << "return ACE_reinterpret_cast (const char ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}"; os->gen_endif (); // endif macro 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 f9c52236c97..a0f5701cf7f 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 @@ -52,15 +52,15 @@ be_visitor_sequence_cs::gen_bounded_str_sequence (be_sequence *node) class_name); } - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // allocate_buffer - *os << "void" << be_nl + *os << be_nl << be_nl + << "void" << be_nl << full_class_name << "::_allocate_buffer (CORBA::ULong /* length */)" << be_nl << "{" << be_idt_nl @@ -77,7 +77,9 @@ be_visitor_sequence_cs::gen_bounded_str_sequence (be_sequence *node) << full_class_name << "::_deallocate_buffer (void)" << be_nl << "{" << be_idt_nl << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl + << "{" << be_idt_nl << "return;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "char **tmp = ACE_reinterpret_cast (char **, this->buffer_);" << be_nl << class_name << "::freebuf (tmp);" << be_nl @@ -89,8 +91,7 @@ be_visitor_sequence_cs::gen_bounded_str_sequence (be_sequence *node) *os << full_class_name << "::~" << class_name << " (void)" << be_nl << "{" << be_idt_nl << "this->_deallocate_buffer ();" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // shrink_buffer *os << "void" << be_nl 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 5765060d42b..56592dd8a67 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 @@ -28,18 +28,18 @@ be_visitor_sequence_ch::gen_bounded_wstr_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); const char * class_name = node->instance_name (); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); - *os << "class TAO_EXPORT_MACRO " << class_name << be_idt_nl + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () + << " " << class_name << be_idt_nl << ": public TAO_Bounded_Base_Sequence" << be_uidt_nl << "{" << be_nl - << "public:" << be_idt_nl - << "// = Initialization and termination methods." << be_nl; + << "public:" << be_idt_nl; // constructor *os << class_name << " (void);" << be_nl; @@ -101,12 +101,12 @@ be_visitor_sequence_ch::gen_bounded_wstr_sequence (be_sequence *node) << "CORBA::ULong ol" << be_uidt_nl << ");" << be_uidt << be_uidt_nl; - *os << "};" << be_nl; + *os << "};"; - os->gen_endif (); // endif macro + os->gen_endif (); - // generate #endif for AHETI - os->gen_endif_AHETI(); + // generate #endif for AHETI. + os->gen_endif_AHETI (); return 0; } 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 a53dc89ec60..2b64014d9d8 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 @@ -50,44 +50,49 @@ be_visitor_sequence_ci::gen_bounded_wstr_sequence (be_sequence *node) class_name); } - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // First generate the static methods since they are used by others. Since // they are inlined, their definition needs to come before their use else // some compilers (e.g., g++) produce lots of warnings. // allocbuf - *os << "ACE_INLINE CORBA::WChar **" << be_nl + *os << be_nl << be_nl + << "ACE_INLINE" << be_nl + << "CORBA::WChar **" << be_nl << full_class_name << "::allocbuf (CORBA::ULong /* length */)" << be_nl << "{" << be_idt_nl << "CORBA::WChar **buf = 0;" << be_nl - << "ACE_NEW_RETURN (buf, CORBA::WChar *[" << node->max_size () << "], 0);" << be_nl - << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; i++)" << be_idt_nl + << "ACE_NEW_RETURN (buf, CORBA::WChar *[" << node->max_size () + << "], 0);" << be_nl << be_nl + << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; i++)" + << be_idt_nl + << "{" << be_idt_nl << "buf[i] = 0;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return buf;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // freebuf - *os << "ACE_INLINE void " << be_nl + *os << "ACE_INLINE" << be_nl + << "void " << be_nl << full_class_name << "::freebuf (CORBA::WChar **buffer)" << be_nl << "{" << be_idt_nl - << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; ++i)" << be_nl + << "for (CORBA::ULong i = 0; i < " << node->max_size () << "; ++i)" + << be_idt_nl << "{" << be_idt_nl - << "if (buffer[i] != 0)" << be_nl + << "if (buffer[i] != 0)" << be_idt_nl << "{" << be_idt_nl << "CORBA::wstring_free (buffer[i]);" << be_nl << "buffer[i] = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "delete [] buffer;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // constructor *os << "ACE_INLINE" << be_nl @@ -95,142 +100,150 @@ be_visitor_sequence_ci::gen_bounded_wstr_sequence (be_sequence *node) << " : TAO_Bounded_Base_Sequence (" << node->max_size () << ", 0)" << be_nl << "{" << be_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // constructor *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name << " (CORBA::ULong length," << be_idt_nl + << full_class_name << "::" << class_name << " (" + << be_idt << be_idt_nl + << "CORBA::ULong length," << be_nl << "CORBA::WChar* *value," << be_nl - << "CORBA::Boolean release)" << be_uidt_nl - << " : TAO_Bounded_Base_Sequence (" << node->max_size () - << ", length, value, release)" << be_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_nl + << ": TAO_Bounded_Base_Sequence (" << node->max_size () + << ", length, value, release)" << be_uidt_nl << "{" << be_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // constructor *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name << " (const " - << class_name << " &rhs)" << be_idt_nl + << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_nl << ": TAO_Bounded_Base_Sequence (rhs)" << be_uidt_nl << "{" << be_idt_nl - << "if (rhs.buffer_ != 0)" << be_nl + << "if (rhs.buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl - << "CORBA::WChar **tmp1 = " << class_name - << "::allocbuf (this->maximum_);" << be_nl + << "CORBA::WChar **tmp1 =" << be_idt_nl + << class_name + << "::allocbuf (this->maximum_);" << be_uidt_nl << be_nl << "CORBA::WChar ** const tmp2 =" << be_idt_nl << "ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST, rhs.buffer_);" - << be_uidt_nl - << be_nl + << be_uidt_nl << be_nl << "for (CORBA::ULong i=0; i < rhs.length_; i++)" << be_idt_nl + << "{" << be_idt_nl << "tmp1[i] = CORBA::wstring_dup (tmp2[i]);" << be_uidt_nl - << be_nl + << "}" << be_uidt_nl << be_nl << "this->buffer_ = tmp1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl << "this->buffer_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_uidt << be_uidt_nl + << "}" << be_nl << be_nl; // operator= - *os << "ACE_INLINE " << full_class_name << "& " << be_nl - << full_class_name << "::operator= (const " << class_name - << " &rhs)" << be_nl + *os << "ACE_INLINE" << be_nl + << full_class_name << "& " << be_nl + << full_class_name << "::operator= (" << be_idt << be_idt_nl + << "const " << class_name << " &rhs" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl << "if (this == &rhs)" << be_idt_nl + << "{" << be_idt_nl << "return *this;" << be_uidt_nl - << be_nl - << "if (this->release_ && this->buffer_ != 0)" << be_nl + << "}" << be_uidt_nl << be_nl + << "if (this->release_ && this->buffer_ != 0)" << be_idt_nl << "{ " << be_idt_nl << "CORBA::WChar **tmp =" << be_idt_nl << "ACE_reinterpret_cast (CORBA::WChar **, this->buffer_);" - << be_uidt_nl - << be_nl - << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_nl + << be_uidt_nl << be_nl + << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl << "{" << be_idt_nl << "CORBA::wstring_free (tmp[i]);" << be_nl << "tmp[i] = 0;" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl << "else" << be_idt_nl - << "this->buffer_ = " << class_name - << "::allocbuf (rhs.maximum_);" << be_uidt_nl - << be_nl - << "TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl - << be_nl + << "{" << be_idt_nl + << "this->buffer_ =" << be_idt_nl + << class_name + << "::allocbuf (rhs.maximum_);" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "TAO_Bounded_Base_Sequence::operator= (rhs);" << be_nl << be_nl << "CORBA::WChar **tmp1 =" << be_idt_nl << "ACE_reinterpret_cast (CORBA::WChar **, this->buffer_);" << be_uidt_nl << "CORBA::WChar ** const tmp2 =" << be_idt_nl << "ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST, rhs.buffer_);" - << be_uidt_nl - << be_nl + << be_uidt_nl << be_nl << "for (CORBA::ULong i = 0; i < rhs.length_; i++)" << be_idt_nl + << "{" << be_idt_nl << "tmp1[i] = CORBA::wstring_dup (tmp2[i]);" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return *this;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // operator[] - *os << "ACE_INLINE TAO_SeqElem_WString_Manager " << be_nl + *os << "ACE_INLINE" << be_nl + << "TAO_SeqElem_WString_Manager " << be_nl << full_class_name << "::operator[] (CORBA::ULong index) const" << be_nl - << "// read-write accessor" << be_nl << "{" << be_idt_nl << "ACE_ASSERT (index < this->maximum_);" << be_nl - << "CORBA::WChar **const tmp = ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST, this->buffer_);" << be_nl - << "return TAO_SeqElem_WString_Manager (tmp + index, this->release_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "CORBA::WChar **const tmp =" << be_idt_nl + << "ACE_reinterpret_cast (CORBA::WChar ** ACE_CAST_CONST, this->buffer_);" + << be_uidt_nl + << "return TAO_SeqElem_WString_Manager (tmp + index, this->release_);" + << be_uidt_nl + << "}" << be_nl << be_nl; // get_buffer - *os << "ACE_INLINE CORBA::WChar**" << be_nl + *os << "ACE_INLINE" << be_nl + << "CORBA::WChar**" << be_nl << full_class_name << "::get_buffer (CORBA::Boolean orphan)" << be_nl << "{" << be_idt_nl - << "CORBA::WChar **result = 0;" << be_nl - << "if (orphan == 0)" << be_nl + << "CORBA::WChar **result = 0;" << be_nl << be_nl + << "if (orphan == 0)" << be_idt_nl << "{" << be_idt_nl << "// We retain ownership. " << be_nl - << "if (this->buffer_ == 0)" << be_nl + << "if (this->buffer_ == 0)" << be_idt_nl << "{" << be_idt_nl << "result = " << class_name << "::allocbuf (this->maximum_);" << be_nl << "this->buffer_ = result;" << be_nl << "this->release_ = 1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl << "result = ACE_reinterpret_cast (CORBA::WChar **, this->buffer_);" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl - << "else // if (orphan == 1)" << be_nl + << "else // if (orphan == 1)" << be_idt_nl << "{" << be_idt_nl - << "if (this->release_ != 0)" << be_nl + << "if (this->release_ != 0)" << be_idt_nl << "{" << be_idt_nl - << "// We set state back to default and relinquish" << be_nl - << "// ownership." << be_nl - << "result = ACE_reinterpret_cast (CORBA::WChar **, this->buffer_);" - << be_nl + << "// We set state back to default and relinquish ownership." << be_nl + << "result =" << be_idt_nl + << "ACE_reinterpret_cast (CORBA::WChar **, this->buffer_);" + << be_uidt_nl << "this->maximum_ = 0;" << be_nl << "this->length_ = 0;" << be_nl << "this->buffer_ = 0;" << be_nl << "this->release_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return result;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // get_buffer - *os << "ACE_INLINE const CORBA::WChar**" << be_nl + *os << "ACE_INLINE" << be_nl + << "const CORBA::WChar**" << be_nl << full_class_name << "::get_buffer (void) const" << be_nl << "{" << be_idt_nl << "return ACE_reinterpret_cast (const CORBA::WChar ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}"; os->gen_endif (); // endif macro 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 ea70ec143bc..6335e23593c 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 @@ -48,15 +48,15 @@ be_visitor_sequence_cs::gen_bounded_wstr_sequence (be_sequence *node) class_name); } - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // allocate_buffer - *os << "void" << be_nl + *os << be_nl << be_nl + << "void" << be_nl << full_class_name << "::_allocate_buffer (CORBA::ULong /* length */)" << be_nl << "{" << be_idt_nl @@ -73,7 +73,9 @@ be_visitor_sequence_cs::gen_bounded_wstr_sequence (be_sequence *node) << full_class_name << "::_deallocate_buffer (void)" << be_nl << "{" << be_idt_nl << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl + << "{" << be_idt_nl << "return;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "CORBA::WChar **tmp =" << be_idt_nl << "ACE_reinterpret_cast (CORBA::WChar **, this->buffer_);" << be_uidt_nl 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 2c15d97a423..592fe5e938b 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 @@ -58,17 +58,18 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH); be_visitor_sequence_base visitor (&ctx); - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - *os << "class TAO_EXPORT_MACRO " << class_name << be_idt_nl + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () + << " " << class_name << be_idt_nl << ": public TAO_Unbounded_Base_Sequence" << be_uidt_nl << "{" << be_nl - << "public:" << be_idt_nl - << "// = Initialization and termination methods." << be_nl; + << "public:" << be_idt_nl; // default constructor *os << class_name << " (void);" << be_nl; @@ -176,12 +177,12 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node) *os << "virtual void _shrink_buffer (" << be_idt << be_idt_nl << "CORBA::ULong nl," << be_nl << "CORBA::ULong ol" << be_uidt_nl - << ");"; + << ");" << be_uidt; if (! (is_pseudo_object || nt == AST_Decl::NT_valuetype)) { // Pseudo objects do not require these methods. - *os << be_uidt_nl << be_nl + *os << be_nl << be_nl << "virtual void _downcast (" << be_idt << be_idt_nl << "void* target," << be_nl << "CORBA_Object *src" << be_nl @@ -191,12 +192,12 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node) *os << "virtual CORBA_Object* _upcast (void *src) const;"; } - *os << be_uidt << be_uidt_nl << "};" << be_nl; + *os << be_uidt_nl << "};"; - os->gen_endif (); // endif macro + os->gen_endif (); - // generate #endif for AHETI - os->gen_endif_AHETI(); + // generate #endif for AHETI. + os->gen_endif_AHETI (); return 0; } 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 745ede3c3c3..3ea47cbc0bf 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 @@ -104,15 +104,15 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // allocbuf. - *os << "ACE_INLINE "; + *os << be_nl << be_nl + << "ACE_INLINE" << be_nl; // The accept is here the first time used and if an // error occurs, it will occur here. Later no check @@ -138,8 +138,7 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) ; bt->accept (&visitor); - *os << "*[nelems], 0);" << be_nl - << be_nl + *os << "*[nelems], 0);" << be_nl << be_nl << "for (CORBA::ULong i = 0; i < nelems; i++)" << be_idt_nl << "{" << be_idt_nl << "buf[i] = "; @@ -165,7 +164,8 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) << "}" << be_nl << be_nl; // Freebuf. - *os << "ACE_INLINE void " << be_nl + *os << "ACE_INLINE" << be_nl + << "void " << be_nl << full_class_name << "::freebuf ("; bt->accept (&visitor); @@ -173,17 +173,17 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) *os << " **buffer)" << be_nl << "{" << be_idt_nl << "if (buffer == 0)" << be_idt_nl + << "{" << be_idt_nl << "return;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "delete[] buffer;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // Constructor. *os << "ACE_INLINE" << be_nl << full_class_name << "::" << class_name << " (void)" << be_nl << "{" << be_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // Constructor. *os << "ACE_INLINE" << be_nl @@ -197,49 +197,53 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) // Constructor. *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name - << " (CORBA::ULong maximum," << be_idt_nl + << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "CORBA::ULong maximum," << be_nl << "CORBA::ULong length," << be_nl; bt->accept (&visitor); *os <<"* *value," << be_nl - << "CORBA::Boolean release)" << be_uidt_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_nl << ": TAO_Unbounded_Base_Sequence (maximum, length, value, release)" - << be_nl + << be_uidt_nl << "{" << be_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // Constructor. *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name << "(const " - << class_name << " &rhs)" << be_idt_nl + << full_class_name << "::" << class_name << "(" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_nl << ": TAO_Unbounded_Base_Sequence (rhs)" << be_uidt_nl << "{" << be_idt_nl - << "if (rhs.buffer_ != 0)" << be_nl + << "if (rhs.buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<" **tmp1 = " << class_name << "::allocbuf (this->maximum_);" - << be_nl; + *os <<" **tmp1 =" << be_idt_nl + << class_name << "::allocbuf (this->maximum_);" << be_uidt_nl; bt->accept (&visitor); - *os <<" ** const tmp2 = ACE_reinterpret_cast ("; + *os <<" ** const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_nl - << be_nl + *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_uidt_nl << be_nl << "for (CORBA::ULong i = 0; i < rhs.length_; ++i)" << be_idt_nl << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_valuetype) { *os << "if (tmp2[i] != 0)" << be_idt_nl + << "{" << be_idt_nl << "tmp2[i]->_add_ref ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "tmp1[i] = tmp2 [i];"; } else @@ -261,40 +265,45 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) *os << be_uidt_nl << "}" << be_uidt_nl << be_nl << "this->buffer_ = tmp1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl << "this->buffer_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_uidt << be_uidt_nl + << "}" << be_nl << be_nl; // Operator =. - *os << "ACE_INLINE " << full_class_name << " &" << be_nl - << full_class_name << "::operator= (const " - << class_name << " &rhs)" << be_nl + *os << "ACE_INLINE" << be_nl + << full_class_name << " &" << be_nl + << full_class_name << "::operator= (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl << "if (this == &rhs)" << be_idt_nl + << "{" << be_idt_nl << "return *this;" << be_uidt_nl - << be_nl - << "if (this->release_)" << be_nl + << "}" << be_uidt_nl << be_nl + << "if (this->release_)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<" **tmp = ACE_reinterpret_cast ("; + *os <<" **tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " **, this->buffer_);" << be_nl - << be_nl - << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_nl + *os << " **, this->buffer_);" << be_uidt_nl << be_nl + << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_valuetype) { *os << "if (tmp[i] != 0)" << be_idt_nl + << "{" << be_idt_nl << "tmp[i]->_remove_ref ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "tmp[i] = 0;"; } else if (bt_is_defined) @@ -314,44 +323,48 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) } *os << be_uidt_nl - << "}" << be_nl - << "if (this->maximum_ < rhs.maximum_)" << be_nl + << "}" << be_uidt_nl << be_nl + << "if (this->maximum_ < rhs.maximum_)" << be_idt_nl << "{" << be_idt_nl << class_name << "::freebuf (tmp);" << be_nl << "this->buffer_ = " << class_name << "::allocbuf (rhs.maximum_);" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl << "else" << be_idt_nl - << "this->buffer_ = " << class_name - << "::allocbuf (rhs.maximum_);" << be_uidt_nl - << be_nl - << "TAO_Unbounded_Base_Sequence::operator= (rhs);" << be_nl - << be_nl; + << "{" << be_idt_nl + << "this->buffer_ =" << be_idt_nl + << class_name + << "::allocbuf (rhs.maximum_);" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "TAO_Unbounded_Base_Sequence::operator= (rhs);" << be_nl << be_nl; bt->accept (&visitor); - *os <<" **tmp1 = ACE_reinterpret_cast ("; + *os <<" **tmp1 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " **, this->buffer_);" << be_nl; + *os << " **, this->buffer_);" << be_uidt_nl << be_nl; bt->accept (&visitor); - *os <<" ** const tmp2 = ACE_reinterpret_cast ("; + *os <<" ** const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_nl - << be_nl + *os << " ** ACE_CAST_CONST, rhs.buffer_);" << be_uidt_nl << be_nl << "for (CORBA::ULong i = 0; i < rhs.length_; ++i)" << be_idt_nl << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_valuetype) { *os << "if (tmp2[i] != 0)" << be_idt_nl + << "{" << be_idt_nl << "tmp2[i]->_add_ref ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "tmp1[i] = tmp2 [i];"; } else @@ -373,8 +386,7 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) *os << be_uidt_nl << "}" << be_uidt_nl << be_nl << "return *this;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // Operator[]. be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt); @@ -384,23 +396,25 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) && prim && prim->pt () == AST_PredefinedType::PT_pseudo; + *os << "ACE_INLINE" << be_nl; + if (is_pseudo_object) { - *os << "ACE_INLINE TAO_Pseudo_Object_Manager<"; + *os << "TAO_Pseudo_Object_Manager<"; } else { if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "ACE_INLINE TAO_Valuetype_Manager<"; + *os << "TAO_Valuetype_Manager<"; } else if (node->base_type ()->is_abstract ()) { - *os << "ACE_INLINE TAO_Abstract_Manager<"; + *os << "TAO_Abstract_Manager<"; } else { - *os << "ACE_INLINE TAO_Object_Manager<"; + *os << "TAO_Object_Manager<"; } } @@ -408,46 +422,46 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) << bt->name () << "_var>" << be_nl << full_class_name << "::operator[] (CORBA::ULong index) const" << be_nl - << "// read-write accessor" << be_nl << "{" << be_idt_nl << "ACE_ASSERT (index < this->maximum_);" << be_nl; bt->accept (&visitor); - *os <<" ** const tmp = ACE_reinterpret_cast ("; + *os <<" ** const tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " ** ACE_CAST_CONST, this->buffer_);" << be_nl; + *os << " ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl + << "return "; if (is_pseudo_object) { - *os << "return TAO_Pseudo_Object_Manager<"; + *os << "TAO_Pseudo_Object_Manager<"; } else { if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "return TAO_Valuetype_Manager<"; + *os << "TAO_Valuetype_Manager<"; } else if (node->base_type ()->is_abstract ()) { - *os << "return TAO_Abstract_Manager<"; + *os << "TAO_Abstract_Manager<"; } else { - *os << "return TAO_Object_Manager<"; + *os << "TAO_Object_Manager<"; } } *os << bt->name () << "," << bt->name () << "_var>" << " (tmp + index, this->release_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // get_buffer - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; bt->accept (&visitor); @@ -457,49 +471,50 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) bt->accept (&visitor); - *os << " **result = 0;" << be_nl - << "if (orphan == 0)" << be_nl + *os << " **result = 0;" << be_nl << be_nl + << "if (orphan == 0)" << be_idt_nl << "{" << be_idt_nl << "// We retain ownership." << be_nl - << "if (this->buffer_ == 0)" << be_nl + << "if (this->buffer_ == 0)" << be_idt_nl << "{" << be_idt_nl - << "result = " << class_name << "::allocbuf (this->maximum_);" - << be_nl + << "result =" << be_idt_nl << class_name + << "::allocbuf (this->maximum_);" << be_uidt_nl << "this->buffer_ = result;" << be_nl << "this->release_ = 1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl - << "result = ACE_reinterpret_cast ("; + << "result =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "**, this->buffer_);" << be_uidt_nl + *os << "**, this->buffer_);" << be_uidt << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl - << "else // if (orphan == 1)" << be_nl + << "else // if (orphan == 1)" << be_idt_nl << "{" << be_idt_nl - << "if (this->release_ != 0)" << be_nl + << "if (this->release_ != 0)" << be_idt_nl << "{" << be_idt_nl - << "// We set the state back to default and relinquish" << be_nl - << "// ownership." << be_nl - << "result = ACE_reinterpret_cast("; + << "// We set the state back to default and relinquish ownership." + << be_nl + << "result =" << be_idt_nl + << "ACE_reinterpret_cast("; bt->accept (&visitor); - *os << "**,this->buffer_);" << be_nl + *os << "**,this->buffer_);" << be_uidt_nl << "this->maximum_ = 0;" << be_nl << "this->length_ = 0;" << be_nl << "this->buffer_ = 0;" << be_nl << "this->release_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return result;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // get_buffer. - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; *os << "const "; bt->accept (&visitor); @@ -507,13 +522,12 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) *os << "* *" << be_nl << full_class_name << "::get_buffer (void) const" << be_nl << "{" << be_idt_nl - << "return ACE_reinterpret_cast(const "; + << "return ACE_reinterpret_cast (const "; bt->accept (&visitor); *os << " ** ACE_CAST_CONST, this->buffer_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}"; os->gen_endif (); 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 f0c57e1a88a..888a6ce9e99 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 @@ -99,15 +99,15 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS); be_visitor_sequence_base visitor (&ctx); - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // allocate_buffer. - *os << "// The Base_Sequence functions, please see tao/Sequence.h" + *os << be_nl << be_nl + << "// The Base_Sequence functions, please see tao/Sequence.h" << be_nl << "void" << be_nl << full_class_name << "::_allocate_buffer (CORBA::ULong length)" @@ -119,7 +119,7 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) *os <<" **tmp = 0;" << be_nl << "tmp = " << class_name << "::allocbuf (length);" << be_nl << be_nl - << "if (this->buffer_ != 0)" << be_nl + << "if (this->buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); @@ -128,7 +128,7 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) bt->accept (&visitor); - *os << "**, this->buffer_);" << be_nl + *os << "**, this->buffer_);" << be_nl << be_nl << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl << "{" << be_idt_nl << "if (!this->release_)" << be_idt_nl @@ -166,17 +166,18 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) << "{" << be_idt_nl << "delete [] old;" << be_uidt_nl << "}" << be_uidt << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt_nl << be_nl << "this->buffer_ = tmp;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // deallocate_buffer. *os << "void" << be_nl << full_class_name << "::_deallocate_buffer (void)" << be_nl << "{" << be_idt_nl << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl - << "return;" << be_uidt_nl; + << "{" << be_idt_nl + << "return;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; bt->accept (&visitor); @@ -327,7 +328,7 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) } *os << be_uidt_nl - << "}" << be_nl; + << "}"; } os->gen_endif (); 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 f66a9d87529..29673b51375 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 @@ -61,18 +61,19 @@ be_visitor_sequence_ch::gen_unbounded_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CH); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI (); os->gen_ifdef_macro (class_name); - *os << "class TAO_EXPORT_MACRO " + *os << be_nl << be_nl + << "class " << be_global->stub_export_macro () << " " << class_name << be_idt_nl << ": public TAO_Unbounded_Base_Sequence" << be_uidt_nl << "{" << be_nl - << "public:" << be_idt_nl - << "// = Initialization and termination methods." << be_nl; + << "public:" << be_idt_nl; + // constructor *os << class_name << " (void);" << be_nl; @@ -173,7 +174,7 @@ be_visitor_sequence_ch::gen_unbounded_sequence (be_sequence *node) << "CORBA::Boolean release" << be_uidt_nl << ");" << be_uidt << be_uidt_nl; - *os << "};" << be_nl; + *os << "};"; os->gen_endif (); // endif macro 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 9c558ec65bc..2188643ffe8 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 @@ -95,17 +95,16 @@ be_visitor_sequence_ci::gen_unbounded_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CI); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // Static operations // allocbuf - *os << "// = Static operations." << be_nl - << "ACE_INLINE "; + *os << be_nl << be_nl + << "ACE_INLINE" << be_nl; // the accept is here the first time used and if an // error occurs, it will occur here. Later no check // for errors will be done. @@ -120,7 +119,6 @@ be_visitor_sequence_ci::gen_unbounded_sequence (be_sequence *node) *os << " *" << be_nl << full_class_name << "::allocbuf (CORBA::ULong size)" << be_nl - << "// Allocate storage for the sequence." << be_nl << "{" << be_idt_nl; bt->accept (&visitor); @@ -135,13 +133,13 @@ be_visitor_sequence_ci::gen_unbounded_sequence (be_sequence *node) << "}" << be_nl << be_nl; - *os << "ACE_INLINE void " + *os << "ACE_INLINE" << be_nl + << "void " << full_class_name << "::freebuf ("; bt->accept (&visitor); *os << " *buffer)" << be_nl - << "// Free the sequence." << be_nl << "{" << be_idt_nl << "delete [] buffer;" << be_uidt_nl << "}" << be_nl @@ -150,15 +148,15 @@ be_visitor_sequence_ci::gen_unbounded_sequence (be_sequence *node) // constructor *os << "ACE_INLINE" << be_nl << full_class_name << "::" << class_name - << " (void) // Default constructor." << be_nl + << " (void)" << be_nl << "{" << be_nl << "}" << be_nl << be_nl; // constructor *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name << " (CORBA::ULong maximum) " - << "// Constructor using a maximum length value." << be_idt_nl + << full_class_name << "::" << class_name + << " (CORBA::ULong maximum) " << be_idt_nl << ": TAO_Unbounded_Base_Sequence (maximum, " << class_name << "::allocbuf (maximum))" << be_uidt_nl @@ -168,179 +166,195 @@ be_visitor_sequence_ci::gen_unbounded_sequence (be_sequence *node) // constructor *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name - << " (CORBA::ULong maximum," << be_idt_nl + << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "CORBA::ULong maximum," << be_nl << "CORBA::ULong length," << be_nl; bt->accept (&visitor); *os << " *data," << be_nl - << "CORBA::Boolean release)" << be_uidt_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_nl << ": TAO_Unbounded_Base_Sequence (maximum, length, data, release)" - << be_nl + << be_uidt_nl << "{" << be_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // constructor *os << "ACE_INLINE" << be_nl - << full_class_name << "::" << class_name << " (const " - << class_name << " &rhs)" << be_nl - << "// Copy constructor." << be_idt_nl; + << full_class_name << "::" << class_name << " (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_nl; *os << ": TAO_Unbounded_Base_Sequence (rhs)" << be_uidt_nl << "{" << be_idt_nl - << "if (rhs.buffer_ != 0)" << be_nl + << "if (rhs.buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<" *tmp1 = " << class_name << "::allocbuf (this->maximum_);" << be_nl; + *os <<" *tmp1 =" << be_idt_nl + << class_name << "::allocbuf (this->maximum_);" << be_uidt_nl; bt->accept (&visitor); - *os << " * const tmp2 = ACE_reinterpret_cast ("; + *os << " * const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_nl - << be_nl - << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl; + *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_uidt_nl << be_nl + << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl + << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_array) { bt->accept (&visitor); - *os << "_var::copy (tmp1[i], tmp2[i]);" << be_uidt_nl; + *os << "_var::copy (tmp1[i], tmp2[i]);"; } else { - *os << "tmp1[i] = tmp2[i];" << be_uidt_nl; + *os << "tmp1[i] = tmp2[i];"; } + *os << be_uidt_nl + << "}" << be_uidt_nl; + *os << be_nl << "this->buffer_ = tmp1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl << "this->buffer_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; // operator = - *os << "ACE_INLINE " << full_class_name << " &" << be_nl - << full_class_name << "::operator= (const " << class_name << " &rhs)" << be_nl - << "// Assignment operator." << be_nl + *os << "ACE_INLINE" << be_nl + << full_class_name << " &" << be_nl + << full_class_name << "::operator= (" << be_idt << be_idt_nl + << "const " + << class_name << " &rhs" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl << "if (this == &rhs)" << be_idt_nl + << "{" << be_idt_nl << "return *this;" << be_uidt_nl - << be_nl - << "if (this->release_)" << be_nl + << "}" << be_uidt_nl << be_nl + << "if (this->release_)" << be_idt_nl << "{" << be_idt_nl - << "if (this->maximum_ < rhs.maximum_)" << be_nl + << "if (this->maximum_ < rhs.maximum_)" << be_idt_nl << "{" << be_idt_nl - << "// free the old buffer" << be_nl; + << "// Free the old buffer." << be_nl; bt->accept (&visitor); - *os <<" *tmp = ACE_reinterpret_cast ("; + *os <<" *tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " *, this->buffer_);" << be_nl - << class_name << "::freebuf (tmp);" << be_nl - << "this->buffer_ = " << class_name - << "::allocbuf (rhs.maximum_);" << be_uidt_nl + *os << " *, this->buffer_);" << be_uidt_nl << be_nl + << class_name << "::freebuf (tmp);" << be_nl << be_nl + << "this->buffer_ =" << be_idt_nl + << class_name + << "::allocbuf (rhs.maximum_);" << be_uidt << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl << "else" << be_idt_nl - << "this->buffer_ = " << class_name - << "::allocbuf (rhs.maximum_);" << be_uidt_nl - << be_nl - << "TAO_Unbounded_Base_Sequence::operator= (rhs);" << be_nl - << be_nl; + << "{" << be_idt_nl + << "this->buffer_ =" << be_idt_nl + << class_name + << "::allocbuf (rhs.maximum_);" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "TAO_Unbounded_Base_Sequence::operator= (rhs);" << be_nl << be_nl; bt->accept (&visitor); - *os <<" *tmp1 = ACE_reinterpret_cast ("; + *os <<" *tmp1 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " *, this->buffer_);" << be_nl; + *os << " *, this->buffer_);" << be_uidt_nl; bt->accept (&visitor); - *os <<" * const tmp2 = ACE_reinterpret_cast ("; + *os <<" * const tmp2 =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_nl - << be_nl - << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl; + *os << " * ACE_CAST_CONST, rhs.buffer_);" << be_uidt_nl << be_nl + << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl + << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_array) { bt->accept (&visitor); - *os << "_var::copy (tmp1[i], tmp2[i]);" << be_uidt_nl; + *os << "_var::copy (tmp1[i], tmp2[i]);"; } else { - *os << "tmp1[i] = tmp2[i];" << be_uidt_nl; + *os << "tmp1[i] = tmp2[i];"; } + *os << be_uidt_nl + << "}" << be_uidt_nl; + *os << be_nl << "return *this;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // Accessors *os << "// = Accessors." << be_nl; - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; bt->accept (&visitor); *os <<" &" << be_nl << full_class_name << "::operator[] (CORBA::ULong i)" << be_nl - << "// operator []" << be_nl << "{" << be_idt_nl << "ACE_ASSERT (i < this->maximum_);" << be_nl; bt->accept (&visitor); - *os <<"* tmp = ACE_reinterpret_cast("; + *os <<"* tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "*,this->buffer_);" << be_nl + *os << "*, this->buffer_);" << be_uidt_nl << "return tmp[i];" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // operator[] - *os << "ACE_INLINE const "; + *os << "ACE_INLINE" << be_nl + << "const "; bt->accept (&visitor); *os << " &" << be_nl << full_class_name << "::operator[] (CORBA::ULong i) const" << be_nl - << "// operator []" << be_nl << "{" << be_idt_nl << "ACE_ASSERT (i < this->maximum_);" << be_nl; bt->accept (&visitor); - *os <<" * const tmp = ACE_reinterpret_cast ("; + *os <<" * const tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "* ACE_CAST_CONST, this->buffer_);" << be_nl + *os << "* ACE_CAST_CONST, this->buffer_);" << be_uidt_nl << "return tmp[i];" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // Implement the TAO_Base_Sequence methods (see Sequence.h) *os << "// Implement the TAO_Base_Sequence methods (see Sequence.h)" << be_nl << be_nl; - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; bt->accept (&visitor); @@ -350,89 +364,94 @@ be_visitor_sequence_ci::gen_unbounded_sequence (be_sequence *node) bt->accept (&visitor); - *os <<" *result = 0;" << be_nl - << "if (orphan == 0)" << be_nl + *os <<" *result = 0;" << be_nl << be_nl + << "if (orphan == 0)" << be_idt_nl << "{" << be_idt_nl << "// We retain ownership." << be_nl - << "if (this->buffer_ == 0)" << be_nl + << "if (this->buffer_ == 0)" << be_idt_nl << "{" << be_idt_nl - << "result = " << class_name << "::allocbuf (this->length_);" << be_nl + << "result =" << be_idt_nl + << class_name << "::allocbuf (this->length_);" << be_uidt_nl << "this->buffer_ = result;" << be_nl << "this->release_ = 1;" << be_uidt_nl - << "}" << be_nl - << "else" << be_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl << "{" << be_idt_nl - << "result = ACE_reinterpret_cast ("; + << "result =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "*, this->buffer_);" << be_uidt_nl + *os << "*, this->buffer_);" << be_uidt << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl - << "}" << be_nl - << "else // if (orphan == 1)" << be_nl + << "else // if (orphan == 1)" << be_idt_nl << "{" << be_idt_nl - << "if (this->release_ != 0)" << be_nl + << "if (this->release_ != 0)" << be_idt_nl << "{" << be_idt_nl - << "// We set the state back to default and relinquish" << be_nl - << "// ownership." << be_nl - << "result = ACE_reinterpret_cast("; + << "// We set the state back to default and relinquish ownership." + << be_nl + << "result =" << be_idt_nl + << "ACE_reinterpret_cast("; bt->accept (&visitor); - *os << "*,this->buffer_);" << be_nl + *os << "*,this->buffer_);" << be_uidt_nl << "this->maximum_ = 0;" << be_nl << "this->length_ = 0;" << be_nl << "this->buffer_ = 0;" << be_nl << "this->release_ = 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return result;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // get_buffer - *os << "ACE_INLINE const "; + *os << "ACE_INLINE" << be_nl; bt->accept (&visitor); *os << " *" << be_nl << full_class_name << "::get_buffer (void) const" << be_nl << "{" << be_idt_nl - << "return ACE_reinterpret_cast(const "; + << "return ACE_reinterpret_cast (const "; bt->accept (&visitor); *os << " * ACE_CAST_CONST, this->buffer_);" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // replace - *os << "ACE_INLINE void" << be_nl - << full_class_name << "::replace (CORBA::ULong max," << be_nl + *os << "ACE_INLINE" << be_nl + << "void" << be_nl + << full_class_name << "::replace (" << be_idt << be_idt_nl + << "CORBA::ULong max," << be_nl << "CORBA::ULong length," << be_nl; bt->accept (&visitor); *os <<" *data," << be_nl - << "CORBA::Boolean release)" << be_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl << "this->maximum_ = max;" << be_nl - << "this->length_ = length;" << be_nl - << "if (this->buffer_ && this->release_ == 1)" << be_nl + << "this->length_ = length;" << be_nl << be_nl + << "if (this->buffer_ && this->release_ == 1)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<" *tmp = ACE_reinterpret_cast("; + *os <<" *tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << "*,this->buffer_);" << be_nl + *os << "*, this->buffer_);" << be_uidt_nl << class_name << "::freebuf (tmp);" << be_uidt_nl - << "}" << be_nl + << "}" << be_uidt_nl << be_nl << "this->buffer_ = data;" << be_nl << "this->release_ = release;" << be_uidt_nl - << "}" << be_nl; + << "}"; os->gen_endif (); // endif macro 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 23546d87070..73ee3a5822d 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 @@ -97,15 +97,15 @@ be_visitor_sequence_cs::gen_unbounded_sequence (be_sequence *node) ctx.state (TAO_CodeGen::TAO_SEQUENCE_BASE_CS); be_visitor_sequence_base visitor (&ctx); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// "__FILE__ << ":" << __LINE__; os->gen_ifdef_AHETI(); os->gen_ifdef_macro (class_name); - os->indent (); // allocate_buffer - *os << "void" << be_nl + *os << be_nl << be_nl + << "void" << be_nl << full_class_name << "::_allocate_buffer (CORBA::ULong length)" << be_nl << "{" << be_idt_nl; @@ -114,65 +114,67 @@ be_visitor_sequence_cs::gen_unbounded_sequence (be_sequence *node) *os << "* tmp = 0;" << be_nl << "tmp = " << class_name << "::allocbuf (length);" << be_nl << be_nl - << "if (this->buffer_ != 0)" << be_nl + << "if (this->buffer_ != 0)" << be_idt_nl << "{" << be_idt_nl; bt->accept (&visitor); - *os <<" *old = ACE_reinterpret_cast ("; + *os <<" *old =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " *,this->buffer_);" << be_nl - << be_nl - << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl; + *os << " *, this->buffer_);" << be_uidt_nl << be_nl + << "for (CORBA::ULong i = 0; i < this->length_; ++i)" << be_idt_nl + << "{" << be_idt_nl; if (pt->node_type () == AST_Decl::NT_array) { bt->accept (&visitor); - *os << "_var::copy (tmp[i], old[i]);" << be_uidt_nl; + *os << "_var::copy (tmp[i], old[i]);"; } else { - *os << "tmp[i] = old[i];" << be_uidt_nl; + *os << "tmp[i] = old[i];"; } - *os << be_nl + *os << be_uidt_nl << "}" << be_uidt_nl << be_nl << "if (this->release_)" << be_idt_nl - << class_name << "::freebuf (old);" << be_uidt_nl << be_uidt_nl - << "}" << be_nl + << "{" << be_idt_nl + << class_name << "::freebuf (old);" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "this->buffer_ = tmp;" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}" << be_nl << be_nl; // deallocate_buffer *os << "void" << be_nl << full_class_name << "::_deallocate_buffer (void)" << be_nl << "{" << be_idt_nl << "if (this->buffer_ == 0 || this->release_ == 0)" << be_idt_nl - << "return;" << be_uidt_nl - << be_nl; + << "{" << be_idt_nl + << "return;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; bt->accept (&visitor); - *os <<" *tmp = ACE_reinterpret_cast ("; + *os <<" *tmp =" << be_idt_nl + << "ACE_reinterpret_cast ("; bt->accept (&visitor); - *os << " *,this->buffer_);" << be_nl - << be_nl + *os << " *, this->buffer_);" << be_uidt_nl << class_name << "::freebuf (tmp);" << be_nl << "this->buffer_ = 0;" << be_uidt_nl << "} " << be_nl << be_nl; // destructor - *os << full_class_name << "::~" << class_name << " (void) // Dtor." << be_nl + *os << full_class_name << "::~" << class_name << " (void)" << be_nl << "{" << be_idt_nl << "this->_deallocate_buffer ();" << be_uidt_nl - << "}" << be_nl - << be_nl; + << "}"; os->gen_endif (); // endif macro 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 d21e37a7b34..5f0d748aa38 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp @@ -47,10 +47,13 @@ be_visitor_sequence_ch::gen_base_sequence_class (be_sequence *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// "__FILE__ << ":" << __LINE__; + os->gen_ifdef_AHETI (); // This is the instantiation branch. - *os << node->instance_name (); + *os << be_nl << node->instance_name (); os->gen_else_AHETI (); @@ -364,6 +367,9 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "class " << node->local_name () << ";" << be_nl; // No _var class for anonymous sequences. @@ -376,13 +382,10 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) *os << "// *************************************************************" << be_nl - << "// " << node->local_name () << be_nl + << "// " << node->name () << be_nl << "// *************************************************************" << be_nl << be_nl; - *os << be_nl << "// TAO_IDL - Generated from " << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - // Generate a typedef to a parametrized sequence. *os << "class " << be_global->stub_export_macro () << " " << node->local_name () << " : public "; @@ -396,14 +399,14 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) -1); } - *os << "{" << be_nl + *os << be_nl << "{" << be_nl << "public:" << be_idt_nl - << node->local_name () << " (void); // default ctor" << be_nl; + << node->local_name () << " (void);" << be_nl; // For unbounded sequences, we have a different set of constructors. if (node->unbounded ()) { - *os << node->local_name () << " (CORBA::ULong max); // uses max size" + *os << node->local_name () << " (CORBA::ULong max);" << be_nl; } @@ -435,15 +438,18 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) << "CORBA::Boolean release = 0" << be_uidt_nl << ");" << be_uidt_nl; *os << node->local_name () << " (const " << node->local_name () - << " &); // copy ctor" << be_nl; - *os << "~" << node->local_name () << " (void);" << be_nl - << "static void _tao_any_destructor (void*);" << be_nl; + << " &);" << be_nl; + *os << "~" << node->local_name () << " (void);" << be_nl << be_nl; + + if (be_global->any_support ()) + { + *os << "static void _tao_any_destructor (void*);" << be_nl << be_nl; + } // Generate the _var_type typedef (only if we are not anonymous). if (this->ctx_->tdef () != 0) { - *os << "typedef " << node->local_name () << "_var _var_type;" - << be_nl << be_nl; + *os << "typedef " << node->local_name () << "_var _var_type;"; } // TAO provides extensions for octet sequences, first find out if @@ -479,10 +485,10 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) << ")" << be_uidt_nl << " : " << node->instance_name () << " (length, mb) {}" << "\n" - << "#endif /* TAO_NO_COPY_OCTET_SEQUENCE == 1 */" << be_nl; + << "#endif /* TAO_NO_COPY_OCTET_SEQUENCE == 1 */"; } - *os << be_uidt_nl << "};" << be_nl; + *os << be_uidt_nl << "};"; os->gen_endif (); // Endif macro. @@ -539,6 +545,9 @@ be_visitor_sequence_ch::gen_var_defn (be_sequence *node) "%s_var", node->local_name ()->get_string ()); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "// *************************************************************" << be_nl; *os << "// class " << node->name () << "_var" << be_nl; @@ -573,18 +582,19 @@ be_visitor_sequence_ch::gen_var_defn (be_sequence *node) *os << namebuf << " (" << node->local_name () << " *);" << be_nl; // Copy constructor. - *os << namebuf << " (const " << namebuf << " &);" << be_nl; + *os << namebuf << " (const " << namebuf << " &);"; // Fixed-size base types only. if (bt->size_type () == AST_Type::FIXED) { - *os << "// Fixed-size base types only." << be_nl; + *os << be_nl << be_nl + << "// Fixed-size base types only." << be_nl; *os << namebuf << " (const " << node->local_name () << " &);" << be_nl; } // Destructor. - *os << "~" << namebuf << " (void);" << be_nl; + *os << be_nl << "~" << namebuf << " (void);" << be_nl; *os << be_nl; // Assignment operator from a pointer. @@ -592,33 +602,35 @@ be_visitor_sequence_ch::gen_var_defn (be_sequence *node) << node->local_name () << " *);" << be_nl; // Assignment from _var. - *os << namebuf << " &operator= (const " << namebuf << " &);" << be_nl; + *os << namebuf << " &operator= (const " << namebuf << " &);"; // Fixed-size base types only. if (bt->size_type () == AST_Type::FIXED) { - *os << "// Fixed-size base types only." << be_nl; + *os << be_nl << be_nl + << "// Fixed-size base types only." << be_nl; *os << namebuf << " &operator= (const " << node->local_name () << " &);" << be_nl; } // Arrow operator. - *os << node->local_name () << " *operator-> (void);" << be_nl; + *os << be_nl << node->local_name () << " *operator-> (void);" << be_nl; *os << "const " << node->local_name () - << " *operator-> (void) const;" << be_nl; - *os << be_nl; + << " *operator-> (void) const;" << be_nl << be_nl; // Other extra types (cast operators, [] operator, and others). // Cast operator. *os << "operator const " << node->local_name () << " &() const;" << be_nl; *os << "operator " << node->local_name () << " &();" << be_nl; - *os << "operator " << node->local_name () << " &() const;" << be_nl; + *os << "operator " << node->local_name () << " &() const;"; if (bt->size_type () == AST_Type::VARIABLE) { - *os << "operator " << node->local_name () - << " *&(); // variable-size base types only" << be_nl; + *os << be_nl << be_nl + << "// Variable-size base types only." << be_nl + << "operator " << node->local_name () + << " *&();" << be_nl; } *os << be_nl; @@ -706,7 +718,7 @@ be_visitor_sequence_ch::gen_var_defn (be_sequence *node) *os << "private:" << be_idt_nl; *os << node->local_name () << " *ptr_;" << be_uidt_nl; - *os << "};" << be_nl << be_nl; + *os << "};"; return 0; } @@ -737,6 +749,9 @@ be_visitor_sequence_ch::gen_out_defn (be_sequence *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the out definition (always in the client header). *os << "class " << be_global->stub_export_macro () << " " << namebuf << be_nl; @@ -793,7 +808,7 @@ be_visitor_sequence_ch::gen_out_defn (be_sequence *node) *os << "// Assignment from T_var not allowed." << be_nl; *os << "void operator= (const " << node->local_name () << "_var &);" << be_uidt_nl; - *os << "};" << be_nl << be_nl; + *os << "};"; return 0; } 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 0213f8a7498..44008bf655e 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp @@ -222,11 +222,8 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) -1); } - // Generate the var implementation in the inline file. - os->indent (); - - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" << be_nl; @@ -253,17 +250,21 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) *os << fname << "::" << lname << " (const ::" << fname << " &p)" << be_nl; *os << "{" << be_idt_nl; - *os << "if (p.ptr_)" << be_idt_nl; + *os << "if (p.ptr_)" << be_idt_nl + << "{" << be_idt_nl; *os << "ACE_NEW (this->ptr_, ::" << node->name () - << " (*p.ptr_));" << be_uidt_nl; - *os << "else" << be_nl; - *os << " this->ptr_ = 0;" << be_uidt_nl; + << " (*p.ptr_));" << be_uidt_nl + << "}" << be_uidt_nl; + *os << "else" << be_idt_nl + << "{" << be_idt_nl; + *os << "this->ptr_ = 0;" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl; *os << "}" << be_nl << be_nl; // Fixed-size base types only. if (bt->size_type () == AST_Type::FIXED) { - *os << "// fixed-size base types only" << be_nl; + *os << "// Fixed-size base types only." << be_nl; *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << " (const ::" << node->name () << " &p)" << be_nl; @@ -281,7 +282,8 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) *os << "}" << be_nl << be_nl; // Assignment operator from a pointer. - *os << "ACE_INLINE " << fname << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << fname << " &" << be_nl; *os << fname << "::operator= (" << node->local_name () << " *p)" << be_nl; *os << "{" << be_idt_nl; @@ -291,7 +293,8 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) *os << "}" << be_nl << be_nl; // Assignment operator from _var. - *os << "ACE_INLINE ::" << fname << " &" << be_nl + *os << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl << fname << "::operator= (const ::" << fname << " &p)" << be_nl << "{" << be_idt_nl @@ -304,9 +307,12 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) << "}" << be_uidt_nl << "else" << be_idt_nl << "{" << be_idt_nl - << node->local_name () << " *deep_copy =" << be_idt_nl - << "new " << node->local_name () << " (*p.ptr_);" - << be_uidt_nl << be_nl + << node->local_name () << " *deep_copy = 0;" << be_nl + << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + << "deep_copy," << be_nl + << node->local_name () << " (*p.ptr_)," << be_nl + << "*this" << be_uidt_nl + << ");" << be_uidt_nl << be_nl << "if (deep_copy != 0)" << be_idt_nl << "{" << be_idt_nl << node->local_name () << " *tmp = deep_copy;" << be_nl @@ -317,55 +323,58 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) << "}" << be_uidt << be_uidt_nl << "}" << be_uidt_nl << be_nl << "return *this;" << be_uidt_nl - << "}\n\n"; + << "}" << be_nl << be_nl; // Fixed-size base types only. if (bt->size_type () == AST_Type::FIXED) { - *os << "// fixed-size types only" << be_nl; - *os << "ACE_INLINE ::" << fname << " &" << be_nl; + *os << "// Fixed-size types only." << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl; *os << fname << "::operator= (const ::" << node->name () << " &p)" << be_nl; *os << "{" << be_idt_nl; - *os << "if (this->ptr_ != &p)" << be_nl; + *os << "if (this->ptr_ != &p)" << be_idt_nl; *os << "{" << be_idt_nl; *os << "delete this->ptr_;" << be_nl; *os << "ACE_NEW_RETURN (this->ptr_, ::" << node->name () << " (p), *this);" << be_uidt_nl; - *os << "}" << be_nl; + *os << "}" << be_uidt_nl << be_nl; *os << "return *this;" << be_uidt_nl; *os << "}" << be_nl << be_nl; } // Two arrow operators. - *os << "ACE_INLINE const ::" << node->name () << " *" << be_nl; + *os << "ACE_INLINE" << be_nl + << "const ::" << node->name () << " *" << be_nl; *os << fname << "::operator-> (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE ::" << node->name () << " *" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << node->name () << " *" << be_nl; *os << fname << "::operator-> (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - // Other extra methods - 3 cast operator (). - *os << "ACE_INLINE " << be_nl; + // Other extra methods - 3 cast operators. + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator const ::" << node->name () << " &() const // cast" << be_nl; *os << "{" << be_idt_nl; *os << "return *this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator ::" << node->name () << " &() // cast " << be_nl; *os << "{" << be_idt_nl; *os << "return *this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator ::" << node->name () << " &() const // cast " << be_nl; *os << "{" << be_idt_nl; @@ -375,7 +384,7 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) // Variable-size base types only. if (bt->size_type () == AST_Type::VARIABLE) { - *os << "// variable-size types only" << be_nl; + *os << "// Variable-size types only." << be_nl; *os << "ACE_INLINE" << be_nl; *os << fname << "::operator ::" << node->name () << " *&() // cast " << be_nl; @@ -387,7 +396,7 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) // The [] operators. // Non-const. - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI); @@ -443,7 +452,8 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) && pdt != AST_PredefinedType::PT_object) { // Const. - *os << "ACE_INLINE const "; + *os << "ACE_INLINE" << be_nl + << "const "; if (bt->accept (&sr_visitor) == -1) { @@ -475,20 +485,22 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) } // in, inout, out, and _retn. - *os << "ACE_INLINE const ::" << node->name () << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << "const ::" << node->name () << " &" << be_nl; *os << fname << "::in (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return *this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE ::" << node->name () << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << node->name () << " &" << be_nl; *os << fname << "::inout (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return *this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "// mapping for variable size " << be_nl; - *os << "ACE_INLINE ::" << node->name () << " *&" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << node->name () << " *&" << be_nl; *os << fname << "::out (void)" << be_nl; *os << "{" << be_idt_nl; *os << "delete this->ptr_;" << be_nl; @@ -496,7 +508,8 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; - *os << "ACE_INLINE ::" << node->name () << " *" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << node->name () << " *" << be_nl; *os << fname << "::_retn (void)" << be_nl; *os << "{" << be_idt_nl; *os << "::" << node->name () << " *tmp = this->ptr_;" << be_nl; @@ -505,11 +518,12 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) *os << "}" << be_nl << be_nl; // The additional ptr () member function. - *os << "ACE_INLINE ::" << node->name () << " *" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << node->name () << " *" << be_nl; *os << fname << "::ptr (void) const" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}"; return 0; } @@ -549,12 +563,8 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node) "Bad element type\n"), -1); } - // Generate the out implementation in the inline file. - - os->indent (); - - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" << be_nl; @@ -574,7 +584,7 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node) // Constructor from _var &. *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << " (" << node->local_name () - << "_var &p) // constructor from _var" << be_nl; + << "_var &p)" << be_nl; *os << " : ptr_ (p.out ())" << be_nl; *os << "{" << be_idt_nl; *os << "delete this->ptr_;" << be_nl; @@ -584,13 +594,14 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node) // Copy constructor. *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << " (const ::" << fname - << " &p) // copy constructor" << be_nl; + << " &p)" << be_nl; *os << " : ptr_ (ACE_const_cast (" << lname << "&, p).ptr_)" << be_nl; *os << "{}" << be_nl << be_nl; // Assignment operator from _out &. - *os << "ACE_INLINE ::" << fname << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl; *os << fname << "::operator= (const ::" << fname << " &p)" << be_nl; *os << "{" << be_idt_nl; @@ -602,7 +613,8 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node) // Assignment from _var is not allowed by a private declaration. // Assignment operator from pointer. - *os << "ACE_INLINE ::" << fname << " &" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << fname << " &" << be_nl; *os << fname << "::operator= (" << node->local_name () << " *p)" << be_nl; *os << "{" << be_idt_nl; @@ -611,7 +623,7 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node) *os << "}" << be_nl << be_nl; // Other extra methods - cast operator (). - *os << "ACE_INLINE " << be_nl; + *os << "ACE_INLINE" << be_nl; *os << fname << "::operator ::" << node->name () << " *&() // cast" << be_nl; *os << "{" << be_idt_nl; @@ -619,21 +631,23 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node) *os << "}" << be_nl << be_nl; // ptr function. - *os << "ACE_INLINE ::" << node->name () << " *&" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << node->name () << " *&" << be_nl; *os << fname << "::ptr (void) // ptr" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; // operator ->. - *os << "ACE_INLINE ::" << node->name () << " *" << be_nl; + *os << "ACE_INLINE" << be_nl + << "::" << node->name () << " *" << be_nl; *os << fname << "::operator-> (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; *os << "}" << be_nl << be_nl; // Sequence has an additional method. - *os << "ACE_INLINE "; + *os << "ACE_INLINE" << be_nl; be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI); @@ -652,7 +666,7 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node) *os << fname << "::operator[] (CORBA::ULong index)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_->operator[] (index);" << be_uidt_nl; - *os << "}\n\n"; + *os << "}"; return 0; } 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 5677be4cf09..2c04fcf5514 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp @@ -50,13 +50,10 @@ be_visitor_sequence_cs::gen_base_sequence_class (be_sequence *node) -1); } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - os->gen_ifdef_AHETI(); // This is the instantiation branch. - *os << node->instance_name (); + *os << be_nl << node->instance_name (); os->gen_else_AHETI(); @@ -209,7 +206,7 @@ be_visitor_sequence_cs::gen_base_sequence_class (be_sequence *node) } } - os->gen_endif_AHETI(); + os->gen_endif_AHETI (); return 0; } @@ -249,7 +246,7 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) "Bad element type\n"), -1); } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" @@ -260,13 +257,14 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) // default constructor *os << node->name () << "::" << node->local_name () << " (void)" << be_nl - << "{}" << be_nl; + << "{}"; // for unbounded sequences, we have a different set of constructors if (node->unbounded ()) { - *os << node->name () << "::" << node->local_name () - << " (CORBA::ULong max) // uses max size" << be_nl + *os << be_nl << be_nl + << node->name () << "::" << node->local_name () + << " (CORBA::ULong max)" << be_nl << " : "; // pass it to the base constructor @@ -279,19 +277,23 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) } - *os << " (max)" << be_nl - << "{}" << be_nl; + *os << be_nl << " (max)" << be_nl + << "{}"; } // constructor with the buffer - *os << node->name () << "::" << node->local_name () << " ("; + *os << be_nl << be_nl + << node->name () << "::" << node->local_name () << " (" + << be_idt << be_idt_nl; if (node->unbounded ()) { - *os << "CORBA::ULong max, "; // unbounded seq takes this extra parameter + // Unbounded seq takes this extra parameter. + *os << "CORBA::ULong max," << be_nl; } - *os << "CORBA::ULong length, "; + *os << "CORBA::ULong length," << be_nl; + // generate the base type for the buffer be_visitor_context ctx (*this->ctx_); ctx.state (TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CS); @@ -306,7 +308,9 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) -1); } - *os << " *buffer, CORBA::Boolean release)" << be_nl + *os << " *buffer," << be_nl + << "CORBA::Boolean release" << be_uidt_nl + << ")" << be_uidt_nl << " : "; // Pass it to the base constructor. @@ -319,7 +323,7 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) -1); } - *os << " ("; + *os << be_nl << " ("; if (node->unbounded ()) { @@ -327,12 +331,12 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) } *os << "length, buffer, release)" << be_nl - << "{}" << be_nl; + << "{}"; // Copy constructor. - *os << node->name () << "::" << node->local_name () + *os << be_nl << be_nl << node->name () << "::" << node->local_name () << " (const " << node->local_name () - << " &seq) // copy ctor" << be_nl + << " &seq)" << be_nl << " : "; // Pass it to the base constructor. @@ -345,21 +349,27 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) -1); } - *os << " (seq)" << be_nl - << "{}" << be_nl; + *os << be_nl << " (seq)" << be_nl + << "{}"; // Destructor. - *os << node->name () << "::~" << node->local_name () + *os << be_nl << be_nl + << node->name () << "::~" << node->local_name () << " (void) // dtor" << be_nl - << "{}" << be_nl - << "void " - << node->name () << "::_tao_any_destructor (void *_tao_void_pointer)" - << be_nl - << "{" << be_idt_nl - << node->local_name () << " *tmp = ACE_static_cast (" - << node->local_name () << "*, _tao_void_pointer);" << be_nl - << "delete tmp;" << be_uidt_nl - << "}\n\n"; + << "{}" << be_nl << be_nl; + + + if (be_global->any_support ()) + { + *os << "void " + << node->name () << "::_tao_any_destructor (void *_tao_void_pointer)" + << be_nl + << "{" << be_idt_nl + << node->local_name () << " *tmp = ACE_static_cast (" + << node->local_name () << "*, _tao_void_pointer);" << be_nl + << "delete tmp;" << be_uidt_nl + << "}"; + } os->gen_endif (); node->cli_stub_gen (1); 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 20dc1453dfe..71fb70136b9 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 @@ -48,8 +48,8 @@ be_visitor_structure_any_op_ch::visit_structure (be_structure *node) TAO_OutStream *os = this->ctx_->stream (); - // Generate the Any <<= and >>= operator declarations. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, const " << node->name () @@ -62,7 +62,7 @@ be_visitor_structure_any_op_ch::visit_structure (be_structure *node) << node->name () << " *&); // deprecated\n"; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, const " - << node->name () << " *&);\n"; + << node->name () << " *&);"; // All we have to do is to visit the scope and generate code. 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 b7aafca737d..7690c64610e 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 @@ -49,14 +49,10 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - // Any <<= and >>= operators. - - os->indent (); - // Copying insertion oeprator. *os << "// Copying insertion." << be_nl @@ -241,7 +237,7 @@ be_visitor_structure_any_op_cs::visit_structure (be_structure *node) << "}" << be_nl << "ACE_ENDTRY;" << be_nl << be_nl << "return 0;" << be_uidt_nl - << "}\n\n"; + << "}"; // all we have to do is to visit the scope and generate code if (this->visit_scope (node) == -1) 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 4185d0e2669..3aca186bbb9 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 @@ -50,15 +50,15 @@ be_visitor_structure_cdr_op_ch::visit_structure (be_structure *node) TAO_OutStream *os = this->ctx_->stream (); - // Generate the CDR << and >> operator declarations. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const " << node->name () << " &);" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>> (TAO_InputCDR &, " - << node->name () << " &);\n"; + << node->name () << " &);"; // Set the substate as generating code for the types defined in our scope. 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 0b273e9ebb3..5702ae974a9 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 @@ -67,7 +67,7 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) -1); } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Set the sub state as generating code for the output operator. @@ -137,7 +137,7 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) << "{" << be_idt_nl << "return 0;" << be_uidt_nl << "}" << be_uidt << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; node->cli_inline_cdr_op_gen (1); return 0; 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 bb5fce26466..e45e7cc5b61 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_ch.cpp @@ -38,85 +38,93 @@ be_visitor_structure_ch::~be_visitor_structure_ch (void) // Visit the Structure node and its scope. int be_visitor_structure_ch::visit_structure (be_structure *node) { - TAO_OutStream *os; - - if (!node->cli_hdr_gen () && !node->imported ()) + if (node->cli_hdr_gen () || node->imported ()) { - os = this->ctx_->stream (); + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - *os << "class " << node->local_name () << "_var;" << be_nl << be_nl; + *os << "class " << node->local_name () << "_var;" << be_nl << be_nl; - *os << "struct " << be_global->stub_export_macro () << " " - << node->local_name () << be_nl - << "{" << be_idt_nl; + *os << "struct " << be_global->stub_export_macro () << " " + << node->local_name () << be_nl + << "{" << be_idt_nl; - // Generate the _ptr_type and _var_type typedefs. - *os << "typedef " << node->local_name () << "_var _var_type;" - << be_nl; + // Generate the _ptr_type and _var_type typedefs. + *os << "typedef " << node->local_name () << "_var _var_type;" + << be_nl << be_nl; - *os << "static void _tao_any_destructor (void*);" + if (be_global->any_support ()) + { + *os << "static void _tao_any_destructor (void *);" << be_nl << be_nl; + } + + // Generate code for field members. + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_structure_ch::" + "visit_structure - " + "codegen for scope failed\n"), + -1); + } - // Generate code for field members. - if (this->visit_scope (node) == -1) + *os << be_uidt_nl; + *os << "};"; + + // Generate var definition. + if (node->gen_var_defn () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_structure_ch::" + "visit_structure - " + "codegen for _var failed\n"), + -1); + } + + // A class is generated for an out defn only for a variable + // length struct. + if (node->size_type () == AST_Type::VARIABLE) + { + if (node->gen_out_defn () == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_ch::" "visit_structure - " - "codegen for scope failed\n"), + "codegen for _out failed\n"), -1); } + } + else + { + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - *os << be_uidt_nl; - *os << "};" << be_nl << be_nl; + *os << "typedef " << node->local_name () << " &" + << node->local_name () << "_out;"; + } - // Generate var definition. - if (node->gen_var_defn () == -1) + if (be_global->tc_support ()) + { + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL); + be_visitor_typecode_decl visitor (&ctx); + + if (node->accept (&visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_ch::" "visit_structure - " - "codegen for _var failed\n"), + "TypeCode declaration failed\n"), -1); } - - // A class is generated for an out defn only for a variable - // length struct. - if (node->size_type () == AST_Type::VARIABLE) - { - if (node->gen_out_defn () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_structure_ch::" - "visit_structure - " - "codegen for _out failed\n"), - -1); - } - } - else - { - *os << "typedef " << node->local_name () << " &" - << node->local_name () << "_out;" << be_nl << be_nl; - } - - if (be_global->tc_support ()) - { - be_visitor_context ctx (*this->ctx_); - ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL); - be_visitor_typecode_decl visitor (&ctx); - - if (node->accept (&visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_structure_ch::" - "visit_structure - " - "TypeCode declaration failed\n"), - -1); - } - } - - node->cli_hdr_gen (I_TRUE); } + node->cli_hdr_gen (I_TRUE); return 0; } 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 e17860f3972..1e096bf1bbb 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp @@ -38,28 +38,36 @@ be_visitor_structure_cs::~be_visitor_structure_cs (void) int be_visitor_structure_cs::visit_structure (be_structure *node) { - if (!node->cli_stub_gen () && !node->imported ()) + if (node->cli_stub_gen () || node->imported ()) { - if (be_global->tc_support ()) - { - be_visitor_context ctx (*this->ctx_); - ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN); - ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE); - be_visitor_typecode_defn visitor (&ctx); + return 0; + } + + if (be_global->tc_support ()) + { + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_TYPECODE_DEFN); + ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE); + be_visitor_typecode_defn visitor (&ctx); - if (visitor.visit_structure (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_structure_cs::" - "visit_structure - " - "TypeCode definition failed\n"), - -1); - } + if (visitor.visit_structure (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_structure_cs::" + "visit_structure - " + "TypeCode definition failed\n"), + -1); } + } + + TAO_OutStream *os = this->ctx_->stream (); - TAO_OutStream *os = this->ctx_->stream (); - os->indent (); + *os << be_nl << be_nl; + *os << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + if (be_global->any_support ()) + { *os << "void " << node->name () << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl @@ -67,22 +75,20 @@ be_visitor_structure_cs::visit_structure (be_structure *node) << node->local_name () << " *tmp = ACE_static_cast (" << node->local_name () << "*, _tao_void_pointer);" << be_nl << "delete tmp;" << be_uidt_nl - << "}\n\n"; - - // Do any code generation required for the scope members - // all we have to do is to visit the scope. - if (this->visit_scope (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_structure_cs::" - "visit_structure - " - "codegen for scope failed\n"), - -1); - } + << "}"; + } - node->cli_stub_gen (I_TRUE); + // Do any code generation required for the scope members + // all we have to do is to visit the scope. + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_structure_cs::" + "visit_structure - " + "codegen for scope failed\n"), + -1); } + node->cli_stub_gen (I_TRUE); return 0; - } diff --git a/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp index c923cfa3987..a60ed387127 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure_fwd/structure_fwd_ch.cpp @@ -37,6 +37,11 @@ be_visitor_structure_fwd_ch::~be_visitor_structure_fwd_ch (void) int be_visitor_structure_fwd_ch::visit_structure_fwd (be_structure_fwd *node) { + if (node->cli_hdr_gen () || node->imported ()) + { + return 0; + } + TAO_OutStream *os = this->ctx_->stream (); if (node->cli_hdr_gen () || node->imported ()) @@ -44,10 +49,13 @@ be_visitor_structure_fwd_ch::visit_structure_fwd (be_structure_fwd *node) return 0; } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Generate a forward declaration of the class. - *os << "struct " << node->local_name () << ";" << be_nl; + *os << be_nl << be_nl + << "struct " << node->local_name () << ";"; node->cli_hdr_gen (I_TRUE); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode.cpp index 9f39e9c258a..25fef2fdded 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode.cpp @@ -24,6 +24,7 @@ #include "be_exception.h" #include "be_field.h" #include "be_interface.h" +#include "be_component.h" #include "be_module.h" #include "be_predefined_type.h" #include "be_sequence.h" @@ -34,6 +35,7 @@ #include "be_union.h" #include "be_union_branch.h" #include "be_valuetype.h" +#include "be_eventtype.h" #include "be_helper.h" #include "be_extern.h" #include "utl_identifier.h" 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 5b371afd375..b51004f3d57 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp @@ -40,7 +40,7 @@ be_visitor_typecode_decl::visit_type (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; if (node->is_nested ()) @@ -60,7 +60,7 @@ be_visitor_typecode_decl::visit_type (be_type *node) *os << "::CORBA::TypeCode_ptr " << node->tc_name ()->last_component () - << ";" << be_nl << be_nl; + << ";"; } else { @@ -68,7 +68,7 @@ be_visitor_typecode_decl::visit_type (be_type *node) *os << "extern " << be_global->stub_export_macro () << " ::CORBA::TypeCode_ptr " << " " << node->tc_name ()->last_component () - << ";" << be_nl << be_nl; + << ";"; } return 0; @@ -99,6 +99,12 @@ be_visitor_typecode_decl::visit_interface (be_interface *node) } int +be_visitor_typecode_decl::visit_component (be_component *node) +{ + return this->visit_type (node); +} + +int be_visitor_typecode_decl::visit_sequence (be_sequence *node) { return this->visit_type (node); @@ -127,3 +133,9 @@ be_visitor_typecode_decl::visit_valuetype (be_valuetype *node) { return this->visit_type (node); } + +int +be_visitor_typecode_decl::visit_eventtype (be_eventtype *node) +{ + return this->visit_type (node); +} 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 4a751e67e70..1460c765bb9 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp @@ -250,7 +250,7 @@ be_visitor_typecode_defn::gen_nested_namespace_end (be_module *node) if (ACE_OS::strcmp (i.item ()->get_string (), "") != 0) { // Leave the outermost root scope. - *os << "TAO_NAMESPACE_END" << be_nl; + *os << "TAO_NAMESPACE_END"; } } @@ -280,7 +280,7 @@ be_visitor_typecode_defn::visit_type (be_type *node) -1); } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; os->indent (); // start from current indentation level @@ -311,6 +311,7 @@ be_visitor_typecode_defn::visit_type (be_type *node) "codegen for typecode encapsulation failed\n"), -1); } + *os << be_uidt << "};" << be_nl << be_nl; // Type code definition. @@ -338,6 +339,12 @@ be_visitor_typecode_defn::visit_type (be_type *node) case AST_Decl::NT_valuetype: *os << "CORBA::tk_value"; break; + case AST_Decl::NT_eventtype: + *os << "CORBA::tk_event"; + break; + case AST_Decl::NT_component: + *os << "CORBA::tk_component"; + break; case AST_Decl::NT_sequence: *os << "CORBA::tk_sequence"; break; @@ -411,8 +418,6 @@ be_visitor_typecode_defn::visit_type (be_type *node) "Error parsing nested name\n"), -1); } - - *os << be_nl; } else { @@ -428,7 +433,7 @@ be_visitor_typecode_defn::visit_type (be_type *node) // Flat name generation. *os << node->flat_name (); - *os << ";" << be_uidt_nl << "\n"; + *os << ";" << be_uidt; } return 0; @@ -604,6 +609,12 @@ be_visitor_typecode_defn::visit_interface (be_interface *node) } int +be_visitor_typecode_defn::visit_component (be_component *node) +{ + return this->visit_interface (node); +} + +int be_visitor_typecode_defn::visit_interface_fwd (be_interface_fwd *) { // nothing to do @@ -834,6 +845,12 @@ be_visitor_typecode_defn::visit_valuetype (be_valuetype *node) } int +be_visitor_typecode_defn::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + +int be_visitor_typecode_defn::visit_union_branch (be_union_branch *node) { switch (this->ctx_->sub_state ()) 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 87f974ce764..52b4d1035e8 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp @@ -59,7 +59,7 @@ be_visitor_typedef_ch::visit_typedef (be_typedef *node) // the type maybe. In the latter, we just need typedefs for the type and all // associated _var, _out, and other types. - be_type *bt; // base type + be_type *bt; if (this->ctx_->tdef ()) { @@ -184,6 +184,9 @@ be_visitor_typedef_ch::visit_array (be_array *node) } else { + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Base type is simply an alias to an array node. Simply output the // required typedefs. @@ -219,7 +222,7 @@ be_visitor_typedef_ch::visit_array (be_array *node) *os << tdef->nested_type_name (scope, "_slice") << " *_tao_from);" << be_nl; // _free *os << "ACE_INLINE void " << tdef->nested_type_name (scope, "_free") << " ("; - *os << tdef->nested_type_name (scope, "_slice") << " *_tao_slice);" << be_nl; + *os << tdef->nested_type_name (scope, "_slice") << " *_tao_slice);"; } return 0; @@ -256,12 +259,15 @@ be_visitor_typedef_ch::visit_enum (be_enum *node) } } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // typedef the type and the _slice type. *os << "typedef " << bt->nested_type_name (scope) << " " << tdef->nested_type_name (scope) << ";" << be_nl; // Typedef the _out *os << "typedef " << bt->nested_type_name (scope, "_out") - << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + << " " << tdef->nested_type_name (scope, "_out") << ";"; return 0; } @@ -284,6 +290,9 @@ be_visitor_typedef_ch::visit_interface (be_interface *node) bt = node; } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Typedef the object. *os << "typedef " << bt->nested_type_name (scope) << " " << tdef->nested_type_name (scope) << ";" << be_nl; @@ -298,7 +307,7 @@ be_visitor_typedef_ch::visit_interface (be_interface *node) // typedef the _out *os << "typedef " << bt->nested_type_name (scope, "_out") - << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + << " " << tdef->nested_type_name (scope, "_out") << ";"; return 0; } @@ -321,6 +330,9 @@ be_visitor_typedef_ch::visit_predefined_type (be_predefined_type *node) bt = node; } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Typedef the type. *os << "typedef " << bt->nested_type_name (scope) << " " << tdef->nested_type_name (scope) << ";" << be_nl; @@ -340,7 +352,7 @@ be_visitor_typedef_ch::visit_predefined_type (be_predefined_type *node) // Typedef the _out. *os << "typedef " << bt->nested_type_name (scope, "_out") - << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + << " " << tdef->nested_type_name (scope, "_out") << ";"; return 0; } @@ -352,6 +364,9 @@ be_visitor_typedef_ch::visit_string (be_string *node) be_typedef *tdef = this->ctx_->tdef (); be_decl *scope = this->ctx_->scope (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + if (node->width () == (long) sizeof (char)) { *os << "typedef char *" @@ -360,7 +375,7 @@ be_visitor_typedef_ch::visit_string (be_string *node) *os << "typedef CORBA::String_var" << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl; *os << "typedef CORBA::String_out" - << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + << " " << tdef->nested_type_name (scope, "_out") << ";"; } else { @@ -370,7 +385,7 @@ be_visitor_typedef_ch::visit_string (be_string *node) *os << "typedef CORBA::WString_var" << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl; *os << "typedef CORBA::WString_out" - << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + << " " << tdef->nested_type_name (scope, "_out") << ";"; } return 0; @@ -408,6 +423,9 @@ be_visitor_typedef_ch::visit_sequence (be_sequence *node) } else { + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Typedef the type. *os << "typedef " << bt->nested_type_name (scope) << " " << tdef->nested_type_name (scope) << ";" << be_nl; @@ -415,7 +433,7 @@ be_visitor_typedef_ch::visit_sequence (be_sequence *node) *os << "typedef " << bt->nested_type_name (scope, "_var") << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl; *os << "typedef " << bt->nested_type_name (scope, "_out") - << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + << " " << tdef->nested_type_name (scope, "_out") << ";"; } return 0; @@ -452,6 +470,9 @@ be_visitor_typedef_ch::visit_structure (be_structure *node) } } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Typedef the type. *os << "typedef " << bt->nested_type_name (scope) << " " << tdef->nested_type_name (scope) << ";" << be_nl; @@ -459,7 +480,7 @@ be_visitor_typedef_ch::visit_structure (be_structure *node) *os << "typedef " << bt->nested_type_name (scope, "_var") << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl; *os << "typedef " << bt->nested_type_name (scope, "_out") - << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + << " " << tdef->nested_type_name (scope, "_out") << ";"; return 0; } @@ -495,6 +516,9 @@ be_visitor_typedef_ch::visit_union (be_union *node) } } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Typedef the type. *os << "typedef " << bt->nested_type_name (scope) << " " << tdef->nested_type_name (scope) << ";" << be_nl; @@ -502,7 +526,7 @@ be_visitor_typedef_ch::visit_union (be_union *node) *os << "typedef " << bt->nested_type_name (scope, "_var") << " " << tdef->nested_type_name (scope, "_var") << ";" << be_nl; *os << "typedef " << bt->nested_type_name (scope, "_out") - << " " << tdef->nested_type_name (scope, "_out") << ";" << be_nl; + << " " << tdef->nested_type_name (scope, "_out") << ";"; return 0; } 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 8f1c86c4cbf..2f4286b1328 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 @@ -41,16 +41,15 @@ int be_visitor_union_any_op_ch::visit_union (be_union *node) { if (node->cli_hdr_any_op_gen () - || node->imported () - || node->is_local ()) + || node->imported ()) { return 0; } TAO_OutStream *os = this->ctx_->stream (); - // Generate the Any <<= and >>= operator declarations. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, const " << node->name () @@ -63,7 +62,7 @@ be_visitor_union_any_op_ch::visit_union (be_union *node) << node->name () << " *&); // deprecated\n"; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, const " - << node->name () << " *&);\n"; + << node->name () << " *&);"; if (this->visit_scope (node) == -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 5590f63a5af..22687ddcebb 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 @@ -49,8 +49,9 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) TAO_OutStream *os = this->ctx_->stream (); - // Generate the Any <<= and >>= operator declarations. - os->indent (); + *os << be_nl << be_nl + << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "void operator<<= (" << be_idt << be_idt_nl << "CORBA::Any &_tao_any," << be_nl @@ -232,7 +233,7 @@ be_visitor_union_any_op_cs::visit_union (be_union *node) << "}" << be_nl << "ACE_ENDTRY;" << be_nl << be_nl << "return 0;" << be_uidt_nl - << "}\n\n"; + << "}"; // All we have to do is to visit the scope and generate code. if (this->visit_scope (node) == -1) 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 12169e60ba5..a9f9dfe6b1c 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 @@ -50,15 +50,15 @@ be_visitor_union_cdr_op_ch::visit_union (be_union *node) TAO_OutStream *os = this->ctx_->stream (); - // Generate the CDR << and >> operator declarations. - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const " << node->name () << " &);" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>> (TAO_InputCDR &, " - << node->name () << " &);\n"; + << node->name () << " &);"; // Set the substate as generating code for the types defined in our scope. 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 4c890a6c284..6079009d65c 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 @@ -63,7 +63,7 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Set the sub state as generating code for the output operator. @@ -104,7 +104,7 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) << "}" << be_uidt_nl << be_nl << "CORBA::Boolean result = 1;" << be_nl << be_nl << "switch (_tao_union._d ())" << be_nl - << "{" << be_idt_nl; + << "{" << be_idt; if (this->visit_scope (node) == -1) { @@ -123,8 +123,8 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) // an enum, this does no harm. if (node->default_index () == -1) { - *os << "default:" << be_nl; - *os << "break;"; + *os << be_nl << "default:" << be_idt_nl; + *os << "break;"<< be_uidt; } *os << be_uidt_nl << "}" << be_nl << be_nl @@ -203,7 +203,7 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) *os << be_uidt_nl << "}" << be_nl << be_nl << "return result;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; node->cli_inline_cdr_op_gen (1); return 0; 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 6e376df059f..33b495f6e55 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ch.cpp @@ -79,10 +79,14 @@ be_visitor_union_discriminant_ch::visit_enum (be_enum *node) } } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // The set method. - *os << "void _d (" << bt->nested_type_name (bu) << ");" << be_nl; + *os << be_nl << be_nl + << "void _d (" << bt->nested_type_name (bu) << ");" << be_nl; // The get method. - *os << bt->nested_type_name (bu) << " _d (void) const;" << be_nl; + *os << bt->nested_type_name (bu) << " _d (void) const;"; return 0; } @@ -107,10 +111,14 @@ be_visitor_union_discriminant_ch::visit_predefined_type (be_predefined_type TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // The set method. - *os << "void _d (" << bt->nested_type_name (bu) << ");" << be_nl; + *os << be_nl << be_nl + << "void _d (" << bt->nested_type_name (bu) << ");" << be_nl; // The get method. - *os << bt->nested_type_name (bu) << " _d (void) const;" << be_nl; + *os << bt->nested_type_name (bu) << " _d (void) const;"; return 0; } 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 3e5a4ce5809..dbdc57ed3d1 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/discriminant_ci.cpp @@ -67,15 +67,15 @@ be_visitor_union_discriminant_ci::visit_enum (be_enum *node) -1); } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; 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 - *os << "// the implicit _default () method" << be_nl; - *os << "ACE_INLINE void " << be_nl + // Only if all cases are not covered AND there is no explicit + // default, we get the _default () method. + *os << "ACE_INLINE" << be_nl + << "void " << be_nl << bu->name () << "::_default ()" << be_nl << "{" << be_idt_nl << "this->disc_ = "; @@ -102,25 +102,27 @@ be_visitor_union_discriminant_ci::visit_enum (be_enum *node) // The function value_to_name() takes care of adding // any necessary scoping to the output. *os << node->value_to_name (dv.u.enum_val); - *os << ";" << be_uidt_nl << "}\n\n"; + *os << ";" << be_uidt_nl << "}" << be_nl << be_nl; } // the set method - *os << "// accessor to set the discriminant" << be_nl - << "ACE_INLINE void" << be_nl + *os << "// Accessor to set the discriminant." << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::_d (" << bt->name () << " discval)" << be_nl << "{" << be_idt_nl << "this->disc_ = discval;" << be_uidt_nl - << "}" << be_nl; + << "}" << be_nl << be_nl; // the get method - *os << "// accessor to get the discriminant" << be_nl - << "ACE_INLINE " << bt->name () << be_nl + *os << "// Accessor to get the discriminant." << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << be_nl << bu->name () << "::_d (void) const" << be_nl << "{" << be_idt_nl << "return this->disc_;" << be_uidt_nl - << "}\n\n"; + << "}"; return 0; } @@ -131,7 +133,8 @@ be_visitor_union_discriminant_ci::visit_predefined_type ( ) { be_union *bu = - this->ctx_->be_node_as_union (); // get the enclosing union backend + this->ctx_->be_node_as_union (); + be_type *bt; if (this->ctx_->alias ()) @@ -157,7 +160,7 @@ be_visitor_union_discriminant_ci::visit_predefined_type ( -1); } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; if ((dv.computed_ != 0) && (bu->default_index () == -1)) @@ -165,8 +168,8 @@ be_visitor_union_discriminant_ci::visit_predefined_type ( // Only if all cases are not covered AND there is no explicit // default, we get the _default () method. - *os << "// the implicit _default () method" << be_nl; - *os << "ACE_INLINE void " << be_nl + *os << "ACE_INLINE" << be_nl + << "void " << be_nl << bu->name () << "::_default ()" << be_nl << "{" << be_idt_nl << "this->disc_ = "; @@ -211,27 +214,28 @@ be_visitor_union_discriminant_ci::visit_predefined_type ( -1); } - *os << ";" << be_uidt_nl << "}\n\n"; + *os << ";" << be_uidt_nl << "}"; } - os->indent (); - // The set method. - *os << "// accessor to set the discriminant" << be_nl - << "ACE_INLINE void" << be_nl + *os << be_nl << be_nl + << "// Accessor to set the discriminant." << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::_d (" << bt->name () << " discval)" << be_nl << "{" << be_idt_nl << "this->disc_ = discval;" << be_uidt_nl - << "}" << be_nl; + << "}" << be_nl << be_nl; // The get method. - *os << "// accessor to get the discriminant" << be_nl - << "ACE_INLINE " << bt->name () << be_nl + *os << "// Accessor to get the discriminant." << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << be_nl << bu->name () << "::_d (void) const" << be_nl << "{" << be_idt_nl << "return this->disc_;" << be_uidt_nl - << "}\n\n"; + << "}"; return 0; } 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 7a60fc6bbbb..7614572ec3d 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp @@ -49,13 +49,14 @@ int be_visitor_union_ch::visit_union (be_union *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Generate the ifdefined macro for the union type. os->gen_ifdef_macro (node->flat_name ()); - *os << "class " << node->local_name () << "_var;" << be_nl << be_nl; + *os << be_nl << be_nl + << "class " << node->local_name () << "_var;" << be_nl << be_nl; *os << "class " << be_global->stub_export_macro () << " " << node->local_name () << be_nl @@ -69,12 +70,15 @@ int be_visitor_union_ch::visit_union (be_union *node) // Generate destructor. << "~" << node->local_name () << " (void);" << be_nl; - *os << "static void _tao_any_destructor (void*);" - << be_nl << be_nl; + if (be_global->any_support ()) + { + *os << "static void _tao_any_destructor (void*);" + << be_nl << be_nl; + } // Generate assignment operator. *os << node->local_name () << " &operator= (const " - << node->local_name () << " &);" << be_nl << be_nl; + << node->local_name () << " &);"; // Retrieve the disriminant type. be_type *bt = be_type::narrow_from_decl (node->disc_type ()); @@ -103,9 +107,12 @@ int be_visitor_union_ch::visit_union (be_union *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Generate the _var_type typedef. - *os << "typedef " << node->local_name () << "_var _var_type;" - << be_nl << be_nl; + *os << be_nl << be_nl + << "typedef " << node->local_name () << "_var _var_type;"; // Now generate the public defn for the union branch members. For this, // set our state to reflect what we are aiming to do. @@ -134,9 +141,13 @@ int be_visitor_union_ch::visit_union (be_union *node) if ((dv.computed_ != 0) && (node->default_index () == -1)) { + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Only if all cases are not covered AND there is no explicit // default, we get the _default () method. - *os << "void _default (void);"; + *os << be_nl << be_nl + << "void _default (void);"; } *os << be_uidt_nl; @@ -149,7 +160,7 @@ int be_visitor_union_ch::visit_union (be_union *node) // The members are inside of a union. *os << "union" << be_nl; - *os << "{" << be_idt_nl; + *os << "{" << be_idt; this->ctx_->state (TAO_CodeGen::TAO_UNION_PRIVATE_CH); @@ -163,14 +174,15 @@ int be_visitor_union_ch::visit_union (be_union *node) } *os << be_uidt_nl; - *os << "} u_;" << be_nl << be_nl; + *os << "} u_;"; // The reset method (TAO extension). - *os << "// TAO extension." << be_nl; + *os << be_nl << be_nl + << "// TAO extension - frees any allocated storage." << be_nl; *os << "void _reset (" << bt->nested_type_name (node) - << ", CORBA::Boolean /* finalize */);" << be_nl; - *os << "// Frees any allocated storage." << be_uidt_nl; - *os << "}; //" << node->name () << be_nl << be_nl; + << ", CORBA::Boolean /* finalize */);"; + + *os << be_uidt_nl << "};"; if (be_global->tc_support ()) { @@ -221,8 +233,11 @@ int be_visitor_union_ch::visit_union (be_union *node) } else { - *os << "typedef " << node->local_name () << " &" - << node->local_name () << "_out;" << be_nl << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl << "typedef " << node->local_name () << " &" + << node->local_name () << "_out;"; } os->gen_endif (); 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 fdfac26e17a..245f2931d87 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp @@ -37,90 +37,94 @@ be_visitor_union_ci::~be_visitor_union_ci (void) int be_visitor_union_ci::visit_union (be_union *node) { + if (node->cli_inline_gen () || node->imported ()) + { + return 0; + } + be_visitor_context ctx (*this->ctx_); ctx.node (node); - if (!node->cli_inline_gen () && !node->imported ()) + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << "// *************************************************************" + << be_nl; + *os << "// Inline operations for union " << node->name () << be_nl; + *os << "// *************************************************************"; + + // the discriminant type may have to be defined here if it was an enum + // declaration inside of the union statement. + + be_type *bt = be_type::narrow_from_decl (node->disc_type ()); + + if (!bt) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_union_ci::" + "visit_union - " + "bad discriminant type\n"), + -1); + } + + ctx.state (TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CI); + + be_visitor_union_discriminant_ci visitor (&ctx); + + if (bt->accept (&visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_union_ci::" + "visit union - " + "codegen for discrminant failed\n"), + -1); + } + + // Now generate the implementation of the access methods for the + // union. For this set our state. + this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_CI); + + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_union_ci::" + "visit_union - " + "codegen for scope failed\n"), + -1); + } + + // Generate the ifdefined macro for the array type. + os->gen_ifdef_macro (node->flat_name (), "_var"); + + if (node->gen_var_impl () == -1) { - TAO_OutStream *os = this->ctx_->stream (); - - *os << "// *************************************************************" - << be_nl; - *os << "// Inline operations for union " << node->name () << be_nl; - *os << "// *************************************************************\n\n"; - - // the discriminant type may have to be defined here if it was an enum - // declaration inside of the union statement. - - be_type *bt = be_type::narrow_from_decl (node->disc_type ()); - - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_ci::" - "visit_union - " - "bad discriminant type\n"), - -1); - } - - ctx.state (TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CI); - - be_visitor_union_discriminant_ci visitor (&ctx); - - if (bt->accept (&visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_ci::" - "visit union - " - "codegen for discrminant failed\n"), - -1); - } - - // Now generate the implementation of the access methods for the - // union. For this set our state. - this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_CI); - - if (this->visit_scope (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_ci::" - "visit_union - " - "codegen for scope failed\n"), - -1); - } - - // Generate the ifdefined macro for the array type. - os->gen_ifdef_macro (node->flat_name (), "_var"); - - if (node->gen_var_impl () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_ci::" - "visit_union - " - "codegen for _var failed\n"), - -1); - } - - os->gen_endif (); - - // Generate the ifdefined macro for the array type then generate the - // _out impl - os->gen_ifdef_macro (node->flat_name (), "_out"); - - if (node->size_type () == AST_Type::VARIABLE - && node->gen_out_impl () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_union_ci::" - "visit_union - " - "codegen for _out failed\n"), - -1); - } - - os->gen_endif (); - - node->cli_inline_gen (I_TRUE); + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_union_ci::" + "visit_union - " + "codegen for _var failed\n"), + -1); } + os->gen_endif (); + + // Generate the ifdefined macro for the array type then generate the + // _out impl + os->gen_ifdef_macro (node->flat_name (), "_out"); + + if (node->size_type () == AST_Type::VARIABLE + && node->gen_out_impl () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_union_ci::" + "visit_union - " + "codegen for _out failed\n"), + -1); + } + + os->gen_endif (); + + node->cli_inline_gen (I_TRUE); return 0; } 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 755939de49d..cf3af206500 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_cs.cpp @@ -88,16 +88,12 @@ int be_visitor_union_cs::visit_union (be_union *node) // Now generate the operations on the union such as the copy constructor // and the assignment operator. - *os << "// *************************************************************" - << be_nl; - *os << "// Operations for union " << node->name () << be_nl - << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; - *os << "// *************************************************************\n\n"; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; // Generate the copy constructor and the assignment operator here. - os->indent (); - *os << node->name () << "::" << node->local_name () << " (void)" << be_nl + *os << be_nl << be_nl + << node->name () << "::" << node->local_name () << " (void)" << be_nl << "{" << be_idt_nl << "ACE_OS::memset (&this->disc_, 0, sizeof (this->disc_));" << be_nl << "ACE_OS::memset (&this->u_, 0, sizeof (this->u_));" << be_nl @@ -174,15 +170,14 @@ int be_visitor_union_cs::visit_union (be_union *node) *os << be_uidt_nl << "}" << be_uidt_nl << "}" << be_nl << be_nl; - *os << "// destructor" << be_nl - << node->name () << "::~" << node->local_name () + *os << node->name () << "::~" << node->local_name () << " (void)" << be_nl << "{" << be_idt_nl - << "// finalize" << be_nl + << "// Finalize." << be_nl << "this->_reset (this->disc_, 1);" << be_uidt_nl << "}" << be_nl << be_nl; - if (!node->is_local ()) + if (be_global->any_support ()) { *os << "void " << node->name () @@ -200,8 +195,6 @@ int be_visitor_union_cs::visit_union (be_union *node) this->ctx_->sub_state (TAO_CodeGen::TAO_SUB_STATE_UNKNOWN); // Assignment operator. - os->indent (); - *os << "// assignment operator" << be_nl; *os << node->name () << " &" << be_nl; *os << node->name () << "::operator= (const ::" << node->name () << " &u)" << be_nl; @@ -250,7 +243,7 @@ int be_visitor_union_cs::visit_union (be_union *node) // The reset method. this->ctx_->state (TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS); os->indent (); - *os << "// reset method to reset old values of a union" << be_nl; + *os << "// Reset method to reset old values of a union." << be_nl; *os << "void " << node->name () << "::_reset (" << bt->name () << ", CORBA::Boolean /*finalize*/)" << be_nl; *os << "{" << be_idt_nl; @@ -281,7 +274,7 @@ int be_visitor_union_cs::visit_union (be_union *node) } *os << be_uidt_nl << "}" << be_uidt_nl - << "}\n\n"; + << "}"; if (!node->is_local () && be_global->tc_support ()) { 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 f6c61680375..2d15b711750 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 @@ -128,9 +128,11 @@ be_visitor_union_branch_cdr_op_ci::visit_array (be_array *node) { case TAO_CodeGen::TAO_CDR_INPUT: *os << fname << " _tao_union_tmp;" << be_nl - << fname << "_forany " << be_idt_nl - << "_tao_union_helper (_tao_union_tmp);" << be_uidt_nl - << "result = strm >> _tao_union_helper;" << be_nl + << fname << "_forany _tao_union_helper (" + << be_idt << be_idt_nl + << "_tao_union_tmp" << be_uidt_nl + << ");" << be_uidt_nl + << "result = strm >> _tao_union_helper;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () @@ -141,9 +143,10 @@ be_visitor_union_branch_cdr_op_ci::visit_array (be_array *node) return 0; case TAO_CodeGen::TAO_CDR_OUTPUT: - *os << fname << "_forany " << be_idt_nl - << "_tao_union_tmp (_tao_union." - << f->local_name () << " ());" << be_uidt_nl + *os << fname << "_forany _tao_union_tmp (" << be_idt << be_idt_nl + << "_tao_union." + << f->local_name () << " ()" << be_uidt_nl + <<");" << be_uidt_nl << "result = strm << _tao_union_tmp;"; return 0; @@ -511,7 +514,7 @@ be_visitor_union_branch_cdr_op_ci::visit_predefined_type (be_predefined_type *no { *os << "CORBA::Object_var _tao_union_tmp;" << be_nl; - *os << "result = strm >> _tao_union_tmp.out ();" << be_nl + *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());"; @@ -523,7 +526,7 @@ be_visitor_union_branch_cdr_op_ci::visit_predefined_type (be_predefined_type *no //@@TODO - case for ValueBase. - *os << "result = strm >> _tao_union_tmp.out ();" << be_nl + *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());"; @@ -534,7 +537,7 @@ be_visitor_union_branch_cdr_op_ci::visit_predefined_type (be_predefined_type *no *os << "CORBA::Char _tao_union_tmp;" << be_nl << "CORBA::Any::to_char _tao_union_helper " << "(_tao_union_tmp);" << be_nl - << "result = strm >> _tao_union_helper;" << be_nl + << "result = strm >> _tao_union_helper;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () @@ -545,7 +548,7 @@ be_visitor_union_branch_cdr_op_ci::visit_predefined_type (be_predefined_type *no *os << "CORBA::WChar _tao_union_tmp;" << be_nl << "CORBA::Any::to_wchar _tao_union_helper " << "(_tao_union_tmp);" << be_nl - << "result = strm >> _tao_union_helper;" << be_nl + << "result = strm >> _tao_union_helper;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () @@ -556,7 +559,7 @@ be_visitor_union_branch_cdr_op_ci::visit_predefined_type (be_predefined_type *no *os << "CORBA::Octet _tao_union_tmp;" << be_nl << "CORBA::Any::to_octet _tao_union_helper " << "(_tao_union_tmp);" << be_nl - << "result = strm >> _tao_union_helper;" << be_nl + << "result = strm >> _tao_union_helper;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () @@ -567,7 +570,7 @@ be_visitor_union_branch_cdr_op_ci::visit_predefined_type (be_predefined_type *no *os << "CORBA::Boolean _tao_union_tmp;" << be_nl << "CORBA::Any::to_boolean _tao_union_helper " << "(_tao_union_tmp);" << be_nl - << "result = strm >> _tao_union_helper;" << be_nl + << "result = strm >> _tao_union_helper;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () @@ -576,7 +579,7 @@ be_visitor_union_branch_cdr_op_ci::visit_predefined_type (be_predefined_type *no else { *os << node->name () << " _tao_union_tmp;" << be_nl - << "result = strm >> _tao_union_tmp;" << be_nl + << "result = strm >> _tao_union_tmp;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () @@ -677,7 +680,7 @@ be_visitor_union_branch_cdr_op_ci::visit_sequence (be_sequence *node) } *os << " _tao_union_tmp;" << be_nl - << "result = strm >> _tao_union_tmp;" << be_nl + << "result = strm >> _tao_union_tmp;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." @@ -761,7 +764,7 @@ be_visitor_union_branch_cdr_op_ci::visit_string (be_string *node) *os << "CORBA::WString_var _tao_union_tmp;" << be_nl; } - *os << "result = strm >> _tao_union_tmp.out ();" << be_nl + *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." @@ -814,7 +817,7 @@ be_visitor_union_branch_cdr_op_ci::visit_structure (be_structure *node) { case TAO_CodeGen::TAO_CDR_INPUT: *os << node->name () << " _tao_union_tmp;" << be_nl - << "result = strm >> _tao_union_tmp;" << be_nl + << "result = strm >> _tao_union_tmp;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () @@ -910,13 +913,13 @@ be_visitor_union_branch_cdr_op_ci::visit_union (be_union *node) case TAO_CodeGen::TAO_CDR_INPUT: *os << node->name () << " _tao_union_tmp" << ";" << be_nl - << "result = strm >> _tao_union_tmp;" << be_nl + << "result = strm >> _tao_union_tmp;" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () << " (_tao_union_tmp);" << be_nl << "_tao_union._d (_tao_discriminant);" << be_uidt_nl - << "}" << be_uidt; + << "}" << be_uidt_nl; return 0; 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 884c849fef8..1040193d8c8 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 @@ -97,18 +97,23 @@ be_visitor_union_branch_private_ch::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + // Not a typedef and bt is defined inside the union. if (bt->node_type () != AST_Decl::NT_typedef && bt->is_child (bu)) { // Case of anonymous array in union *os << "_" << bt->local_name () << "_slice *" << ub->local_name () - << "_;" << be_nl; + << "_;"; } else { *os << bt->nested_type_name (bu, "_slice") << " *" << ub->local_name () - << "_;" << be_nl; + << "_;"; } return 0; @@ -142,8 +147,13 @@ be_visitor_union_branch_private_ch::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + *os << bt->nested_type_name (bu) << " " << ub->local_name () - << "_;" << be_nl; + << "_;"; return 0; } @@ -176,8 +186,13 @@ be_visitor_union_branch_private_ch::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + *os << bt->nested_type_name (bu, "_var") - << " *" << ub->local_name () << "_;" << be_nl; + << " *" << ub->local_name () << "_;"; return 0; } @@ -210,8 +225,13 @@ be_visitor_union_branch_private_ch::visit_interface_fwd (be_interface_fwd *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + *os << bt->nested_type_name (bu, "_var") - << " *" << ub->local_name () << "_;" << be_nl; + << " *" << ub->local_name () << "_;"; return 0; } @@ -244,8 +264,13 @@ be_visitor_union_branch_private_ch::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + *os << bt->nested_type_name (bu, "_var") - << " *" << ub->local_name () << "_;" << be_nl; + << " *" << ub->local_name () << "_;"; return 0; } @@ -278,8 +303,13 @@ be_visitor_union_branch_private_ch::visit_valuetype_fwd (be_valuetype_fwd *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + *os << bt->nested_type_name (bu, "_var") - << " *" << ub->local_name () << "_;" << be_nl; + << " *" << ub->local_name () << "_;"; return 0; } @@ -314,27 +344,32 @@ be_visitor_union_branch_private_ch::visit_predefined_type ( TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + if (node->pt () == AST_PredefinedType::PT_object) { *os << bt->name () << "_var" - << " *" << ub->local_name () << "_;" << be_nl; + << " *" << ub->local_name () << "_;"; } else if (node->pt () == AST_PredefinedType::PT_pseudo) { *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name () - << "_;" << be_nl; + << "_;"; } else if (node->pt () == AST_PredefinedType::PT_any) { // Cannot have an object inside of a union. In addition, an Any is a // variable data type. *os << bt->nested_type_name (bu) << " *" << ub->local_name () - << "_;" << be_nl; + << "_;"; } else { *os << bt->nested_type_name (bu) << " " << ub->local_name () - << "_;" << be_nl; + << "_;"; } return 0; @@ -368,10 +403,15 @@ be_visitor_union_branch_private_ch::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + // C++ doesn't allow object instances inside unions, so we need a // pointer. *os << bt->nested_type_name (bu) << " *" << ub->local_name () - << "_;" << be_nl; + << "_;"; return 0; } @@ -393,13 +433,18 @@ be_visitor_union_branch_private_ch::visit_string (be_string *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + if (node->width () == (long) sizeof (char)) { - *os << "char *" << ub->local_name () << "_;" << be_nl; + *os << "char *" << ub->local_name () << "_;"; } else { - *os << "CORBA::WChar *" << ub->local_name () << "_;" << be_nl; + *os << "CORBA::WChar *" << ub->local_name () << "_;"; } return 0; @@ -433,17 +478,22 @@ be_visitor_union_branch_private_ch::visit_structure (be_structure *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + // If we are variable sized, we need a pointer type. if (node->size_type () == AST_Type::VARIABLE || node->has_constructor ()) { *os << bt->nested_type_name (bu) << " *" << ub->local_name () - << "_;" << be_nl; + << "_;"; } else { *os << bt->nested_type_name (bu) << " " << ub->local_name () - << "_;" << be_nl; + << "_;"; } return 0; @@ -498,10 +548,15 @@ be_visitor_union_branch_private_ch::visit_union (be_union *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl; + // C++ doesn't allow object instances inside unions, so we need a // pointer. *os << bt->nested_type_name (bu) << " *" << ub->local_name () - << "_;" << be_nl; + << "_;"; return 0; } 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 a3b0b8d97e5..636633ba43a 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 @@ -166,9 +166,9 @@ be_visitor_union_branch_public_assign_cs::visit_array (be_array *node) } // set the discriminant to the appropriate label - *os << "// make a deep copy" << be_nl; + *os << "// Make a deep copy." << be_nl; *os << "this->u_." << ub->local_name () - << "_ = " << be_idt_nl + << "_ = " << be_idt_nl << fname << "_dup (u.u_." << ub->local_name () << "_);" << be_uidt << be_uidt_nl; @@ -196,8 +196,7 @@ be_visitor_union_branch_public_assign_cs::visit_enum (be_enum *) // set the discriminant to the appropriate label // valid label - *os << "// set the value" << be_nl - << "this->u_." << ub->local_name () << "_ = " << be_idt_nl + *os << "this->u_." << ub->local_name () << "_ = " << be_idt_nl << "u.u_." << ub->local_name () << "_;" << be_uidt << be_uidt_nl; @@ -623,8 +622,7 @@ be_visitor_union_branch_public_assign_cs::visit_predefined_type ( case AST_PredefinedType::PT_void: break; default: - *os << "// set the value" << be_nl - << "this->u_." << ub->local_name () << "_ = " + *os << "this->u_." << ub->local_name () << "_ = " << "u.u_." << ub->local_name () << "_;" << be_uidt_nl; break; 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 0341c745ea1..2426123a9a2 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 @@ -117,24 +117,32 @@ be_visitor_union_branch_public_ch::visit_array (be_array *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Now use this array as a "type" for the subsequent declarator // the set method. - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << "_" << bt->local_name () << ");" << be_nl; // The get method. *os << "_" << bt->local_name () << "_slice * " << ub->local_name () - << " (void) const; // get method" << be_nl << be_nl; + << " (void) const; // get method"; } else { + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Now use this array as a "type" for the subsequent declarator // the set method. - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu) << ");" << be_nl; // The get method. *os << bt->nested_type_name (bu, "_slice *") << " " << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; } return 0; @@ -187,14 +195,18 @@ be_visitor_union_branch_public_ch::visit_enum (be_enum *node) } } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Now use this enum as a "type" for the subsequent declarator // the set method. - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu) << ");" << be_nl; // the get method. *os << bt->nested_type_name (bu) << " " << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; return 0; } @@ -227,13 +239,17 @@ be_visitor_union_branch_public_ch::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Set method. - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu, "_ptr") << ");" << be_nl; // Get method. *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; return 0; } @@ -266,13 +282,17 @@ be_visitor_union_branch_public_ch::visit_interface_fwd (be_interface_fwd *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Set method. - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu, "_ptr") << ");" << be_nl; // Get method. *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; return 0; } @@ -305,13 +325,17 @@ be_visitor_union_branch_public_ch::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Set method. - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu, "*") << ");" << be_nl; // Get method. *os << bt->nested_type_name (bu, "*") << " " << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; return 0; } @@ -344,13 +368,17 @@ be_visitor_union_branch_public_ch::visit_valuetype_fwd (be_valuetype_fwd *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Set method. - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu, "*") << ")" << be_nl; // Get method. *os << bt->nested_type_name (bu, "*") << " " << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; return 0; } @@ -383,30 +411,36 @@ be_visitor_union_branch_public_ch::visit_predefined_type (be_predefined_type *no TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + switch (node->pt ()) { case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_object: - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu, "_ptr") << ");" << be_nl; *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; break; case AST_PredefinedType::PT_any: - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu) << " &);" << be_nl; *os << "const " << bt->nested_type_name (bu) << " &" - << ub->local_name () << " (void) const;" << be_nl << be_nl; + << ub->local_name () << " (void) const;" << be_nl; *os << bt->nested_type_name (bu) << " &" - << ub->local_name () << " (void);" << be_nl << be_nl; + << ub->local_name () << " (void);"; break; case AST_PredefinedType::PT_void: break; default: - *os << "void " << ub->local_name () << " (" + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" << bt->nested_type_name (bu) << ");" << be_nl; *os << bt->nested_type_name (bu) << " " << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; } return 0; @@ -458,20 +492,28 @@ be_visitor_union_branch_public_ch::visit_sequence (be_sequence *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Generate the anonymous sequence member typedef. // This provides a consistent name to use instead of the // implementation-specific name. - *os << "typedef " << bt->nested_type_name (bu) - << " _" << ub->local_name () << "_seq;" << be_nl << be_nl; + *os << be_nl << be_nl + << "typedef " << bt->nested_type_name (bu) + << " _" << ub->local_name () << "_seq;"; } - *os << "void " << ub->local_name () << " (const " + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl + << "void " << ub->local_name () << " (const " << bt->nested_type_name (bu) << " &);" << be_nl; *os << "const " << bt->nested_type_name (bu) << " &" << ub->local_name () << " (void) const;" << be_nl; *os << bt->nested_type_name (bu) << " &" << ub->local_name () - << " (void);" << be_nl << be_nl; + << " (void);"; return 0; } @@ -493,26 +535,31 @@ be_visitor_union_branch_public_ch::visit_string (be_string *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Three methods to set the string value if (node->width () == (long) sizeof (char)) { - *os << "void " << ub->local_name () << " (char *);" << be_nl; + *os << be_nl << be_nl + << "void " << ub->local_name () << " (char *);" << be_nl; *os << "void " << ub->local_name () << " (const char *);" << be_nl; *os << "void " << ub->local_name () << " (const CORBA::String_var&);" << be_nl; *os << "const char *" << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; } else { - *os << "void " << ub->local_name () << " (CORBA::WChar *);" << be_nl; + *os << be_nl << be_nl + << "void " << ub->local_name () << " (CORBA::WChar *);" << be_nl; *os << "void " << ub->local_name () << " (const CORBA::WChar *);" << be_nl; *os << "void " << ub->local_name () << " (const CORBA::WString_var&);" << be_nl; *os << "const CORBA::WChar *" << ub->local_name () - << " (void) const;" << be_nl << be_nl; + << " (void) const;"; } return 0; @@ -565,13 +612,17 @@ be_visitor_union_branch_public_ch::visit_structure (be_structure *node) } } - *os << "void " << ub->local_name () << " (const " + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl + << "void " << ub->local_name () << " (const " << bt->nested_type_name (bu) << " &);" << be_nl << "const " << bt->nested_type_name (bu) << " &" << ub->local_name () << " (void) const;" << be_nl << bt->nested_type_name (bu) << " &" << ub->local_name () - << " (void);" << be_nl << be_nl; + << " (void);"; return 0; } @@ -645,13 +696,17 @@ be_visitor_union_branch_public_ch::visit_union (be_union *node) } } - *os << "void " << ub->local_name () << " (const " + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_nl << be_nl + << "void " << ub->local_name () << " (const " << bt->nested_type_name (bu) << " &);" << be_nl << "const " << bt->nested_type_name (bu) << " &" << ub->local_name () << " (void) const;" << be_nl << bt->nested_type_name (bu) << " &" << ub->local_name () - << " (void);" << be_nl << be_nl; + << " (void);"; return 0; } 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 331966b02f0..a27ad9fc264 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 @@ -163,11 +163,12 @@ be_visitor_union_branch_public_ci::visit_array (be_array *node) } // Set method. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (" << fname << " val)" << be_nl << "{" << be_idt_nl @@ -202,11 +203,12 @@ be_visitor_union_branch_public_ci::visit_array (be_array *node) // Get method. *os << "// Retrieve the member." << be_nl - << "ACE_INLINE " << fname << "_slice *" << be_nl + << "ACE_INLINE" << be_nl + << fname << "_slice *" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -240,11 +242,12 @@ be_visitor_union_branch_public_ci::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); // Set method. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (" << bt->name () << " val)" << be_nl << "{" << be_idt_nl @@ -278,11 +281,12 @@ be_visitor_union_branch_public_ci::visit_enum (be_enum *node) // Get method. *os << "// Retrieve the member." << be_nl - << "ACE_INLINE " << bt->name () << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -316,11 +320,12 @@ be_visitor_union_branch_public_ci::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); // Set method. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (" << bt->name () << "_ptr val)" << be_nl << "{" << be_idt_nl @@ -371,11 +376,12 @@ be_visitor_union_branch_public_ci::visit_interface (be_interface *node) // Get method. *os << "// Retrieve the member." << be_nl - << "ACE_INLINE " << bt->name () << "_ptr " << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << "_ptr " << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_->ptr ();" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -409,11 +415,12 @@ be_visitor_union_branch_public_ci::visit_interface_fwd (be_interface_fwd *node) TAO_OutStream *os = this->ctx_->stream (); // Set method. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (" << bt->name () << "_ptr val)" << be_nl << "{" << be_idt_nl @@ -464,11 +471,12 @@ be_visitor_union_branch_public_ci::visit_interface_fwd (be_interface_fwd *node) // Get method. *os << "// Retrieve the member." << be_nl - << "ACE_INLINE " << bt->name () << "_ptr " << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << "_ptr " << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_->ptr ();" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -502,11 +510,12 @@ be_visitor_union_branch_public_ci::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); // Set method. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (" << bt->name () << " *val)" << be_nl << "{" << be_idt_nl @@ -546,11 +555,12 @@ be_visitor_union_branch_public_ci::visit_valuetype (be_valuetype *node) // Get method. *os << "// Retrieve the member." << be_nl - << "ACE_INLINE " << bt->name () << "_ptr " << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << "_ptr " << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_->ptr ();" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -584,11 +594,12 @@ be_visitor_union_branch_public_ci::visit_valuetype_fwd (be_valuetype_fwd *node) TAO_OutStream *os = this->ctx_->stream (); // Set method. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (" << bt->name () << " *val)" << be_nl << "{" << be_idt_nl @@ -639,11 +650,12 @@ be_visitor_union_branch_public_ci::visit_valuetype_fwd (be_valuetype_fwd *node) // Get method. *os << "// Retrieve the member." << be_nl - << "ACE_INLINE " << bt->name () << "_ptr " << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << "_ptr " << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_->ptr ();" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -679,11 +691,12 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( TAO_OutStream *os = this->ctx_->stream (); // Set method. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (" << bt->name (); AST_PredefinedType::PredefinedType pt = node->pt (); @@ -766,31 +779,34 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( case AST_PredefinedType::PT_object: // Get method. *os << "// Retrieve the member." << be_nl - << "ACE_INLINE " << bt->name () << "_ptr" << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << "_ptr" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl; *os << "return this->u_." << ub->local_name () << "_->ptr ();" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; break; case AST_PredefinedType::PT_pseudo: // Get method. *os << "// Retrieve the member." << be_nl - << "ACE_INLINE " << bt->name () << "_ptr" << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << "_ptr" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl; *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; break; case AST_PredefinedType::PT_any: // Get method with read-only access. - *os << "// retrieve the member" << be_nl - << "ACE_INLINE const " << bt->name () << " &" << be_nl + *os << "// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << "const " << bt->name () << " &" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl @@ -798,25 +814,27 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( << "}" << be_nl << be_nl; // Get method with read/write access - *os << "// retrieve the member" << be_nl - << "ACE_INLINE " << bt->name () << " &" << be_nl + *os << "// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << " &" << be_nl << bu->name () << "::" << ub->local_name () << " (void)" << be_nl << "{" << be_idt_nl << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; break; case AST_PredefinedType::PT_void: break; default: // Get method. - *os << "// retrieve the member" << be_nl - << "ACE_INLINE " << bt->name () << be_nl + *os << "// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; break; } @@ -877,12 +895,13 @@ be_visitor_union_branch_public_ci::visit_sequence (be_sequence *node) } } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // (1) Set from a const. *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (const " << bt->name () << " &val)" << be_nl << "{" << be_idt_nl @@ -918,7 +937,8 @@ be_visitor_union_branch_public_ci::visit_sequence (be_sequence *node) // Readonly get method. *os << "// Readonly get method." << be_nl - << "ACE_INLINE const " << bt->name () << " &" << be_nl + << "ACE_INLINE" << be_nl + << "const " << bt->name () << " &" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl @@ -926,11 +946,12 @@ be_visitor_union_branch_public_ci::visit_sequence (be_sequence *node) // Read/write get method. *os << "// Read/write get method." << be_nl - << "ACE_INLINE " << bt->name () << " &" << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << " &" << be_nl << bu->name () << "::" << ub->local_name () << " (void)" << be_nl << "{" << be_idt_nl << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -955,11 +976,12 @@ be_visitor_union_branch_public_ci::visit_string (be_string *node) // Three methods to set the string value. // (1) Set method from char* or wchar*. - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl; + << "ACE_INLINE" << be_nl + << "void" << be_nl; if (node->width () == (long) sizeof (char)) { @@ -997,13 +1019,13 @@ be_visitor_union_branch_public_ci::visit_string (be_string *node) } *os << ";" << be_nl - << "// set the value" << be_nl << "this->u_." << ub->local_name () << "_ = val;" << be_uidt_nl << "}" << be_nl << be_nl; // (2) Set method from const char * or const wchar *. *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name (); if (node->width () == (long) sizeof (char)) @@ -1055,7 +1077,8 @@ be_visitor_union_branch_public_ci::visit_string (be_string *node) // (3) Set from const String_var& or WString_var& *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name (); if (node->width () == (long) sizeof (char)) @@ -1108,21 +1131,23 @@ be_visitor_union_branch_public_ci::visit_string (be_string *node) << ub->local_name () << "_var._retn ();" << be_uidt_nl << "}" << be_nl << be_nl; + *os << "ACE_INLINE" << be_nl; + // Get method. if (node->width () == (long) sizeof (char)) { - *os << "ACE_INLINE const char *" << be_nl; + *os << "const char *" << be_nl; } else { - *os << "ACE_INLINE const CORBA::WChar *" << be_nl; + *os << "const CORBA::WChar *" << be_nl; } *os << bu->name () << "::" << ub->local_name () << " (void) const // get method" << be_nl << "{" << be_idt_nl << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -1180,12 +1205,13 @@ be_visitor_union_branch_public_ci::visit_structure (be_structure *node) } } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // (1) Set from a const. *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (const " << bt->name () << " &val)" << be_nl << "{" << be_idt_nl @@ -1231,7 +1257,8 @@ be_visitor_union_branch_public_ci::visit_structure (be_structure *node) // Readonly get method. *os << "// Readonly get method." << be_nl - << "ACE_INLINE const " << bt->name () << " &" << be_nl + << "ACE_INLINE" << be_nl + << "const " << bt->name () << " &" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl; @@ -1249,7 +1276,8 @@ be_visitor_union_branch_public_ci::visit_structure (be_structure *node) // Read/write get method. *os << "// Read/write get method." << be_nl - << "ACE_INLINE " << bt->name () << " &" << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << " &" << be_nl << bu->name () << "::" << ub->local_name () << " (void)" << be_nl << "{" << be_idt_nl; @@ -1263,7 +1291,7 @@ be_visitor_union_branch_public_ci::visit_structure (be_structure *node) *os << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl; } - *os << "}" << be_nl << be_nl; + *os << "}"; return 0; } @@ -1343,12 +1371,13 @@ be_visitor_union_branch_public_ci::visit_union (be_union *node) } } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // (1) Set from a const. *os << "// Accessor to set the member." << be_nl - << "ACE_INLINE void" << be_nl + << "ACE_INLINE" << be_nl + << "void" << be_nl << bu->name () << "::" << ub->local_name () << " (const " << bt->name () << " &val)" << be_nl << "{" << be_idt_nl @@ -1384,7 +1413,8 @@ be_visitor_union_branch_public_ci::visit_union (be_union *node) // Readonly get method. *os << "// Readonly get method." << be_nl - << "ACE_INLINE const " << bt->name () << " &" << be_nl + << "ACE_INLINE" << be_nl + << "const " << bt->name () << " &" << be_nl << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl << "{" << be_idt_nl << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl @@ -1392,11 +1422,12 @@ be_visitor_union_branch_public_ci::visit_union (be_union *node) // Read/write get method. *os << "// Read/write get method." << be_nl - << "ACE_INLINE " << bt->name () << " &" << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << " &" << be_nl << bu->name () << "::" << ub->local_name () << " (void)" << be_nl << "{" << be_idt_nl << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp index ad86bed923b..455b4fdec48 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_fwd/union_fwd_ch.cpp @@ -37,17 +37,20 @@ be_visitor_union_fwd_ch::~be_visitor_union_fwd_ch (void) int be_visitor_union_fwd_ch::visit_union_fwd (be_union_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); - if (node->cli_hdr_gen () || node->imported ()) { return 0; } + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Generate a forward declaration of the class. - *os << "class " << node->local_name () << ";" << be_nl; + *os << be_nl << be_nl + << "class " << node->local_name () << ";"; node->cli_hdr_gen (I_TRUE); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp index fd38a0cb138..d2050d95194 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype.cpp @@ -24,6 +24,7 @@ #include "be_constant.h" #include "be_enum.h" #include "be_exception.h" +#include "be_eventtype.h" #include "be_factory.h" #include "be_field.h" #include "be_interface_fwd.h" @@ -43,9 +44,10 @@ #include "be_extern.h" #include "utl_identifier.h" +#include "be_visitor_valuetype.h" #include "be_visitor_argument.h" #include "be_visitor_array.h" -#include "be_visitor_valuetype.h" +#include "be_visitor_eventtype.h" #include "be_visitor_field.h" #include "be_visitor_constant.h" #include "be_visitor_enum.h" 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 1fa8514f202..52c82a39d2d 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 @@ -45,7 +45,7 @@ be_visitor_valuetype_ami_exception_holder_ch::visit_valuetype ( TAO_OutStream *os = this->ctx_->stream (); // Generate the implemenation of the Messaging aware ORB. - *os << be_nl + *os << be_nl << be_nl << "class _tao_" << node->local_name () << be_idt_nl << ": public "; @@ -60,7 +60,7 @@ be_visitor_valuetype_ami_exception_holder_ch::visit_valuetype ( << "{" << be_nl; *os << "public:" << be_idt_nl; *os << "_tao_" << node->local_name () << " ();" << be_nl << be_nl; - *os << "~_tao_" << node->local_name () << " ();" << be_nl << be_nl; + *os << "~_tao_" << node->local_name () << " ();"; if (this->visit_valuetype_scope (node) == -1) { @@ -73,7 +73,7 @@ be_visitor_valuetype_ami_exception_holder_ch::visit_valuetype ( } *os << be_uidt_nl - << "};" << be_nl << be_nl; + << "};"; return 0; } 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 69cf3eb4a34..2f4e63fec96 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 @@ -43,17 +43,15 @@ int be_visitor_valuetype_any_op_ch::visit_valuetype (be_valuetype *node) { if (node->cli_hdr_any_op_gen () - || node->imported () - || node->is_local ()) + || node->imported ()) { return 0; } TAO_OutStream *os = this->ctx_->stream (); - // Generate the Any <<= and >>= operator declarations. - os->indent (); - *os << "// Any operators for valuetype " << node->name () << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << be_global->stub_export_macro () << " void" << " operator<<= (CORBA::Any &, " << node->name () @@ -65,9 +63,8 @@ be_visitor_valuetype_any_op_ch::visit_valuetype (be_valuetype *node) *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>>= (const CORBA::Any &, " - << node->name () << " *&);" << be_nl; + << node->name () << " *&);"; node->cli_hdr_any_op_gen (1); - return 0; } 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 74232a8ed5a..5d708e319cd 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 @@ -52,7 +52,7 @@ be_visitor_valuetype_any_op_cs::visit_valuetype (be_valuetype *node) // Generate the Any <<= and >>= operator declarations - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Copying." << be_nl @@ -166,7 +166,7 @@ be_visitor_valuetype_any_op_cs::visit_valuetype (be_valuetype *node) << "# pragma instantiate TAO_Valuetype_Manager<" << node->full_name () << ", " << node->full_name () << "_var>" << be_uidt_nl - << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */\n\n"; + << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */"; node->cli_stub_any_op_gen (1); return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp index c4d383b3ae1..dadbaa62c0a 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp @@ -193,7 +193,7 @@ be_visitor_obv_operation_arglist::visit_operation (be_operation *node) /***********************************************************/ else { - *os << " = 0;" << be_uidt_nl << be_nl; + *os << " = 0;" << be_uidt; } break; case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IH: @@ -201,11 +201,11 @@ be_visitor_obv_operation_arglist::visit_operation (be_operation *node) case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IS: break; case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IMPL_CH: - *os << ";" << be_nl; + *os << ";"; break; case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IMPL_CS: default: - *os << be_nl; + break; } return 0; 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 aec3fac0e73..13fe3bc35ff 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 @@ -38,38 +38,35 @@ be_visitor_valuetype_cdr_op_ch::~be_visitor_valuetype_cdr_op_ch (void) int be_visitor_valuetype_cdr_op_ch::visit_valuetype (be_valuetype *node) { - if (node->imported ()) + if (node->imported () + || node->cli_hdr_cdr_op_gen ()) { return 0; } TAO_OutStream *os = this->ctx_->stream (); - if (!node->cli_hdr_cdr_op_gen ()) - { - // Generate helper functions declaration. - if (node->gen_helper_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_valuetype_cdr_op_ch::" - "visit_valuetype - " - "codegen for helper functions failed\n"), - -1); - } - - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate helper functions declaration. + if (node->gen_helper_header () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_valuetype_cdr_op_ch::" + "visit_valuetype - " + "codegen for helper functions failed\n"), + -1); + } - *os << be_global->stub_export_macro () << " " - << "CORBA::Boolean operator<< (TAO_OutputCDR &, const " - << node->full_name () << " *);" << be_nl; + *os << be_nl << be_nl + << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - *os << be_global->stub_export_macro () << " " - << "CORBA::Boolean operator>> (TAO_InputCDR &, " - << node->full_name () << " *&);" << be_nl; + *os << be_global->stub_export_macro () << " " + << "CORBA::Boolean operator<< (TAO_OutputCDR &, const " + << node->full_name () << " *);" << be_nl; - node->cli_hdr_cdr_op_gen (1); - } + *os << be_global->stub_export_macro () << " " + << "CORBA::Boolean operator>> (TAO_InputCDR &, " + << node->full_name () << " *&);"; // Set the substate as generating code for the types defined in our scope. this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_SCOPE); @@ -89,7 +86,8 @@ be_visitor_valuetype_cdr_op_ch::visit_valuetype (be_valuetype *node) be_visitor_context new_ctx (*this->ctx_); be_visitor_valuetype_marshal_ch visitor (&new_ctx); visitor.visit_valuetype (node); - } + } + node->cli_hdr_cdr_op_gen (1); 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 7ef0373f2b7..d92b599076f 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 @@ -56,7 +56,7 @@ be_visitor_valuetype_cdr_op_ci::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // This is just declaration so no ACE_INLINE @@ -66,7 +66,9 @@ be_visitor_valuetype_cdr_op_ci::visit_valuetype (be_valuetype *node) *os << be_global->stub_export_macro () << " " << "CORBA::Boolean operator>> (TAO_InputCDR &, " - << node->full_name () << " *&);" << be_nl << be_nl; + << node->full_name () << " *&);"; + + node->cli_inline_cdr_op_gen (I_TRUE); if (this->visit_scope (node) == -1) { @@ -77,6 +79,58 @@ be_visitor_valuetype_cdr_op_ci::visit_valuetype (be_valuetype *node) -1); } - node->cli_inline_cdr_op_gen (I_TRUE); return 0; } + +// @@@ (JP) The following three methods are a hack to get CDR +// operators generated for anonymous array and sequence +// valuetype members. This should be done like it is in structs, +// but part of that mechanism is used by valuetypes for +// generating code to marshal the state. Someday this should +// be untangled and made consistent. + +int +be_visitor_valuetype_cdr_op_ci::visit_field (be_field *node) +{ + be_type *bt = be_type::narrow_from_decl (node->field_type ()); + + if (bt == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_field_cdr_op_ci::" + "visit_field - " + "Bad field type\n"), + -1); + } + + // Save the node. + this->ctx_->node (node); + + if (bt->accept (this) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_valuetype_cdr_op_ci::" + "visit_field - " + "codegen for field type failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_valuetype_cdr_op_ci::visit_array (be_array *node) +{ + be_visitor_context ctx (*this->ctx_); + be_visitor_array_cdr_op_ci visitor (&ctx); + return node->accept (&visitor); +} + +int +be_visitor_valuetype_cdr_op_ci::visit_sequence (be_sequence *node) +{ + be_visitor_context ctx (*this->ctx_); + be_visitor_sequence_cdr_op_ci visitor (&ctx); + return node->accept (&visitor); +} + 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 597784321ae..cc7e3f561ef 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 @@ -40,7 +40,9 @@ int be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) { // Already generated and/or we are imported. Don't do anything. - if (node->cli_stub_cdr_op_gen () || node->imported ()) + if (node->cli_stub_cdr_op_gen () + || node->imported () + || ! node->is_defined ()) { return 0; } @@ -56,6 +58,7 @@ be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) } TAO_OutStream *os = this->ctx_->stream (); + node->cli_stub_cdr_op_gen (I_TRUE); if (this->visit_scope (node) == -1) { @@ -66,7 +69,7 @@ be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) -1); } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Set the sub state as generating code for the output operator. @@ -110,6 +113,50 @@ be_visitor_valuetype_cdr_op_cs::visit_valuetype (be_valuetype *node) visitor.visit_valuetype (node); } - node->cli_stub_cdr_op_gen (I_TRUE); return 0; } + +// @@@ (JP) The following three methods are a hack to get CDR +// operators generated for anonymous array and sequence +// valuetype members. This should be done like it is in structs, +// but part of that mechanism is used by valuetypes for +// generating code to marshal the state. Someday this should +// be untangled and made consistent. + +int +be_visitor_valuetype_cdr_op_cs::visit_field (be_field *node) +{ + be_type *bt = be_type::narrow_from_decl (node->field_type ()); + + if (bt == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_field_cdr_op_ci::" + "visit_field - " + "Bad field type\n"), + -1); + } + + // Save the node. + this->ctx_->node (node); + + if (bt->accept (this) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_valuetype_cdr_op_ci::" + "visit_field - " + "codegen for field type failed\n"), + -1); + } + + return 0; +} + +int +be_visitor_valuetype_cdr_op_cs::visit_sequence (be_sequence *node) +{ + be_visitor_context ctx (*this->ctx_); + be_visitor_sequence_cdr_op_cs visitor (&ctx); + return node->accept (&visitor); +} + 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 f443ff1dd7a..286c2f3bcb8 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_ch.cpp @@ -94,7 +94,7 @@ be_visitor_valuetype_field_ch::visit_array (be_array *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; if (bt->node_type () != AST_Decl::NT_typedef @@ -141,7 +141,7 @@ be_visitor_valuetype_field_ch::visit_array (be_array *node) // The get (read/write) method. *os << pre_op () << "const " << bt->name () << "_slice *" << ub->local_name () - << " (void) const" << post_op () << be_nl << be_nl; + << " (void) const" << post_op (); } return 0; @@ -175,7 +175,7 @@ be_visitor_valuetype_field_ch::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; if (bt->node_type () != AST_Decl::NT_typedef @@ -202,7 +202,7 @@ be_visitor_valuetype_field_ch::visit_enum (be_enum *node) << bt->name () << ")" << post_op () << be_nl; // The get method. *os << pre_op () << bt->name () << " " << ub->local_name () - << " (void) const" << post_op () << be_nl << be_nl; + << " (void) const" << post_op (); return 0; } @@ -235,7 +235,7 @@ be_visitor_valuetype_field_ch::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Set method. @@ -245,7 +245,7 @@ be_visitor_valuetype_field_ch::visit_interface (be_interface *node) // Get method. *os << pre_op() << bt->name () << "_ptr " << ub->local_name () - << " (void) const" << post_op() << be_nl << be_nl; + << " (void) const" << post_op(); return 0; } @@ -278,7 +278,7 @@ be_visitor_valuetype_field_ch::visit_interface_fwd (be_interface_fwd *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Set method. @@ -288,7 +288,7 @@ be_visitor_valuetype_field_ch::visit_interface_fwd (be_interface_fwd *node) // Get method. *os << pre_op () << bt->name () << "_ptr " << ub->local_name () - << " (void) const" << post_op () << be_nl << be_nl; + << " (void) const" << post_op (); return 0; } @@ -321,7 +321,7 @@ be_visitor_valuetype_field_ch::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Set method. @@ -331,7 +331,7 @@ be_visitor_valuetype_field_ch::visit_valuetype (be_valuetype *node) // Get method. *os << pre_op () << bt->name () << " *" << ub->local_name () - << " (void) const" << post_op () << be_nl << be_nl; + << " (void) const" << post_op (); return 0; } @@ -364,7 +364,7 @@ be_visitor_valuetype_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Set method. @@ -374,7 +374,7 @@ be_visitor_valuetype_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node) // Get method. *os << pre_op () << bt->name () << " *" << ub->local_name () - << " (void) const" << post_op () << be_nl << be_nl; + << " (void) const" << post_op (); return 0; } @@ -407,7 +407,7 @@ be_visitor_valuetype_field_ch::visit_predefined_type (be_predefined_type *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; switch (node->pt ()) @@ -421,7 +421,7 @@ be_visitor_valuetype_field_ch::visit_predefined_type (be_predefined_type *node) // Get method. *os << pre_op () << bt->name () << "_ptr " << ub->local_name () - << " (void) const" << post_op () << be_nl << be_nl; + << " (void) const" << post_op (); break; case AST_PredefinedType::PT_any: // Set method. @@ -431,7 +431,7 @@ be_visitor_valuetype_field_ch::visit_predefined_type (be_predefined_type *node) // Get method (read-only). *os << pre_op () << "const " << bt->name () << " &" << ub->local_name () << " (void) const" - << post_op () << be_nl << be_nl; + << post_op (); // Get method (read/write). *os << pre_op () << bt->name () << " &" << ub->local_name () << " (void)" @@ -446,7 +446,7 @@ be_visitor_valuetype_field_ch::visit_predefined_type (be_predefined_type *node) << post_op () << be_nl; // Get method. *os << pre_op () << bt->name () << " " << ub->local_name () - << " (void) const" << post_op () << be_nl << be_nl; + << " (void) const" << post_op (); } return 0; @@ -480,9 +480,6 @@ be_visitor_valuetype_field_ch::visit_sequence (be_sequence *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - // Not a typedef and bt is defined here. if (bt->node_type () != AST_Decl::NT_typedef && bt->is_child (bu)) @@ -504,13 +501,8 @@ be_visitor_valuetype_field_ch::visit_sequence (be_sequence *node) // Generate the anonymous sequence member typedef. // This provides a consistent name to use instead of the // implementation-specific name. - os->decr_indent (0); - - *os << "typedef " << bt->nested_type_name (bu) + *os << be_nl << be_nl << "typedef " << bt->nested_type_name (bu) << " _" << ub->local_name () << "_seq;" << be_nl; - - os->incr_indent (); - } // Set method. @@ -524,7 +516,7 @@ be_visitor_valuetype_field_ch::visit_sequence (be_sequence *node) // Read/write. *os << pre_op () << bt->name () << " &" << ub->local_name () << " (void)" - << post_op () << be_nl << be_nl; + << post_op (); return 0; } @@ -546,7 +538,7 @@ be_visitor_valuetype_field_ch::visit_string (be_string *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl<< "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Three methods to set the string value. @@ -563,7 +555,7 @@ be_visitor_valuetype_field_ch::visit_string (be_string *node) << post_op () << be_nl; // Get method. *os << pre_op () << "const char *" << ub->local_name () - << " (void) const" << post_op () << be_nl << be_nl; + << " (void) const" << post_op (); } else { @@ -578,7 +570,7 @@ be_visitor_valuetype_field_ch::visit_string (be_string *node) << post_op () << be_nl; // Get method. *os << pre_op() << "const CORBA::WChar *" << ub->local_name () - << " (void) const" << post_op() << be_nl << be_nl; + << " (void) const" << post_op(); } return 0; @@ -612,7 +604,7 @@ be_visitor_valuetype_field_ch::visit_structure (be_structure *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl<< "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Not a typedef and bt is defined here. @@ -644,7 +636,7 @@ be_visitor_valuetype_field_ch::visit_structure (be_structure *node) << post_op () << be_nl // Read/write. << pre_op () << bt->name () << " &" << ub->local_name () - << " (void)" << post_op () << be_nl << be_nl; + << " (void)" << post_op (); return 0; } @@ -698,7 +690,7 @@ be_visitor_valuetype_field_ch::visit_union (be_union *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl<< "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Not a typedef and bt is defined here. @@ -730,7 +722,7 @@ be_visitor_valuetype_field_ch::visit_union (be_union *node) << post_op () << be_nl; // Read/write. *os << pre_op () << bt->name () << " &" << ub->local_name () - << " (void)" << post_op () << be_nl << be_nl; + << " (void)" << post_op (); return 0; } 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 bbc42c3e500..9b85497a589 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp @@ -150,7 +150,7 @@ be_visitor_valuetype_field_cs::visit_array (be_array *node) bt->full_name ()); } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl @@ -192,7 +192,7 @@ be_visitor_valuetype_field_cs::visit_array (be_array *node) *os << "return this->" << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix () << ";" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; return 0; } @@ -225,7 +225,7 @@ be_visitor_valuetype_field_cs::visit_enum (be_enum *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl @@ -260,7 +260,7 @@ be_visitor_valuetype_field_cs::visit_enum (be_enum *node) << bu->field_pd_postfix () << ";" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; return 0; } @@ -293,7 +293,7 @@ be_visitor_valuetype_field_cs::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl @@ -327,7 +327,7 @@ be_visitor_valuetype_field_cs::visit_interface (be_interface *node) << bu->field_pd_postfix () << ".ptr ();" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; return 0; } @@ -360,7 +360,7 @@ be_visitor_valuetype_field_cs::visit_interface_fwd (be_interface_fwd *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl @@ -394,7 +394,7 @@ be_visitor_valuetype_field_cs::visit_interface_fwd (be_interface_fwd *node) << bu->field_pd_postfix () << ".ptr ();" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; return 0; } @@ -427,7 +427,7 @@ be_visitor_valuetype_field_cs::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl @@ -462,7 +462,7 @@ be_visitor_valuetype_field_cs::visit_valuetype (be_valuetype *node) << bu->field_pd_postfix () << ".ptr ();" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; return 0; } @@ -495,7 +495,7 @@ be_visitor_valuetype_field_cs::visit_valuetype_fwd (be_valuetype_fwd *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl @@ -531,7 +531,7 @@ be_visitor_valuetype_field_cs::visit_valuetype_fwd (be_valuetype_fwd *node) () << ".ptr ();" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; return 0; } @@ -564,7 +564,7 @@ be_visitor_valuetype_field_cs::visit_predefined_type (be_predefined_type *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member." << be_nl @@ -635,7 +635,7 @@ be_visitor_valuetype_field_cs::visit_predefined_type (be_predefined_type *node) << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix () << ";" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; break; case AST_PredefinedType::PT_any: @@ -667,7 +667,7 @@ be_visitor_valuetype_field_cs::visit_predefined_type (be_predefined_type *node) << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix () << ";" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; break; case AST_PredefinedType::PT_void: @@ -686,7 +686,7 @@ be_visitor_valuetype_field_cs::visit_predefined_type (be_predefined_type *node) << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix () << ";" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; break; } @@ -740,7 +740,7 @@ be_visitor_valuetype_field_cs::visit_sequence (be_sequence *node) } } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // (1) set from a const @@ -787,7 +787,7 @@ be_visitor_valuetype_field_cs::visit_sequence (be_sequence *node) << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix() << ";" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -811,12 +811,9 @@ be_visitor_valuetype_field_cs::visit_string (be_string *node) // Three methods to set the string value. - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - // (1) Set method from char* or wchar*. - os->indent (); - *os << "// Accessor to set the member." << be_nl << this->pre_op () << "void" << be_nl; @@ -834,8 +831,7 @@ be_visitor_valuetype_field_cs::visit_string (be_string *node) *os << be_nl << "{" << be_idt_nl; - *os << "// set the value" << be_nl - << "this->" + *os << "this->" << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix () << " = val;" << be_uidt_nl @@ -896,7 +892,6 @@ be_visitor_valuetype_field_cs::visit_string (be_string *node) } *os << "{" << be_idt_nl; - *os << "// set the value" << be_nl; if (node->width () == (long) sizeof (char)) { @@ -934,7 +929,7 @@ be_visitor_valuetype_field_cs::visit_string (be_string *node) << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix () << ";" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } @@ -985,7 +980,7 @@ be_visitor_valuetype_field_cs::visit_structure (be_structure *node) } } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // (1) Set from a const. @@ -1032,7 +1027,7 @@ be_visitor_valuetype_field_cs::visit_structure (be_structure *node) << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix () << ";" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}"; return 0; } @@ -1102,7 +1097,7 @@ be_visitor_valuetype_field_cs::visit_union (be_union *node) } } - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// Accessor to set the member" << be_nl @@ -1147,7 +1142,7 @@ be_visitor_valuetype_field_cs::visit_union (be_union *node) << bu->field_pd_prefix () << ub->local_name () << bu->field_pd_postfix () << ";" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } 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 836c462aeb8..95eba34ec61 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp @@ -168,7 +168,7 @@ be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node) << "{" << be_idt_nl << "return 0;" << be_uidt_nl << "}" << be_uidt << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; return 0; } 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 0fea9926210..c6be4bcb6f7 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/obv_module.cpp @@ -40,13 +40,19 @@ be_visitor_obv_module::~be_visitor_obv_module (void) int be_visitor_obv_module::visit_module (be_module *node) { - TAO_OutStream *os = this->ctx_->stream (); + if (node->imported ()) + { + return 0; + } if (node->has_nested_valuetype ()) { + TAO_OutStream *os = this->ctx_->stream (); + if (this->ctx_->state () == TAO_CodeGen::TAO_MODULE_OBV_CH) { - os->indent (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "TAO_NAMESPACE "; @@ -61,8 +67,7 @@ be_visitor_obv_module::visit_module (be_module *node) *os << " " << node->local_name () << be_nl; } - *os << "{" << be_nl - << be_idt; + *os << "{" << be_idt; } if (this->visit_scope (node) == -1) @@ -76,15 +81,16 @@ be_visitor_obv_module::visit_module (be_module *node) if (this->ctx_->state () == TAO_CodeGen::TAO_MODULE_OBV_CH) { - os->decr_indent (); - *os << "}\nTAO_NAMESPACE_CLOSE\n\n"; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + + *os << be_uidt_nl << be_nl << "}TAO_NAMESPACE_CLOSE"; } } return 0; } - int be_visitor_obv_module::visit_valuetype (be_valuetype *node) { @@ -190,3 +196,109 @@ be_visitor_obv_module::visit_valuetype (be_valuetype *node) return 0; } + +int +be_visitor_obv_module::visit_eventtype (be_eventtype *node) +{ + be_visitor_context ctx (*this->ctx_); + ctx.node (node); + int status = 1; + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_MODULE_OBV_CH: + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_OBV_CH); + break; + case TAO_CodeGen::TAO_MODULE_OBV_CI: + { + // This context state is not involved in any strategies. + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_OBV_CI); + be_visitor_eventtype_obv_ci visitor (&ctx); + status = node->accept (&visitor); + break; + } + case TAO_CodeGen::TAO_MODULE_OBV_CS: + ctx.state (TAO_CodeGen::TAO_EVENTTYPE_OBV_CS); + break; + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_obv_module::" + "visit_valuetype - " + "Bad context state\n" + ), + -1); + } + } + + 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 ())); + + be_visitor *visitor = tao_cg->make_visitor (&ctx); + + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_obv_module::" + "visit_valuetype - " + "NUL visitor\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_obv_module::" + "visit_valuetype - " + "failed to accept visitor\n"), + -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_obv_module::" + "visit_valuetype - " + "NUL visitor\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_obv_module::" + "visit_valuetype - " + "failed to accept visitor\n"), + -1); + } + + delete visitor; + visitor = 0; + } + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp index 73193e5cdda..6248fd149a7 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp @@ -1003,6 +1003,9 @@ be_visitor_valuetype::gen_init_defn (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "class " << be_global->stub_export_macro () << " " << node->local_name () << "_init : public CORBA_ValueFactoryBase" << be_nl; @@ -1071,8 +1074,13 @@ be_visitor_valuetype::determine_factory_style (be_valuetype* node) return factory_style; } + if (node->is_abstract ()) + { + return FS_NO_FACTORY; + } + // Check whether we have at least one operation or not. - idl_bool have_operation = be_visitor_valuetype::have_operation(node); + idl_bool have_operation = be_visitor_valuetype::have_operation (node); idl_bool have_factory = 0; @@ -1222,7 +1230,7 @@ be_visitor_valuetype::obv_need_ref_counter (be_valuetype* node) // VT needs RefCounter if it has concrete factory and // none of its base VT has ref_counter - if (determine_factory_style (node) != FS_CONCRETE_FACTORY) + if (be_visitor_valuetype::determine_factory_style (node) != FS_CONCRETE_FACTORY) { return 0; } @@ -1234,7 +1242,7 @@ be_visitor_valuetype::obv_need_ref_counter (be_valuetype* node) if (vt != 0) { - if (obv_have_ref_counter (vt)) + if (be_visitor_valuetype::obv_have_ref_counter (vt)) { return 0; } @@ -1254,7 +1262,7 @@ be_visitor_valuetype::obv_have_ref_counter (be_valuetype* node) return 0; } - if (determine_factory_style(node) == FS_CONCRETE_FACTORY) + if (be_visitor_valuetype::determine_factory_style (node) == FS_CONCRETE_FACTORY) { return 1; } @@ -1266,7 +1274,7 @@ be_visitor_valuetype::obv_have_ref_counter (be_valuetype* node) if (vt != 0) { - if (obv_have_ref_counter (vt)) + if (be_visitor_valuetype::obv_have_ref_counter (vt)) { return 1; } 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 bf74fd7233c..08660fc562e 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp @@ -37,7 +37,6 @@ be_visitor_valuetype_ch::~be_visitor_valuetype_ch (void) { } - int be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) { @@ -49,18 +48,18 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); int status = 0; - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // == STEP 1: Generate the class name and class names we inherit == // Forward declaration. - *os << "class " << node->local_name () << ";" << be_nl; + *os << "class " << node->local_name () << ";"; os->gen_ifdef_macro (node->flat_name (), "_ptr"); - *os << "typedef " << node->local_name () - << " *" << node->local_name () << "_ptr;" << be_nl; + *os << be_nl << be_nl << "typedef " << node->local_name () + << " *" << node->local_name () << "_ptr;"; os->gen_endif (); @@ -93,6 +92,9 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) -1); } + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__; + // Generate the endif macro. os->gen_endif (); @@ -100,17 +102,18 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) os->gen_ifdef_macro (node->flat_name ()); // Now generate the class definition. - *os << "class " << be_global->stub_export_macro () + *os << be_nl << be_nl << "class " << be_global->stub_export_macro () << " " << node->local_name (); // Node valuetype inherits from other valuetypes (OMG 20.17.9) // (ordinary (not abstract) interfaces ignored). - *os << be_idt_nl <<": "; + *os << be_idt_nl <<": " << be_idt; long i; // loop index be_valuetype *inherited = 0; long n_inherits = node->n_inherits (); + int inherits_eventtype = 0; if (n_inherits > 0) { @@ -119,18 +122,14 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) inherited = be_valuetype::narrow_from_decl (node->inherits ()[i]); + if (inherited->node_type () == AST_Decl::NT_eventtype) + { + inherits_eventtype = 1; + } + if (i > 0) { - *os << ","; - - if (i == 1) - { - *os << be_idt_nl; - } - else - { - *os << be_nl; - } + *os << "," << be_nl; } be_decl *scope = 0; @@ -192,26 +191,37 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) is_an_amh_exception_holder = 1; } } - /*******************************************************************/ - // We do not inherit from any valuetype, hence we do so from the base - // CORBA::ValueBase class. - if (n_inherits > 0) + if (is_an_amh_exception_holder) { - *os << "," << be_nl; + if (n_inherits > 0) + { + *os << "," << be_nl; + } + + *os << "public virtual CORBA_DefaultValueRefCountBase"; } - /*********************************************************************/ - // 2 - if (is_an_amh_exception_holder) + if (node->node_type () == AST_Decl::NT_eventtype) { - *os << "public virtual CORBA_DefaultValueRefCountBase" - << be_uidt_nl; + if (inherits_eventtype == 0) + { + if (n_inherits > 0) + { + *os << "," << be_nl; + } + + *os << "public virtual Components::ValueBase"; + } } - /*********************************************************************/ - else + else if (n_inherits == 0) { - *os << "public virtual CORBA_ValueBase" << be_uidt_nl; + if (is_an_amh_exception_holder) + { + *os << "," << be_nl; + } + + *os << "public virtual CORBA_ValueBase"; } if (node->supports_abstract ()) @@ -269,9 +279,10 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) << "static const char* " << "_tao_obv_static_repository_id (void);" << be_nl << be_nl; - *os << "static void _tao_any_destructor (void *);" - << be_nl << be_nl; - + if (be_global->any_support ()) + { + *os << "static void _tao_any_destructor (void *);"; + } // Generate code for the valuetype definition. if (this->visit_valuetype_scope (node) == -1) @@ -300,7 +311,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) -1); } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__; // If we inherit from both CORBA::ValueBase and CORBA::AbstractBase, @@ -390,8 +401,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) << node->flat_name () << " (TAO_OutputCDR &) {return 1;}" << be_nl; *os << "virtual CORBA::Boolean _tao_unmarshal__" - << node->flat_name () << " (TAO_InputCDR &) {return 1;}" - << be_nl; + << node->flat_name () << " (TAO_InputCDR &) {return 1;}"; } /*********************************************************/ else @@ -400,13 +410,12 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) << node->flat_name () << " (TAO_OutputCDR &) = 0;" << be_nl; *os << "virtual CORBA::Boolean _tao_unmarshal__" - << node->flat_name () << " (TAO_InputCDR &) = 0;" - << be_nl; + << node->flat_name () << " (TAO_InputCDR &) = 0;"; } } } - *os << be_uidt_nl << "};" << be_nl; + *os << be_uidt_nl << "};"; os->gen_endif (); @@ -454,6 +463,9 @@ be_visitor_valuetype_ch::visit_operation (be_operation *node) this->ctx_->node (node); // save the node + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Every operation is declared virtual in the client code. *os << "virtual "; @@ -552,7 +564,7 @@ be_visitor_valuetype_ch::begin_private (void) { TAO_OutStream *os = this->ctx_->stream (); - *os << be_uidt_nl << "protected:" << be_idt_nl; + *os << be_uidt_nl << be_nl << "protected:" << be_idt; } int 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 0717c18d30c..72f8e62cf2a 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp @@ -52,9 +52,7 @@ be_visitor_valuetype_ci::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); - os->indent (); - - *os << "// TAO_IDL - Generated from " << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "ACE_INLINE" << be_nl; @@ -95,7 +93,7 @@ be_visitor_valuetype_ci::visit_valuetype (be_valuetype *node) << node->name () << "::_tao_obv_static_repository_id ()" << be_nl << "{" << be_idt_nl << "return \"" << node->repoID () << "\";" << be_uidt_nl - << "}\n\n"; + << "}"; if (this->visit_scope (node) == -1) { 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 25689ad47c8..4b3df9a4b2c 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp @@ -91,7 +91,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Global functions to allow non-defined forward declared interfaces @@ -112,7 +112,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) << ")" << be_uidt_nl << "{" << be_idt_nl << "CORBA::remove_ref (p);" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; // Generate methods for _var class. if (node->gen_var_impl () == -1) @@ -134,7 +134,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) -1); } - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // The _downcast method // %! use ACE_xxx_cast here ? @@ -247,17 +247,20 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) *os << be_nl << "return rval;" << be_uidt_nl << "}" << be_nl << be_nl; - *os << "void" << be_nl - << node->name () - << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl - << "{" << be_idt_nl - << node->local_name () << " *tmp =" << be_idt_nl - << "ACE_static_cast (" << be_idt << be_idt_nl - << node->local_name () << " *," << be_nl - << "_tao_void_pointer" << be_uidt_nl - << ");" << be_uidt << be_uidt_nl - << "delete tmp;" << be_uidt_nl - << "}" << be_nl << be_nl; + if (be_global->any_support ()) + { + *os << "void" << be_nl + << node->name () + << "::_tao_any_destructor (void *_tao_void_pointer)" << be_nl + << "{" << be_idt_nl + << node->local_name () << " *tmp =" << be_idt_nl + << "ACE_static_cast (" << be_idt << be_idt_nl + << node->local_name () << " *," << be_nl + << "_tao_void_pointer" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl + << "delete tmp;" << be_uidt_nl + << "}" << be_nl << be_nl; + } // Nothing to marshal if abstract valuetype. @@ -352,15 +355,16 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) << "// Align the pointer to the right subobject." << be_nl << "new_object = " << node->local_name () << "::_downcast (base);" << be_nl << "return retval;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; if (node->supports_abstract ()) { - *os << "CORBA::ValueBase *" << be_nl + *os << be_nl << be_nl + << "CORBA::ValueBase *" << be_nl << node->name () << "::_tao_to_value (void)" << be_nl << "{" << be_idt_nl << "return this;" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; } // Generate code for the elements of the valuetype. 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 cb507e4ca8b..4d057ca4d21 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 @@ -67,6 +67,8 @@ be_visitor_valuetype_init_ch::visit_valuetype (be_valuetype *node) // Generate the ifdef macro for the _init class. os.gen_ifdef_macro (node->flat_name (), "_init"); + os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; //@@ If I'm generating concrete class I need a RefCounter. os << "class " << be_global->stub_export_macro () @@ -133,7 +135,7 @@ be_visitor_valuetype_init_ch::visit_valuetype (be_valuetype *node) os << node->local_name () << "_init ();"; } - os << be_uidt_nl << "};" << be_nl << be_nl; + os << be_uidt_nl << "};"; // Generate the endif macro. os.gen_endif (); 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 bda1a103b02..7086baf33b2 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 @@ -80,7 +80,7 @@ be_visitor_valuetype_init_cs::visit_valuetype (be_valuetype *node) "%s_init", node->local_name ()); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // ctor @@ -136,8 +136,6 @@ be_visitor_valuetype_init_cs::visit_valuetype (be_valuetype *node) } } - *os << be_nl << be_nl; - return 0; } 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 45e70d1190b..92a482266cd 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 @@ -30,7 +30,9 @@ ACE_RCSID (be_visitor_valuetype, // Valuetype visitor for client header // ****************************************************** -be_visitor_valuetype_obv_ch::be_visitor_valuetype_obv_ch (be_visitor_context *ctx) +be_visitor_valuetype_obv_ch::be_visitor_valuetype_obv_ch ( + be_visitor_context *ctx + ) : be_visitor_valuetype (ctx) { } @@ -52,10 +54,13 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ ; + // OBV_ class maps only to a typedef if we are optimizing accessors. if (node->opt_accessor ()) { - *os << "typedef " << node->full_name () << " "; + *os << be_nl << be_nl << "typedef " << node->full_name () << " "; if (!node->is_nested ()) { @@ -69,7 +74,7 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node) // STEP 1: Generate the class name and the class name we inherit. os->gen_ifdef_macro (node->flat_name (), "_OBV"); - *os << "// OBV_ class" << be_nl; + *os << be_nl << be_nl << "// OBV_ class" << be_nl; *os << "class " << be_global->stub_export_macro() << " ";; if (!node->is_nested()) @@ -118,7 +123,7 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node) *os << inherited->full_name(); } // end of for loop - if (obv_need_ref_counter (node)) + if (this->obv_need_ref_counter (node)) { *os << "," << be_nl; @@ -173,7 +178,7 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node) } *os << be_uidt_nl; - *os << "};" << be_nl; + *os << "};"; os->gen_endif (); } @@ -217,13 +222,13 @@ void be_visitor_valuetype_obv_ch::begin_public (void) { TAO_OutStream *os = this->ctx_->stream (); - *os << "public:" << be_idt_nl; + *os << "public:" << be_idt; } void be_visitor_valuetype_obv_ch::begin_private (void) { TAO_OutStream *os = this->ctx_->stream (); - *os << be_uidt_nl; - *os << "protected:" << be_idt_nl; + *os << be_uidt_nl << be_nl; + *os << "protected:" << be_idt; } 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 40067e536c2..c66063fc844 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 @@ -30,7 +30,9 @@ ACE_RCSID (be_visitor_valuetype, // Valuetype visitor for OBV_ class implementation // ****************************************************** -be_visitor_valuetype_obv_ci::be_visitor_valuetype_obv_ci (be_visitor_context *ctx) +be_visitor_valuetype_obv_ci::be_visitor_valuetype_obv_ci ( + be_visitor_context *ctx + ) : be_visitor_valuetype (ctx) { } 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 f4d115dfd23..fc4d71c1b6b 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 @@ -30,7 +30,9 @@ ACE_RCSID (be_visitor_valuetype, // Valuetype visitor for OBV_ class implementation // ****************************************************** -be_visitor_valuetype_obv_cs::be_visitor_valuetype_obv_cs (be_visitor_context *ctx) +be_visitor_valuetype_obv_cs::be_visitor_valuetype_obv_cs ( + be_visitor_context *ctx + ) : be_visitor_scope (ctx) { } @@ -52,7 +54,7 @@ be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// TAO_IDL - Generated from" << be_nl + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // OBV_ class has no accessors or modifiers if we are optimizing @@ -73,7 +75,7 @@ be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node) << " (TAO_InputCDR &strm)" << be_nl << "{" << be_idt_nl << "return _tao_unmarshal_state (strm);" << be_uidt_nl - << "}" << be_nl; + << "}"; if (this->visit_scope (node) == -1) { @@ -102,7 +104,7 @@ be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node) << "{" << be_idt_nl << "this->CORBA_DefaultValueRefCountBase::_remove_ref ();" << be_uidt_nl - << "}" << be_nl << be_nl; + << "}"; } } @@ -112,11 +114,11 @@ be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node) int be_visitor_valuetype_obv_cs::visit_field (be_field *node) { - be_visitor_context *ctx = new be_visitor_context (*this->ctx_); - be_visitor_valuetype_field_cs *visitor = - new be_visitor_valuetype_field_cs (ctx); - visitor->in_obv_space_ = 1; - if (visitor->visit_field (node) == -1) + be_visitor_context ctx = (*this->ctx_); + be_visitor_valuetype_field_cs visitor (&ctx); + visitor.in_obv_space_ = 1; + + if (visitor.visit_field (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_valuetype_obv_cs::" @@ -124,6 +126,6 @@ be_visitor_valuetype_obv_cs::visit_field (be_field *node) "visit_field failed\n" ), -1); } - delete visitor; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp index 54d3bdb0bd5..8c0cf37e843 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_sh.cpp @@ -128,7 +128,7 @@ be_visitor_valuetype_sh::visit_valuetype (be_valuetype *node) *os << "virtual const char* _interface_repository_id " << "(void) const;" << be_uidt_nl; - *os << "};\n\n"; + *os << "};" << be_nl << be_nl; return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp index bcc4a2200da..925c5e847a5 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd.cpp @@ -27,7 +27,7 @@ #include "be_visitor_context.h" #include "be_visitor_valuetype_fwd/valuetype_fwd_ch.cpp" -#include "be_visitor_valuetype_fwd/valuetype_fwd_ci.cpp" +#include "be_visitor_valuetype_fwd/any_op_ch.cpp" #include "be_visitor_valuetype_fwd/cdr_op_ch.cpp" #include "be_visitor_valuetype_fwd/cdr_op_ci.cpp" diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp new file mode 100644 index 00000000000..ee2355ca3cd --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/any_op_ch.cpp @@ -0,0 +1,79 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for Any operators for a forward declared +// valuetype in the client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +ACE_RCSID (be_visitor_valuetype_fwd, + any_op_ch, + "$Id$") + +// *************************************************************************** +// Generates Any operator declarations in the client header +// *************************************************************************** + +be_visitor_valuetype_fwd_any_op_ch::be_visitor_valuetype_fwd_any_op_ch ( + be_visitor_context *ctx + ) + : be_visitor_decl (ctx) +{ +} + +be_visitor_valuetype_fwd_any_op_ch::~be_visitor_valuetype_fwd_any_op_ch (void) +{ +} + +int +be_visitor_valuetype_fwd_any_op_ch::visit_valuetype_fwd ( + be_valuetype_fwd *node + ) +{ + AST_Interface *fd = node->full_definition (); + + // Only a forward declared interface that is not defined in the same file + // needs to have this generated here. The Any operators are needed by + // portable interceptor code if the interface is a parameter of an operation. + if (fd->is_defined () != 0) + { + return 0; + } + + if (node->cli_hdr_any_op_gen () + || node->imported ()) + { + return 0; + } + + TAO_OutStream *os = this->ctx_->stream (); + + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << be_global->stub_export_macro () << " void" + << " operator<<= (CORBA::Any &, " << node->name () + << " *); // copying" << be_nl; + *os << be_global->stub_export_macro () << " void" + << " operator<<= (CORBA::Any &, " << node->name () + << " **); // non-copying" << be_nl; + *os << be_global->stub_export_macro () << " CORBA::Boolean" + << " operator>>= (const CORBA::Any &, " + << node->name () << " *&);"; + + node->cli_hdr_any_op_gen (1); + return 0; +} 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 8126f1674ee..b1ff613ea30 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 @@ -11,7 +11,7 @@ // valuetype_fwd_ch.cpp // // = DESCRIPTION -// Visitor generating code for Interface_Fwd node in the client header. +// Visitor generating code for ValueTypeFwd node in the client header. // // = AUTHOR // Boris Kolpackov <bosk@ipmce.ru> @@ -24,7 +24,9 @@ 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_valuetype_fwd_ch::be_visitor_valuetype_fwd_ch ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } @@ -53,18 +55,20 @@ be_visitor_valuetype_fwd_ch::visit_valuetype_fwd (be_valuetype_fwd *node) TAO_OutStream *os = this->ctx_->stream (); - *os << "// Valuetype class" << be_nl; + *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // == STEP 1: Generate the class name and class names we inherit == // Forward declaration. - *os << "class " << node->local_name () << ";" << be_nl; + *os << "class " << node->local_name () << ";"; // Generate _ptr declaration os->gen_ifdef_macro (node->flat_name (), "_ptr"); - *os << "typedef " << node->local_name () - << " *" << node->local_name () << "_ptr;" << be_nl; + *os << be_nl << be_nl + << "typedef " << node->local_name () + << " *" << node->local_name () << "_ptr;"; os->gen_endif (); 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 deleted file mode 100644 index b24a18a32b2..00000000000 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/valuetype_fwd_ci.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -// $Id$ -// - -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// valuetype_fwd_ci.cpp -// -// = DESCRIPTION -// Visitor generating code for Interface_Fwd node in the client inline. -// -// = AUTHOR -// Torsten Kuepper -// based on code from Aniruddha Gokhale (interface_fwd_ci.cpp) -// -// ============================================================================ - -ACE_RCSID (be_visitor_valuetype_fwd, - valuetype_fwd_ci, - "$Id$") - -be_visitor_valuetype_fwd_ci::be_visitor_valuetype_fwd_ci ( - be_visitor_context *ctx - ) - : be_visitor_decl (ctx) -{ -} - -be_visitor_valuetype_fwd_ci::~be_visitor_valuetype_fwd_ci (void) -{ -} - -int -be_visitor_valuetype_fwd_ci::visit_valuetype_fwd (be_valuetype_fwd *) -{ - return 0; -} diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h index 9fe2850154a..95e43105898 100644 --- a/TAO/TAO_IDL/be_include/be_codegen.h +++ b/TAO/TAO_IDL/be_include/be_codegen.h @@ -176,6 +176,7 @@ public: TAO_INTERFACE_TIE_SI, TAO_INTERFACE_SMART_PROXY_CH, TAO_INTERFACE_SMART_PROXY_CS, + TAO_INTERFACE_INTERCEPTORS_CH, TAO_INTERFACE_INTERCEPTORS_CS, TAO_INTERFACE_INTERCEPTORS_SH, TAO_INTERFACE_INTERCEPTORS_SS, @@ -206,11 +207,8 @@ public: // Emitting code for the interface forward declaration. TAO_INTERFACE_FWD_CH, - TAO_INTERFACE_FWD_CI, - TAO_INTERFACE_FWD_CS, TAO_INTERFACE_FWD_CDR_OP_CH, TAO_INTERFACE_FWD_CDR_OP_CI, - TAO_INTERFACE_FWD_CDR_OP_CS, TAO_INTERFACE_FWD_ANY_OP_CH, // Emitting code for the AMH ResponseHandlers. @@ -246,11 +244,69 @@ public: // Emitting code for the valuetype forward declaration. TAO_VALUETYPE_FWD_CH, - TAO_VALUETYPE_FWD_CI, - TAO_VALUETYPE_FWD_CS, + TAO_VALUETYPE_FWD_ANY_OP_CH, TAO_VALUETYPE_FWD_CDR_OP_CH, TAO_VALUETYPE_FWD_CDR_OP_CI, - TAO_VALUETYPE_FWD_CDR_OP_CS, + + // Emitting code for the component. + TAO_COMPONENT_CH, + TAO_COMPONENT_CI, + TAO_COMPONENT_CS, + TAO_COMPONENT_IS, + TAO_COMPONENT_IH, + TAO_COMPONENT_SH, + TAO_COMPONENT_SI, + TAO_COMPONENT_SS, + TAO_COMPONENT_ANY_OP_CH, + TAO_COMPONENT_ANY_OP_CS, + TAO_COMPONENT_CDR_OP_CH, + TAO_COMPONENT_CDR_OP_CI, + TAO_COMPONENT_CDR_OP_CS, + + // Emitting code for the component forward declaration. + TAO_COMPONENT_FWD_CH, + TAO_COMPONENT_FWD_CDR_OP_CH, + TAO_COMPONENT_FWD_CDR_OP_CI, + TAO_COMPONENT_FWD_ANY_OP_CH, + + // Emitting code for the eventtype. + TAO_EVENTTYPE_CH, + TAO_EVENTTYPE_CI, + TAO_EVENTTYPE_CS, + TAO_EVENTTYPE_IS, + TAO_EVENTTYPE_IH, + TAO_EVENTTYPE_SH, + TAO_EVENTTYPE_SI, + TAO_EVENTTYPE_SS, + TAO_EVENTTYPE_OBV_CH, // OBV_ class + TAO_EVENTTYPE_OBV_CI, + TAO_EVENTTYPE_OBV_CS, + TAO_EVENTTYPE_ANY_OP_CH, + TAO_EVENTTYPE_ANY_OP_CS, + TAO_EVENTTYPE_CDR_OP_CH, + TAO_EVENTTYPE_CDR_OP_CI, + TAO_EVENTTYPE_CDR_OP_CS, + + // Emitting code for the eventtype forward declaration. + TAO_EVENTTYPE_FWD_CH, + TAO_EVENTTYPE_FWD_CDR_OP_CH, + TAO_EVENTTYPE_FWD_CDR_OP_CI, + TAO_EVENTTYPE_FWD_ANY_OP_CH, + + // Emitting code for the component home. + TAO_HOME_CH, + TAO_HOME_CI, + TAO_HOME_CS, + TAO_HOME_IS, + TAO_HOME_IH, + TAO_HOME_SH, + TAO_HOME_SI, + TAO_HOME_SS, + TAO_HOME_ANY_OP_CH, + TAO_HOME_ANY_OP_CS, + TAO_HOME_CDR_OP_CH, + TAO_HOME_CDR_OP_CI, + TAO_HOME_CDR_OP_CS, // Emitting code for the module, TAO_MODULE_CH, diff --git a/TAO/TAO_IDL/be_include/be_component.h b/TAO/TAO_IDL/be_include/be_component.h index c9a5f96891d..bddd9f35a66 100644 --- a/TAO/TAO_IDL/be_include/be_component.h +++ b/TAO/TAO_IDL/be_include/be_component.h @@ -44,12 +44,17 @@ public: ~be_component (void); - virtual void destroy (void); // Cleanup function. + virtual void destroy (void); // Visiting. virtual int accept (be_visitor *visitor); + // Need for public access to fe_add_structure and fe_add_typedef, + // used to add implied IDL nodes created for 'uses multiple' declarations. + AST_Structure *be_add_structure (AST_Structure *t); + AST_Typedef *be_add_typedef (AST_Typedef *t); + // Narrowing. DEF_NARROW_METHODS2 (be_component, be_interface, AST_Component); DEF_NARROW_FROM_DECL (be_component); diff --git a/TAO/TAO_IDL/be_include/be_eventtype.h b/TAO/TAO_IDL/be_include/be_eventtype.h new file mode 100644 index 00000000000..c6c71fc9324 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_eventtype.h @@ -0,0 +1,66 @@ +/* -*- c++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_eventtype.h +// +// = DESCRIPTION +// Extension of class AST_EventType and be_valuetype that provides +// additional means for C++ mapping of an valuetype. +// +// ============================================================================ + +#ifndef TAO_BE_EVENTTYPE_H +#define TAO_BE_EVENTTYPE_H + +#include "be_valuetype.h" +#include "ast_eventtype.h" + +class be_eventtype : public virtual be_valuetype, + public virtual AST_EventType +{ + // = TITLE + // Backend-class for eventtypes + // + // = DESCRIPTION + // Extends be_valuetype. + // +public: + be_eventtype (void); + // Default constructor. + + be_eventtype (UTL_ScopedName *n, + AST_Interface **inherits, + long n_inherits, + AST_ValueType *inherits_concrete, + AST_Interface **inherits_flat, + long n_inherits_flat, + AST_Interface **supports, + long n_supports, + AST_Interface *supports_concrete, + idl_bool abstract, + idl_bool truncatable); + // Constructor that sets its scoped name <n>, a list of inherited valuetypes + // and supported interfaces <ih>, and the number of inherited interfaces <nih> + + ~be_eventtype (void); + // Destructor. + + // Visiting. + virtual int accept (be_visitor *visitor); + + // Cleanup. + virtual void destroy (void); + + // Narrowing. + DEF_NARROW_METHODS2 (be_eventtype, be_valuetype, AST_EventType); + DEF_NARROW_FROM_DECL (be_eventtype); + DEF_NARROW_FROM_SCOPE (be_eventtype); +}; + +#endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_eventtype_fwd.h b/TAO/TAO_IDL/be_include/be_eventtype_fwd.h new file mode 100644 index 00000000000..63499fe887e --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_eventtype_fwd.h @@ -0,0 +1,57 @@ +/* -*- c++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_eventtype_fwd.h +// +// = DESCRIPTION +// Extension of class AST_EventType_Fwd that provides additional +// means for C++ mapping of an eventtype. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef BE_EVENTTYPE_FWD_H +#define BE_EVENTTYPE_FWD_H + +#include "be_valuetype_fwd.h" +#include "ast_eventtype_fwd.h" + +class be_eventtype_fwd : public virtual be_valuetype_fwd, + public virtual AST_EventTypeFwd +{ + // =TITLE + // be_valuetype_fwd + // + // =DESCRIPTION + // Extensions to the be_interface_fwd class +public: + be_eventtype_fwd (void); + // Default constructor. + + be_eventtype_fwd (AST_Interface *dummy, + UTL_ScopedName *n); + // Constructor. + + virtual ~be_eventtype_fwd (void); + // Destructor. + + // Visiting. + virtual int accept (be_visitor* visitor); + + // Cleanup + virtual void destroy (void); + + // Narrowing. + DEF_NARROW_METHODS2 (be_eventtype_fwd, be_valuetype_fwd, AST_EventTypeFwd); + DEF_NARROW_FROM_DECL (be_eventtype_fwd); +}; + +#endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_generator.h b/TAO/TAO_IDL/be_include/be_generator.h index 73012b08b63..a0aa517494b 100644 --- a/TAO/TAO_IDL/be_include/be_generator.h +++ b/TAO/TAO_IDL/be_include/be_generator.h @@ -117,6 +117,21 @@ public: virtual AST_ValueTypeFwd *create_valuetype_fwd (UTL_ScopedName *n, idl_bool abstract); + virtual AST_EventType *create_eventtype (UTL_ScopedName *n, + AST_Interface **inherits, + long n_inherits, + AST_ValueType *inherits_concrete, + AST_Interface **inherits_flat, + long n_inherits_flat, + AST_Interface **supports, + long n_supports, + AST_Interface *supports_concrete, + idl_bool abstract, + idl_bool truncatable); + + virtual AST_EventTypeFwd *create_eventtype_fwd (UTL_ScopedName *n, + idl_bool abstract); + virtual AST_Component *create_component (UTL_ScopedName *n, AST_Component *base_component, AST_Interface **supports, diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index fe4ff9a7219..0033597775e 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -27,6 +27,7 @@ class be_interface; class be_interface_fwd; class UTL_String; +class AST_PredefinedType; // Defines a class containing all back end global data. @@ -390,6 +391,10 @@ public: // CORBA::is_nil, needed when the interface inherits versions from // both CORBA::Object and CORBA::AbstractBase. + AST_PredefinedType *void_type (void) const; + void void_type (AST_PredefinedType *val); + // Accessors for the member. + private: size_t changing_standard_include_files_; // To switch between changing or non-changing standard include @@ -506,6 +511,9 @@ private: LOOKUP_STRATEGY lookup_strategy_; // The enumerated value indicating the lookup strategy. + + AST_PredefinedType *void_type_; + // Used for void operation return types. }; #endif /* _BE_GLOBAL_H */ diff --git a/TAO/TAO_IDL/be_include/be_structure.h b/TAO/TAO_IDL/be_include/be_structure.h index 8830f052572..7d337d7e440 100644 --- a/TAO/TAO_IDL/be_include/be_structure.h +++ b/TAO/TAO_IDL/be_include/be_structure.h @@ -62,6 +62,9 @@ public: virtual int accept (be_visitor *visitor); // Visiting. + AST_Field *be_add_field (AST_Field *f); + // To access the protected base class method fe_add_field. + // Narrowing. DEF_NARROW_METHODS3 (be_structure, AST_Structure, be_scope, be_type); DEF_NARROW_FROM_DECL (be_structure); diff --git a/TAO/TAO_IDL/be_include/be_structure_fwd.h b/TAO/TAO_IDL/be_include/be_structure_fwd.h index 6627e9ade78..f1fd43c0e99 100644 --- a/TAO/TAO_IDL/be_include/be_structure_fwd.h +++ b/TAO/TAO_IDL/be_include/be_structure_fwd.h @@ -25,6 +25,7 @@ #include "ast_structure_fwd.h" class be_visitor; +class be_structure; class be_structure_fwd : public virtual AST_StructureFwd, public virtual be_type @@ -38,7 +39,8 @@ public: be_structure_fwd (void); // Default constructor. - be_structure_fwd (UTL_ScopedName *n); + be_structure_fwd (AST_Structure *dummy, + UTL_ScopedName *n); // Constructor. virtual ~be_structure_fwd (void); diff --git a/TAO/TAO_IDL/be_include/be_union_fwd.h b/TAO/TAO_IDL/be_include/be_union_fwd.h index c9d2132983a..1303e345e9d 100644 --- a/TAO/TAO_IDL/be_include/be_union_fwd.h +++ b/TAO/TAO_IDL/be_include/be_union_fwd.h @@ -21,13 +21,13 @@ #ifndef BE_UNION_FWD_H #define BE_UNION_FWD_H -#include "be_type.h" +#include "be_structure_fwd.h" #include "ast_union_fwd.h" class be_visitor; class be_union_fwd : public virtual AST_UnionFwd, - public virtual be_type + public virtual be_structure_fwd { // =TITLE // be_union_fwd @@ -38,7 +38,8 @@ public: be_union_fwd (void); // Default constructor. - be_union_fwd (UTL_ScopedName *n); + be_union_fwd (AST_Union *dummy, + UTL_ScopedName *n); // Constructor. virtual ~be_union_fwd (void); @@ -51,7 +52,7 @@ public: virtual int accept (be_visitor* visitor); // Narrowing. - DEF_NARROW_METHODS2 (be_union_fwd, AST_UnionFwd, be_type); + DEF_NARROW_METHODS2 (be_union_fwd, AST_UnionFwd, be_structure_fwd); DEF_NARROW_FROM_DECL (be_union_fwd); }; diff --git a/TAO/TAO_IDL/be_include/be_visitor.h b/TAO/TAO_IDL/be_include/be_visitor.h index e326965ddc8..243289833d5 100644 --- a/TAO/TAO_IDL/be_include/be_visitor.h +++ b/TAO/TAO_IDL/be_include/be_visitor.h @@ -34,6 +34,8 @@ class be_interface; class be_interface_fwd; class be_valuetype; class be_valuetype_fwd; +class be_eventtype; +class be_eventtype_fwd; class be_component; class be_component_fwd; class be_home; @@ -105,6 +107,12 @@ public: virtual int visit_valuetype_fwd (be_valuetype_fwd *node); // visit valuetype_fwd + virtual int visit_eventtype (be_eventtype *node); + // visit eventtype + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit eventtype_fwd + virtual int visit_component (be_component *node); // visit component 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 a4aba407390..44aa412274e 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 @@ -71,8 +71,8 @@ public: private: int create_raise_operation (be_decl *node, - be_valuetype *excep_holder, - Operation_Kind operation_kind); + be_valuetype *excep_holder, + Operation_Kind operation_kind); // Creates a raise operation from node and inserts it in // excep_holder, while obeying if it is a normal operation // or a set or get attribute. diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h b/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h index 2bf9e4d56de..eea8d3da9b2 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/arglist.h @@ -62,6 +62,12 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface forward + virtual int visit_component (be_component *node); + // visit component + + virtual int visit_component_fwd (be_component_fwd *node); + // visit component forward + virtual int visit_native (be_native *node); // visit native node @@ -88,6 +94,15 @@ public: virtual int visit_valuetype_fwd (be_valuetype_fwd *node); // visit valuetype_fwd + + virtual int visit_eventtype (be_eventtype *node); + // visit eventtype + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit eventtype_fwd + + virtual int visit_home (be_home *node); + // visit home }; #endif /* _BE_VISITOR_ARGUMENT_ARGLIST_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/invoke_cs.h b/TAO/TAO_IDL/be_include/be_visitor_argument/invoke_cs.h index 2276f4d42b6..85e7bb968c7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/invoke_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/invoke_cs.h @@ -82,7 +82,20 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type + virtual int visit_component (be_component *node); + // visit a component node + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + virtual int visit_home (be_home *node); + // visit home }; #endif /* _BE_VISITOR_ARGUMENT_INVOKE_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/marshal_ss.h b/TAO/TAO_IDL/be_include/be_visitor_argument/marshal_ss.h index 346fe3154f8..20de8d09bae 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/marshal_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/marshal_ss.h @@ -82,6 +82,21 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + virtual int visit_home (be_home *node); + // visit home }; #endif /* _BE_VISITOR_ARGUMENT_MARSHAL_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/post_invoke_cs.h b/TAO/TAO_IDL/be_include/be_visitor_argument/post_invoke_cs.h index a77b3aaeda8..00df5340e90 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/post_invoke_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/post_invoke_cs.h @@ -64,6 +64,21 @@ public: virtual int visit_string (be_string *node); // visit string + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + virtual int visit_home (be_home *node); + // visit a component home }; #endif /* _BE_VISITOR_ARGUMENT_POST_INVOKE_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/post_marshal_ss.h b/TAO/TAO_IDL/be_include/be_visitor_argument/post_marshal_ss.h index 2c9af16ce5d..43e56ad2783 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/post_marshal_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/post_marshal_ss.h @@ -46,7 +46,6 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type - }; #endif /* _BE_VISITOR_ARGUMENT_POST_MARSHAL_SS_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/pre_invoke_cs.h b/TAO/TAO_IDL/be_include/be_visitor_argument/pre_invoke_cs.h index 9ff7ba0d918..b2d97c8b829 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/pre_invoke_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/pre_invoke_cs.h @@ -78,6 +78,21 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + virtual int visit_home (be_home *node); + // visit a component home }; #endif /* _BE_VISITOR_ARGUMENT_PRE_INVOKE_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_arglist.h b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_arglist.h index f0a105f2429..81fb89a6f3d 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_arglist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_arglist.h @@ -88,6 +88,21 @@ public: virtual int visit_valuetype_fwd (be_valuetype_fwd *node); // visit valuetype_fwd + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + virtual int visit_home (be_home *node); + // visit a component home }; #endif /* _BE_VISITOR_ARGUMENT_REQUEST_INFO_ARGLIST_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_ch.h b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_ch.h index e258f4af1ad..bc93a98ef51 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_ch.h @@ -89,6 +89,21 @@ public: virtual int visit_valuetype_fwd (be_valuetype_fwd *node); // visit valuetype_fwd + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + virtual int visit_home (be_home *node); + // visit a component home }; #endif /* _BE_VISITOR_ARGUMENT_REQUEST_INFO_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_result.h b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_result.h index c539301c9e9..feadf9c20aa 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_result.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_result.h @@ -80,6 +80,18 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node }; #endif /* _BE_VISITOR_ARGUMENT_REQUEST_INFO_RESULT_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_sh.h b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_sh.h index ad3963d4a5c..e5218f796b6 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_sh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_sh.h @@ -89,6 +89,18 @@ public: virtual int visit_valuetype_fwd (be_valuetype_fwd *node); // visit valuetype_fwd + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node }; #endif /* _BE_VISITOR_ARGUMENT_REQUEST_INFO_SH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_ss.h b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_ss.h index 26862a488a9..00d6706136f 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/request_info_ss.h @@ -43,7 +43,6 @@ public: virtual int visit_argument (be_argument *node); // visit the argument node - }; #endif /* _BE_VISITOR_ARGUMENT_REQUEST_INFO_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument/upcall_ss.h b/TAO/TAO_IDL/be_include/be_visitor_argument/upcall_ss.h index 0f0db659a35..f539efe24e6 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument/upcall_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument/upcall_ss.h @@ -83,6 +83,17 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node }; #endif /* _BE_VISITOR_ARGUMENT_UPCALL_SS_H_ */ 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 374f1f1a2ee..502edf093b6 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 @@ -83,6 +83,17 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node }; #endif /* _BE_VISITOR_ARGUMENT_VARDECL_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_ccm_pre_proc.h b/TAO/TAO_IDL/be_include/be_visitor_ccm_pre_proc.h new file mode 100644 index 00000000000..da3f5826140 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_ccm_pre_proc.h @@ -0,0 +1,163 @@ +// +// $Id$ +// + +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_visitor_ccm_pre_proc.h +// +// = DESCRIPTION +// This visitor creates for components the appropriate AST +// (Abstract Syntax Tree) nodes, corresponding to provides, uses, +// emits, publishes and consumes declarations, +// and adds the nodes to the AST. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef TAO_BE_VISITOR_CCM_PRE_PROC_H +#define TAO_BE_VISITOR_CCM_PRE_PROC_H + +#include "be_visitor_scope.h" +#include "ast_component.h" +#include "utl_identifier.h" + +class be_valuetype; +class be_exception; +class UTL_ExceptList; + +class be_visitor_ccm_pre_proc : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_ccm_pre_proc + // + // = DESCRIPTION + // Adds CCM implied IDL code to the AST. + // +public: + be_visitor_ccm_pre_proc (be_visitor_context *ctx); + + virtual ~be_visitor_ccm_pre_proc (void); + + virtual int visit_root (be_root *node); + // visit a root + + virtual int visit_module (be_module *node); + // visit module + + virtual int visit_component (be_component *node); + // visit component + + virtual int visit_home (be_home *node); + // visit component home + + virtual int visit_eventtype (be_eventtype *node); + // visit eventtype + +private: + // Utility methods to handle the corresponding IDL declarations. + int gen_provides (be_component *node); + int gen_uses (be_component *node); + int gen_emits (be_component *node); + int gen_publishes (be_component *node); + int gen_consumes (be_component *node); + int gen_factories (be_home *node, + AST_Interface *xplicit); + int gen_finders (be_home *node, + AST_Interface *xplicit); + int gen_implicit_ops (be_home *node, + AST_Interface *implicit); + + // Utility methods which generate individual operation nodes. + int gen_connect_single (be_component *node, + AST_Component::port_description *pd); + int gen_disconnect_single (be_component *node, + AST_Component::port_description *pd); + int gen_get_connection_single (be_component *node, + AST_Component::port_description *pd); + int gen_connect_multiple (be_component *node, + AST_Component::port_description *pd); + int gen_disconnect_multiple (be_component *node, + AST_Component::port_description *pd); + int gen_get_connection_multiple (be_component *node, + AST_Component::port_description *pd); + int gen_push_op (be_eventtype *node, + AST_Interface *consumer); + int gen_subscribe (be_component *node, + AST_Component::port_description *pd); + int gen_unsubscribe (be_component *node, + AST_Component::port_description *pd); + int gen_emits_connect (be_component *node, + AST_Component::port_description *pd); + int gen_emits_disconnect (be_component *node, + AST_Component::port_description *pd); + int gen_get_consumer (be_component *node, + AST_Component::port_description *pd); + int gen_create (be_home *node, + AST_Interface *implicit); + int gen_find_by_primary_key (be_home *node, + AST_Interface *implicit); + int gen_remove (be_home *node, + AST_Interface *implicit); + int gen_get_primary_key (be_home *node, + AST_Interface *implicit); + + // Utility functions to create and destroy the various things + // needed by operations generated from CCM-related declarations. + + int lookup_cookie (be_component *node); + int lookup_exceptions (be_component *node); + int lookup_one_exception (be_component *node, + const char *name, + be_exception *&result); + + int create_uses_multiple_stuff (be_component *node, + AST_Component::port_description *pd); + int create_uses_multiple_struct (be_component *node, + AST_Component::port_description *pd); + int create_uses_multiple_sequence (be_component *node, + AST_Component::port_description *pd); + + int create_event_consumer (be_eventtype *node); + AST_Interface *lookup_consumer (AST_Component::port_description *pd); + AST_Interface *create_explicit (be_home *node); + AST_Interface *create_implicit (be_home *node); + AST_Interface *create_equivalent (be_home *node, + AST_Interface *xplicit, + AST_Interface *implicit); + UTL_ScopedName *create_scoped_name (const char *prefix, + const char *local_name, + const char *suffix, + AST_Decl *parent); + UTL_NameList *compute_inheritance (be_home *node); + +private: + // These are created for operations implied by 'uses multiple' declarations. + Identifier module_id_; + be_valuetype *cookie_; + be_structure *connection_; + be_sequence *connections_; + + // Exceptions thrown by implied CCM operations. + be_exception *already_connected_; + be_exception *invalid_connection_; + be_exception *no_connection_; + be_exception *exceeded_connection_limit_; + be_exception *create_failure_; + be_exception *remove_failure_; + be_exception *finder_failure_; + be_exception *invalid_key_; + be_exception *unknown_key_value_; + be_exception *duplicate_key_value_; +}; + + +#endif // TAO_BE_VISITOR_CCM_PRE_PROC_H diff --git a/TAO/TAO_IDL/be_include/be_visitor_component.h b/TAO/TAO_IDL/be_include/be_visitor_component.h index 67e63e73cda..f1e2cbd37b3 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_component.h +++ b/TAO/TAO_IDL/be_include/be_visitor_component.h @@ -22,6 +22,21 @@ #ifndef TAO_BE_VISITOR_COMPONENT_H #define TAO_BE_VISITOR_COMPONENT_H -#include "be_visitor_scope.h" +#include "be_visitor_interface.h" -#endif +#include "be_visitor_component/component.h" +#include "be_visitor_component/component_ch.h" +#include "be_visitor_component/component_ci.h" +#include "be_visitor_component/component_cs.h" +#include "be_visitor_component/component_sh.h" +#include "be_visitor_component/component_si.h" +#include "be_visitor_component/component_ss.h" +#include "be_visitor_component/component_ih.h" +#include "be_visitor_component/component_is.h" +#include "be_visitor_component/any_op_ch.h" +#include "be_visitor_component/any_op_cs.h" +#include "be_visitor_component/cdr_op_ch.h" +#include "be_visitor_component/cdr_op_ci.h" +#include "be_visitor_component/cdr_op_cs.h" + +#endif /* TAO_BE_VISITOR_COMPONENT_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/any_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_component/any_op_ch.h new file mode 100644 index 00000000000..e5aec9e8f02 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/any_op_ch.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This one provides code generation for the Any operators +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_ANY_OP_CH_H_ +#define _BE_COMPONENT_ANY_OP_CH_H_ + +class be_visitor_component_any_op_ch : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_any_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for component that generates the Any + // operator declarations + // + +public: + be_visitor_component_any_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_any_op_ch (void); + // destructor + + virtual int visit_component (be_component *node); + // visit interface +}; + +#endif /* _BE_COMPONENT_ANY_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/any_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_component/any_op_cs.h new file mode 100644 index 00000000000..9d1c560a694 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/any_op_cs.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_cs.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This one provides code generation for the Any operators +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_ANY_OP_CS_H_ +#define _BE_COMPONENT_ANY_OP_CS_H_ + +class be_visitor_component_any_op_cs : public be_visitor_component +{ + // + // = TITLE + // be_visitor_interface_any_op_cs + // + // = DESCRIPTION + // This is a concrete visitor for interface that generates the Any operator + // implementations + // + +public: + be_visitor_component_any_op_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_any_op_cs (void); + // destructor + + virtual int visit_component (be_component *node); + // visit interface +}; + +#endif /* _BE_COMPONENT_ANY_OP_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_ch.h new file mode 100644 index 00000000000..ecb49788a08 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_ch.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Component class +// This one provides code generation for the CDR operators for the +// component in the client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_COMPONENT_CDR_OP_CH_H_ +#define _BE_VISITOR_COMPONENT_CDR_OP_CH_H_ + +class be_visitor_component_cdr_op_ch : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_cdr_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for component that generates the CDR operator + // declarations + // + +public: + be_visitor_component_cdr_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_cdr_op_ch (void); + // destructor + + virtual int visit_component (be_component *node); + // visit component +}; + +#endif /* _BE_VISITOR_COMPONENT_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_ci.h new file mode 100644 index 00000000000..bd403618824 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_ci.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Component class +// This one provides code generation for the CDR operators for the +// component in the client stub. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_COMPONENT_CDR_OP_CI_H_ +#define _BE_VISITOR_COMPONENT_CDR_OP_CI_H_ + +class be_visitor_component_cdr_op_ci : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_cdr_op_ci + // + // = DESCRIPTION + // This is a concrete visitor for component that generates the CDR operator + // implementations + // + +public: + be_visitor_component_cdr_op_ci (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_cdr_op_ci (void); + // destructor + + virtual int visit_component (be_component *node); + // visit interface +}; + +#endif /* _BE_VISITOR_COMPONENT_CDR_OP_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_cs.h new file mode 100644 index 00000000000..02076baf649 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/cdr_op_cs.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Component class +// This one provides code generation for the CDR operators for the +// component in the client stub. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_COMPONENT_CDR_OP_CS_H_ +#define _BE_VISITOR_COMPONENT_CDR_OP_CS_H_ + +class be_visitor_component_cdr_op_cs : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_cdr_op_cs + // + // = DESCRIPTION + // This is a concrete visitor for component that generates the CDR operator + // implementations + // + +public: + be_visitor_component_cdr_op_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_cdr_op_cs (void); + // destructor + + virtual int visit_component (be_component *node); + // visit interface +}; + +#endif /* _BE_VISITOR_COMPONENT_CDR_OP_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component.h b/TAO/TAO_IDL/be_include/be_visitor_component/component.h new file mode 100644 index 00000000000..1bb54989a6a --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component.h @@ -0,0 +1,57 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component.h +// +// = DESCRIPTION +// Concrete visitor for components +// This one provides the generic visitor for the be_component node. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_COMPONENT_COMPONENT_H_ +#define _BE_VISITOR_COMPONENT_COMPONENT_H_ + +class be_visitor_component : public be_visitor_interface +{ + // + // = TITLE + // be_visitor_component + // + // = DESCRIPTION + // This is a concrete visitor for component + // that abstracts all common tasks. + // + +public: + be_visitor_component (be_visitor_context *ctx); + // constructor + + ~be_visitor_component (void); + // destructor + + virtual int visit_attribute (be_attribute *node); + // This is the only type of declaration a component may contain. + + virtual int visit_operation (be_operation *node); + // Operations are created by the back end for 'provides', 'uses', 'emits', + // 'publishes' and 'consumes' declarations. + + virtual int visit_structure (be_structure *node); + virtual int visit_typedef (be_typedef *node); + // Structs and sequences are created by the back end for 'uses multiple' + // declarations. +}; + +#endif /* _BE_VISITOR_MODULE_MODULE_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_ch.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_ch.h new file mode 100644 index 00000000000..bdfc0a964a0 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_ch.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This one provides code generation for components in the client header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_CH_H_ +#define _BE_COMPONENT_COMPONENT_CH_H_ + +class be_visitor_component_ch : public be_visitor_component +{ + // + // = TITLE + // be_visitor_interface_ch + // + // = DESCRIPTION + // This is a concrete visitor to generate the client header for component. + // + // +public: + be_visitor_component_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_ch (void); + // destructor + + virtual int visit_component (be_component *node); + // set the right context and make a visitor +}; + +#endif /* _BE_COMPONENT_COMPONENT_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_ci.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_ci.h new file mode 100644 index 00000000000..403aa52e474 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_ci.h @@ -0,0 +1,45 @@ +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_ci.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This one provides code generation for components in the client inline. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_CI_H_ +#define _BE_COMPONENT_COMPONENT_CI_H_ + +class be_visitor_component_ci : public be_visitor_component +{ + // + // = TITLE + // be_visitor_interface_ci + // + // = DESCRIPTION + // This is a concrete visitor to generate the client header for component. + // + // +public: + be_visitor_component_ci (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_ci (void); + // destructor + + virtual int visit_component (be_component *node); + // set the right context and make a visitor +}; + +#endif /* _BE_COMPONENT_COMPONENT_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_cs.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_cs.h new file mode 100644 index 00000000000..1098f629512 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_cs.h @@ -0,0 +1,50 @@ +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_cs.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This one provides code generation for components in the client stub. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_CS_H_ +#define _BE_COMPONENT_COMPONENT_CS_H_ + +class be_visitor_component_cs : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_cs + // + // = DESCRIPTION + // This is a concrete visitor to generate the client stub for component. + // + // +public: + be_visitor_component_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_cs (void); + // destructor + + virtual int visit_component (be_component *node); + // set the right context and make a visitor + +protected: + void gen_unchecked_narrow (be_component *node, + be_type *bt, + TAO_OutStream *os); +}; + +#endif /* _BE_COMPONENT_COMPONENT_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_ih.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_ih.h new file mode 100644 index 00000000000..938fbb08017 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_ih.h @@ -0,0 +1,46 @@ +/* -*- c++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_ih.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the implementation header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_IH_H_ +#define _BE_COMPONENT_COMPONENT_IH_H_ + +class be_visitor_component_ih : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_ih + // + // = DESCRIPTION + // This is a concrete visitor to generate + // the implementation header for component + // + // +public: + be_visitor_component_ih (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_ih (void); + // destructor + + virtual int visit_component (be_component *node); + // set the right context and make a visitor +}; + +#endif /* _BE_COMPONENT_COMPONENT_IH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_is.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_is.h new file mode 100644 index 00000000000..dd3360448c5 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_is.h @@ -0,0 +1,46 @@ +/* -*- c++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_is.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the implementation skeleton +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_IS_H_ +#define _BE_COMPONENT_COMPONENT_IS_H_ + +class be_visitor_component_is : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_ih + // + // = DESCRIPTION + // This is a concrete visitor to generate + // the implementation skeleton for component + // + // +public: + be_visitor_component_is (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_is (void); + // destructor + + virtual int visit_component (be_component *node); + // set the right context and make a visitor +}; + +#endif /* _BE_COMPONENT_COMPONENT_IS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_sh.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_sh.h new file mode 100644 index 00000000000..42076bdaf7c --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_sh.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_sh.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the server header +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_SH_H_ +#define _BE_COMPONENT_COMPONENT_SH_H_ + +class be_visitor_component_sh : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_sh + // + // = DESCRIPTION + // This is a concrete visitor to generate the server header for component. + // + // +public: + be_visitor_component_sh (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_sh (void); + // destructor + + virtual int visit_component (be_component *node); + // set the right context and make a visitor +}; + +#endif /* _BE_COMPONENT_COMPONENT_SH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_si.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_si.h new file mode 100644 index 00000000000..18df6aa2053 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_si.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_si.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the server inline +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_SI_H_ +#define _BE_COMPONENT_COMPONENT_SI_H_ + +class be_visitor_component_si : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_sh + // + // = DESCRIPTION + // This is a concrete visitor to generate the server header for component. + // + // +public: + be_visitor_component_si (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_si (void); + // destructor + + virtual int visit_component (be_component *node); + // set the right context and make a visitor +}; + +#endif /* _BE_COMPONENT_COMPONENT_SI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/component_ss.h b/TAO/TAO_IDL/be_include/be_visitor_component/component_ss.h new file mode 100644 index 00000000000..05120e29ef6 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component/component_ss.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_ss.h +// +// = DESCRIPTION +// Concrete visitor for the Component node. +// This provides for code generation in the server skeleton +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_SS_H_ +#define _BE_COMPONENT_COMPONENT_SS_H_ + +class be_visitor_component_ss : public be_visitor_component +{ + // + // = TITLE + // be_visitor_component_ss + // + // = DESCRIPTION + // This is a concrete visitor to generate + // the server skeleton for component. + // + // +public: + be_visitor_component_ss (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_ss (void); + // destructor + + virtual int visit_component (be_component *node); + // set the right context and make a visitor +}; + +#endif /* _BE_COMPONENT_COMPONENT_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component_fwd.h b/TAO/TAO_IDL/be_include/be_visitor_component_fwd.h index cf2c856aac2..1f504a79352 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_component_fwd.h +++ b/TAO/TAO_IDL/be_include/be_visitor_component_fwd.h @@ -24,4 +24,9 @@ #include "be_visitor_decl.h" -#endif +#include "be_visitor_component_fwd/component_fwd_ch.h" +#include "be_visitor_component_fwd/any_op_ch.h" +#include "be_visitor_component_fwd/cdr_op_ch.h" +#include "be_visitor_component_fwd/cdr_op_ci.h" + +#endif /* TAO_BE_VISITOR_COMPONENT_FWD_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component_fwd/any_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_component_fwd/any_op_ch.h new file mode 100644 index 00000000000..a85a465160b --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component_fwd/any_op_ch.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the forward declared Component node. +// This one provides code generation for the Any operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_FWD_ANY_OP_CH_H_ +#define _BE_COMPONENT_FWD_ANY_OP_CH_H_ + +class be_visitor_component_fwd_any_op_ch : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_component_fwd_any_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for forward declared components that + // generates the Any operator declaration. + // + +public: + be_visitor_component_fwd_any_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_fwd_any_op_ch (void); + // destructor + + virtual int visit_component_fwd (be_component_fwd *node); + // visit component_fwd +}; + +#endif /* _BE_COMPONENT_FWD_ANY_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component_fwd/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_component_fwd/cdr_op_ch.h new file mode 100644 index 00000000000..1294a1f282c --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component_fwd/cdr_op_ch.h @@ -0,0 +1,49 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the ComponentFwd class +// This one provides code generation for the CDR operators for the forward +// declared component in the client header, if the node is not later defined +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_COMPONENT_FWD_CDR_OP_CH_H_ +#define _BE_VISITOR_COMPONENT_FWD_CDR_OP_CH_H_ + +class be_visitor_component_fwd_cdr_op_ch : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_component_fwd_cdr_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for forward declared component that generates + // the CDR operator declarations, if the node is not later defined. + // + +public: + be_visitor_component_fwd_cdr_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_fwd_cdr_op_ch (void); + // destructor + + virtual int visit_component_fwd (be_component_fwd *node); + // visit forward declared component. +}; + +#endif /* _BE_VISITOR_COMPONENT_FWD_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component_fwd/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_component_fwd/cdr_op_ci.h new file mode 100644 index 00000000000..4863a43d39e --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component_fwd/cdr_op_ci.h @@ -0,0 +1,50 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ci.h +// +// = DESCRIPTION +// Concrete visitor for the component_fwd class +// This one provides code generation for the CDR operators +// (actually just their declarations) for the component forward +// declaration in the client inline. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef BE_VISITOR_COMPONENT_FWD_CDR_OP_CI_H +#define BE_VISITOR_COMPONENT_FWD_CDR_OP_CI_H + +class be_visitor_component_fwd_cdr_op_ci : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_component_fwd_cdr_op_ci + // + // = DESCRIPTION + // This is a concrete visitor for component that generates the CDR + // operator forward declarations. + // + +public: + be_visitor_component_fwd_cdr_op_ci (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_fwd_cdr_op_ci (void); + // destructor + + virtual int visit_component_fwd (be_component_fwd *node); + // visit interface +}; + +#endif /* BE_VISITOR_COMPONENT_FWD_CDR_OP_CI_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component_fwd/component_fwd_ch.h b/TAO/TAO_IDL/be_include/be_visitor_component_fwd/component_fwd_ch.h new file mode 100644 index 00000000000..6ce3f927239 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_component_fwd/component_fwd_ch.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// component_fwd_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Component Forward node. +// This one provides code generation for component forward node. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_COMPONENT_COMPONENT_FWD_CH_H_ +#define _BE_COMPONENT_COMPONENT_FWD_CH_H_ + +class be_visitor_component_fwd_ch : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_component_fwd_ch + // + // = DESCRIPTION + // This is the visitor for component_fwd for the header file + // + // +public: + be_visitor_component_fwd_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_component_fwd_ch (void); + // destructor + + virtual int visit_component_fwd (be_component_fwd *node); + // visit interface_fwd. +}; + +#endif /* _BE_COMPONENT_COMPONENT_FWD_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype.h new file mode 100644 index 00000000000..5dbfaaa21e8 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype.h @@ -0,0 +1,42 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_visitor_eventtype.h +// +// = DESCRIPTION +// Concrete visitor for the EventType class +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef TAO_BE_VISITOR_EVENTTYPE_H +#define TAO_BE_VISITOR_EVENTTYPE_H + +#include "be_visitor_valuetype.h" + +#include "be_visitor_eventtype/eventtype_ch.h" +#include "be_visitor_eventtype/eventtype_ci.h" +#include "be_visitor_eventtype/eventtype_cs.h" +#include "be_visitor_eventtype/eventtype_sh.h" +#include "be_visitor_eventtype/eventtype_si.h" +#include "be_visitor_eventtype/eventtype_ss.h" +#include "be_visitor_eventtype/eventtype_obv_ch.h" +#include "be_visitor_eventtype/eventtype_obv_ci.h" +#include "be_visitor_eventtype/eventtype_obv_cs.h" +#include "be_visitor_eventtype/any_op_ch.h" +#include "be_visitor_eventtype/any_op_cs.h" +#include "be_visitor_eventtype/cdr_op_ch.h" +#include "be_visitor_eventtype/cdr_op_ci.h" +#include "be_visitor_eventtype/cdr_op_cs.h" + +#endif diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/any_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/any_op_ch.h new file mode 100644 index 00000000000..1de871158ad --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/any_op_ch.h @@ -0,0 +1,48 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for eventtypes. +// This one provides code generation for the any operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_EVENTTYPE_ANY_OP_CH_H_ +#define _BE_VISITOR_EVENTTYPE_ANY_OP_CH_H_ + +class be_visitor_eventtype_any_op_ch : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_any_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for eventtype that generates the Any operator + // declarations + // + +public: + be_visitor_eventtype_any_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_any_op_ch (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); + // visit valuetype +}; + +#endif /* _BE_VISITOR_EVENTTYPE_ANY_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/any_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/any_op_cs.h new file mode 100644 index 00000000000..b24f645b963 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/any_op_cs.h @@ -0,0 +1,48 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_cs.h +// +// = DESCRIPTION +// Concrete visitor for eventtypes. +// This one provides code generation for the any operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_EVENTTYPE_ANY_OP_CS_H_ +#define _BE_VISITOR_EVENTTYPE_ANY_OP_CS_H_ + +class be_visitor_eventtype_any_op_cs : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_any_op_cs + // + // = DESCRIPTION + // This is a concrete visitor for eventtype that generates the Any operator + // declarations + // + +public: + be_visitor_eventtype_any_op_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_any_op_cs (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); + // visit valuetype +}; + +#endif /* _BE_VISITOR_EVENTTYPE_ANY_OP_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_ch.h new file mode 100644 index 00000000000..3e72c36c6b5 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_ch.h @@ -0,0 +1,48 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for eventtypes. +// This one provides code generation for the CDR operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_EVENTTYPE_CDR_OP_CH_H_ +#define _BE_VISITOR_EVENTTYPE_CDR_OP_CH_H_ + +class be_visitor_eventtype_cdr_op_ch : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_cdr_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for eventtype that generates the CDR operator + // declarations + // + +public: + be_visitor_eventtype_cdr_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_cdr_op_ch (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); + // visit valuetype +}; + +#endif /* _BE_VISITOR_EVENTTYPE_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_ci.h new file mode 100644 index 00000000000..a3c1fdcbcc7 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_ci.h @@ -0,0 +1,48 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ci.h +// +// = DESCRIPTION +// Concrete visitor for eventtypes. +// This one provides code generation for the CDR operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_EVENTTYPE_CDR_OP_CI_H_ +#define _BE_VISITOR_EVENTTYPE_CDR_OP_CI_H_ + +class be_visitor_eventtype_cdr_op_ci : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_cdr_op_ci + // + // = DESCRIPTION + // This is a concrete visitor for eventtype that generates the CDR operator + // declarations + // + +public: + be_visitor_eventtype_cdr_op_ci (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_cdr_op_ci (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); + // visit valuetype +}; + +#endif /* _BE_VISITOR_EVENTTYPE_CDR_OP_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_cs.h new file mode 100644 index 00000000000..2fd94f7587a --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/cdr_op_cs.h @@ -0,0 +1,48 @@ +/* -*- c++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_cs.h +// +// = DESCRIPTION +// Concrete visitor for eventtypes. +// This one provides code generation for the CDR operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_EVENTTYPE_CDR_OP_CS_H_ +#define _BE_VISITOR_EVENTTYPE_CDR_OP_CS_H_ + +class be_visitor_eventtype_cdr_op_cs : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_cdr_op_cs + // + // = DESCRIPTION + // This is a concrete visitor for eventtype that generates the CDR operator + // declarations + // + +public: + be_visitor_eventtype_cdr_op_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_cdr_op_cs (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); + // visit valuetype +}; + +#endif /* _BE_VISITOR_EVENTTYPE_CDR_OP_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ch.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ch.h new file mode 100644 index 00000000000..e2e873e61f7 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ch.h @@ -0,0 +1,45 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for eventtypes in the (client) header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_CH_H_ +#define _BE_EVENTTYPE_EVENTTYPE_CH_H_ + +class be_visitor_eventtype_ch : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_ch + // + // = DESCRIPTION + // This is a concrete visitor to generate the client header for eventtype + // + // +public: + be_visitor_eventtype_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_ch (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ci.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ci.h new file mode 100644 index 00000000000..0ed63ed297c --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ci.h @@ -0,0 +1,45 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_ci.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for eventtypes in the (client) inline. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_CI_H_ +#define _BE_EVENTTYPE_EVENTTYPE_CI_H_ + +class be_visitor_eventtype_ci : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_ci + // + // = DESCRIPTION + // This is a concrete visitor to generate the client inline for eventtype + // + // +public: + be_visitor_eventtype_ci (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_ci (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_cs.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_cs.h new file mode 100644 index 00000000000..8682cb4b21d --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_cs.h @@ -0,0 +1,45 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_cs.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for eventtypes in the (client) source. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_CS_H_ +#define _BE_EVENTTYPE_EVENTTYPE_CS_H_ + +class be_visitor_eventtype_cs : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_cs + // + // = DESCRIPTION + // This is a concrete visitor to generate the client source for eventtype + // + // +public: + be_visitor_eventtype_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_cs (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_ch.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_ch.h new file mode 100644 index 00000000000..d720aa1c011 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_ch.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_obv_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for valuetype OBV_ class +// in the (client) header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_OBV_CH_H_ +#define _BE_EVENTTYPE_EVENTTYPE_OBV_CH_H_ + +class be_visitor_eventtype_obv_ch : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_obv_ch + // + // = DESCRIPTION + // This is a concrete visitor to generate the header for valuetype + // OBV_ class + // +public: + be_visitor_eventtype_obv_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_obv_ch (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_OBV_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_ci.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_ci.h new file mode 100644 index 00000000000..136ec808ff0 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_ci.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_obv_ci.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for valuetype OBV_ class +// in the (client) inline. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_OBV_CI_H_ +#define _BE_EVENTTYPE_EVENTTYPE_OBV_CI_H_ + +class be_visitor_eventtype_obv_ci : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_obv_ci + // + // = DESCRIPTION + // This is a concrete visitor to generate the inline for valuetype + // OBV_ class + // +public: + be_visitor_eventtype_obv_ci (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_obv_ci (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_OBV_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_cs.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_cs.h new file mode 100644 index 00000000000..8024c40f0cb --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_obv_cs.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_obv_cs.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for valuetype OBV_ class +// in the (client) stub. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_OBV_CS_H_ +#define _BE_EVENTTYPE_EVENTTYPE_OBV_CS_H_ + +class be_visitor_eventtype_obv_cs : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_obv_cs + // + // = DESCRIPTION + // This is a concrete visitor to generate the stub for valuetype + // OBV_ class + // +public: + be_visitor_eventtype_obv_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_obv_cs (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_OBV_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_sh.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_sh.h new file mode 100644 index 00000000000..e86b44e2b6b --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_sh.h @@ -0,0 +1,45 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_sh.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for eventtypes in the server header. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_SH_H_ +#define _BE_EVENTTYPE_EVENTTYPE_SH_H_ + +class be_visitor_eventtype_sh : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_sh + // + // = DESCRIPTION + // This is a concrete visitor to generate the server header for eventtype + // + // +public: + be_visitor_eventtype_sh (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_sh (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_SH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_si.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_si.h new file mode 100644 index 00000000000..2da19a133c1 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_si.h @@ -0,0 +1,45 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_si.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for eventtypes in the server inline. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_SI_H_ +#define _BE_EVENTTYPE_EVENTTYPE_SI_H_ + +class be_visitor_eventtype_si : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_si + // + // = DESCRIPTION + // This is a concrete visitor to generate the server inline for eventtype + // + // +public: + be_visitor_eventtype_si (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_si (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_SI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ss.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ss.h new file mode 100644 index 00000000000..51da4f80356 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype/eventtype_ss.h @@ -0,0 +1,45 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_ss.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype node. +// This one provides code generation for eventtypes in the server source. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_EVENTTYPE_SS_H_ +#define _BE_EVENTTYPE_EVENTTYPE_SS_H_ + +class be_visitor_eventtype_ss : public be_visitor_valuetype +{ + // + // = TITLE + // be_visitor_eventtype_ss + // + // = DESCRIPTION + // This is a concrete visitor to generate the server source for eventtype + // + // +public: + be_visitor_eventtype_ss (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_ss (void); + // destructor + + virtual int visit_eventtype (be_eventtype *node); +}; + +#endif /* _BE_EVENTTYPE_EVENTTYPE_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd.h new file mode 100644 index 00000000000..96ea31ee43f --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd.h @@ -0,0 +1,31 @@ +/* -*- C++ -*- */ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_visitor_eventtype_fwd.h +// +// = DESCRIPTION +// Concrete visitor for the eventtype_fwd class +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef TAO_BE_VISITOR_EVENTTYPE_FWD_H +#define TAO_BE_VISITOR_EVENTTYPE_FWD_H + +#include "be_visitor_decl.h" +#include "be_visitor_eventtype_fwd/eventtype_fwd_ch.h" +#include "be_visitor_eventtype_fwd/any_op_ch.h" +#include "be_visitor_eventtype_fwd/cdr_op_ch.h" +#include "be_visitor_eventtype_fwd/cdr_op_ci.h" + +#endif /* TAO_BE_VISITOR_EVENTTYPE_FWD_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/any_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/any_op_ch.h new file mode 100644 index 00000000000..029e6fc3b23 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/any_op_ch.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the forward declared Eventtype node. +// This one provides code generation for the Any operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_FWD_ANY_OP_CH_H_ +#define _BE_EVENTTYPE_FWD_ANY_OP_CH_H_ + +class be_visitor_eventtype_fwd_any_op_ch : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_eventtype_fwd_any_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for forward declared eventtypes that + // generates the Any operator declaration. + // + +public: + be_visitor_eventtype_fwd_any_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_fwd_any_op_ch (void); + // destructor + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit valuetype_fwd +}; + +#endif /* _BE_EVENTTYPE_FWD_ANY_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/cdr_op_ch.h new file mode 100644 index 00000000000..9318df51813 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/cdr_op_ch.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the forward declared Eventtype node. +// This one provides code generation for the CDR operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_FWD_CDR_OP_CH_H_ +#define _BE_EVENTTYPE_FWD_CDR_OP_CH_H_ + +class be_visitor_eventtype_fwd_cdr_op_ch : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_eventtype_fwd_cdr_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for forward declared eventtypes that + // generates the CDR operator declaration. + // + +public: + be_visitor_eventtype_fwd_cdr_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_fwd_cdr_op_ch (void); + // destructor + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit valuetype_fwd +}; + +#endif /* _BE_EVENTTYPE_FWD_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/cdr_op_ci.h new file mode 100644 index 00000000000..1af95c8dd40 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/cdr_op_ci.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// cdr_op_ci.h +// +// = DESCRIPTION +// Concrete visitor for the forward declared Eventtype node. +// This one provides code generation for the CDR operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_EVENTTYPE_FWD_CDR_OP_CI_H_ +#define _BE_EVENTTYPE_FWD_CDR_OP_CI_H_ + +class be_visitor_eventtype_fwd_cdr_op_ci : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_eventtype_fwd_cdr_op_ci + // + // = DESCRIPTION + // This is a concrete visitor for forward declared eventtypes that + // generates the CDR operator declaration. + // + +public: + be_visitor_eventtype_fwd_cdr_op_ci (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_fwd_cdr_op_ci (void); + // destructor + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit valuetype_fwd +}; + +#endif /* _BE_EVENTTYPE_FWD_CDR_OP_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/eventtype_fwd_ch.h b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/eventtype_fwd_ch.h new file mode 100644 index 00000000000..3f477575696 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_eventtype_fwd/eventtype_fwd_ch.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// eventtype_fwd_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Eventtype Forward node. +// This one provides code generation for eventtype forward node. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_EVENTTYPE_FWD_CH_H_ +#define _BE_VISITOR_EVENTTYPE_FWD_CH_H_ + +class be_visitor_eventtype_fwd_ch : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_eventtype_fwd_ch + // + // = DESCRIPTION + // This is the visitor for eventtype_fwd for the header file + // + // +public: + be_visitor_eventtype_fwd_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_eventtype_fwd_ch (void); + // destructor + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit valuetype_fwd. +}; + +#endif /* _BE_VISITOR_EVENTTYPE_FWD_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h b/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h index 61f417722ae..d3da6023441 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field/field_ch.h @@ -78,6 +78,18 @@ public: virtual int visit_union (be_union *node); // visit union type + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node }; #endif /* _BE_VISITOR_FIELD_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_home.h b/TAO/TAO_IDL/be_include/be_visitor_home.h index 195d0e95b3a..b511f6cd2a9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_home.h +++ b/TAO/TAO_IDL/be_include/be_visitor_home.h @@ -22,6 +22,8 @@ #ifndef TAO_BE_VISITOR_HOME_H #define TAO_BE_VISITOR_HOME_H -#include "be_visitor_scope.h" +#include "be_visitor_decl.h" + +#include "be_visitor_home/home_ch.h" #endif diff --git a/TAO/TAO_IDL/be_include/be_visitor_home/home_ch.h b/TAO/TAO_IDL/be_include/be_visitor_home/home_ch.h new file mode 100644 index 00000000000..79fe815e178 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_home/home_ch.h @@ -0,0 +1,46 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// home_ch.h +// +// = DESCRIPTION +// Concrete visitor for the Component Home node. +// This one provides code generation for component home node. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VISITOR_HOME_CH_H_ +#define _BE_VISITOR_HOME_CH_H_ + +class be_visitor_home_ch : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_home_ch + // + // = DESCRIPTION + // This is the visitor for component home for the header file + // + // +public: + be_visitor_home_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_home_ch (void); + // destructor + + virtual int visit_home (be_home *node); + // visit home. +}; + +#endif /* _BE_VISITOR_HOME_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface.h index eaebb4299ea..a5a8bc64c0d 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface.h @@ -45,7 +45,6 @@ #include "be_visitor_interface/smart_proxy_ch.h" #include "be_visitor_interface/smart_proxy_cs.h" #include "be_visitor_interface/interceptors_cs.h" -#include "be_visitor_interface/interceptors_sh.h" #include "be_visitor_interface/interceptors_ss.h" // Proxy Brokers diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_broker_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_broker_ch.h index 34b950be5a7..5c4f36fdb1f 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_broker_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_broker_ch.h @@ -36,6 +36,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* BE_BASE_PROXY_BROKER_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_impl_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_impl_ch.h index 73b04dd8e16..4df4ef8d872 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_impl_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/base_proxy_impl_ch.h @@ -36,6 +36,10 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_sh.h index 0c16d1467ea..15f33e4bee7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_sh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_sh.h @@ -36,6 +36,10 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_ss.h b/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_ss.h index 91586f0d42a..2fd30eaf71f 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/direct_proxy_impl_ss.h @@ -35,6 +35,10 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_cs.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_cs.h index 26617298145..95ca89fde04 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_cs.h @@ -38,6 +38,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // visit a component + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_sh.h deleted file mode 100644 index 43a4b87da26..00000000000 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_sh.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// $Id$ -// -/* -*- c++ -*- */ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// interceptors_sh.h -// -// = DESCRIPTION -// Concrete visitor for the Interface node. -// This provides code generation for interceptor classes for an -// interface in the server header. -// -// = AUTHOR -// Kirthika Parameswaran -// -// ============================================================================ - -#ifndef _BE_INTERFACE_INTERCEPTORS_SH_H_ -#define _BE_INTERFACE_INTERCEPTORS_SH_H_ - -class be_visitor_interface_interceptors_sh : public be_visitor_interface -{ - // = TITLE - // Generate the "thru_poa collocated" class declaration. - -public: - be_visitor_interface_interceptors_sh (be_visitor_context *ctx); - // constructor - - virtual ~be_visitor_interface_interceptors_sh (void); - // destructor - - virtual int visit_interface (be_interface *node); - // visit an interface - -}; - -#endif /* _BE_INTERFACE_INTERCEPTORS_SH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_ss.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_ss.h index 936773ccdaa..22df885f3b3 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_ss.h @@ -38,6 +38,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // visit a component + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_brokers_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_brokers_ch.h index 9882a029980..9d9348a5645 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_brokers_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_brokers_ch.h @@ -36,6 +36,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* BE_PROXY_BROKERS_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_impls_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_impls_ch.h index d9fbdced972..b7b67bd306e 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_impls_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/proxy_impls_ch.h @@ -36,6 +36,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* BE_PROXY_BROKER_IMPLS_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_ch.h index 62c24fa336d..3e7a9f4cd20 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_ch.h @@ -36,6 +36,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* BE_REMOTE_PROXY_BROKER_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_cs.h b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_cs.h index 0b903e32986..4b5aa1fe514 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_broker_cs.h @@ -36,6 +36,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* BE_REMOTE_PROXY_BROKER_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_ch.h index 0eb989aa593..d07f234ae18 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_ch.h @@ -36,6 +36,10 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_cs.h b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_cs.h index 3588e6b1178..27d996191c1 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/remote_proxy_impl_cs.h @@ -36,6 +36,10 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/smart_proxy_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/smart_proxy_ch.h index 3ccaec66582..7538681f47b 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/smart_proxy_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/smart_proxy_ch.h @@ -38,6 +38,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_interface *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* _BE_INTERFACE_SMART_PROXY_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/smart_proxy_cs.h b/TAO/TAO_IDL/be_include/be_visitor_interface/smart_proxy_cs.h index d279dd2fa14..01f475b23fc 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/smart_proxy_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/smart_proxy_cs.h @@ -36,6 +36,10 @@ public: virtual int visit_interface (be_interface *node); // visit interface + + virtual int visit_component (be_interface *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* _BE_INTERFACE_SMART_PROXY_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_sh.h index 235b319c688..b06651ac36b 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_sh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_sh.h @@ -36,6 +36,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* BE_STRATEGIZED_PROXY_BROKER_SH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_ss.h b/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_ss.h index c39b0e9e40e..a426d570d17 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/strategized_proxy_broker_ss.h @@ -36,6 +36,9 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. }; #endif /* BE_STRATEGIZED_PROXY_BROKER_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_sh.h index 2c9970a02b5..1acbbb772eb 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_sh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_sh.h @@ -36,6 +36,10 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_ss.h b/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_ss.h index 7595dceb14b..5a35936e215 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/thru_poa_proxy_impl_ss.h @@ -36,6 +36,10 @@ public: virtual int visit_interface (be_interface *node); // visit an interface + virtual int visit_component (be_component *node); + // This will just call the above method - no need to create + // another set of visitors for this stuff. + static int gen_abstract_ops_helper (be_interface *node, be_interface *base, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h index ec49eab3cae..fd27d61c022 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h @@ -42,6 +42,9 @@ public: virtual int visit_interface (be_interface *node); // set the right context and make a visitor + virtual int visit_component (be_component *node); + // set the right context and make a visitor + static int method_helper (be_interface *, be_interface *, TAO_OutStream *os); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h b/TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h index f8a9f982946..b097b77be1a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h @@ -43,6 +43,9 @@ public: virtual int visit_interface (be_interface *node); // set the right context and make a visitor + virtual int visit_component (be_component *node); + // set the right context and make a visitor + static int method_helper (be_interface *, be_interface *, TAO_OutStream *os); 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 2168bfc80e8..422bc1436f7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd.h @@ -24,7 +24,6 @@ #include "be_visitor_decl.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" diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/interface_fwd_ci.h b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/interface_fwd_ci.h deleted file mode 100644 index 66d3d4e1924..00000000000 --- a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/interface_fwd_ci.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// $Id$ -// -/* -*- c++ -*- */ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// interface_fwd_ci.h -// -// = DESCRIPTION -// Concrete visitor for the Interface Forward node. -// This one provides code generation for interface forward node. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#ifndef _BE_INTERFACE_INTERFACE_FWD_CI_H_ -#define _BE_INTERFACE_INTERFACE_FWD_CI_H_ - -class be_visitor_interface_fwd_ci : public be_visitor_decl -{ - // - // = TITLE - // be_visitor_interface_fwd_ci - // - // = DESCRIPTION - // This is the visitor for interface_fwd for the inline file - // - // -public: - be_visitor_interface_fwd_ci (be_visitor_context *ctx); - // constructor - - ~be_visitor_interface_fwd_ci (void); - // destructor - - virtual int visit_interface_fwd (be_interface_fwd *node); - // visit interface_fwd -}; - -#endif /* _BE_INTERFACE_INTERFACE_FWD_CH_I_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_module/module.h b/TAO/TAO_IDL/be_include/be_visitor_module/module.h index 60fa15695d5..b8cddafdadc 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_module/module.h +++ b/TAO/TAO_IDL/be_include/be_visitor_module/module.h @@ -55,13 +55,28 @@ public: // visit an interface virtual int visit_interface_fwd (be_interface_fwd *node); - // visit an interface + // visit a forward declared interface virtual int visit_valuetype (be_valuetype *node); - // visit valuetype + // visit a valuetype virtual int visit_valuetype_fwd (be_valuetype_fwd *node); - // visit valuetype_fwd + // visit a forward declared valuetype + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype + + virtual int visit_component (be_component *node); + // visit a component + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component + + virtual int visit_home (be_home *node); + // visit a home virtual int visit_module (be_module *node); // visit a module diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/amh_rh_ss.h b/TAO/TAO_IDL/be_include/be_visitor_operation/amh_rh_ss.h index 3649b7118f7..84dc944af6e 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/amh_rh_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/amh_rh_ss.h @@ -32,8 +32,7 @@ class be_visitor_amh_rh_operation_ss : public be_visitor_operation int visit_operation (be_operation *node); private: - int marshal_params (be_operation *node); - + int marshal_params (be_operation *node); }; #endif /* AMH_RH_OPERATION_SS_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h index 2160d14f007..800641aa5d9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_reply_stub_operation_ch.h @@ -46,7 +46,6 @@ public: virtual int visit_operation (be_operation *node); // visit operation. - }; #endif /* _BE_VISITOR_OPERATION_ami_handler_reply_stub_operation_ch_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/argument.h b/TAO/TAO_IDL/be_include/be_visitor_operation/argument.h index 320e7a9aff1..06a7d315b10 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/argument.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/argument.h @@ -51,7 +51,6 @@ public: virtual int visit_argument (be_argument *node); // visit argument - }; #endif /* _BE_VISITOR_OPERATION_ARGUMENT_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/base_proxy_impl_ch.h b/TAO/TAO_IDL/be_include/be_visitor_operation/base_proxy_impl_ch.h index a10a0f663c6..c8d2dd9158c 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/base_proxy_impl_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/base_proxy_impl_ch.h @@ -40,7 +40,6 @@ public: virtual int visit_operation (be_operation *node); // visit operation. - }; #endif /* _BE_VISITOR_OPERATION_BASE_PROXY_IMPL_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/exceptlist_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/exceptlist_cs.h index 9e6d44f8848..1900c981438 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/exceptlist_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/exceptlist_cs.h @@ -46,7 +46,6 @@ public: int visit_operation (be_operation *node); // visit the operation - }; #endif /* _BE_VISITOR_OPERATION_EXCEPTIONLIST_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_arglist.h b/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_arglist.h index 93db6eaf05c..04027eaeaf2 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_arglist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_arglist.h @@ -53,7 +53,6 @@ public: virtual int post_process (be_decl *); // stuff to o/p after each element of the scope is handled - }; #endif /* _BE_VISITOR_OPERATION_INTERCEPTORS_ARGLIST_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_exceptlist.h b/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_exceptlist.h index bd9b1aac9b0..e829f7c37f2 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_exceptlist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_exceptlist.h @@ -43,7 +43,6 @@ public: // visit operation. protected: virtual int gen_exceptlist (be_operation *node); - }; diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_info_rettype.h b/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_info_rettype.h index f166d24ba08..39480d1804a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_info_rettype.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_info_rettype.h @@ -81,6 +81,21 @@ public: int visit_valuetype_fwd (be_valuetype_fwd *node); // visit a forward declared valuetype node + + int visit_component (be_component *node); + // visit a component node + + int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + int visit_home (be_home *node); + // visit a component home node }; #endif /* _BE_VISITOR_OPERATION_INTERCEPTORS_INFO_RETTYPE_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_result.h b/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_result.h index 3a3cc79e5e5..5f7abd89ea9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_result.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/interceptors_result.h @@ -77,6 +77,21 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef type + + virtual int visit_component (be_component *node); + // visit a component node + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + virtual int visit_home (be_home *node); + // visit a component home node }; #endif /* _BE_VISITOR_OPERATION_INTERCEPTORS_RESULT_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/proxy_impl_xh.h b/TAO/TAO_IDL/be_include/be_visitor_operation/proxy_impl_xh.h index 369d19c5a7f..3bd938dd891 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/proxy_impl_xh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/proxy_impl_xh.h @@ -40,7 +40,6 @@ public: virtual int visit_operation (be_operation *node); // visit operation. - }; #endif /* _BE_VISITOR_OPERATION_PROXY_IMPL_XH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h index 7ef5996a4f4..ee4b2792e64 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype.h @@ -81,6 +81,21 @@ public: int visit_valuetype_fwd (be_valuetype_fwd *node); // visit a forward declared valuetype node + + int visit_component (be_component *node); + // visit a component node + + int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + int visit_home (be_home *node); + // visit a component home node }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_assign_ss.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_assign_ss.h index 363986d5009..6fd11d0ff18 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_assign_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_assign_ss.h @@ -81,6 +81,20 @@ public: int visit_union (be_union *node); // visit a union node + int visit_component (be_component *node); + // visit component + + int visit_component_fwd (be_component_fwd *node); + // visit component forward + + int visit_eventtype (be_eventtype *node); + // visit eventtype + + int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit eventtype forward + + int visit_home (be_home *node); + // visit component home }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_ASSIGN_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_is.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_is.h index 1c2030b794a..59802c7dfa9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_is.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_is.h @@ -53,7 +53,13 @@ public: // visit an interface node int visit_interface_fwd (be_interface_fwd *node); - // visit an interface node + // visit a forward declared interface node + + int visit_valuetype (be_valuetype *node); + // visit a valuetype node + + int visit_valuetype_fwd (be_valuetype_fwd *node); + // visit a forward declared interface node int visit_native (be_native *node); // visit native type @@ -76,6 +82,20 @@ public: int visit_union (be_union *node); // visit a union node + int visit_component (be_component *node); + // visit component + + int visit_component_fwd (be_component_fwd *node); + // visit component forward + + int visit_eventtype (be_eventtype *node); + // visit eventtype + + int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit eventtype forward + + int visit_home (be_home *node); + // visit component home }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_IS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_marshal_ss.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_marshal_ss.h index a8411951b68..fb58fbb3bf1 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_marshal_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_marshal_ss.h @@ -83,6 +83,20 @@ public: int visit_union (be_union *node); // visit a union node + int visit_component (be_component *node); + // visit component + + int visit_component_fwd (be_component_fwd *node); + // visit component forward + + int visit_eventtype (be_eventtype *node); + // visit eventtype + + int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit eventtype forward + + int visit_home (be_home *node); + // visit component home }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_MARSHAL_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_pre_invoke_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_pre_invoke_cs.h index 67cb9d70bfb..baa85b94812 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_pre_invoke_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_pre_invoke_cs.h @@ -51,7 +51,13 @@ public: // visit an interface node virtual int visit_interface_fwd (be_interface_fwd *node); - // visit an interface node + // visit a forward decalred interface node + + virtual int visit_valuetype (be_valuetype *node); + // visit a valuetype node + + virtual int visit_valuetype_fwd (be_valuetype_fwd *node); + // visit a forward decalred valuetype node virtual int visit_predefined_type (be_predefined_type *node); // visit a predefined type node @@ -67,6 +73,21 @@ public: virtual int visit_union (be_union *node); // visit a union node + + virtual int visit_component (be_component *node); + // visit component + + virtual int visit_component_fwd (be_component_fwd *node); + // visit component forward + + virtual int visit_eventtype (be_eventtype *node); + // visit eventtype + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit eventtype forward + + virtual int visit_home (be_home *node); + // visit component home }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_PRE_INVOKE_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_return_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_return_cs.h index 646bb1ca643..9e46bb99474 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_return_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_return_cs.h @@ -79,6 +79,20 @@ public: int visit_union (be_union *node); // visit a union node + int visit_component (be_component *node); + // visit component + + int visit_component_fwd (be_component_fwd *node); + // visit component forward + + int visit_eventtype (be_eventtype *node); + // visit eventtype + + int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit eventtype forward + + int visit_home (be_home *node); + // visit component home }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_RETURN_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_vardecl_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_vardecl_cs.h index 4094f04882c..6178105bf14 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_vardecl_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_vardecl_cs.h @@ -79,6 +79,20 @@ public: int visit_union (be_union *node); // visit a union node + int visit_component (be_component *node); + // visit a component node + + int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + int visit_home (be_home *node); + // visit a component home node }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_VARDECL_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_vardecl_ss.h b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_vardecl_ss.h index 6e7b0fe298e..369b97fe3a7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_vardecl_ss.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/rettype_vardecl_ss.h @@ -80,6 +80,20 @@ public: int visit_union (be_union *node); // visit a union node + int visit_component (be_component *node); + // visit a component node + + int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component node + + int visit_eventtype (be_eventtype *node); + // visit an eventtype node + + int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype node + + int visit_home (be_home *node); + // visit a component home node }; #endif /* _BE_VISITOR_OPERATION_RETTYPE_VARDECL_SS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/smart_proxy_ch.h b/TAO/TAO_IDL/be_include/be_visitor_operation/smart_proxy_ch.h index 320a1a81ef7..6dbe525cc45 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/smart_proxy_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/smart_proxy_ch.h @@ -46,7 +46,6 @@ public: virtual int visit_operation (be_operation *node); // visit operation node. - }; #endif /* _BE_VISITOR_OPERATION_SMART_PROXY_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root.h b/TAO/TAO_IDL/be_include/be_visitor_root/root.h index cb95595d55b..1f2e14895dc 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_root/root.h +++ b/TAO/TAO_IDL/be_include/be_visitor_root/root.h @@ -58,13 +58,28 @@ public: // visit an interface virtual int visit_interface_fwd (be_interface_fwd *node); - // visit an interface + // visit a forward declared interface virtual int visit_valuetype (be_valuetype *node); - // visit valuetype + // visit a valuetype virtual int visit_valuetype_fwd (be_valuetype_fwd *node); - // visit valuetype_fwd + // visit a forward declared valuetype + + virtual int visit_eventtype (be_eventtype *node); + // visit an eventtype + + virtual int visit_eventtype_fwd (be_eventtype_fwd *node); + // visit a forward declared eventtype + + virtual int visit_component (be_component *node); + // visit a component + + virtual int visit_component_fwd (be_component_fwd *node); + // visit a forward declared component + + virtual int visit_home (be_home *node); + // visit a home virtual int visit_module (be_module *node); // visit a module diff --git a/TAO/TAO_IDL/be_include/be_visitor_root/root_sth.h b/TAO/TAO_IDL/be_include/be_visitor_root/root_sth.h index 359091eaa4a..e15265275c7 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_root/root_sth.h +++ b/TAO/TAO_IDL/be_include/be_visitor_root/root_sth.h @@ -52,6 +52,8 @@ public: virtual int visit_module (be_module *node); virtual int visit_interface (be_interface *node); + + virtual int visit_component (be_component *node); }; #endif /* _BE_VISITOR_ROOT_ROOT_STH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_decl.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_decl.h index 9b3e7f3f40e..0685cf845f9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_decl.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_decl.h @@ -57,6 +57,9 @@ public: virtual int visit_interface (be_interface *node); // visit interface + virtual int visit_component (be_component *node); + // visit component + virtual int visit_sequence (be_sequence *node); // visit a sequence @@ -72,6 +75,8 @@ public: virtual int visit_valuetype (be_valuetype *node); // visit a valuetype + virtual int visit_eventtype (be_eventtype *node); + // visit a valuetype }; #endif /* _BE_VISITOR_TYPECODE_TYPECODE_DECL_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 911243fbb2f..31557af93d0 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 @@ -75,6 +75,9 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface + virtual int visit_component (be_component *node); + // visit component + virtual int visit_predefined_type (be_predefined_type *node); // visit predefined types @@ -96,6 +99,8 @@ public: virtual int visit_valuetype (be_valuetype *node); // visit a valuetype + virtual int visit_eventtype (be_eventtype *node); + // visit a valuetype // = visit methods for the scope elements diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_ch.h index 5ff6cb5f5fb..43c9ab57038 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_ch.h @@ -9,7 +9,7 @@ // TAO IDL // // = FILENAME -// valuetype_cdr_op_ch.h +// cdr_op_ch.h // // = DESCRIPTION // Concrete visitor for valuetypes. @@ -30,7 +30,7 @@ class be_visitor_valuetype_cdr_op_ch : public be_visitor_valuetype // be_visitor_valuetype_cdr_op_ch // // = DESCRIPTION - // This is a concrete visitor for interface that generates the CDR operator + // This is a concrete visitor for valuetype that generates the CDR operator // declarations // diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_ci.h index a936aed771c..4f7fa51bea4 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_ci.h @@ -9,7 +9,7 @@ // TAO IDL // // = FILENAME -// valuetype_cdr_op_ci.h +// cdr_op_ci.h // // = DESCRIPTION // Concrete visitor for valuetypes. @@ -30,7 +30,7 @@ class be_visitor_valuetype_cdr_op_ci : public be_visitor_valuetype // be_visitor_valuetype_cdr_op_ci // // = DESCRIPTION - // This is a concrete visitor for interface that generates the CDR operator + // This is a concrete visitor for valuetype that generates the CDR operator // implementations // @@ -43,6 +43,15 @@ public: virtual int visit_valuetype (be_valuetype *node); // visit valuetype + + virtual int visit_field (be_field *node); + // visit field + + virtual int visit_array (be_array *node); + // visit array + + virtual int visit_sequence (be_sequence *node); + // visit sequence }; #endif /* _BE_VISITOR_VALUETYPE_CDR_OP_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_cs.h index 8d28fa1c3f1..17d45be4b70 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/cdr_op_cs.h @@ -9,7 +9,7 @@ // TAO IDL // // = FILENAME -// valuetype_cdr_op_cs.h +// cdr_op_cs.h // // = DESCRIPTION // Concrete visitor for valuetypes. @@ -31,7 +31,7 @@ class be_visitor_valuetype_cdr_op_cs : public be_visitor_valuetype // be_visitor_valuetype_cdr_op_cs // // = DESCRIPTION - // This is a concrete visitor for interface that generates the CDR operator + // This is a concrete visitor for valuetype that generates the CDR operator // implementations // @@ -44,6 +44,12 @@ public: virtual int visit_valuetype (be_valuetype *node); // visit valuetype + + virtual int visit_field (be_field *node); + // visit field + + virtual int visit_sequence (be_sequence *node); + // visit sequence }; #endif /* _BE_VISITOR_VALUETYPE_CDR_OP_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/obv_module.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/obv_module.h index 84e82d06cca..b4da292f1f1 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/obv_module.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/obv_module.h @@ -45,6 +45,7 @@ public: virtual int visit_valuetype (be_valuetype *node); + virtual int visit_eventtype (be_eventtype *node); }; #endif /* _BE_VISITOR_VALUETYPE_OBV_MODULE_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_ch.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_ch.h index 10fc526dca8..b2523ef2b7a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_ch.h @@ -8,7 +8,7 @@ // TAO IDL // // = FILENAME -// valuetype_ch.h +// valuetype_obv_ch.h // // = DESCRIPTION // Concrete visitor for the Valuetype node. @@ -31,7 +31,7 @@ class be_visitor_valuetype_obv_ch : public be_visitor_valuetype { // // = TITLE - // be_visitor_valuetype_ch + // be_visitor_valuetype_obv_ch // // = DESCRIPTION // This is a concrete visitor to generate the header for valuetype diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_ci.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_ci.h index ba4f3b0d584..fff3dfe2565 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_ci.h @@ -8,7 +8,7 @@ // TAO IDL // // = FILENAME -// valuetype_ci.h +// valuetype_obv_ci.h // // = DESCRIPTION // Concrete visitor for the Valuetype node. 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 d867c2d31d9..6e6cb0edee8 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd.h @@ -25,7 +25,7 @@ #include "be_visitor_decl.h" #include "be_visitor_valuetype_fwd/valuetype_fwd_ch.h" -#include "be_visitor_valuetype_fwd/valuetype_fwd_ci.h" +#include "be_visitor_valuetype_fwd/any_op_ch.h" #include "be_visitor_valuetype_fwd/cdr_op_ch.h" #include "be_visitor_valuetype_fwd/cdr_op_ci.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/any_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/any_op_ch.h new file mode 100644 index 00000000000..9d20239758c --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/any_op_ch.h @@ -0,0 +1,47 @@ +// +// $Id$ +// +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// any_op_ch.h +// +// = DESCRIPTION +// Concrete visitor for the forward declared Valuetype node. +// This one provides code generation for the Any operators. +// +// = AUTHOR +// Jeff Parsons +// +// ============================================================================ + +#ifndef _BE_VALUETYPE_FWD_ANY_OP_CH_H_ +#define _BE_VALUETYPE_FWD_ANY_OP_CH_H_ + +class be_visitor_valuetype_fwd_any_op_ch : public be_visitor_decl +{ + // + // = TITLE + // be_visitor_valuetype_fwd_any_op_ch + // + // = DESCRIPTION + // This is a concrete visitor for forward declared valuetypes that + // generates the Any operator declaration. + // + +public: + be_visitor_valuetype_fwd_any_op_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_valuetype_fwd_any_op_ch (void); + // destructor + + virtual int visit_valuetype_fwd (be_valuetype_fwd *node); + // visit valuetype_fwd +}; + +#endif /* _BE_VALUETYPE_FWD_ANY_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/valuetype_fwd_ch.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/valuetype_fwd_ch.h index eabdfdd06ca..40301223436 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/valuetype_fwd_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/valuetype_fwd_ch.h @@ -11,7 +11,7 @@ // valuetype_fwd_ch.h // // = DESCRIPTION -// Concrete visitor for the Interface Forward node. +// Concrete visitor for the Valuetype Forward node. // This one provides code generation for valuetype forward node. // // = AUTHOR @@ -42,7 +42,6 @@ public: virtual int visit_valuetype_fwd (be_valuetype_fwd *node); // visit valuetype_fwd. - }; #endif /* _BE_VISITOR_VALUETYPE_FWD_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/valuetype_fwd_ci.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/valuetype_fwd_ci.h deleted file mode 100644 index 922117856b6..00000000000 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype_fwd/valuetype_fwd_ci.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// $Id$ -// -/* -*- c++ -*- */ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// valuetype_fwd_ci.h -// -// = DESCRIPTION -// Concrete visitor for the Interface Forward node. -// This one provides code generation for valuetype forward node. -// -// = AUTHOR -// Torsten Kuepper -// based on code from Aniruddha Gokhale -// -// ============================================================================ - -#ifndef _BE_VISITOR_VALUETYPE_FWD_CI_H_ -#define _BE_VISITOR_VALUETYPE_FWD_CI_H_ - -class be_visitor_valuetype_fwd_ci : public be_visitor_decl -{ - // - // = TITLE - // be_visitor_valuetype_fwd_ci - // - // = DESCRIPTION - // This is the visitor for valuetype_fwd for the inline file - // - // -public: - be_visitor_valuetype_fwd_ci (be_visitor_context *ctx); - // constructor - - ~be_visitor_valuetype_fwd_ci (void); - // destructor - - virtual int visit_valuetype_fwd (be_valuetype_fwd *node); - // visit valuetype_fwd - -}; - -#endif /* _BE_VISITOR_VALUETYPE_FWD_CH_I_ */ diff --git a/TAO/TAO_IDL/driver/drv_args.cpp b/TAO/TAO_IDL/driver/drv_args.cpp index e1282acce43..2168ab848e0 100644 --- a/TAO/TAO_IDL/driver/drv_args.cpp +++ b/TAO/TAO_IDL/driver/drv_args.cpp @@ -184,6 +184,7 @@ DRV_prep_be_arg (char *s, else { ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%s%s%s%s"), idl_global->prog_name (), ACE_TEXT (": invalid or unknown argument <"), arg, @@ -197,6 +198,7 @@ void DRV_usage (void) { ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("%s%s%s%s"), idl_global->prog_name (), ACE_TEXT (": usage: "), idl_global->prog_name (), @@ -1233,11 +1235,6 @@ DRV_parse_args (long ac, char **av) // enable OBV (Valuetype) support idl_global->obv_support (1); } - else if (av[i][2] == 'm') - { - // enable CORBA component support - idl_global->component_support (1); - } else if (av[i][2] == 'I') { int options = ACE_OS::strlen(av[i]) - 3; @@ -1406,9 +1403,10 @@ DRV_parse_args (long ac, char **av) { ACE_ERROR (( LM_ERROR, + ACE_TEXT ("%s%s%s\n"), ACE_TEXT ("Can't access temporary directory ("), tmpdir, - ACE_TEXT ("), using current directory for temp files.\n") + ACE_TEXT ("), using current directory for temp files.") )); ACE_OS::strcpy (tmpdir, "."); @@ -1422,7 +1420,7 @@ DRV_parse_args (long ac, char **av) { ACE_ERROR ((LM_ERROR, "%s%s\n", - ACE_TEXT ("Error: Can't access temporary directory ("), + ACE_TEXT ("Error: Can't access temporary directory "), tmpdir)); ACE_OS::exit (99); diff --git a/TAO/TAO_IDL/fe/fe_interface_header.cpp b/TAO/TAO_IDL/fe/fe_interface_header.cpp index 9e0c59d79bd..0a2e64bc802 100644 --- a/TAO/TAO_IDL/fe/fe_interface_header.cpp +++ b/TAO/TAO_IDL/fe/fe_interface_header.cpp @@ -481,7 +481,9 @@ int FE_InterfaceHeader::check_inherit (AST_Interface *i, idl_bool for_valuetype) { - idl_bool is_valuetype = (i->node_type () == AST_Decl::NT_valuetype); + // We use the narrow instead of node_type() here so we can get a + // match with both valuetypes and eventtypes. + idl_bool is_valuetype = (AST_ValueType::narrow_from_decl (i) != 0); if ( // Non-local interfaces may not inherit from local ones. @@ -535,7 +537,8 @@ FE_InterfaceHeader::n_inherits_flat (void) const FE_OBVHeader::FE_OBVHeader (UTL_ScopedName *n, UTL_NameList *inherits, UTL_NameList *supports, - idl_bool truncatable) + idl_bool truncatable, + idl_bool is_eventtype) : FE_InterfaceHeader (n, inherits, I_FALSE, @@ -552,19 +555,20 @@ FE_OBVHeader::FE_OBVHeader (UTL_ScopedName *n, if (this->pd_n_inherits > 0) { AST_Interface *iface = this->pd_inherits[0]; + AST_ValueType *vt = AST_ValueType::narrow_from_decl (iface); - if (!iface->is_abstract ()) + if (vt != 0 + && vt->is_abstract () == I_FALSE) { - AST_ValueType *vt = AST_ValueType::narrow_from_decl (iface); - - if (vt == 0) - { - idl_global->err ()->valuetype_expected (iface); - } - this->pd_inherits_concrete = vt; } + if (! is_eventtype + && this->pd_inherits[0]->node_type () == AST_Decl::NT_eventtype) + { + idl_global->err ()->valuetype_expected (this->pd_inherits[0]); + } + for (long i = 1; i < this->pd_n_inherits; ++i) { iface = this->pd_inherits[i]; @@ -573,6 +577,12 @@ FE_OBVHeader::FE_OBVHeader (UTL_ScopedName *n, { idl_global->err ()->abstract_expected (iface); } + + if (! is_eventtype + && iface->node_type () == AST_Decl::NT_eventtype) + { + idl_global->err ()->valuetype_expected (iface); + } } } @@ -758,6 +768,24 @@ FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d) //************************************************************************ +FE_EventHeader::FE_EventHeader (UTL_ScopedName *n, + UTL_NameList *inherits, + UTL_NameList *supports, + idl_bool truncatable) + : FE_OBVHeader (n, + inherits, + supports, + truncatable, + I_TRUE) +{ +} + +FE_EventHeader::~FE_EventHeader (void) +{ +} + +//************************************************************************ + FE_ComponentHeader::FE_ComponentHeader (UTL_ScopedName *n, UTL_ScopedName *base_component, UTL_NameList *supports, @@ -800,28 +828,8 @@ FE_ComponentHeader::FE_ComponentHeader (UTL_ScopedName *n, } } - if (compile_now) - { - this->compile_inheritance (supports, - I_FALSE); - } -} - -void -FE_ComponentHeader::compile_inheritance (UTL_NameList *supports, - idl_bool for_valuetype) -{ - if (this->pd_base_component != 0) - { - UTL_NameList *base_component_name = 0; - ACE_NEW (base_component_name, - UTL_NameList (this->pd_base_component->name (), - supports)); - supports = base_component_name; - - this->FE_InterfaceHeader::compile_inheritance (supports, - for_valuetype); - } + this->compile_inheritance (supports, + I_FALSE); } FE_ComponentHeader::~FE_ComponentHeader (void) diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index 6f888ab5b2e..c3dd14e5b3d 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -110,37 +110,6 @@ inline char *__yytext() #define ace_yytext yytext #endif /* 0 */ -static int scan_obv_token (int token) -{ - if (idl_global->obv_support ()) - { - return token; - } - - TAO_IDL_CPP_Keyword_Table cpp_key_tbl; - const TAO_IDL_CPP_Keyword_Entry *entry = - cpp_key_tbl.lookup (ace_yytext, - ACE_OS::strlen (ace_yytext)); - if (entry) - yylval.strval = ACE_OS::strdup (entry->mapping_); - else - yylval.strval = ACE_OS::strdup (ace_yytext); - return IDENTIFIER; -} - -static int scan_ccm_token (int token) -{ - if (idl_global->component_support ()) - { - return token; - } - else - { - yylval.strval = ACE_OS::strdup (ace_yytext); - return IDENTIFIER; - } -} - %} /* SO we don't choke on files that use \r\n */ @@ -184,31 +153,31 @@ octet return IDL_OCTET; void return IDL_VOID; native return IDL_NATIVE; local return IDL_LOCAL; -abstract return scan_obv_token (IDL_ABSTRACT); -custom return scan_obv_token (IDL_CUSTOM); -factory return scan_obv_token (IDL_FACTORY); -private return scan_obv_token (IDL_PRIVATE); -public return scan_obv_token (IDL_PUBLIC); -supports return scan_obv_token (IDL_SUPPORTS); -truncatable return scan_obv_token (IDL_TRUNCATABLE); -valuetype return scan_obv_token (IDL_VALUETYPE); -component return scan_ccm_token (IDL_COMPONENT); -consumes return scan_ccm_token (IDL_CONSUMES); -emits return scan_ccm_token (IDL_EMITS); -eventtype return scan_ccm_token (IDL_EVENTTYPE); -finder return scan_ccm_token (IDL_FINDER); -getraises return scan_ccm_token (IDL_GETRAISES); -home return scan_ccm_token (IDL_HOME); -import return scan_ccm_token (IDL_IMPORT); -multiple return scan_ccm_token (IDL_MULTIPLE); -primarykey return scan_ccm_token (IDL_PRIMARYKEY); -provides return scan_ccm_token (IDL_PROVIDES); -publishes return scan_ccm_token (IDL_PUBLISHES); -setraises return scan_ccm_token (IDL_SETRAISES); -typeid return scan_ccm_token (IDL_TYPEID); -typeprefix return scan_ccm_token (IDL_TYPEPREFIX); -uses return scan_ccm_token (IDL_USES); -manages return scan_ccm_token (IDL_MANAGES); +abstract return IDL_ABSTRACT; +custom return IDL_CUSTOM; +factory return IDL_FACTORY; +private return IDL_PRIVATE; +public return IDL_PUBLIC; +supports return IDL_SUPPORTS; +truncatable return IDL_TRUNCATABLE; +valuetype return IDL_VALUETYPE; +component return IDL_COMPONENT; +consumes return IDL_CONSUMES; +emits return IDL_EMITS; +eventtype return IDL_EVENTTYPE; +finder return IDL_FINDER; +getraises return IDL_GETRAISES; +home return IDL_HOME; +import return IDL_IMPORT; +multiple return IDL_MULTIPLE; +primarykey return IDL_PRIMARYKEY; +provides return IDL_PROVIDES; +publishes return IDL_PUBLISHES; +setraises return IDL_SETRAISES; +typeid return IDL_TYPEID; +typeprefix return IDL_TYPEPREFIX; +uses return IDL_USES; +manages return IDL_MANAGES; TRUE return IDL_TRUETOK; FALSE return IDL_FALSETOK; diff --git a/TAO/TAO_IDL/fe/idl.yy b/TAO/TAO_IDL/fe/idl.yy index 93e46169ab0..4c13b23b4a9 100644 --- a/TAO/TAO_IDL/fe/idl.yy +++ b/TAO/TAO_IDL/fe/idl.yy @@ -71,29 +71,22 @@ trademarks or registered trademarks of Sun Microsystems, Inc. /* Declarations */ %{ -#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_argument.h" +#include "ast_array.h" +#include "ast_attribute.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_valuetype.h" #include "ast_valuetype_fwd.h" +#include "ast_eventtype.h" +#include "ast_eventtype_fwd.h" #include "ast_component.h" #include "ast_component_fwd.h" #include "ast_home.h" -#include "utl_string.h" #include "ast_constant.h" -#include "fe_declarator.h" #include "ast_union.h" #include "ast_union_fwd.h" #include "ast_structure_fwd.h" @@ -104,7 +97,17 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_string.h" #include "ast_factory.h" #include "ast_exception.h" -#include "ast_array.h" +#include "fe_declarator.h" +#include "fe_interface_header.h" +#include "utl_identifier.h" +#include "utl_err.h" +#include "utl_string.h" +#include "utl_strlist.h" +#include "utl_namelist.h" +#include "utl_exprlist.h" +#include "utl_labellist.h" +#include "utl_decllist.h" +#include "global_extern.h" #include "nr_extern.h" #if (defined(apollo) || defined(hpux)) && defined(__cplusplus) @@ -136,6 +139,7 @@ AST_Decl *tao_enum_constant_decl = 0; UTL_DeclList *dlval; /* Declaration list */ FE_InterfaceHeader *ihval; /* Interface header */ FE_OBVHeader *vhval; /* Valuetype header */ + FE_EventHeader *ehval; /* Event header */ FE_ComponentHeader *chval; /* Component header */ FE_HomeHeader *hhval; /* Home header */ AST_Expression *exval; /* Expression value */ @@ -263,7 +267,7 @@ AST_Decl *tao_enum_constant_decl = 0; %type <slval> string_literals %type <nlval> at_least_one_scoped_name scoped_names inheritance_spec -%type <nlval> opt_raises supports_spec +%type <nlval> opt_raises opt_getraises opt_setraises supports_spec %type <elval> at_least_one_array_dim array_dims @@ -280,6 +284,8 @@ AST_Decl *tao_enum_constant_decl = 0; %type <hhval> home_header +%type <ehval> event_rest_of_header + %type <exval> expression const_expr or_expr xor_expr and_expr shift_expr %type <exval> add_expr mult_expr unary_expr primary_expr literal %type <exval> positive_int_expr array_dim @@ -298,9 +304,11 @@ AST_Decl *tao_enum_constant_decl = 0; %type <deval> declarator simple_declarator complex_declarator -%type <bval> opt_readonly opt_truncatable opt_multiple +%type <bval> opt_truncatable opt_multiple %type <idval> interface_decl value_decl union_decl struct_decl id +%type <idval> event_header event_plain_header event_custom_header +%type <idval> event_abs_header %type <ival> type_dcl %% @@ -3271,11 +3279,20 @@ array_dim : } ; -attribute : - opt_readonly +attribute + : attribute_readonly + | attribute_readwrite + ; + +attribute_readonly : + IDL_READONLY + { +// attribute_readonly : IDL_READONLY + idl_global->set_parse_state (IDL_GlobalData::PS_AttrROSeen); + } IDL_ATTRIBUTE { -// attribute : opt_readonly IDL_ATTRIBUTE +// IDL_ATTRIBUTE idl_global->set_parse_state (IDL_GlobalData::PS_AttrSeen); } param_type_spec @@ -3286,20 +3303,26 @@ attribute : at_least_one_simple_declarator { // at_least_one_simple_declarator + idl_global->set_parse_state (IDL_GlobalData::PS_AttrDeclsSeen); + } + opt_raises + { +// opt_raises UTL_Scope *s = idl_global->scopes ().top_non_null (); AST_Attribute *a = 0; FE_Declarator *d = 0; - idl_global->set_parse_state (IDL_GlobalData::PS_AttrCompleted); + + idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); /* * Create nodes representing attributes and add them to the * enclosing scope. */ if (s != 0 - && $4 != 0 - && $6 != 0) + && $5 != 0 + && $7 != 0) { - for (UTL_DecllistActiveIterator l ($6); + for (UTL_DecllistActiveIterator l ($7); !l.is_done (); l.next ()) { @@ -3310,7 +3333,7 @@ attribute : continue; } - AST_Type *tp = d->compose ($4); + AST_Type *tp = d->compose ($5); if (tp == 0) { @@ -3319,32 +3342,102 @@ attribute : a = idl_global->gen ()->create_attribute ( - $1, + I_TRUE, tp, (UTL_IdList *) d->name ()->copy (), s->is_local (), s->is_abstract () ); - /* - * Add one attribute to the enclosing scope. - */ + + if ($9 != 0) + { + (void) a->fe_add_get_exceptions ($9); + } + (void) s->fe_add_attribute (a); } } } ; -opt_readonly - : IDL_READONLY +attribute_readwrite : + IDL_ATTRIBUTE { -// opt_readonly : IDL_READONLY - idl_global->set_parse_state (IDL_GlobalData::PS_AttrROSeen); - $$ = I_TRUE; +// attribute_readonly : IDL_ATTRIBUTE + idl_global->set_parse_state (IDL_GlobalData::PS_AttrSeen); } - | /* EMPTY */ + param_type_spec { -/* | EMPTY */ - $$ = I_FALSE; +// param_type_spec + idl_global->set_parse_state (IDL_GlobalData::PS_AttrTypeSeen); + } + at_least_one_simple_declarator + { +// at_least_one_simple_declarator + idl_global->set_parse_state (IDL_GlobalData::PS_AttrDeclsSeen); + } + opt_getraises + { +// opt_getraises + idl_global->set_parse_state (IDL_GlobalData::PS_OpGetRaiseCompleted); + } + opt_setraises + { +// opt_setraises + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Attribute *a = 0; + FE_Declarator *d = 0; + + idl_global->set_parse_state (IDL_GlobalData::PS_OpSetRaiseCompleted); + + /* + * Create nodes representing attributes and add them to the + * enclosing scope. + */ + if (s != 0 + && $3 != 0 + && $5 != 0) + { + for (UTL_DecllistActiveIterator l ($5); + !l.is_done (); + l.next ()) + { + d = l.item (); + + if (d == 0) + { + continue; + } + + AST_Type *tp = d->compose ($3); + + if (tp == 0) + { + continue; + } + + a = + idl_global->gen ()->create_attribute ( + I_FALSE, + tp, + (UTL_IdList *) d->name ()->copy (), + s->is_local (), + s->is_abstract () + ); + + if ($7 != 0) + { + (void) a->fe_add_get_exceptions ($9); + } + + if ($9 != 0) + { + (void) a->fe_add_set_exceptions ($9); + } + + (void) s->fe_add_attribute (a); + } + } } ; @@ -3850,6 +3943,56 @@ opt_raises } ; +opt_getraises + : IDL_GETRAISES + { +// opt_getraises : IDL_GETRAISES + idl_global->set_parse_state (IDL_GlobalData::PS_OpGetRaiseSeen); + } + '(' + { +// '(' + idl_global->set_parse_state (IDL_GlobalData::PS_OpGetRaiseSqSeen); + } + at_least_one_scoped_name + ')' + { +// at_least_one_scoped_name ')' + idl_global->set_parse_state (IDL_GlobalData::PS_OpGetRaiseQsSeen); + $$ = $5; + } + | /* EMPTY */ + { + $$ = 0; +/* | EMPTY */ + } + ; + +opt_setraises + : IDL_SETRAISES + { +// opt_setraises : IDL_SETRAISES + idl_global->set_parse_state (IDL_GlobalData::PS_OpSetRaiseSeen); + } + '(' + { +// '(' + idl_global->set_parse_state (IDL_GlobalData::PS_OpSetRaiseSqSeen); + } + at_least_one_scoped_name + ')' + { +// at_least_one_scoped_name ')' + idl_global->set_parse_state (IDL_GlobalData::PS_OpSetRaiseQsSeen); + $$ = $5; + } + | /* EMPTY */ + { + $$ = 0; +/* | EMPTY */ + } + ; + opt_context : IDL_CONTEXT { @@ -4185,10 +4328,27 @@ provides_decl : if (c != 0) { - AST_Component::port_description pd; - pd.id = $3; - pd.impl = $2; - c->provides ().enqueue_tail (pd); + AST_Decl *d = s->lookup_by_name ($2, + I_TRUE); + + if (d == 0) + { + idl_global->err ()->lookup_error ($2); + } + else if (d->node_type () != AST_Decl::NT_interface) + { + idl_global->err ()->interface_expected (d); + } + else + { + AST_Type *interface_type = + AST_Interface::narrow_from_decl (d); + + AST_Component::port_description pd; + pd.id = $3; + pd.impl = interface_type; + c->provides ().enqueue_tail (pd); + } } } ; @@ -4244,16 +4404,31 @@ uses_decl : { // uses_decl : IDL_USES opt_multiple interface_type id UTL_Scope *s = idl_global->scopes ().top_non_null (); - AST_Component *c = AST_Component::narrow_from_scope (s); - - if (c != 0) + AST_Decl *d = s->lookup_by_name ($3, + I_TRUE); + + if (d == 0) { - AST_Component::uses_description ud; - ud.id = $4; - ud.impl = $3; - ud.is_multiple = $2; - c->uses ().enqueue_tail (ud); - } + idl_global->err ()->lookup_error ($3); + } + else if (d->node_type () != AST_Decl::NT_interface) + { + idl_global->err ()->interface_expected (d); + } + else + { + AST_Type *interface_type = AST_Type::narrow_from_decl (d); + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description ud; + ud.id = $4; + ud.impl = interface_type; + ud.is_multiple = $2; + c->uses ().enqueue_tail (ud); + } + } } ; @@ -4284,20 +4459,23 @@ emits_decl : { idl_global->err ()->lookup_error ($2); } - else if (d->node_type () != AST_Decl::NT_valuetype) + else if (d->node_type () != AST_Decl::NT_eventtype) { - idl_global->err ()->valuetype_expected (d); + idl_global->err ()->eventtype_expected (d); } - - AST_Component *c = AST_Component::narrow_from_scope (s); - - if (c != 0) + else { - AST_Component::port_description pd; - pd.id = $3; - pd.impl = $2; - c->emits ().enqueue_tail (pd); - } + AST_Type *event_type = AST_Type::narrow_from_decl (d); + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = $3; + pd.impl = event_type; + c->emits ().enqueue_tail (pd); + } + } } ; @@ -4315,20 +4493,23 @@ publishes_decl : { idl_global->err ()->lookup_error ($2); } - else if (d->node_type () != AST_Decl::NT_valuetype) + else if (d->node_type () != AST_Decl::NT_eventtype) { - idl_global->err ()->valuetype_expected (d); + idl_global->err ()->eventtype_expected (d); } - - AST_Component *c = AST_Component::narrow_from_scope (s); - - if (c != 0) + else { - AST_Component::port_description pd; - pd.id = $3; - pd.impl = $2; - c->publishes ().enqueue_tail (pd); - } + AST_Type *event_type = AST_Type::narrow_from_decl (d); + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = $3; + pd.impl = event_type; + c->publishes ().enqueue_tail (pd); + } + } } ; @@ -4346,20 +4527,23 @@ consumes_decl : { idl_global->err ()->lookup_error ($2); } - else if (d->node_type () != AST_Decl::NT_valuetype) + else if (d->node_type () != AST_Decl::NT_eventtype) { - idl_global->err ()->valuetype_expected (d); + idl_global->err ()->eventtype_expected (d); } - - AST_Component *c = AST_Component::narrow_from_scope (s); - - if (c != 0) + else { - AST_Component::port_description pd; - pd.id = $3; - pd.impl = $2; - c->consumes ().enqueue_tail (pd); - } + AST_Type *event_type = AST_Type::narrow_from_decl (d); + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = $3; + pd.impl = event_type; + c->consumes ().enqueue_tail (pd); + } + } } ; @@ -4392,7 +4576,7 @@ home_decl : (void) s->fe_add_home (h); // This FE_HomeHeader class isn't destroyed with the AST. - $1->name ()->destroy (); + $1->name ()->destroy (); delete $1; $1 = 0; } @@ -4403,6 +4587,13 @@ home_decl : idl_global->scopes ().push (h); } home_body + { +// home_body + /* + * Done with this component - pop it off the scopes stack. + */ + idl_global->scopes ().pop (); + } ; home_header : @@ -4554,17 +4745,14 @@ factory_decl : if (s != 0) { AST_Home *home = AST_Home::narrow_from_scope (s); - AST_Component *rt = home->managed_component (); - o = idl_global->gen ()->create_operation ( - rt, + home->managed_component (), AST_Operation::OP_noflags, &n, - I_TRUE, + I_FALSE, I_FALSE ); - (void) s->fe_add_operation (o); home->factories ().enqueue_tail (o); } @@ -4584,9 +4772,24 @@ factory_decl : opt_raises { // opt_raises + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Operation *o = 0; idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); /* + * Add exceptions and context to the operation. + */ + if (s != 0 && s->scope_node_type () == AST_Decl::NT_op) + { + o = AST_Operation::narrow_from_scope (s); + + if ($6 != 0 && o != 0) + { + (void) o->fe_add_exceptions ($6); + } + } + + /* * Done with this operation. Pop its scope from the scopes stack. */ idl_global->scopes ().pop (); @@ -4611,17 +4814,14 @@ finder_decl : if (s != 0) { AST_Home *home = AST_Home::narrow_from_scope (s); - AST_Component *rt = home->managed_component (); - o = idl_global->gen ()->create_operation ( - rt, + home->managed_component (), AST_Operation::OP_noflags, &n, - I_TRUE, + I_FALSE, I_FALSE ); - (void) s->fe_add_operation (o); home->finders ().enqueue_tail (o); } @@ -4641,9 +4841,24 @@ finder_decl : opt_raises { // opt_raises + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Operation *o = 0; idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); /* + * Add exceptions and context to the operation. + */ + if (s != 0 && s->scope_node_type () == AST_Decl::NT_op) + { + o = AST_Operation::narrow_from_scope (s); + + if ($6 != 0 && o != 0) + { + (void) o->fe_add_exceptions ($6); + } + } + + /* * Done with this operation. Pop its scope from the scopes stack. */ idl_global->scopes ().pop (); @@ -4664,56 +4879,252 @@ event_forward_decl event_concrete_forward_decl : IDL_EVENTTYPE id + { +// event_concrete_forward_decl : IDL_EVENTTYPE id + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n ($2, + 0); + AST_EventTypeFwd *f = 0; + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeForwardSeen); + + /* + * Create a node representing a forward declaration of an + * eventtype. Store it in the enclosing scope + */ + if (s != 0) + { + f = idl_global->gen ()->create_eventtype_fwd (&n, + I_FALSE); + (void) s->fe_add_valuetype_fwd (f); + } + } ; event_abs_forward_decl : IDL_ABSTRACT IDL_EVENTTYPE id + { +// event_abs_forward_decl : IDL_ABSTRACT IDL_EVENTTYPE id + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n ($3, + 0); + AST_EventTypeFwd *f = 0; + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeForwardSeen); + + /* + * Create a node representing a forward declaration of an + * eventtype. Store it in the enclosing scope + */ + if (s != 0) + { + f = idl_global->gen ()->create_eventtype_fwd (&n, + I_TRUE); + (void) s->fe_add_valuetype_fwd (f); + } + } ; event_abs_decl : event_abs_header event_rest_of_header + { +// event_abs_decl : event_abs_header event_rest_of_header + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_EventType *e = 0; + AST_Interface *i = 0; + + if (s != 0 && $1 != 0) + { + UTL_ScopedName sn ($1, + 0); + e = + idl_global->gen ()->create_eventtype ( + &sn, + $2->inherits (), + $2->n_inherits (), + $2->inherits_concrete (), + $2->inherits_flat (), + $2->n_inherits_flat (), + $2->supports (), + $2->n_supports (), + $2->supports_concrete (), + I_TRUE, + I_FALSE + ); + i = AST_Interface::narrow_from_decl (e); + AST_Interface::fwd_redefinition_helper (i, + s); + /* + * Add the eventetype to its definition scope + */ + e = AST_EventType::narrow_from_decl (i); + (void) s->fe_add_eventtype (e); + } + + /* + * Push it on the scope stack. + */ + idl_global->scopes ().push (e); + } '{' + { +// '{' + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeSqSeen); + } exports + { +// exports + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeBodySeen); + } '}' + { +// '}' + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeQsSeen); + + /* + * Done with this eventtype - pop it off the scopes stack. + */ + idl_global->scopes ().pop (); + } ; event_abs_header : IDL_ABSTRACT IDL_EVENTTYPE id + { +// event_abs_header : IDL_ABSTRACT IDL_EVENTTYPE id + $$ = $3; + } ; event_custom_header : IDL_CUSTOM IDL_EVENTTYPE id + { +// id + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeIDSeen); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("error in %s line %d\n"), + idl_global->filename ()->get_string (), + idl_global->lineno ())); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Sorry, I (TAO_IDL) can't handle") + ACE_TEXT (" custom yet\n"))); + $$ = 0; + } ; -event_plain_header : +event_plain_header : IDL_EVENTTYPE id + { +// id + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeIDSeen); + + $$ = $2; + } ; event_rest_of_header : opt_truncatable inheritance_spec + { +// event_rest_of_header : opt_truncatable inheritance_spec + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + } supports_spec + { +// supports_spec + idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); + + ACE_NEW_RETURN ($$, + FE_EventHeader (0, + $2, + $4, + $1), + 1); + } ; event_decl : event_header event_rest_of_header + { +// event_decl : event_header event_rest_of_header + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_EventType *e = 0; + AST_Interface *i = 0; + + if (s != 0 && $1 != 0) + { + UTL_ScopedName sn ($1, + 0); + e = + idl_global->gen ()->create_eventtype ( + &sn, + $2->inherits (), + $2->n_inherits (), + $2->inherits_concrete (), + $2->inherits_flat (), + $2->n_inherits_flat (), + $2->supports (), + $2->n_supports (), + $2->supports_concrete (), + I_FALSE, + $2->truncatable () + ); + i = AST_Interface::narrow_from_decl (e); + AST_Interface::fwd_redefinition_helper (i, + s); + /* + * Add the eventetype to its definition scope + */ + e = AST_EventType::narrow_from_decl (i); + (void) s->fe_add_eventtype (e); + } + + /* + * Push it on the scope stack. + */ + idl_global->scopes ().push (e); + } '{' + { +// '{' + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeSqSeen); + } value_elements + { +// value_elements + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeBodySeen); + } '}' + { +// '}' + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeQsSeen); + + /* + * Done with this eventtype - pop it off the scopes stack. + */ + idl_global->scopes ().pop (); + } ; event_header : event_custom_header + { +// event_header : event_custom_header + $$ = $1; + } | event_plain_header + { +// event_header : event_plain_header + $$ = $1; + } ; %% diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index 0e8e724bd4c..c533e0b1ca5 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -790,7 +790,7 @@ static char *tao_yy_last_accepting_cpos; char tao_yytext[TAO_YYLMAX]; char *tao_yytext_ptr; #define INITIAL 0 -/* $Id: idl.ll,v 1.68 2002/07/23 02:51:14 parsons Exp $ +/* $Id: idl.ll,v 1.70 2002/08/26 19:47:28 parsons Exp $ COPYRIGHT @@ -901,37 +901,6 @@ inline char *__tao_yytext() #define ace_tao_yytext tao_yytext #endif /* 0 */ -static int scan_obv_token (int token) -{ - if (idl_global->obv_support ()) - { - return token; - } - - TAO_IDL_CPP_Keyword_Table cpp_key_tbl; - const TAO_IDL_CPP_Keyword_Entry *entry = - cpp_key_tbl.lookup (ace_tao_yytext, - ACE_OS::strlen (ace_tao_yytext)); - if (entry) - tao_yylval.strval = ACE_OS::strdup (entry->mapping_); - else - tao_yylval.strval = ACE_OS::strdup (ace_tao_yytext); - return IDENTIFIER; -} - -static int scan_ccm_token (int token) -{ - if (idl_global->component_support ()) - { - return token; - } - else - { - tao_yylval.strval = ACE_OS::strdup (ace_tao_yytext); - return IDENTIFIER; - } -} - /* SO we don't choke on files that use \r\n */ #define TAO_YY_NEVER_INTERACTIVE 1 @@ -1305,103 +1274,103 @@ return IDL_LOCAL; TAO_YY_BREAK case 34: TAO_YY_RULE_SETUP -return scan_obv_token (IDL_ABSTRACT); +return IDL_ABSTRACT; TAO_YY_BREAK case 35: TAO_YY_RULE_SETUP -return scan_obv_token (IDL_CUSTOM); +return IDL_CUSTOM; TAO_YY_BREAK case 36: TAO_YY_RULE_SETUP -return scan_obv_token (IDL_FACTORY); +return IDL_FACTORY; TAO_YY_BREAK case 37: TAO_YY_RULE_SETUP -return scan_obv_token (IDL_PRIVATE); +return IDL_PRIVATE; TAO_YY_BREAK case 38: TAO_YY_RULE_SETUP -return scan_obv_token (IDL_PUBLIC); +return IDL_PUBLIC; TAO_YY_BREAK case 39: TAO_YY_RULE_SETUP -return scan_obv_token (IDL_SUPPORTS); +return IDL_SUPPORTS; TAO_YY_BREAK case 40: TAO_YY_RULE_SETUP -return scan_obv_token (IDL_TRUNCATABLE); +return IDL_TRUNCATABLE; TAO_YY_BREAK case 41: TAO_YY_RULE_SETUP -return scan_obv_token (IDL_VALUETYPE); +return IDL_VALUETYPE; TAO_YY_BREAK case 42: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_COMPONENT); +return IDL_COMPONENT; TAO_YY_BREAK case 43: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_CONSUMES); +return IDL_CONSUMES; TAO_YY_BREAK case 44: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_EMITS); +return IDL_EMITS; TAO_YY_BREAK case 45: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_EVENTTYPE); +return IDL_EVENTTYPE; TAO_YY_BREAK case 46: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_FINDER); +return IDL_FINDER; TAO_YY_BREAK case 47: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_GETRAISES); +return IDL_GETRAISES; TAO_YY_BREAK case 48: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_HOME); +return IDL_HOME; TAO_YY_BREAK case 49: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_IMPORT); +return IDL_IMPORT; TAO_YY_BREAK case 50: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_MULTIPLE); +return IDL_MULTIPLE; TAO_YY_BREAK case 51: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_PRIMARYKEY); +return IDL_PRIMARYKEY; TAO_YY_BREAK case 52: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_PROVIDES); +return IDL_PROVIDES; TAO_YY_BREAK case 53: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_PUBLISHES); +return IDL_PUBLISHES; TAO_YY_BREAK case 54: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_SETRAISES); +return IDL_SETRAISES; TAO_YY_BREAK case 55: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_TYPEID); +return IDL_TYPEID; TAO_YY_BREAK case 56: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_TYPEPREFIX); +return IDL_TYPEPREFIX; TAO_YY_BREAK case 57: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_USES); +return IDL_USES; TAO_YY_BREAK case 58: TAO_YY_RULE_SETUP -return scan_ccm_token (IDL_MANAGES); +return IDL_MANAGES; TAO_YY_BREAK case 59: TAO_YY_RULE_SETUP diff --git a/TAO/TAO_IDL/fe/y.tab.cpp b/TAO/TAO_IDL/fe/y.tab.cpp index bbcb59803a9..53bcb99897c 100644 --- a/TAO/TAO_IDL/fe/y.tab.cpp +++ b/TAO/TAO_IDL/fe/y.tab.cpp @@ -3,29 +3,22 @@ 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 "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_argument.h" +#include "ast_array.h" +#include "ast_attribute.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_valuetype.h" #include "ast_valuetype_fwd.h" +#include "ast_eventtype.h" +#include "ast_eventtype_fwd.h" #include "ast_component.h" #include "ast_component_fwd.h" #include "ast_home.h" -#include "utl_string.h" #include "ast_constant.h" -#include "fe_declarator.h" #include "ast_union.h" #include "ast_union_fwd.h" #include "ast_structure_fwd.h" @@ -36,7 +29,17 @@ char tao_yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90 \n\ #include "ast_string.h" #include "ast_factory.h" #include "ast_exception.h" -#include "ast_array.h" +#include "fe_declarator.h" +#include "fe_interface_header.h" +#include "utl_identifier.h" +#include "utl_err.h" +#include "utl_string.h" +#include "utl_strlist.h" +#include "utl_namelist.h" +#include "utl_exprlist.h" +#include "utl_labellist.h" +#include "utl_decllist.h" +#include "global_extern.h" #include "nr_extern.h" #if (defined(apollo) || defined(hpux)) && defined(__cplusplus) @@ -62,6 +65,7 @@ typedef union { UTL_DeclList *dlval; /* Declaration list */ FE_InterfaceHeader *ihval; /* Interface header */ FE_OBVHeader *vhval; /* Valuetype header */ + FE_EventHeader *ehval; /* Event header */ FE_ComponentHeader *chval; /* Component header */ FE_HomeHeader *hhval; /* Home header */ AST_Expression *exval; /* Expression value */ @@ -163,52 +167,54 @@ typedef union { #define IDL_WSTRING_LITERAL 332 #define TAO_YYERRCODE 256 short tao_yylhs[] = { -1, - 0, 82, 82, 84, 83, 86, 83, 88, 83, 90, - 83, 92, 83, 94, 83, 96, 83, 98, 83, 100, - 83, 102, 83, 104, 83, 105, 83, 106, 107, 108, - 109, 95, 93, 93, 112, 114, 115, 110, 116, 76, - 37, 37, 37, 117, 26, 26, 97, 97, 97, 97, - 118, 118, 123, 125, 126, 122, 127, 128, 129, 119, - 130, 38, 131, 77, 74, 74, 28, 28, 120, 120, - 121, 124, 124, 132, 132, 132, 137, 133, 138, 133, - 113, 113, 139, 134, 140, 134, 141, 134, 142, 134, - 143, 134, 145, 134, 147, 134, 148, 134, 24, 149, - 25, 25, 16, 150, 16, 151, 16, 80, 111, 111, - 111, 152, 153, 154, 155, 89, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 41, 42, 43, 43, 44, - 44, 45, 45, 46, 46, 46, 47, 47, 47, 48, - 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, - 157, 81, 81, 81, 81, 81, 81, 159, 156, 1, - 1, 2, 2, 2, 65, 65, 65, 65, 65, 65, - 65, 65, 4, 4, 4, 3, 3, 3, 158, 158, - 33, 162, 34, 34, 70, 70, 35, 163, 36, 36, - 71, 72, 57, 57, 63, 63, 63, 64, 64, 64, - 60, 60, 60, 61, 58, 58, 66, 59, 62, 67, - 164, 79, 165, 167, 168, 7, 166, 170, 170, 171, - 169, 172, 173, 136, 174, 136, 175, 78, 176, 177, - 178, 179, 181, 182, 10, 9, 9, 9, 9, 9, - 9, 180, 184, 184, 185, 186, 183, 187, 183, 31, - 32, 32, 188, 54, 189, 190, 54, 191, 55, 160, - 161, 192, 193, 195, 196, 8, 194, 199, 198, 198, - 197, 200, 201, 5, 5, 202, 203, 13, 205, 206, - 6, 6, 204, 208, 209, 14, 14, 207, 210, 11, - 29, 30, 30, 211, 212, 53, 213, 214, 144, 73, - 73, 215, 216, 217, 218, 91, 219, 221, 222, 223, - 146, 69, 69, 69, 12, 12, 224, 226, 135, 227, - 225, 229, 225, 228, 232, 231, 231, 233, 234, 230, - 235, 220, 237, 220, 236, 240, 239, 239, 241, 242, - 238, 15, 15, 15, 15, 68, 68, 68, 243, 244, - 27, 27, 245, 246, 21, 21, 22, 247, 23, 23, - 85, 87, 99, 99, 249, 250, 252, 253, 248, 254, - 255, 39, 256, 18, 18, 251, 251, 259, 257, 261, - 257, 263, 257, 265, 257, 267, 257, 268, 257, 258, - 17, 17, 260, 75, 75, 262, 264, 266, 270, 101, - 271, 272, 273, 274, 275, 276, 40, 277, 19, 19, - 20, 20, 279, 280, 269, 278, 278, 281, 283, 281, - 285, 281, 286, 287, 282, 288, 289, 284, 103, 103, - 103, 292, 292, 294, 293, 291, 295, 297, 298, 296, - 290, 299, 299, + 0, 88, 88, 90, 89, 92, 89, 94, 89, 96, + 89, 98, 89, 100, 89, 102, 89, 104, 89, 106, + 89, 108, 89, 110, 89, 111, 89, 112, 113, 114, + 115, 101, 99, 99, 118, 120, 121, 116, 122, 78, + 39, 39, 39, 123, 26, 26, 103, 103, 103, 103, + 124, 124, 129, 131, 132, 128, 133, 134, 135, 125, + 136, 40, 137, 79, 76, 76, 30, 30, 126, 126, + 127, 130, 130, 138, 138, 138, 143, 139, 144, 139, + 119, 119, 145, 140, 146, 140, 147, 140, 148, 140, + 149, 140, 151, 140, 153, 140, 154, 140, 24, 155, + 25, 25, 16, 156, 16, 157, 16, 82, 117, 117, + 117, 158, 159, 160, 161, 95, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 44, 45, 46, 46, 47, + 47, 48, 48, 49, 49, 49, 50, 50, 50, 51, + 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, + 54, 54, 54, 54, 54, 54, 54, 54, 54, 55, + 163, 87, 87, 87, 87, 87, 87, 165, 162, 1, + 1, 2, 2, 2, 68, 68, 68, 68, 68, 68, + 68, 68, 4, 4, 4, 3, 3, 3, 164, 164, + 35, 168, 36, 36, 73, 73, 37, 169, 38, 38, + 74, 75, 60, 60, 66, 66, 66, 67, 67, 67, + 63, 63, 63, 64, 61, 61, 69, 62, 65, 70, + 170, 81, 171, 173, 174, 7, 172, 176, 176, 177, + 175, 178, 179, 142, 180, 142, 181, 80, 182, 183, + 184, 185, 187, 188, 10, 9, 9, 9, 9, 9, + 9, 186, 190, 190, 191, 192, 189, 193, 189, 33, + 34, 34, 194, 57, 195, 196, 57, 197, 58, 166, + 167, 198, 199, 201, 202, 8, 200, 205, 204, 204, + 203, 206, 207, 5, 5, 208, 209, 13, 211, 212, + 6, 6, 210, 214, 215, 14, 14, 213, 216, 11, + 31, 32, 32, 217, 218, 56, 150, 150, 221, 222, + 223, 224, 219, 225, 226, 227, 228, 220, 229, 230, + 231, 232, 97, 233, 235, 236, 237, 152, 72, 72, + 72, 12, 12, 238, 240, 141, 241, 239, 243, 239, + 242, 246, 245, 245, 247, 248, 244, 249, 234, 251, + 234, 250, 254, 253, 253, 255, 256, 252, 15, 15, + 15, 15, 71, 71, 71, 257, 258, 27, 27, 259, + 260, 28, 28, 261, 262, 29, 29, 263, 264, 21, + 21, 22, 265, 23, 23, 91, 93, 105, 105, 267, + 268, 270, 271, 266, 272, 273, 41, 274, 18, 18, + 269, 269, 277, 275, 279, 275, 281, 275, 283, 275, + 285, 275, 286, 275, 276, 17, 17, 278, 77, 77, + 280, 282, 284, 288, 107, 289, 290, 291, 292, 293, + 294, 42, 295, 19, 19, 20, 20, 297, 298, 287, + 296, 296, 299, 301, 299, 303, 299, 304, 305, 300, + 306, 307, 302, 109, 109, 109, 310, 310, 312, 311, + 313, 314, 315, 309, 86, 85, 84, 316, 43, 317, + 318, 319, 308, 83, 83, }; short tao_yylen[] = { 2, 1, 2, 0, 0, 3, 0, 3, 0, 3, 0, @@ -241,31 +247,33 @@ short tao_yylen[] = { 2, 1, 0, 0, 0, 0, 9, 2, 0, 4, 0, 1, 0, 0, 6, 2, 0, 0, 5, 0, 0, 6, 1, 1, 0, 0, 6, 1, 1, 0, 3, - 2, 2, 0, 0, 0, 5, 0, 0, 6, 1, - 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, - 10, 1, 1, 0, 1, 1, 0, 0, 5, 0, - 3, 0, 4, 2, 0, 4, 0, 0, 0, 5, - 0, 3, 0, 4, 2, 0, 4, 0, 0, 0, - 5, 1, 1, 1, 1, 1, 1, 1, 0, 0, - 6, 0, 0, 0, 6, 0, 2, 0, 4, 0, - 3, 3, 1, 1, 2, 0, 0, 0, 7, 0, - 0, 6, 0, 3, 0, 2, 0, 0, 3, 0, - 3, 0, 3, 0, 3, 0, 3, 0, 3, 3, - 1, 1, 4, 1, 0, 3, 3, 3, 0, 3, - 0, 0, 0, 0, 0, 0, 13, 0, 3, 0, - 2, 0, 0, 0, 5, 2, 0, 1, 0, 3, - 0, 3, 0, 0, 6, 0, 0, 6, 1, 1, - 1, 1, 1, 2, 3, 5, 3, 3, 2, 3, - 5, 1, 1, + 2, 2, 0, 0, 0, 5, 1, 1, 0, 0, + 0, 0, 9, 0, 0, 0, 0, 9, 0, 0, + 0, 0, 9, 0, 0, 0, 0, 10, 1, 1, + 0, 1, 1, 0, 0, 5, 0, 3, 0, 4, + 2, 0, 4, 0, 0, 0, 5, 0, 3, 0, + 4, 2, 0, 4, 0, 0, 0, 5, 1, 1, + 1, 1, 1, 1, 1, 0, 0, 6, 0, 0, + 0, 6, 0, 0, 0, 6, 0, 0, 0, 6, + 0, 2, 0, 4, 0, 3, 3, 1, 1, 2, + 0, 0, 0, 7, 0, 0, 6, 0, 3, 0, + 2, 0, 0, 3, 0, 3, 0, 3, 0, 3, + 0, 3, 0, 3, 3, 1, 1, 4, 1, 0, + 3, 3, 3, 0, 3, 0, 0, 0, 0, 0, + 0, 13, 0, 3, 0, 2, 0, 0, 0, 5, + 2, 0, 1, 0, 3, 0, 3, 0, 0, 6, + 0, 0, 6, 1, 1, 1, 1, 1, 2, 3, + 0, 0, 0, 8, 3, 3, 2, 0, 4, 0, + 0, 0, 8, 1, 1, }; short tao_yydefred[] = { 3, 0, 0, 26, 112, 28, 39, 161, 221, 237, 272, - 312, 0, 0, 0, 0, 63, 0, 0, 411, 0, - 0, 163, 165, 164, 35, 53, 376, 409, 0, 0, - 0, 0, 4, 2, 6, 8, 10, 12, 14, 16, - 18, 20, 22, 24, 33, 34, 47, 48, 49, 50, - 52, 167, 189, 190, 373, 374, 439, 440, 441, 442, - 443, 0, 452, 453, 0, 0, 0, 0, 0, 0, + 319, 0, 0, 0, 0, 63, 0, 0, 426, 0, + 0, 163, 165, 164, 35, 53, 391, 424, 0, 0, + 0, 0, 0, 475, 474, 0, 4, 2, 6, 8, + 10, 12, 14, 16, 18, 20, 22, 24, 33, 34, + 47, 48, 49, 50, 52, 167, 189, 190, 388, 389, + 454, 455, 456, 457, 458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 166, 201, 0, 0, 57, 0, 0, 0, 0, 51, 0, 0, 0, 0, 104, 0, 103, 0, 0, 0, 0, 0, 44, 41, 0, @@ -273,511 +281,517 @@ short tao_yydefred[] = { 3, 220, 286, 293, 298, 65, 71, 170, 171, 173, 183, 184, 186, 188, 187, 0, 185, 0, 175, 177, 178, 176, 180, 181, 203, 204, 172, 179, 182, 0, 0, - 223, 0, 0, 239, 0, 0, 0, 0, 0, 0, + 223, 0, 0, 239, 0, 470, 0, 461, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 123, 124, 0, 113, 117, 118, 120, 121, 122, 119, - 29, 40, 168, 162, 222, 238, 273, 313, 42, 0, - 0, 43, 448, 64, 0, 412, 0, 371, 106, 372, - 36, 54, 377, 423, 410, 0, 206, 213, 0, 210, - 0, 282, 285, 61, 289, 294, 0, 224, 5, 7, - 9, 11, 13, 15, 17, 19, 21, 23, 25, 0, - 82, 73, 0, 0, 0, 0, 0, 58, 383, 381, - 0, 105, 0, 82, 73, 387, 427, 0, 45, 209, - 287, 0, 0, 0, 0, 240, 230, 0, 450, 0, - 0, 114, 30, 202, 169, 194, 195, 196, 0, 274, - 314, 82, 0, 0, 418, 413, 107, 0, 0, 0, - 0, 0, 0, 151, 152, 153, 155, 157, 158, 159, - 156, 154, 0, 0, 0, 0, 0, 160, 0, 0, - 0, 0, 0, 0, 140, 144, 149, 283, 62, 290, - 295, 0, 225, 229, 0, 67, 97, 310, 322, 323, - 446, 0, 0, 83, 85, 87, 89, 91, 81, 93, - 95, 327, 79, 77, 451, 72, 74, 75, 0, 0, - 3, 0, 0, 0, 229, 0, 0, 382, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 398, 0, 386, - 388, 390, 392, 394, 396, 0, 0, 428, 0, 426, - 429, 431, 100, 288, 145, 146, 147, 0, 0, 0, + 29, 40, 168, 162, 222, 238, 273, 320, 42, 0, + 0, 43, 466, 64, 0, 427, 0, 386, 106, 387, + 36, 54, 392, 438, 425, 0, 206, 213, 0, 210, + 0, 282, 285, 61, 289, 294, 0, 224, 0, 468, + 0, 5, 7, 9, 11, 13, 15, 17, 19, 21, + 23, 25, 0, 0, 0, 0, 0, 58, 398, 396, + 0, 105, 0, 82, 73, 402, 442, 0, 45, 209, + 287, 0, 0, 0, 0, 240, 230, 471, 0, 462, + 114, 30, 202, 169, 194, 195, 196, 0, 274, 321, + 82, 0, 0, 433, 428, 107, 0, 0, 0, 0, + 0, 0, 151, 152, 153, 155, 157, 158, 159, 156, + 154, 0, 0, 0, 0, 0, 160, 0, 0, 0, + 0, 0, 0, 140, 144, 149, 283, 0, 62, 290, + 295, 0, 225, 229, 0, 73, 469, 82, 0, 3, + 0, 0, 0, 229, 0, 0, 397, 0, 0, 97, + 309, 314, 329, 330, 0, 83, 85, 87, 89, 91, + 0, 81, 93, 95, 307, 308, 334, 79, 77, 0, + 72, 74, 75, 0, 0, 0, 0, 0, 0, 413, + 0, 401, 403, 405, 407, 409, 411, 0, 0, 443, + 0, 441, 444, 446, 100, 288, 145, 146, 147, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 250, 241, 0, 246, 247, 249, 248, 0, - 0, 235, 232, 231, 0, 326, 353, 317, 354, 325, - 0, 352, 307, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 76, 115, 0, 192, 304, 300, 303, - 281, 275, 280, 0, 0, 0, 414, 38, 56, 0, - 0, 402, 0, 0, 0, 404, 0, 0, 379, 0, - 0, 0, 0, 0, 433, 436, 425, 0, 0, 0, - 150, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 284, 291, 296, 0, 226, 228, 0, 0, 98, - 0, 0, 84, 86, 88, 90, 92, 94, 96, 328, - 80, 78, 0, 0, 0, 0, 0, 0, 0, 0, - 60, 0, 408, 406, 400, 407, 0, 399, 389, 391, - 393, 395, 397, 0, 0, 430, 432, 0, 242, 236, - 233, 318, 308, 0, 116, 126, 32, 193, 305, 302, - 276, 278, 316, 415, 403, 0, 434, 437, 0, 0, - 0, 0, 329, 0, 0, 0, 0, 0, 0, 0, - 243, 234, 0, 319, 309, 200, 306, 279, 0, 331, - 338, 0, 337, 359, 435, 438, 0, 0, 0, 0, - 0, 0, 0, 333, 0, 0, 258, 265, 263, 255, - 262, 244, 254, 342, 356, 357, 358, 349, 0, 348, - 320, 198, 0, 417, 339, 335, 360, 0, 0, 0, - 0, 0, 0, 0, 0, 344, 0, 0, 0, 0, - 0, 0, 0, 259, 266, 264, 268, 256, 261, 245, - 253, 350, 346, 363, 321, 199, 340, 336, 0, 0, - 0, 0, 0, 0, 0, 361, 267, 269, 257, 351, - 347, 364, 0, 370, 0, 0, 365, 368, 0, 369, + 0, 67, 0, 0, 0, 250, 241, 0, 246, 247, + 249, 248, 0, 0, 235, 232, 231, 0, 0, 115, + 0, 192, 304, 300, 303, 281, 275, 280, 0, 0, + 0, 429, 0, 0, 0, 333, 360, 324, 361, 332, + 0, 359, 0, 0, 0, 0, 0, 38, 0, 0, + 0, 0, 0, 56, 76, 0, 0, 417, 0, 0, + 0, 419, 0, 0, 394, 0, 0, 0, 0, 0, + 448, 451, 440, 0, 0, 0, 150, 0, 0, 0, + 0, 0, 0, 0, 141, 142, 143, 284, 291, 296, + 0, 226, 228, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 60, 0, 98, 310, 315, + 0, 84, 86, 88, 90, 92, 94, 96, 335, 80, + 78, 423, 421, 415, 422, 0, 414, 404, 406, 408, + 410, 412, 0, 0, 445, 447, 0, 242, 236, 233, + 473, 464, 116, 126, 32, 193, 305, 302, 276, 278, + 323, 430, 0, 0, 325, 0, 418, 0, 449, 452, + 0, 0, 0, 0, 0, 311, 316, 200, 0, 336, + 0, 0, 0, 0, 243, 234, 306, 279, 0, 0, + 0, 0, 0, 326, 338, 345, 0, 344, 366, 450, + 453, 0, 0, 312, 370, 317, 198, 0, 0, 0, + 0, 340, 0, 0, 258, 265, 263, 255, 262, 244, + 254, 0, 432, 0, 0, 0, 0, 349, 363, 364, + 365, 356, 0, 355, 327, 346, 342, 367, 0, 0, + 0, 0, 0, 0, 0, 0, 313, 371, 374, 318, + 199, 0, 351, 0, 0, 0, 0, 0, 259, 266, + 264, 268, 256, 261, 245, 253, 0, 0, 357, 353, + 378, 328, 347, 343, 0, 0, 0, 0, 0, 375, + 0, 0, 0, 368, 267, 269, 257, 372, 0, 358, + 354, 379, 0, 0, 376, 385, 0, 0, 380, 383, + 0, 384, }; short tao_yydgoto[] = { 1, - 393, 117, 118, 119, 120, 121, 22, 23, 384, 24, - 254, 398, 125, 126, 400, 287, 434, 230, 266, 584, - 615, 635, 636, 239, 272, 99, 555, 249, 419, 487, - 570, 592, 255, 332, 545, 561, 25, 26, 27, 28, - 515, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 420, 571, 608, 164, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 578, 312, 256, - 257, 258, 313, 139, 437, 29, 30, 31, 32, 92, - 314, 2, 34, 146, 315, 147, 316, 148, 317, 149, - 318, 150, 39, 151, 40, 152, 41, 153, 42, 154, - 43, 155, 44, 156, 66, 68, 224, 331, 484, 45, - 46, 94, 250, 234, 341, 69, 196, 47, 48, 49, - 50, 51, 95, 251, 235, 342, 181, 262, 425, 243, - 86, 326, 327, 319, 329, 394, 413, 412, 404, 405, - 406, 407, 408, 320, 409, 321, 410, 395, 450, 187, - 233, 67, 223, 330, 483, 174, 70, 52, 225, 53, - 54, 485, 599, 71, 145, 303, 247, 390, 467, 391, - 305, 469, 530, 468, 72, 207, 302, 465, 529, 572, - 557, 593, 573, 594, 591, 622, 588, 590, 589, 620, - 621, 73, 226, 422, 334, 488, 423, 489, 535, 242, - 379, 201, 273, 142, 244, 380, 143, 245, 381, 333, - 486, 534, 472, 532, 74, 227, 335, 490, 471, 544, - 531, 560, 598, 411, 527, 514, 537, 552, 538, 553, - 565, 602, 563, 601, 558, 579, 559, 580, 597, 624, - 595, 623, 566, 603, 625, 633, 639, 55, 56, 96, - 270, 236, 349, 185, 264, 263, 350, 351, 440, 352, - 441, 353, 442, 354, 443, 355, 444, 438, 195, 97, - 89, 231, 340, 492, 536, 562, 339, 271, 237, 359, - 360, 361, 448, 362, 449, 504, 539, 505, 540, 57, - 58, 59, 60, 61, 62, 158, 63, 64, 65, + 396, 117, 118, 119, 120, 121, 22, 23, 387, 24, + 253, 418, 125, 126, 420, 286, 440, 230, 265, 593, + 642, 667, 668, 239, 271, 99, 570, 576, 620, 299, + 404, 482, 588, 613, 254, 311, 547, 562, 25, 26, + 27, 28, 146, 523, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 405, 589, 633, 164, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 602, 325, 255, 256, 257, 139, 443, 29, 30, 31, + 32, 92, 33, 34, 35, 36, 326, 2, 38, 149, + 327, 150, 328, 151, 329, 152, 330, 153, 43, 154, + 44, 155, 45, 156, 46, 157, 47, 158, 48, 159, + 66, 68, 224, 310, 479, 49, 50, 94, 267, 234, + 331, 69, 196, 51, 52, 53, 54, 55, 95, 268, + 235, 340, 181, 261, 410, 243, 86, 341, 342, 332, + 344, 397, 433, 432, 423, 424, 425, 426, 427, 333, + 429, 334, 430, 413, 456, 187, 233, 67, 223, 309, + 478, 174, 70, 56, 225, 57, 58, 480, 597, 71, + 145, 303, 247, 393, 473, 394, 305, 475, 542, 474, + 72, 207, 302, 471, 541, 590, 572, 614, 591, 615, + 612, 648, 609, 611, 610, 646, 647, 73, 226, 407, + 313, 483, 408, 484, 544, 242, 381, 201, 272, 142, + 244, 383, 143, 245, 384, 312, 481, 543, 335, 336, + 414, 533, 560, 594, 415, 534, 561, 596, 74, 227, + 314, 485, 491, 564, 549, 580, 625, 431, 539, 536, + 551, 567, 552, 568, 583, 627, 581, 626, 578, 603, + 579, 604, 624, 652, 622, 651, 584, 628, 595, 637, + 638, 659, 653, 664, 671, 59, 60, 96, 269, 236, + 351, 185, 263, 262, 352, 353, 446, 354, 447, 355, + 448, 356, 449, 357, 450, 444, 195, 97, 89, 231, + 319, 487, 545, 573, 318, 270, 237, 361, 362, 363, + 454, 364, 455, 513, 553, 514, 554, 61, 62, 63, + 64, 65, 211, 308, 477, 249, 209, 306, 476, }; short tao_yysindex[] = { 0, - 0, 828, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -133, -110, -45, -150, 0, -133, -133, 0, -188, - -188, 0, 0, 0, 0, 0, 0, 0, 168, 602, - -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 793, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -156, -133, -38, -136, 0, -156, -156, 0, -200, + -200, 0, 0, 0, 0, 0, 0, 0, 74, 625, + -97, 0, -108, 0, 0, -108, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 122, 237, -22, -156, 644, + -156, -156, -156, -156, 0, 0, 0, 74, -156, 0, + 74, -108, -156, -108, 0, -156, 0, 0, -156, 0, + -279, 0, -275, 114, 116, 126, 132, 0, 0, -92, + 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -61, 0, 0, -61, 193, 789, -3, -133, 621, - -133, -133, -133, -133, 0, 0, 0, 168, -133, 0, - 168, -61, -133, -61, 0, -133, 0, 0, -133, 0, - -260, 0, -98, 137, 171, 173, 200, 0, 0, 13, - 0, -190, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 96, 0, -53, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 74, -97, + 0, 160, 206, 0, 157, 0, 74, 0, 227, 231, + 243, 245, 251, 259, 261, 272, 275, 279, 283, 0, + 0, 0, -53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 51, 0, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 168, -26, - 0, 257, 281, 0, 220, 287, 311, 316, 317, 320, - 329, 340, 344, 352, 353, 354, 168, 264, 291, 0, - 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 289, 0, -156, 0, 0, 0, + 0, 0, 0, 0, 0, -200, 0, 0, 89, 0, + 303, 0, 0, 0, 0, 0, 335, 0, 254, 0, + 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -156, 288, -156, 306, 309, 0, 0, 0, + 377, 0, -156, 0, 0, 0, 0, -53, 0, 0, + 0, 60, 140, 60, 60, 0, 0, 0, 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 304, 0, 0, 0, 371, 0, -133, 0, 0, 0, - 0, 0, 0, 0, 0, -188, 0, 0, 174, 0, - 379, 0, 0, 0, 0, 0, 400, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 142, - 0, 0, -133, 321, -133, 325, 326, 0, 0, 0, - 392, 0, -133, 0, 0, 0, 0, 28, 0, 0, - 0, -18, 142, -18, -18, 0, 0, -188, 0, 516, - 489, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -188, 142, 0, 0, 0, 947, 881, 132, - 908, 408, 719, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 26, 26, 26, -18, 28, 0, 330, 362, - 421, -169, 160, 283, 0, 0, 0, 0, 0, 0, - 0, 808, 0, 0, 583, 0, 0, 0, 0, 0, - 0, 738, 175, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 403, 402, - 0, 422, 376, 211, 0, 947, 28, 0, -188, 142, - 347, 349, -188, -188, -105, -188, 159, 0, 350, 0, - 0, 0, 0, 0, 0, -133, -133, 0, 355, 0, - 0, 0, 0, 0, 0, 0, 0, 442, -18, -18, - -18, -18, -18, -18, -18, -18, -18, -18, 424, 426, - 427, 222, 0, 0, 28, 0, 0, 0, 0, 365, - 0, 0, 0, 0, 432, 0, 0, 0, 0, 0, - 28, 0, 0, 445, 452, 457, 458, 463, 464, 465, - 268, 583, 583, 0, 0, 828, 0, 0, 0, 0, - 0, 0, 0, 0, 401, 28, 0, 0, 0, -179, - -179, 0, 28, -133, -179, 0, -105, 468, 0, 469, - 472, 475, 476, 477, 0, 0, 0, 478, 480, -188, - 0, 362, 421, -169, 160, 160, 283, 283, 0, 0, - 0, 0, 0, 0, 500, 0, 0, 483, -133, 0, - 286, 765, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -18, 423, -133, -18, 376, 425, 501, 428, - 0, 227, 0, 0, 0, 0, -133, 0, 0, 0, - 0, 0, 0, 509, 509, 0, 0, 28, 0, 0, - 0, 0, 0, 509, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 429, 492, - 514, -133, 0, 462, 211, -188, 515, 271, 265, 265, - 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, - 0, 520, 0, 0, 0, 0, -39, 521, 42, 265, - 523, 252, 765, 0, 527, 533, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 534, 0, - 0, 0, -188, 0, 0, 0, 0, 518, -18, 522, - 621, -14, 454, -39, 765, 0, 537, 289, -133, 28, - -133, 271, -188, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 542, 546, - -133, 551, -133, 42, 575, 0, 0, 0, 0, 0, - 0, 0, 293, 0, 576, 588, 0, 0, 315, 0, + 0, -200, 140, 0, 0, 0, 893, 843, 31, 878, + 413, 676, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 75, 75, 75, 60, -53, 0, 359, 375, 446, + -33, 47, 329, 0, 0, 0, 0, -200, 0, 0, + 0, 778, 0, 0, 606, 0, 0, 0, 426, 0, + 447, 399, 235, 0, 893, -53, 0, -200, 140, 0, + 0, 0, 0, 0, 730, 0, 0, 0, 0, 0, + 368, 0, 0, 0, 0, 0, 0, 0, 0, 370, + 0, 0, 0, 438, -200, -200, -189, -200, 186, 0, + 385, 0, 0, 0, 0, 0, 0, -156, -156, 0, + 386, 0, 0, 0, 0, 0, 0, 0, 0, 471, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, + 452, 0, 456, 479, 284, 0, 0, -53, 0, 0, + 0, 0, 422, 0, 0, 0, 0, 843, 893, 0, + 793, 0, 0, 0, 0, 0, 0, 0, 0, 423, + -53, 0, 490, 268, 757, 0, 0, 0, 0, 0, + -53, 0, 495, 496, 499, 500, 503, 0, 504, 507, + 310, 606, 606, 0, 0, -182, -182, 0, -53, -156, + -182, 0, -189, 509, 0, 510, 511, 512, 514, 517, + 0, 0, 0, 518, 520, -200, 0, 375, 446, -33, + 47, 47, 329, 329, 0, 0, 0, 0, 0, 0, + 540, 0, 0, 521, -156, 457, 459, 60, 461, -156, + 60, 399, 465, 547, 470, 0, 281, 0, 0, 0, + 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -156, 0, 0, 0, 0, + 0, 0, 563, 563, 0, 0, -53, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 757, -156, 0, 563, 0, 0, 0, 0, + 481, 546, 513, 235, -200, 0, 0, 0, 567, 0, + 570, 323, 321, 321, 0, 0, 0, 0, -53, -156, + 312, 575, 0, 0, 0, 0, 581, 0, 0, 0, + 0, 85, 311, 0, 0, 0, 0, 582, 173, 321, + 757, 0, 594, 604, 0, 0, 0, 0, 0, 0, + 0, -200, 0, 321, 605, 330, -156, 0, 0, 0, + 0, 0, 607, 0, 0, 0, 0, 0, 608, 60, + 610, 644, 73, 541, 85, -53, 0, 0, 0, 0, + 0, 757, 0, 621, 378, -156, 323, -200, 0, 0, + 0, 0, 0, 0, 0, 0, -200, 632, 0, 0, + 0, 0, 0, 0, 633, 615, -156, 616, 635, 0, + -156, 173, 637, 0, 0, 0, 0, 0, -200, 0, + 0, 0, 638, 358, 0, 0, 641, 639, 0, 0, + 361, 0, }; short tao_yyrindex[] = { 0, - 0, 639, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 685, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 8, 38, + 627, 12, 2, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 23, -25, - 581, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, + 98, 61, 0, 2, 0, 0, 64, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -20, 0, 0, -20, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, - 64, 68, 0, -20, 0, 0, 85, -35, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -84, 0, + 0, 121, 185, 0, 0, 0, -84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -92, 0, - 0, 148, 178, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -92, 0, 0, 0, - 0, 0, 397, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -29, - 0, 0, 0, 0, -82, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, + 0, 0, 430, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, + 0, 0, 0, 0, -83, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 532, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -173, 0, 0, 0, 0, 0, 0, -4, 0, 0, - 0, 0, 532, 0, 0, 0, 0, 0, 0, 652, - 652, 0, 0, 0, 0, 0, 0, 0, 141, 0, - 0, 0, 0, 532, 0, 0, 0, 230, 380, -81, - 407, -2, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 38, 0, 471, 278, - 674, 383, 96, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -246, 0, 0, 0, 0, 0, 0, -13, 0, 0, + 0, 0, 566, 0, 0, 0, 0, 0, 566, 0, + 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, + 0, 0, 566, 0, 0, 0, 363, 390, 565, 431, + -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 40, 0, 271, 427, 556, + 722, 137, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 646, 0, 0, 0, 458, -82, 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 598, 0, 0, 0, 434, -65, 0, 0, 338, - 0, 0, 0, 0, 0, 0, -77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 620, 0, 0, 622, 0, 0, 0, 0, 0, - 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 405, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 541, 0, 0, 0, 0, - 0, 0, 0, 356, 0, -134, 0, 0, 0, 0, - 0, 0, 410, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 280, 720, 420, 135, 140, 71, 77, 0, 0, + 0, 0, 0, 0, 665, 0, 0, 666, 0, 0, + 0, 0, 0, 181, 0, 0, 0, 485, 539, 0, + 583, 0, 0, 0, 0, 0, 0, 0, 265, 0, + -63, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 455, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 516, 731, 729, + 147, 152, 104, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 194, 0, 556, 0, + 0, 45, 0, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 623, 623, - 0, 0, 2, 0, 0, 0, 0, 0, -71, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, - 624, 562, 0, 0, 647, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 688, 0, 564, 0, 0, 649, 634, 0, 571, + 0, 0, 654, 654, 0, 0, 0, 0, -81, 0, + -37, -39, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 591, 0, 0, 0, 0, 0, 0, -29, + 0, 0, 675, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 654, 0, 673, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 711, 0, 609, 612, 0, 0, 0, 0, + 0, 0, 0, 692, 677, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 668, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 698, 0, 0, + 0, 0, }; short tao_yygindex[] = { 0, - -22, 437, 0, 0, 0, -57, -23, -28, 0, -21, - 0, 0, 0, -55, -347, -17, 274, 0, 0, 0, - 0, 0, 0, -229, 0, 67, -470, -126, 0, 0, - 0, 0, 243, 0, 0, 0, 0, 702, 0, 0, - 0, -265, 0, 351, 357, 358, -38, -73, 32, 98, - 0, -199, 231, 125, 0, 0, -41, -32, -31, 654, - 656, 0, 0, 0, -284, -13, 0, 0, 0, -374, - -11, 0, 0, 250, 0, 346, 348, -19, -15, -12, - 12, 393, 0, 0, 14, 0, 15, 0, 16, 0, - 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -27, 468, 0, 0, 0, -62, -24, -18, 0, -16, + 0, 0, 0, -58, -379, -20, 298, 0, 0, 0, + 0, 0, 0, -285, 0, 111, -259, 0, 0, -169, + 0, 0, 0, 0, 269, 0, 183, 0, 0, 747, + 0, 0, 709, 0, -270, 0, 391, 394, 395, -52, + -4, 94, 196, 0, -207, 287, 158, 0, 0, -48, + -46, -40, 707, 708, 0, 0, 0, -308, -34, 0, + 0, 0, -435, -8, 0, 191, 0, 345, 379, -14, + -12, -10, 0, 0, 0, 0, 9, 466, 0, 0, + 21, 0, 23, 0, 24, 0, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -148, 0, + 0, 0, 0, 0, 0, 0, 0, 762, 0, 472, + 0, 0, 0, 0, 0, 0, 0, 0, 0, -198, + 0, -28, 0, 0, 0, 0, 0, 0, 0, 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -50, 0, 0, 0, 0, 0, 0, 0, - 0, 710, 0, 491, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -6, 0, -47, 0, 0, 0, 0, - 0, 0, 0, 460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 481, 396, + 0, 0, 0, 0, 532, 469, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 143, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, + 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -449, 0, 0, 0, 0, 136, - 0, 0, 0, 0, 0, 0, 0, 116, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -288, 0, + 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, + 0, 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 676, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -#define TAO_YYTABLESIZE 1265 -short tao_yytable[] = { 77, - 76, 123, 91, 93, 87, 88, 122, 116, 124, 161, - 140, 162, 127, 33, 141, 35, 36, 37, 306, 38, - 368, 286, 449, 444, 283, 165, 284, 402, 447, 445, - 46, 330, 66, 70, 166, 167, 102, 66, 99, 102, - 385, 123, 341, 378, 300, 301, 122, 173, 124, 163, - 140, 416, 127, 170, 141, 528, 172, 384, 175, 176, - 177, 178, 188, 362, 533, 286, 180, 189, 75, 556, - 183, 199, 200, 184, 148, 148, 186, 75, 148, 148, - 148, 109, 148, 208, 148, 137, 208, 449, 137, 581, - 137, 270, 137, 447, 202, 148, 148, 66, 110, 148, - 101, 208, 66, 101, 208, 137, 137, 285, 138, 137, - 518, 138, 203, 138, 139, 138, 299, 139, 102, 139, - 99, 139, 111, 75, 513, 66, 69, 420, 138, 138, - 148, 148, 138, 134, 139, 139, 134, 338, 139, 90, - 137, 137, 380, 375, 179, 46, 420, 182, 189, 6, - 205, 75, 16, 134, 134, 223, 83, 134, 174, 372, - 373, 148, 46, 138, 138, 205, 419, 432, 205, 139, - 139, 137, 135, 174, 232, 135, 174, 136, 238, 405, - 136, 201, 101, 268, 201, 419, 46, 402, 134, 134, - 66, 292, 135, 135, 138, 405, 135, 136, 136, 201, - 139, 136, 374, 311, 375, 204, 292, 380, 46, 292, - 252, 336, 259, 427, 6, 585, 567, 516, 385, 134, - 267, 297, 90, 220, 190, 98, 617, 135, 135, 189, - 238, 299, 136, 136, 301, 384, 297, 301, 75, 297, - 115, 416, 568, 569, 328, 337, 628, 612, 630, 144, - 405, 160, 301, 171, 397, 127, 399, 16, 135, 191, - 386, 79, 328, 136, 358, 449, 449, 568, 569, 387, - 388, 447, 447, 383, 197, 66, 123, 198, 402, 332, - 66, 122, 75, 124, 385, 140, 519, 127, 389, 141, - 343, 343, 343, 192, 401, 193, 102, 362, 99, 208, - 457, 458, 274, 275, 276, 277, 278, 279, 280, 90, - 402, 157, 281, 282, 157, 102, 205, 99, 128, 378, - 129, 426, 194, 605, 376, 430, 431, 433, 435, 377, - 575, 576, 577, 455, 456, 128, 128, 129, 129, 128, - 206, 129, 208, 445, 446, 209, 274, 275, 276, 277, - 278, 279, 280, 90, 37, 189, 281, 282, 78, 81, - 101, 82, 84, 205, 481, 482, 148, 148, 66, 210, - 128, 174, 129, 619, 211, 212, 137, 137, 213, 101, - 365, 366, 367, 123, 123, 380, 221, 214, 122, 122, - 124, 124, 140, 140, 127, 127, 141, 141, 215, 138, - 138, 128, 216, 129, 292, 139, 139, 459, 460, 461, - 217, 218, 219, 222, 397, 308, 399, 493, 494, 433, - 132, 495, 496, 132, 134, 134, 228, 33, 229, 35, - 36, 37, 508, 38, 297, 240, 343, 344, 241, 246, - 132, 132, 248, 253, 132, 345, 346, 260, 261, 265, - 347, 363, 227, 369, 401, 370, 259, 133, 371, 403, - 133, 414, 415, 135, 135, 417, 418, 421, 136, 136, - 436, 428, 259, 429, 439, 132, 132, 133, 133, 447, - 315, 133, 451, 197, 525, 462, 324, 463, 464, 466, - 470, 324, 324, 324, 324, 324, 324, 324, 324, 324, - 324, 324, 324, 473, 55, 397, 132, 399, 324, 324, - 474, 127, 133, 133, 311, 475, 476, 324, 549, 77, - 546, 477, 478, 479, 480, 491, 498, 499, 127, 127, - 500, 424, 127, 501, 502, 503, 506, 397, 507, 399, - 509, 510, 512, 133, 522, 401, 524, 517, 526, 521, - 542, 541, 523, 543, 547, 550, 554, 324, 59, 551, - 564, 574, 123, 127, 583, 600, 582, 122, 607, 124, - 586, 140, 587, 127, 596, 141, 604, 401, 610, 606, - 613, 614, 626, 230, 230, 238, 77, 616, 259, 230, +#define TAO_YYTABLESIZE 1211 +short tao_yytable[] = { 91, + 93, 77, 116, 76, 161, 122, 87, 88, 162, 127, + 37, 123, 382, 124, 370, 140, 422, 141, 165, 197, + 166, 373, 39, 337, 40, 41, 167, 102, 42, 369, + 102, 101, 170, 99, 101, 490, 300, 301, 46, 400, + 399, 431, 173, 188, 526, 122, 163, 190, 189, 127, + 348, 123, 189, 124, 435, 140, 75, 141, 172, 66, + 175, 176, 177, 178, 467, 459, 109, 75, 180, 343, + 270, 360, 183, 435, 75, 184, 148, 148, 186, 307, + 148, 148, 148, 438, 148, 301, 148, 137, 301, 376, + 137, 377, 137, 317, 137, 66, 70, 148, 148, 285, + 75, 148, 282, 301, 283, 205, 422, 137, 137, 102, + 174, 137, 315, 101, 285, 99, 465, 460, 66, 69, + 205, 395, 390, 205, 66, 174, 6, 90, 174, 467, + 46, 98, 148, 148, 223, 420, 110, 208, 90, 202, + 208, 138, 137, 137, 138, 189, 138, 139, 138, 412, + 139, 420, 139, 546, 139, 208, 111, 203, 208, 399, + 66, 138, 138, 148, 292, 138, 16, 139, 139, 197, + 83, 139, 198, 137, 134, 238, 232, 134, 144, 292, + 160, 465, 292, 66, 135, 284, 395, 135, 179, 136, + 643, 182, 136, 115, 134, 134, 138, 138, 134, 343, + 46, 606, 139, 139, 135, 135, 420, 524, 135, 136, + 136, 656, 251, 136, 258, 660, 46, 400, 399, 205, + 46, 6, 266, 147, 422, 540, 147, 138, 297, 134, + 134, 431, 201, 139, 171, 201, 191, 434, 192, 135, + 135, 316, 639, 297, 136, 136, 297, 550, 193, 204, + 201, 127, 197, 389, 194, 390, 434, 210, 199, 200, + 134, 391, 417, 369, 16, 206, 419, 392, 79, 197, + 135, 339, 422, 527, 189, 136, 197, 238, 373, 208, + 122, 388, 299, 386, 127, 212, 123, 102, 124, 213, + 140, 101, 141, 99, 571, 374, 375, 411, 350, 350, + 350, 214, 66, 215, 421, 227, 102, 467, 467, 216, + 101, 127, 99, 422, 321, 322, 75, 217, 205, 218, + 605, 461, 462, 174, 436, 437, 439, 441, 127, 127, + 219, 75, 127, 220, 617, 345, 346, 221, 66, 630, + 585, 222, 645, 228, 347, 348, 229, 451, 452, 349, + 240, 649, 417, 208, 586, 587, 419, 78, 81, 465, + 465, 66, 241, 127, 395, 380, 586, 587, 148, 148, + 378, 463, 464, 663, 246, 379, 248, 292, 137, 137, + 273, 274, 275, 276, 277, 278, 279, 90, 250, 322, + 280, 281, 82, 84, 421, 273, 274, 275, 276, 277, + 278, 279, 90, 500, 501, 280, 281, 122, 122, 37, + 252, 127, 127, 123, 123, 124, 124, 140, 140, 141, + 141, 39, 439, 40, 41, 502, 503, 42, 259, 504, + 505, 260, 138, 138, 264, 517, 230, 230, 139, 139, + 298, 297, 230, 230, 230, 230, 230, 230, 230, 230, + 230, 230, 230, 230, 230, 230, 365, 230, 230, 230, + 230, 599, 600, 601, 258, 134, 134, 128, 372, 258, + 417, 465, 466, 467, 419, 135, 135, 367, 368, 369, + 136, 136, 371, 373, 128, 128, 400, 37, 128, 403, + 402, 406, 428, 75, 434, 537, 435, 442, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 230, 445, + 453, 457, 421, 468, 55, 113, 114, 469, 417, 128, + 230, 230, 419, 77, 559, 548, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, - 230, 230, 230, 627, 230, 230, 230, 230, 259, 629, - 259, 230, 230, 325, 632, 634, 637, 230, 230, 230, - 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, - 230, 638, 230, 230, 230, 230, 324, 640, 1, 271, - 311, 324, 324, 324, 324, 324, 324, 324, 324, 324, - 324, 324, 324, 125, 68, 230, 191, 68, 324, 324, - 205, 355, 251, 324, 311, 31, 401, 324, 324, 324, - 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, - 277, 362, 197, 230, 422, 324, 324, 334, 252, 345, - 324, 311, 366, 421, 324, 324, 324, 324, 324, 324, - 324, 324, 324, 324, 324, 324, 324, 324, 367, 364, - 497, 511, 324, 324, 130, 80, 609, 520, 311, 452, - 168, 324, 169, 416, 85, 269, 453, 304, 454, 348, - 424, 130, 130, 548, 324, 130, 611, 618, 0, 631, - 159, 0, 0, 0, 307, 0, 4, 0, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 131, 324, 8, 9, 0, 10, 130, 130, 0, 11, - 0, 307, 308, 4, 309, 310, 7, 131, 131, 0, - 0, 131, 12, 0, 0, 0, 322, 323, 324, 8, - 9, 0, 10, 0, 0, 0, 11, 130, 0, 308, - 0, 309, 310, 0, 0, 20, 21, 0, 0, 12, - 0, 0, 131, 131, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 20, 21, 0, 0, 0, 0, 392, 75, - 0, 0, 0, 131, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 8, 9, 75, 10, - 112, 113, 114, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 8, 9, 75, 10, 112, - 113, 114, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 8, 9, 0, 10, 112, 113, - 114, 0, 0, 115, 0, 0, 0, 0, 324, 0, - 90, 0, 0, 324, 324, 324, 324, 324, 324, 324, - 324, 324, 324, 324, 324, 0, 0, 0, 0, 90, - 324, 324, 0, 0, 0, 0, 311, 0, 0, 324, - 0, 0, 0, 0, 260, 0, 0, 0, 90, 260, - 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, - 260, 260, 260, 0, 260, 260, 260, 260, 0, 0, - 0, 0, 0, 0, 0, 75, 0, 0, 0, 324, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 0, 0, 75, 0, 112, 113, 114, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 0, 0, 0, 0, 260, 113, 114, 0, 0, - 0, 75, 0, 0, 0, 396, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 0, 0, - 0, 0, 0, 113, 114, 75, 90, 0, 0, 0, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 0, 0, 0, 0, 75, 90, 0, 113, 114, 382, - 101, 102, 0, 0, 105, 106, 107, 108, 0, 0, - 0, 0, 0, 3, 10, 4, 5, 6, 7, 0, - 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, - 0, 8, 9, 0, 10, 0, 0, 0, 11, 0, - 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, - 0, 12, 13, 14, 15, 0, 0, 0, 0, 0, - 16, 17, 0, 0, 18, 90, 307, 19, 4, 0, - 0, 7, 0, 0, 20, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 8, 9, 0, 10, 0, 0, - 0, 11, 0, 307, 308, 4, 309, 310, 7, 0, - 0, 0, 0, 0, 12, 0, 0, 0, 322, 323, - 324, 8, 9, 0, 10, 0, 0, 0, 11, 0, - 0, 308, 0, 309, 310, 0, 0, 20, 21, 0, - 0, 12, 307, 0, 4, 356, 0, 7, 0, 0, - 0, 0, 0, 0, 0, 357, 0, 0, 0, 0, - 8, 9, 0, 10, 20, 21, 0, 11, 0, 0, - 308, 0, 309, 310, 0, 0, 0, 0, 0, 0, - 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 470, 230, 230, 230, 230, 197, 472, 486, 488, 77, + 128, 548, 489, 492, 493, 439, 129, 494, 495, 417, + 421, 496, 497, 419, 90, 498, 499, 507, 508, 509, + 510, 616, 511, 129, 129, 512, 515, 129, 516, 519, + 518, 521, 59, 522, 632, 525, 77, 122, 621, 529, + 530, 127, 230, 123, 531, 124, 130, 140, 535, 141, + 532, 421, 538, 555, 556, 557, 563, 238, 129, 472, + 565, 566, 569, 130, 130, 258, 238, 130, 577, 331, + 575, 582, 598, 592, 331, 331, 331, 331, 331, 331, + 331, 331, 331, 331, 331, 331, 258, 607, 238, 129, + 258, 331, 331, 608, 618, 619, 331, 623, 130, 130, + 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, + 331, 331, 331, 463, 640, 635, 629, 631, 331, 331, + 641, 650, 655, 654, 657, 658, 662, 331, 665, 130, + 666, 669, 670, 672, 1, 271, 125, 331, 68, 393, + 331, 68, 331, 331, 331, 331, 331, 331, 331, 331, + 331, 331, 331, 331, 191, 205, 251, 31, 277, 331, + 331, 362, 369, 437, 331, 341, 416, 331, 331, 331, + 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, + 331, 377, 352, 252, 436, 381, 331, 331, 382, 366, + 506, 331, 574, 520, 148, 331, 331, 331, 331, 331, + 331, 331, 331, 331, 331, 331, 331, 331, 331, 132, + 80, 458, 132, 331, 331, 459, 133, 460, 528, 133, + 634, 131, 331, 168, 169, 401, 85, 398, 304, 132, + 132, 636, 409, 132, 558, 331, 133, 133, 131, 131, + 133, 350, 131, 661, 644, 331, 0, 0, 0, 0, + 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, + 331, 331, 331, 0, 132, 132, 0, 331, 331, 0, + 0, 133, 133, 131, 131, 0, 331, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 20, 21, + 0, 0, 0, 0, 0, 132, 0, 0, 0, 0, + 0, 0, 133, 0, 131, 0, 0, 0, 0, 0, + 0, 395, 75, 0, 0, 0, 331, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 8, + 9, 75, 10, 112, 113, 114, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 8, 9, + 75, 10, 112, 113, 114, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 8, 9, 0, + 10, 112, 113, 114, 0, 0, 115, 0, 0, 0, + 0, 0, 75, 90, 0, 0, 0, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 0, + 0, 0, 90, 112, 113, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 260, 0, 0, + 0, 90, 260, 260, 260, 260, 260, 260, 260, 260, + 260, 260, 260, 260, 260, 260, 75, 260, 260, 260, + 260, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 90, 0, 0, 0, 0, 113, 114, + 0, 0, 0, 75, 0, 0, 0, 416, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 0, 0, 0, 0, 75, 113, 114, 0, 260, 385, + 101, 102, 0, 0, 105, 106, 107, 108, 3, 0, + 4, 5, 6, 7, 10, 0, 0, 90, 0, 0, + 0, 0, 0, 0, 0, 0, 8, 9, 0, 10, + 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 90, 0, 12, 13, 14, 15, + 0, 0, 0, 0, 0, 16, 17, 0, 320, 18, + 4, 0, 19, 7, 0, 90, 0, 0, 0, 20, + 21, 0, 0, 0, 0, 0, 8, 9, 0, 10, + 0, 0, 0, 11, 0, 0, 321, 322, 323, 324, + 0, 0, 0, 320, 0, 4, 12, 0, 7, 0, + 337, 338, 339, 0, 0, 0, 0, 0, 320, 0, + 4, 8, 9, 7, 10, 0, 0, 0, 11, 20, + 21, 321, 322, 323, 324, 0, 8, 9, 0, 10, + 0, 12, 0, 11, 0, 358, 321, 322, 323, 324, + 0, 0, 0, 0, 0, 359, 12, 0, 0, 0, + 0, 0, 0, 0, 20, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, + 21, }; -short tao_yycheck[] = { 12, - 12, 30, 20, 21, 17, 18, 30, 30, 30, 67, - 30, 67, 30, 2, 30, 2, 2, 2, 248, 2, - 286, 40, 58, 59, 43, 67, 45, 312, 58, 59, - 123, 41, 58, 59, 67, 67, 41, 58, 41, 44, - 123, 70, 41, 125, 244, 245, 70, 70, 70, 67, - 70, 123, 70, 67, 70, 505, 69, 123, 71, 72, - 73, 74, 323, 59, 514, 40, 79, 328, 257, 540, - 83, 262, 263, 86, 37, 38, 89, 257, 41, 42, - 43, 59, 45, 41, 47, 38, 44, 123, 41, 560, - 43, 59, 45, 123, 44, 58, 59, 123, 59, 62, - 41, 59, 123, 44, 62, 58, 59, 126, 38, 62, - 485, 41, 62, 43, 38, 45, 243, 41, 123, 43, - 123, 45, 59, 257, 472, 58, 59, 301, 58, 59, - 93, 94, 62, 38, 58, 59, 41, 264, 62, 328, - 93, 94, 58, 59, 78, 123, 320, 81, 328, 260, - 44, 257, 303, 58, 59, 123, 307, 62, 44, 329, - 330, 124, 123, 93, 94, 59, 301, 273, 62, 93, - 94, 124, 38, 59, 187, 41, 62, 38, 196, 257, - 41, 41, 123, 234, 44, 320, 123, 472, 93, 94, - 123, 44, 58, 59, 124, 273, 62, 58, 59, 59, - 124, 62, 43, 285, 45, 139, 59, 123, 301, 62, - 223, 262, 225, 340, 260, 563, 256, 483, 301, 124, - 233, 44, 328, 157, 323, 58, 601, 93, 94, 328, - 248, 91, 93, 94, 41, 301, 59, 44, 257, 62, - 302, 313, 282, 283, 251, 263, 621, 595, 623, 276, - 328, 59, 59, 257, 312, 273, 312, 303, 124, 123, - 302, 307, 269, 124, 271, 301, 302, 282, 283, 302, - 302, 301, 302, 302, 262, 301, 305, 265, 563, 289, - 301, 305, 257, 305, 302, 305, 486, 305, 302, 305, - 289, 290, 291, 123, 312, 123, 301, 293, 301, 257, - 374, 375, 321, 322, 323, 324, 325, 326, 327, 328, - 595, 62, 331, 332, 65, 320, 60, 320, 41, 37, - 41, 339, 123, 589, 42, 343, 344, 345, 346, 47, - 289, 290, 291, 372, 373, 58, 59, 58, 59, 62, - 60, 62, 123, 356, 357, 59, 321, 322, 323, 324, - 325, 326, 327, 328, 125, 328, 331, 332, 13, 14, - 301, 14, 15, 257, 412, 413, 329, 330, 301, 59, - 93, 257, 93, 603, 59, 59, 329, 330, 59, 320, - 283, 284, 285, 412, 413, 301, 123, 59, 412, 413, - 412, 413, 412, 413, 412, 413, 412, 413, 59, 329, - 330, 124, 59, 124, 257, 329, 330, 376, 377, 378, - 59, 59, 59, 123, 472, 284, 472, 430, 431, 437, - 38, 434, 435, 41, 329, 330, 123, 416, 58, 416, - 416, 416, 450, 416, 257, 262, 305, 306, 60, 40, - 58, 59, 301, 123, 62, 314, 315, 123, 123, 58, - 319, 44, 125, 124, 472, 94, 469, 38, 38, 285, - 41, 59, 61, 329, 330, 44, 91, 257, 329, 330, - 312, 125, 485, 125, 125, 93, 94, 58, 59, 125, - 125, 62, 41, 262, 497, 62, 257, 62, 62, 125, - 59, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 59, 125, 563, 124, 563, 279, 280, - 59, 41, 93, 94, 285, 59, 59, 288, 536, 532, - 532, 59, 59, 59, 257, 125, 59, 59, 58, 59, - 59, 125, 62, 59, 59, 59, 59, 595, 59, 595, - 41, 59, 257, 124, 44, 563, 320, 125, 40, 125, - 59, 123, 125, 40, 93, 41, 292, 328, 125, 289, - 41, 41, 591, 93, 313, 583, 44, 591, 591, 591, - 44, 591, 40, 591, 41, 591, 59, 595, 125, 58, - 44, 293, 41, 256, 257, 603, 599, 599, 601, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 58, 277, 278, 279, 280, 621, 59, - 623, 256, 257, 125, 40, 323, 41, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 44, 277, 278, 279, 280, 257, 323, 0, 59, - 125, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 257, 123, 328, 59, 320, 279, 280, - 41, 257, 41, 257, 285, 125, 257, 288, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 125, 59, 59, 328, 123, 279, 280, 41, 125, 41, - 257, 285, 59, 123, 288, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 328, 41, 273, - 437, 469, 279, 280, 41, 14, 592, 487, 285, 369, - 67, 288, 67, 331, 15, 235, 370, 247, 371, 270, - 335, 58, 59, 535, 328, 62, 594, 602, -1, 624, - 65, -1, -1, -1, 256, -1, 258, -1, -1, 261, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 41, 328, 274, 275, -1, 277, 93, 94, -1, 281, - -1, 256, 284, 258, 286, 287, 261, 58, 59, -1, - -1, 62, 294, -1, -1, -1, 298, 299, 300, 274, - 275, -1, 277, -1, -1, -1, 281, 124, -1, 284, - -1, 286, 287, -1, -1, 317, 318, -1, -1, 294, - -1, -1, 93, 94, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 317, 318, -1, -1, -1, -1, 256, 257, - -1, -1, -1, 124, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 257, 277, - 278, 279, 280, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 257, 277, 278, - 279, 280, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, -1, 277, 278, 279, - 280, -1, -1, 302, -1, -1, -1, -1, 257, -1, - 328, -1, -1, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, -1, -1, -1, -1, 328, - 279, 280, -1, -1, -1, -1, 285, -1, -1, 288, - -1, -1, -1, -1, 257, -1, -1, -1, 328, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, -1, 277, 278, 279, 280, -1, -1, - -1, -1, -1, -1, -1, 257, -1, -1, -1, 328, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, -1, -1, 257, -1, 278, 279, 280, 262, +short tao_yycheck[] = { 20, + 21, 12, 30, 12, 67, 30, 17, 18, 67, 30, + 2, 30, 298, 30, 285, 30, 325, 30, 67, 59, + 67, 59, 2, 41, 2, 2, 67, 41, 2, 59, + 44, 41, 67, 41, 44, 415, 244, 245, 123, 123, + 123, 123, 70, 323, 480, 70, 67, 323, 328, 70, + 41, 70, 328, 70, 301, 70, 257, 70, 69, 58, + 71, 72, 73, 74, 58, 59, 59, 257, 79, 268, + 59, 270, 83, 320, 257, 86, 37, 38, 89, 249, + 41, 42, 43, 273, 45, 41, 47, 38, 44, 43, + 41, 45, 43, 263, 45, 58, 59, 58, 59, 40, + 257, 62, 43, 59, 45, 44, 415, 58, 59, 123, + 44, 62, 261, 123, 40, 123, 58, 59, 58, 59, + 59, 58, 59, 62, 123, 59, 260, 328, 62, 123, + 123, 58, 93, 94, 123, 257, 59, 41, 328, 44, + 44, 38, 93, 94, 41, 328, 43, 38, 45, 319, + 41, 273, 43, 533, 45, 59, 59, 62, 62, 308, + 123, 58, 59, 124, 44, 62, 303, 58, 59, 262, + 307, 62, 265, 124, 38, 196, 187, 41, 276, 59, + 59, 123, 62, 123, 38, 126, 123, 41, 78, 38, + 626, 81, 41, 302, 58, 59, 93, 94, 62, 398, + 123, 581, 93, 94, 58, 59, 328, 478, 62, 58, + 59, 647, 223, 62, 225, 651, 301, 301, 301, 60, + 123, 260, 233, 33, 533, 514, 36, 124, 44, 93, + 94, 313, 41, 124, 257, 44, 123, 301, 123, 93, + 94, 262, 622, 59, 93, 94, 62, 536, 123, 139, + 59, 272, 292, 302, 123, 302, 320, 147, 262, 263, + 124, 302, 325, 293, 303, 60, 325, 302, 307, 309, + 124, 289, 581, 481, 328, 124, 316, 298, 316, 123, + 305, 302, 91, 302, 305, 59, 305, 301, 305, 59, + 305, 301, 305, 301, 554, 329, 330, 318, 289, 290, + 291, 59, 301, 59, 325, 125, 320, 301, 302, 59, + 320, 41, 320, 622, 284, 285, 257, 59, 257, 59, + 580, 374, 375, 257, 345, 346, 347, 348, 58, 59, + 59, 257, 62, 59, 594, 305, 306, 59, 301, 610, + 256, 59, 628, 123, 314, 315, 58, 358, 359, 319, + 262, 637, 415, 257, 282, 283, 415, 13, 14, 301, + 302, 301, 60, 93, 301, 37, 282, 283, 329, 330, + 42, 376, 377, 659, 40, 47, 123, 257, 329, 330, + 321, 322, 323, 324, 325, 326, 327, 328, 123, 125, + 331, 332, 14, 15, 415, 321, 322, 323, 324, 325, + 326, 327, 328, 432, 433, 331, 332, 432, 433, 401, + 123, 432, 433, 432, 433, 432, 433, 432, 433, 432, + 433, 401, 443, 401, 401, 436, 437, 401, 123, 440, + 441, 123, 329, 330, 58, 456, 256, 257, 329, 330, + 301, 257, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 44, 277, 278, 279, + 280, 289, 290, 291, 475, 329, 330, 41, 94, 480, + 533, 378, 379, 380, 533, 329, 330, 282, 283, 284, + 329, 330, 124, 38, 58, 59, 61, 125, 62, 91, + 44, 257, 125, 257, 125, 506, 59, 312, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 328, 125, + 125, 41, 533, 62, 125, 279, 280, 62, 581, 93, + 256, 257, 581, 534, 545, 534, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 62, 277, 278, 279, 280, 262, 125, 125, 59, 560, + 124, 560, 285, 59, 59, 125, 41, 59, 59, 622, + 581, 59, 59, 622, 328, 59, 257, 59, 59, 59, + 59, 592, 59, 58, 59, 59, 59, 62, 59, 59, + 41, 125, 125, 125, 612, 125, 597, 612, 597, 125, + 44, 612, 328, 612, 125, 612, 41, 612, 257, 612, + 320, 622, 40, 123, 59, 93, 40, 628, 93, 125, + 41, 289, 292, 58, 59, 626, 637, 62, 44, 257, + 309, 41, 41, 313, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 647, 44, 659, 124, + 651, 279, 280, 40, 40, 316, 257, 41, 93, 94, + 288, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 125, 44, 125, 59, 58, 279, 280, + 293, 40, 58, 41, 59, 41, 40, 288, 41, 124, + 323, 41, 44, 323, 0, 59, 257, 257, 123, 125, + 328, 320, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 59, 41, 41, 125, 125, 279, + 280, 257, 59, 123, 257, 41, 257, 328, 288, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, -1, -1, -1, -1, 328, 279, 280, -1, -1, - -1, 257, -1, -1, -1, 288, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, -1, -1, - -1, -1, -1, 279, 280, 257, 328, -1, -1, -1, + 273, 59, 41, 125, 123, 59, 279, 280, 41, 272, + 443, 257, 560, 475, 36, 288, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 328, 38, + 14, 371, 41, 279, 280, 372, 38, 373, 482, 41, + 613, 41, 288, 67, 67, 310, 15, 306, 247, 58, + 59, 615, 314, 62, 544, 328, 58, 59, 58, 59, + 62, 269, 62, 652, 627, 257, -1, -1, -1, -1, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - -1, -1, -1, -1, 257, 328, -1, 279, 280, 262, - 263, 264, -1, -1, 267, 268, 269, 270, -1, -1, - -1, -1, -1, 256, 277, 258, 259, 260, 261, -1, - -1, -1, 328, -1, -1, -1, -1, -1, -1, -1, - -1, 274, 275, -1, 277, -1, -1, -1, 281, -1, - -1, -1, -1, -1, -1, -1, 328, -1, -1, -1, - -1, 294, 295, 296, 297, -1, -1, -1, -1, -1, - 303, 304, -1, -1, 307, 328, 256, 310, 258, -1, - -1, 261, -1, -1, 317, 318, -1, -1, -1, -1, - -1, -1, -1, -1, 274, 275, -1, 277, -1, -1, - -1, 281, -1, 256, 284, 258, 286, 287, 261, -1, - -1, -1, -1, -1, 294, -1, -1, -1, 298, 299, - 300, 274, 275, -1, 277, -1, -1, -1, 281, -1, - -1, 284, -1, 286, 287, -1, -1, 317, 318, -1, - -1, 294, 256, -1, 258, 298, -1, 261, -1, -1, - -1, -1, -1, -1, -1, 308, -1, -1, -1, -1, - 274, 275, -1, 277, 317, 318, -1, 281, -1, -1, - 284, -1, 286, 287, -1, -1, -1, -1, -1, -1, - 294, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 272, 273, 328, -1, 93, 94, -1, 279, 280, -1, + -1, 93, 94, 93, 94, -1, 288, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 317, 318, + -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, + -1, -1, 124, -1, 124, -1, -1, -1, -1, -1, + -1, 256, 257, -1, -1, -1, 328, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 257, 277, 278, 279, 280, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 257, 277, 278, 279, 280, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, -1, + 277, 278, 279, 280, -1, -1, 302, -1, -1, -1, + -1, -1, 257, 328, -1, -1, -1, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, -1, + -1, -1, 328, 278, 279, 280, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, + -1, 328, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 257, 277, 278, 279, + 280, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 328, -1, -1, -1, -1, 279, 280, + -1, -1, -1, 257, -1, -1, -1, 288, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + -1, -1, -1, -1, 257, 279, 280, -1, 328, 262, + 263, 264, -1, -1, 267, 268, 269, 270, 256, -1, + 258, 259, 260, 261, 277, -1, -1, 328, -1, -1, + -1, -1, -1, -1, -1, -1, 274, 275, -1, 277, + -1, -1, -1, 281, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 328, -1, 294, 295, 296, 297, + -1, -1, -1, -1, -1, 303, 304, -1, 256, 307, + 258, -1, 310, 261, -1, 328, -1, -1, -1, 317, + 318, -1, -1, -1, -1, -1, 274, 275, -1, 277, + -1, -1, -1, 281, -1, -1, 284, 285, 286, 287, + -1, -1, -1, 256, -1, 258, 294, -1, 261, -1, + 298, 299, 300, -1, -1, -1, -1, -1, 256, -1, + 258, 274, 275, 261, 277, -1, -1, -1, 281, 317, + 318, 284, 285, 286, 287, -1, 274, 275, -1, 277, + -1, 294, -1, 281, -1, 298, 284, 285, 286, 287, + -1, -1, -1, -1, -1, 308, 294, -1, -1, -1, + -1, -1, -1, -1, 317, 318, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 317, + 318, }; #define TAO_YYFINAL 1 #ifndef TAO_YYDEBUG @@ -1118,51 +1132,58 @@ const char *tao_yyrule[] = { "$$87 :", "$$88 :", "array_dim : '[' $$87 positive_int_expr $$88 ']'", +"attribute : attribute_readonly", +"attribute : attribute_readwrite", "$$89 :", "$$90 :", -"attribute : opt_readonly IDL_ATTRIBUTE $$89 param_type_spec $$90 at_least_one_simple_declarator", -"opt_readonly : IDL_READONLY", -"opt_readonly :", "$$91 :", "$$92 :", +"attribute_readonly : IDL_READONLY $$89 IDL_ATTRIBUTE $$90 param_type_spec $$91 at_least_one_simple_declarator $$92 opt_raises", "$$93 :", "$$94 :", -"exception : IDL_EXCEPTION $$91 id $$92 '{' $$93 members $$94 '}'", "$$95 :", "$$96 :", +"attribute_readwrite : IDL_ATTRIBUTE $$93 param_type_spec $$94 at_least_one_simple_declarator $$95 opt_getraises $$96 opt_setraises", "$$97 :", "$$98 :", -"operation : opt_op_attribute op_type_spec $$95 IDENTIFIER $$96 parameter_list $$97 opt_raises $$98 opt_context", -"opt_op_attribute : IDL_ONEWAY", -"opt_op_attribute : IDL_IDEMPOTENT", -"opt_op_attribute :", -"op_type_spec : param_type_spec", -"op_type_spec : IDL_VOID", "$$99 :", "$$100 :", -"init_decl : IDL_FACTORY $$99 IDENTIFIER $$100 init_parameter_list", +"exception : IDL_EXCEPTION $$97 id $$98 '{' $$99 members $$100 '}'", "$$101 :", -"init_parameter_list : '(' $$101 ')'", "$$102 :", -"init_parameter_list : '(' $$102 at_least_one_in_parameter ')'", -"at_least_one_in_parameter : in_parameter in_parameters", "$$103 :", -"in_parameters : in_parameters ',' $$103 in_parameter", -"in_parameters :", "$$104 :", +"operation : opt_op_attribute op_type_spec $$101 IDENTIFIER $$102 parameter_list $$103 opt_raises $$104 opt_context", +"opt_op_attribute : IDL_ONEWAY", +"opt_op_attribute : IDL_IDEMPOTENT", +"opt_op_attribute :", +"op_type_spec : param_type_spec", +"op_type_spec : IDL_VOID", "$$105 :", -"in_parameter : IDL_IN $$104 param_type_spec $$105 declarator", "$$106 :", -"parameter_list : '(' $$106 ')'", +"init_decl : IDL_FACTORY $$105 IDENTIFIER $$106 init_parameter_list", "$$107 :", -"parameter_list : '(' $$107 at_least_one_parameter ')'", -"at_least_one_parameter : parameter parameters", +"init_parameter_list : '(' $$107 ')'", "$$108 :", -"parameters : parameters ',' $$108 parameter", -"parameters :", +"init_parameter_list : '(' $$108 at_least_one_in_parameter ')'", +"at_least_one_in_parameter : in_parameter in_parameters", "$$109 :", +"in_parameters : in_parameters ',' $$109 in_parameter", +"in_parameters :", "$$110 :", -"parameter : direction $$109 param_type_spec $$110 declarator", +"$$111 :", +"in_parameter : IDL_IN $$110 param_type_spec $$111 declarator", +"$$112 :", +"parameter_list : '(' $$112 ')'", +"$$113 :", +"parameter_list : '(' $$113 at_least_one_parameter ')'", +"at_least_one_parameter : parameter parameters", +"$$114 :", +"parameters : parameters ',' $$114 parameter", +"parameters :", +"$$115 :", +"$$116 :", +"parameter : direction $$115 param_type_spec $$116 declarator", "param_type_spec : base_type_spec", "param_type_spec : string_type_spec", "param_type_spec : wstring_type_spec", @@ -1170,86 +1191,94 @@ const char *tao_yyrule[] = { "direction : IDL_IN", "direction : IDL_OUT", "direction : IDL_INOUT", -"$$111 :", -"$$112 :", -"opt_raises : IDL_RAISES $$111 '(' $$112 at_least_one_scoped_name ')'", -"opt_raises :", -"$$113 :", -"$$114 :", -"opt_context : IDL_CONTEXT $$113 '(' $$114 at_least_one_string_literal ')'", -"opt_context :", -"at_least_one_string_literal : IDL_STRING_LITERAL string_literals", -"$$115 :", -"string_literals : string_literals ',' $$115 IDL_STRING_LITERAL", -"string_literals :", -"typeid_dcl : IDL_TYPEID scoped_name IDL_STRING_LITERAL", -"typeprefix_dcl : IDL_TYPEPREFIX scoped_name IDL_STRING_LITERAL", -"component : component_decl", -"component : component_forward_decl", -"component_forward_decl : IDL_COMPONENT id", -"$$116 :", "$$117 :", "$$118 :", -"component_decl : component_header $$116 '{' $$117 component_exports $$118 '}'", +"opt_raises : IDL_RAISES $$117 '(' $$118 at_least_one_scoped_name ')'", +"opt_raises :", "$$119 :", "$$120 :", -"component_header : IDL_COMPONENT id $$119 component_inheritance_spec $$120 supports_spec", +"opt_getraises : IDL_GETRAISES $$119 '(' $$120 at_least_one_scoped_name ')'", +"opt_getraises :", "$$121 :", -"component_inheritance_spec : ':' $$121 scoped_name", -"component_inheritance_spec :", -"component_exports : component_exports component_export", -"component_exports :", "$$122 :", -"component_export : provides_decl $$122 ';'", +"opt_setraises : IDL_SETRAISES $$121 '(' $$122 at_least_one_scoped_name ')'", +"opt_setraises :", "$$123 :", -"component_export : uses_decl $$123 ';'", "$$124 :", -"component_export : emits_decl $$124 ';'", +"opt_context : IDL_CONTEXT $$123 '(' $$124 at_least_one_string_literal ')'", +"opt_context :", +"at_least_one_string_literal : IDL_STRING_LITERAL string_literals", "$$125 :", -"component_export : publishes_decl $$125 ';'", +"string_literals : string_literals ',' $$125 IDL_STRING_LITERAL", +"string_literals :", +"typeid_dcl : IDL_TYPEID scoped_name IDL_STRING_LITERAL", +"typeprefix_dcl : IDL_TYPEPREFIX scoped_name IDL_STRING_LITERAL", +"component : component_decl", +"component : component_forward_decl", +"component_forward_decl : IDL_COMPONENT id", "$$126 :", -"component_export : consumes_decl $$126 ';'", "$$127 :", -"component_export : attribute $$127 ';'", -"provides_decl : IDL_PROVIDES interface_type id", -"interface_type : scoped_name", -"interface_type : IDL_OBJECT", -"uses_decl : IDL_USES opt_multiple interface_type id", -"opt_multiple : IDL_MULTIPLE", -"opt_multiple :", -"emits_decl : IDL_EMITS scoped_name id", -"publishes_decl : IDL_PUBLISHES scoped_name id", -"consumes_decl : IDL_CONSUMES scoped_name id", "$$128 :", -"home_decl : home_header $$128 home_body", +"component_decl : component_header $$126 '{' $$127 component_exports $$128 '}'", "$$129 :", "$$130 :", +"component_header : IDL_COMPONENT id $$129 component_inheritance_spec $$130 supports_spec", "$$131 :", +"component_inheritance_spec : ':' $$131 scoped_name", +"component_inheritance_spec :", +"component_exports : component_exports component_export", +"component_exports :", "$$132 :", +"component_export : provides_decl $$132 ';'", "$$133 :", +"component_export : uses_decl $$133 ';'", "$$134 :", -"home_header : IDL_HOME $$129 id $$130 home_inheritance_spec $$131 supports_spec $$132 IDL_MANAGES $$133 scoped_name $$134 primary_key_spec", +"component_export : emits_decl $$134 ';'", "$$135 :", -"home_inheritance_spec : ':' $$135 scoped_name", -"home_inheritance_spec :", -"primary_key_spec : IDL_PRIMARYKEY scoped_name", -"primary_key_spec :", +"component_export : publishes_decl $$135 ';'", "$$136 :", +"component_export : consumes_decl $$136 ';'", "$$137 :", -"home_body : '{' $$136 home_exports $$137 '}'", -"home_exports : home_exports home_export", -"home_exports :", -"home_export : export", +"component_export : attribute $$137 ';'", +"provides_decl : IDL_PROVIDES interface_type id", +"interface_type : scoped_name", +"interface_type : IDL_OBJECT", +"uses_decl : IDL_USES opt_multiple interface_type id", +"opt_multiple : IDL_MULTIPLE", +"opt_multiple :", +"emits_decl : IDL_EMITS scoped_name id", +"publishes_decl : IDL_PUBLISHES scoped_name id", +"consumes_decl : IDL_CONSUMES scoped_name id", "$$138 :", -"home_export : factory_decl $$138 ';'", +"home_decl : home_header $$138 home_body", "$$139 :", -"home_export : finder_decl $$139 ';'", "$$140 :", "$$141 :", -"factory_decl : IDL_FACTORY id $$140 init_parameter_list $$141 opt_raises", "$$142 :", "$$143 :", -"finder_decl : IDL_FINDER id $$142 init_parameter_list $$143 opt_raises", +"$$144 :", +"home_header : IDL_HOME $$139 id $$140 home_inheritance_spec $$141 supports_spec $$142 IDL_MANAGES $$143 scoped_name $$144 primary_key_spec", +"$$145 :", +"home_inheritance_spec : ':' $$145 scoped_name", +"home_inheritance_spec :", +"primary_key_spec : IDL_PRIMARYKEY scoped_name", +"primary_key_spec :", +"$$146 :", +"$$147 :", +"home_body : '{' $$146 home_exports $$147 '}'", +"home_exports : home_exports home_export", +"home_exports :", +"home_export : export", +"$$148 :", +"home_export : factory_decl $$148 ';'", +"$$149 :", +"home_export : finder_decl $$149 ';'", +"$$150 :", +"$$151 :", +"factory_decl : IDL_FACTORY id $$150 init_parameter_list $$151 opt_raises", +"$$152 :", +"$$153 :", +"finder_decl : IDL_FINDER id $$152 init_parameter_list $$153 opt_raises", "event : event_decl", "event : event_abs_decl", "event : event_forward_decl", @@ -1257,12 +1286,19 @@ const char *tao_yyrule[] = { "event_forward_decl : event_concrete_forward_decl", "event_concrete_forward_decl : IDL_EVENTTYPE id", "event_abs_forward_decl : IDL_ABSTRACT IDL_EVENTTYPE id", -"event_abs_decl : event_abs_header event_rest_of_header '{' exports '}'", +"$$154 :", +"$$155 :", +"$$156 :", +"event_abs_decl : event_abs_header event_rest_of_header $$154 '{' $$155 exports $$156 '}'", "event_abs_header : IDL_ABSTRACT IDL_EVENTTYPE id", "event_custom_header : IDL_CUSTOM IDL_EVENTTYPE id", "event_plain_header : IDL_EVENTTYPE id", -"event_rest_of_header : opt_truncatable inheritance_spec supports_spec", -"event_decl : event_header event_rest_of_header '{' value_elements '}'", +"$$157 :", +"event_rest_of_header : opt_truncatable inheritance_spec $$157 supports_spec", +"$$158 :", +"$$159 :", +"$$160 :", +"event_decl : event_header event_rest_of_header $$158 '{' $$159 value_elements $$160 '}'", "event_header : event_custom_header", "event_header : event_plain_header", }; @@ -3389,6 +3425,8 @@ case 223: s->is_local (), s->is_abstract () ); + AST_Structure::fwd_redefinition_helper (d, + s); (void) s->fe_add_structure (d); } @@ -3573,7 +3611,11 @@ case 242: s->is_abstract ()); } - (void) s->fe_add_union (u); + AST_Structure *i = AST_Structure::narrow_from_decl (u); + AST_Structure::fwd_redefinition_helper (i, + s); + u = AST_Union::narrow_from_decl (i); + (void) s->fe_add_union (u); } /* @@ -4438,35 +4480,48 @@ case 306: } } break; -case 307: +case 309: { -/* attribute : opt_readonly IDL_ATTRIBUTE*/ +/* attribute_readonly : IDL_READONLY*/ + idl_global->set_parse_state (IDL_GlobalData::PS_AttrROSeen); + } +break; +case 310: +{ +/* IDL_ATTRIBUTE*/ idl_global->set_parse_state (IDL_GlobalData::PS_AttrSeen); } break; -case 308: +case 311: { /* param_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_AttrTypeSeen); } break; -case 309: +case 312: { /* at_least_one_simple_declarator*/ + idl_global->set_parse_state (IDL_GlobalData::PS_AttrDeclsSeen); + } +break; +case 313: +{ +/* opt_raises*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); AST_Attribute *a = 0; FE_Declarator *d = 0; - idl_global->set_parse_state (IDL_GlobalData::PS_AttrCompleted); + + idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); /* * Create nodes representing attributes and add them to the * enclosing scope. */ if (s != 0 - && tao_yyvsp[-2].dcval != 0 - && tao_yyvsp[0].dlval != 0) + && tao_yyvsp[-4].dcval != 0 + && tao_yyvsp[-2].dlval != 0) { - for (UTL_DecllistActiveIterator l (tao_yyvsp[0].dlval); + for (UTL_DecllistActiveIterator l (tao_yyvsp[-2].dlval); !l.is_done (); l.next ()) { @@ -4477,7 +4532,7 @@ case 309: continue; } - AST_Type *tp = d->compose (tao_yyvsp[-2].dcval); + AST_Type *tp = d->compose (tao_yyvsp[-4].dcval); if (tp == 0) { @@ -4486,40 +4541,113 @@ case 309: a = idl_global->gen ()->create_attribute ( - tao_yyvsp[-5].bval, + I_TRUE, tp, (UTL_IdList *) d->name ()->copy (), s->is_local (), s->is_abstract () ); - /* - * Add one attribute to the enclosing scope. - */ + + if (tao_yyvsp[0].nlval != 0) + { + (void) a->fe_add_get_exceptions (tao_yyvsp[0].nlval); + } + (void) s->fe_add_attribute (a); } } } break; -case 310: +case 314: { -/* opt_readonly : IDL_READONLY*/ - idl_global->set_parse_state (IDL_GlobalData::PS_AttrROSeen); - tao_yyval.bval = I_TRUE; +/* attribute_readonly : IDL_ATTRIBUTE*/ + idl_global->set_parse_state (IDL_GlobalData::PS_AttrSeen); } break; -case 311: +case 315: { -/* | EMPTY */ - tao_yyval.bval = I_FALSE; +/* param_type_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_AttrTypeSeen); } break; -case 312: +case 316: +{ +/* at_least_one_simple_declarator*/ + idl_global->set_parse_state (IDL_GlobalData::PS_AttrDeclsSeen); + } +break; +case 317: +{ +/* opt_getraises*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpGetRaiseCompleted); + } +break; +case 318: +{ +/* opt_setraises*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Attribute *a = 0; + FE_Declarator *d = 0; + + idl_global->set_parse_state (IDL_GlobalData::PS_OpSetRaiseCompleted); + + /* + * Create nodes representing attributes and add them to the + * enclosing scope. + */ + if (s != 0 + && tao_yyvsp[-6].dcval != 0 + && tao_yyvsp[-4].dlval != 0) + { + for (UTL_DecllistActiveIterator l (tao_yyvsp[-4].dlval); + !l.is_done (); + l.next ()) + { + d = l.item (); + + if (d == 0) + { + continue; + } + + AST_Type *tp = d->compose (tao_yyvsp[-6].dcval); + + if (tp == 0) + { + continue; + } + + a = + idl_global->gen ()->create_attribute ( + I_FALSE, + tp, + (UTL_IdList *) d->name ()->copy (), + s->is_local (), + s->is_abstract () + ); + + if (tao_yyvsp[-2].nlval != 0) + { + (void) a->fe_add_get_exceptions (tao_yyvsp[0].nlval); + } + + if (tao_yyvsp[0].nlval != 0) + { + (void) a->fe_add_set_exceptions (tao_yyvsp[0].nlval); + } + + (void) s->fe_add_attribute (a); + } + } + } +break; +case 319: { /* exception : IDL_EXCEPTION*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptSeen); } break; -case 313: +case 320: { /* id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4546,19 +4674,19 @@ case 313: idl_global->scopes ().push (e); } break; -case 314: +case 321: { /* '{'*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptSqSeen); } break; -case 315: +case 322: { /* members*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptBodySeen); } break; -case 316: +case 323: { /* '}'*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptQsSeen); @@ -4568,13 +4696,13 @@ case 316: idl_global->scopes ().pop (); } break; -case 317: +case 324: { /* operation : opt_op_attribute op_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpTypeSeen); } break; -case 318: +case 325: { /* IDENTIFIER*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4622,19 +4750,19 @@ case 318: idl_global->scopes ().push (o); } break; -case 319: +case 326: { /* parameter_list*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParsCompleted); } break; -case 320: +case 327: { /* opt_raises*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); } break; -case 321: +case 328: { /* opt_context*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4665,27 +4793,27 @@ case 321: idl_global->scopes ().pop (); } break; -case 322: +case 329: { /* opt_op_attribute : IDL_ONEWAY*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpAttrSeen); tao_yyval.ofval = AST_Operation::OP_oneway; } break; -case 323: +case 330: { /* | IDL_IDEMPOTENT*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpAttrSeen); tao_yyval.ofval = AST_Operation::OP_idempotent; } break; -case 324: +case 331: { /* | EMPTY */ tao_yyval.ofval = AST_Operation::OP_noflags; } break; -case 326: +case 333: { /* op_type_spec : param_type_spec | IDL_VOID*/ tao_yyval.dcval = @@ -4694,14 +4822,14 @@ case 326: ); } break; -case 327: +case 334: { /* init_decl : IDL_FACTORY */ /*@@ PS_FactorySeen?*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpTypeSeen); } break; -case 328: +case 335: { /* IDENTIFIER */ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4739,7 +4867,7 @@ case 328: idl_global->scopes ().push (factory); } break; -case 329: +case 336: { /* init_parameter_list*/ /* TODO: replace parameter_list with rule that accepts only IN args */ @@ -4748,49 +4876,49 @@ case 329: idl_global->scopes ().pop (); } break; -case 330: +case 337: { /* init_parameter_list : '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpSqSeen); } break; -case 331: +case 338: { /* ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpQsSeen); } break; -case 332: +case 339: { /* | '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpSqSeen); } break; -case 333: +case 340: { /* at_least_one_in_parameter ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpQsSeen); } break; -case 335: +case 342: { /* in_parameters : in_parameters ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParCommaSeen); } break; -case 338: +case 345: { /* in_parameter : IDL_IN*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParDirSeen); } break; -case 339: +case 346: { /* param_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParTypeSeen); } break; -case 340: +case 347: { /* declarator*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4820,49 +4948,49 @@ case 340: } } break; -case 341: +case 348: { /* parameter_list : '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpSqSeen); } break; -case 342: +case 349: { /* ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpQsSeen); } break; -case 343: +case 350: { /* | '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpSqSeen); } break; -case 344: +case 351: { /* at_least_one_parameter ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpQsSeen); } break; -case 346: +case 353: { /* parameters : parameters ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParCommaSeen); } break; -case 349: +case 356: { /* parameter : direction*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParDirSeen); } break; -case 350: +case 357: { /* param_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParTypeSeen); } break; -case 351: +case 358: { /* declarator*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4906,7 +5034,7 @@ case 351: } } break; -case 352: +case 359: { /* param_type_spec : base_type_spec*/ tao_yyval.dcval = @@ -4915,7 +5043,7 @@ case 352: ); } break; -case 355: +case 362: { /* | string_type_spec*/ /* | wstring_type_spec*/ @@ -4955,75 +5083,125 @@ case 355: tao_yyval.dcval = d; } break; -case 356: +case 363: { /* direction : IDL_IN*/ tao_yyval.dival = AST_Argument::dir_IN; } break; -case 357: +case 364: { /* | IDL_OUT*/ tao_yyval.dival = AST_Argument::dir_OUT; } break; -case 358: +case 365: { /* | IDL_INOUT*/ tao_yyval.dival = AST_Argument::dir_INOUT; } break; -case 359: +case 366: { /* opt_raises : IDL_RAISES*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseSeen); } break; -case 360: +case 367: { /* '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseSqSeen); } break; -case 361: +case 368: { /* at_least_one_scoped_name ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseQsSeen); tao_yyval.nlval = tao_yyvsp[-1].nlval; } break; -case 362: +case 369: { tao_yyval.nlval = 0; /* | EMPTY */ } break; -case 363: +case 370: +{ +/* opt_getraises : IDL_GETRAISES*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpGetRaiseSeen); + } +break; +case 371: +{ +/* '('*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpGetRaiseSqSeen); + } +break; +case 372: +{ +/* at_least_one_scoped_name ')'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpGetRaiseQsSeen); + tao_yyval.nlval = tao_yyvsp[-1].nlval; + } +break; +case 373: +{ + tao_yyval.nlval = 0; +/* | EMPTY */ + } +break; +case 374: +{ +/* opt_setraises : IDL_SETRAISES*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpSetRaiseSeen); + } +break; +case 375: +{ +/* '('*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpSetRaiseSqSeen); + } +break; +case 376: +{ +/* at_least_one_scoped_name ')'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpSetRaiseQsSeen); + tao_yyval.nlval = tao_yyvsp[-1].nlval; + } +break; +case 377: +{ + tao_yyval.nlval = 0; +/* | EMPTY */ + } +break; +case 378: { /* opt_context : IDL_CONTEXT*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpContextSeen); } break; -case 364: +case 379: { idl_global->set_parse_state (IDL_GlobalData::PS_OpContextSqSeen); /* '('*/ } break; -case 365: +case 380: { /* at_least_one_string_literal ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpContextQsSeen); tao_yyval.slval = tao_yyvsp[-1].slval; } break; -case 366: +case 381: { /* | EMPTY */ tao_yyval.slval = 0; } break; -case 367: +case 382: { /* at_least_one_string_literal : IDL_STRING_LITERAL string_literals*/ ACE_NEW_RETURN (tao_yyval.slval, @@ -5032,13 +5210,13 @@ case 367: 1); } break; -case 368: +case 383: { /* string_literals : string_literals ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpContextCommaSeen); } break; -case 369: +case 384: { /* IDL_STRING_LITERAL*/ if (tao_yyvsp[-3].slval == 0) @@ -5060,13 +5238,13 @@ case 369: } } break; -case 370: +case 385: { /* | EMPTY */ tao_yyval.slval = 0; } break; -case 371: +case 386: { /* typeid_dcl : IDL_TYPEID scoped_name IDL_STRING_LITERAL*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5085,7 +5263,7 @@ case 371: } } break; -case 372: +case 387: { /* typeprefix_dcl : IDL_TYPEPREFIX scoped_name IDL_STRING_LITERAL*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5104,7 +5282,7 @@ case 372: } } break; -case 375: +case 390: { /* component_forward_decl : IDL_COMPONENT id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5126,7 +5304,7 @@ case 375: } } break; -case 376: +case 391: { /* component_decl : component_header */ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5167,19 +5345,19 @@ case 376: idl_global->scopes ().push (c); } break; -case 377: +case 392: { /* '{'*/ idl_global->set_parse_state (IDL_GlobalData::PS_ComponentSqSeen); } break; -case 378: +case 393: { /* component_exports*/ idl_global->set_parse_state (IDL_GlobalData::PS_ComponentBodySeen); } break; -case 379: +case 394: { /* '}'*/ idl_global->set_parse_state (IDL_GlobalData::PS_ComponentQsSeen); @@ -5190,19 +5368,19 @@ case 379: idl_global->scopes ().pop (); } break; -case 380: +case 395: { /* id*/ idl_global->set_parse_state (IDL_GlobalData::PS_ComponentIDSeen); } break; -case 381: +case 396: { /* component_inheritance_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); } break; -case 382: +case 397: { /* supports_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); @@ -5221,97 +5399,97 @@ case 382: 1); } break; -case 383: +case 398: { /* component_inheritance_spec : ':'*/ idl_global->set_parse_state (IDL_GlobalData::PS_InheritColonSeen); } break; -case 384: +case 399: { /* scoped_name*/ tao_yyval.idlist = tao_yyvsp[0].idlist; } break; -case 385: +case 400: { /* | EMPTY */ tao_yyval.idlist = 0; } break; -case 388: +case 403: { /* component_export : provides_decl*/ idl_global->set_parse_state (IDL_GlobalData::PS_ProvidesDeclSeen); } break; -case 389: +case 404: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 390: +case 405: { /* | uses_decl*/ idl_global->set_parse_state (IDL_GlobalData::PS_UsesDeclSeen); } break; -case 391: +case 406: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 392: +case 407: { /* | emits_decl*/ idl_global->set_parse_state (IDL_GlobalData::PS_EmitsDeclSeen); } break; -case 393: +case 408: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 394: +case 409: { /* | publishes_decl*/ idl_global->set_parse_state (IDL_GlobalData::PS_PublishesDeclSeen); } break; -case 395: +case 410: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 396: +case 411: { /* | consumes_decl*/ idl_global->set_parse_state (IDL_GlobalData::PS_ConsumesDeclSeen); } break; -case 397: +case 412: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 398: +case 413: { /* | attribute*/ idl_global->set_parse_state (IDL_GlobalData::PS_AttrDeclSeen); } break; -case 399: +case 414: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 400: +case 415: { /* provides_decl : IDL_PROVIDES interface_type id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5319,14 +5497,31 @@ case 400: if (c != 0) { - AST_Component::port_description pd; - pd.id = tao_yyvsp[0].idval; - pd.impl = tao_yyvsp[-1].idlist; - c->provides ().enqueue_tail (pd); + AST_Decl *d = s->lookup_by_name (tao_yyvsp[-1].idlist, + I_TRUE); + + if (d == 0) + { + idl_global->err ()->lookup_error (tao_yyvsp[-1].idlist); + } + else if (d->node_type () != AST_Decl::NT_interface) + { + idl_global->err ()->interface_expected (d); + } + else + { + AST_Type *interface_type = + AST_Interface::narrow_from_decl (d); + + AST_Component::port_description pd; + pd.id = tao_yyvsp[0].idval; + pd.impl = interface_type; + c->provides ().enqueue_tail (pd); + } } } break; -case 401: +case 416: { /* interface_type : scoped_name*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5345,7 +5540,7 @@ case 401: tao_yyval.idlist = tao_yyvsp[0].idlist; } break; -case 402: +case 417: { /* | IDL_OBJECT*/ Identifier *corba_id = 0; @@ -5368,35 +5563,50 @@ case 402: tao_yyval.idlist = corba_name; } break; -case 403: +case 418: { /* uses_decl : IDL_USES opt_multiple interface_type id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); - AST_Component *c = AST_Component::narrow_from_scope (s); - - if (c != 0) + AST_Decl *d = s->lookup_by_name (tao_yyvsp[-1].idlist, + I_TRUE); + + if (d == 0) { - AST_Component::uses_description ud; - ud.id = tao_yyvsp[0].idval; - ud.impl = tao_yyvsp[-1].idlist; - ud.is_multiple = tao_yyvsp[-2].bval; - c->uses ().enqueue_tail (ud); - } + idl_global->err ()->lookup_error (tao_yyvsp[-1].idlist); + } + else if (d->node_type () != AST_Decl::NT_interface) + { + idl_global->err ()->interface_expected (d); + } + else + { + AST_Type *interface_type = AST_Type::narrow_from_decl (d); + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description ud; + ud.id = tao_yyvsp[0].idval; + ud.impl = interface_type; + ud.is_multiple = tao_yyvsp[-2].bval; + c->uses ().enqueue_tail (ud); + } + } } break; -case 404: +case 419: { /* opt_multiple : IDL_MULTIPLE*/ tao_yyval.bval = I_TRUE; } break; -case 405: +case 420: { /* | EMPTY */ tao_yyval.bval = I_FALSE; } break; -case 406: +case 421: { /* emits_decl : IDL_EMITS scoped_name id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5407,23 +5617,26 @@ case 406: { idl_global->err ()->lookup_error (tao_yyvsp[-1].idlist); } - else if (d->node_type () != AST_Decl::NT_valuetype) + else if (d->node_type () != AST_Decl::NT_eventtype) { - idl_global->err ()->valuetype_expected (d); + idl_global->err ()->eventtype_expected (d); } - - AST_Component *c = AST_Component::narrow_from_scope (s); - - if (c != 0) + else { - AST_Component::port_description pd; - pd.id = tao_yyvsp[0].idval; - pd.impl = tao_yyvsp[-1].idlist; - c->emits ().enqueue_tail (pd); - } + AST_Type *event_type = AST_Type::narrow_from_decl (d); + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = tao_yyvsp[0].idval; + pd.impl = event_type; + c->emits ().enqueue_tail (pd); + } + } } break; -case 407: +case 422: { /* publishes_decl : IDL_PUBLISHES scoped_name id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5434,23 +5647,26 @@ case 407: { idl_global->err ()->lookup_error (tao_yyvsp[-1].idlist); } - else if (d->node_type () != AST_Decl::NT_valuetype) + else if (d->node_type () != AST_Decl::NT_eventtype) { - idl_global->err ()->valuetype_expected (d); + idl_global->err ()->eventtype_expected (d); } - - AST_Component *c = AST_Component::narrow_from_scope (s); - - if (c != 0) + else { - AST_Component::port_description pd; - pd.id = tao_yyvsp[0].idval; - pd.impl = tao_yyvsp[-1].idlist; - c->publishes ().enqueue_tail (pd); - } + AST_Type *event_type = AST_Type::narrow_from_decl (d); + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = tao_yyvsp[0].idval; + pd.impl = event_type; + c->publishes ().enqueue_tail (pd); + } + } } break; -case 408: +case 423: { /* consumes_decl : IDL_CONSUMES scoped_name id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5461,23 +5677,26 @@ case 408: { idl_global->err ()->lookup_error (tao_yyvsp[-1].idlist); } - else if (d->node_type () != AST_Decl::NT_valuetype) + else if (d->node_type () != AST_Decl::NT_eventtype) { - idl_global->err ()->valuetype_expected (d); + idl_global->err ()->eventtype_expected (d); } - - AST_Component *c = AST_Component::narrow_from_scope (s); - - if (c != 0) + else { - AST_Component::port_description pd; - pd.id = tao_yyvsp[0].idval; - pd.impl = tao_yyvsp[-1].idlist; - c->consumes ().enqueue_tail (pd); - } + AST_Type *event_type = AST_Type::narrow_from_decl (d); + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = tao_yyvsp[0].idval; + pd.impl = event_type; + c->consumes ().enqueue_tail (pd); + } + } } break; -case 409: +case 424: { /* home_decl : home_header */ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5505,7 +5724,7 @@ case 409: (void) s->fe_add_home (h); /* This FE_HomeHeader class isn't destroyed with the AST.*/ - tao_yyvsp[0].hhval->name ()->destroy (); + tao_yyvsp[0].hhval->name ()->destroy (); delete tao_yyvsp[0].hhval; tao_yyvsp[0].hhval = 0; } @@ -5516,43 +5735,52 @@ case 409: idl_global->scopes ().push (h); } break; -case 411: +case 425: +{ +/* home_body*/ + /* + * Done with this component - pop it off the scopes stack. + */ + idl_global->scopes ().pop (); + } +break; +case 426: { /* home_header : IDL_HOME*/ idl_global->set_parse_state (IDL_GlobalData::PS_HomeSeen); } break; -case 412: +case 427: { /* id*/ idl_global->set_parse_state (IDL_GlobalData::PS_HomeIDSeen); } break; -case 413: +case 428: { /* home_inheritance_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); } break; -case 414: +case 429: { /* supports_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); } break; -case 415: +case 430: { /* IDL_MANAGES*/ idl_global->set_parse_state (IDL_GlobalData::PS_ManagesSeen); } break; -case 416: +case 431: { /* scoped_name*/ idl_global->set_parse_state (IDL_GlobalData::PS_ManagesIDSeen); } break; -case 417: +case 432: { /* primary_key_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_PrimaryKeySpecSeen); @@ -5572,79 +5800,79 @@ case 417: 1); } break; -case 418: +case 433: { /* home_inheritance_spec ':' */ idl_global->set_parse_state (IDL_GlobalData::PS_InheritColonSeen); } break; -case 419: +case 434: { /* scoped_name*/ tao_yyval.idlist = tao_yyvsp[0].idlist; } break; -case 420: +case 435: { /* | EMPTY */ tao_yyval.idlist = 0; } break; -case 421: +case 436: { /* primary_key_spec : IDL_PRIMARYKEY scoped_name*/ tao_yyval.idlist = tao_yyvsp[0].idlist; } break; -case 422: +case 437: { /* | EMPTY */ tao_yyval.idlist = 0; } break; -case 423: +case 438: { /* home_body : '{'*/ idl_global->set_parse_state (IDL_GlobalData::PS_HomeSqSeen); } break; -case 424: +case 439: { /* home_exports*/ idl_global->set_parse_state (IDL_GlobalData::PS_HomeBodySeen); } break; -case 425: +case 440: { /* '}'*/ idl_global->set_parse_state (IDL_GlobalData::PS_HomeQsSeen); } break; -case 429: +case 444: { /* home_export : factory_decl*/ idl_global->set_parse_state (IDL_GlobalData::PS_FactoryDeclSeen); } break; -case 430: +case 445: { /* | ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 431: +case 446: { /* | finder_decl*/ idl_global->set_parse_state (IDL_GlobalData::PS_FinderDeclSeen); } break; -case 432: +case 447: { /* | ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 433: +case 448: { /* factory_decl : IDL_FACTORY id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5660,17 +5888,14 @@ case 433: if (s != 0) { AST_Home *home = AST_Home::narrow_from_scope (s); - AST_Component *rt = home->managed_component (); - o = idl_global->gen ()->create_operation ( - rt, + home->managed_component (), AST_Operation::OP_noflags, &n, - I_TRUE, + I_FALSE, I_FALSE ); - (void) s->fe_add_operation (o); home->factories ().enqueue_tail (o); } @@ -5683,24 +5908,39 @@ case 433: idl_global->scopes ().push (o); } break; -case 434: +case 449: { /* init_parameter_list*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParsCompleted); } break; -case 435: +case 450: { /* opt_raises*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Operation *o = 0; idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); /* + * Add exceptions and context to the operation. + */ + if (s != 0 && s->scope_node_type () == AST_Decl::NT_op) + { + o = AST_Operation::narrow_from_scope (s); + + if (tao_yyvsp[0].nlval != 0 && o != 0) + { + (void) o->fe_add_exceptions (tao_yyvsp[0].nlval); + } + } + + /* * Done with this operation. Pop its scope from the scopes stack. */ idl_global->scopes ().pop (); } break; -case 436: +case 451: { /* finder_decl : IDL_FINDER id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5716,17 +5956,14 @@ case 436: if (s != 0) { AST_Home *home = AST_Home::narrow_from_scope (s); - AST_Component *rt = home->managed_component (); - o = idl_global->gen ()->create_operation ( - rt, + home->managed_component (), AST_Operation::OP_noflags, &n, - I_TRUE, + I_FALSE, I_FALSE ); - (void) s->fe_add_operation (o); home->finders ().enqueue_tail (o); } @@ -5739,23 +5976,268 @@ case 436: idl_global->scopes ().push (o); } break; -case 437: +case 452: { /* init_parameter_list*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParsCompleted); } break; -case 438: +case 453: { /* opt_raises*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Operation *o = 0; idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); /* + * Add exceptions and context to the operation. + */ + if (s != 0 && s->scope_node_type () == AST_Decl::NT_op) + { + o = AST_Operation::narrow_from_scope (s); + + if (tao_yyvsp[0].nlval != 0 && o != 0) + { + (void) o->fe_add_exceptions (tao_yyvsp[0].nlval); + } + } + + /* * Done with this operation. Pop its scope from the scopes stack. */ idl_global->scopes ().pop (); } break; +case 459: +{ +/* event_concrete_forward_decl : IDL_EVENTTYPE id*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n (tao_yyvsp[0].idval, + 0); + AST_EventTypeFwd *f = 0; + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeForwardSeen); + + /* + * Create a node representing a forward declaration of an + * eventtype. Store it in the enclosing scope + */ + if (s != 0) + { + f = idl_global->gen ()->create_eventtype_fwd (&n, + I_FALSE); + (void) s->fe_add_valuetype_fwd (f); + } + } +break; +case 460: +{ +/* event_abs_forward_decl : IDL_ABSTRACT IDL_EVENTTYPE id*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n (tao_yyvsp[0].idval, + 0); + AST_EventTypeFwd *f = 0; + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeForwardSeen); + + /* + * Create a node representing a forward declaration of an + * eventtype. Store it in the enclosing scope + */ + if (s != 0) + { + f = idl_global->gen ()->create_eventtype_fwd (&n, + I_TRUE); + (void) s->fe_add_valuetype_fwd (f); + } + } +break; +case 461: +{ +/* event_abs_decl : event_abs_header event_rest_of_header*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_EventType *e = 0; + AST_Interface *i = 0; + + if (s != 0 && tao_yyvsp[-1].idval != 0) + { + UTL_ScopedName sn (tao_yyvsp[-1].idval, + 0); + e = + idl_global->gen ()->create_eventtype ( + &sn, + tao_yyvsp[0].ehval->inherits (), + tao_yyvsp[0].ehval->n_inherits (), + tao_yyvsp[0].ehval->inherits_concrete (), + tao_yyvsp[0].ehval->inherits_flat (), + tao_yyvsp[0].ehval->n_inherits_flat (), + tao_yyvsp[0].ehval->supports (), + tao_yyvsp[0].ehval->n_supports (), + tao_yyvsp[0].ehval->supports_concrete (), + I_TRUE, + I_FALSE + ); + i = AST_Interface::narrow_from_decl (e); + AST_Interface::fwd_redefinition_helper (i, + s); + /* + * Add the eventetype to its definition scope + */ + e = AST_EventType::narrow_from_decl (i); + (void) s->fe_add_eventtype (e); + } + + /* + * Push it on the scope stack. + */ + idl_global->scopes ().push (e); + } +break; +case 462: +{ +/* '{'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeSqSeen); + } +break; +case 463: +{ +/* exports*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeBodySeen); + } +break; +case 464: +{ +/* '}'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeQsSeen); + + /* + * Done with this eventtype - pop it off the scopes stack. + */ + idl_global->scopes ().pop (); + } +break; +case 465: +{ +/* event_abs_header : IDL_ABSTRACT IDL_EVENTTYPE id*/ + tao_yyval.idval = tao_yyvsp[0].idval; + } +break; +case 466: +{ +/* id*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeIDSeen); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("error in %s line %d\n"), + idl_global->filename ()->get_string (), + idl_global->lineno ())); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Sorry, I (TAO_IDL) can't handle") + ACE_TEXT (" custom yet\n"))); + tao_yyval.idval = 0; + } +break; +case 467: +{ +/* id*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeIDSeen); + + tao_yyval.idval = tao_yyvsp[0].idval; + } +break; +case 468: +{ +/* event_rest_of_header : opt_truncatable inheritance_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + } +break; +case 469: +{ +/* supports_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); + + ACE_NEW_RETURN (tao_yyval.ehval, + FE_EventHeader (0, + tao_yyvsp[-2].nlval, + tao_yyvsp[0].nlval, + tao_yyvsp[-3].bval), + 1); + } +break; +case 470: +{ +/* event_decl : event_header event_rest_of_header*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_EventType *e = 0; + AST_Interface *i = 0; + + if (s != 0 && tao_yyvsp[-1].idval != 0) + { + UTL_ScopedName sn (tao_yyvsp[-1].idval, + 0); + e = + idl_global->gen ()->create_eventtype ( + &sn, + tao_yyvsp[0].ehval->inherits (), + tao_yyvsp[0].ehval->n_inherits (), + tao_yyvsp[0].ehval->inherits_concrete (), + tao_yyvsp[0].ehval->inherits_flat (), + tao_yyvsp[0].ehval->n_inherits_flat (), + tao_yyvsp[0].ehval->supports (), + tao_yyvsp[0].ehval->n_supports (), + tao_yyvsp[0].ehval->supports_concrete (), + I_FALSE, + tao_yyvsp[0].ehval->truncatable () + ); + i = AST_Interface::narrow_from_decl (e); + AST_Interface::fwd_redefinition_helper (i, + s); + /* + * Add the eventetype to its definition scope + */ + e = AST_EventType::narrow_from_decl (i); + (void) s->fe_add_eventtype (e); + } + + /* + * Push it on the scope stack. + */ + idl_global->scopes ().push (e); + } +break; +case 471: +{ +/* '{'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeSqSeen); + } +break; +case 472: +{ +/* value_elements*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeBodySeen); + } +break; +case 473: +{ +/* '}'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EventTypeQsSeen); + + /* + * Done with this eventtype - pop it off the scopes stack. + */ + idl_global->scopes ().pop (); + } +break; +case 474: +{ +/* event_header : event_custom_header*/ + tao_yyval.idval = tao_yyvsp[0].idval; + } +break; +case 475: +{ +/* event_header : event_plain_header*/ + tao_yyval.idval = tao_yyvsp[0].idval; + } +break; } tao_yyssp -= tao_yym; tao_yystate = *tao_yyssp; diff --git a/TAO/TAO_IDL/fe/y.tab.h b/TAO/TAO_IDL/fe/y.tab.h index c79ca35e9a6..510a80d1e49 100644 --- a/TAO/TAO_IDL/fe/y.tab.h +++ b/TAO/TAO_IDL/fe/y.tab.h @@ -84,7 +84,9 @@ typedef union { UTL_DeclList *dlval; /* Declaration list */ FE_InterfaceHeader *ihval; /* Interface header */ FE_OBVHeader *vhval; /* Valuetype header */ + FE_EventHeader *ehval; /* Event header */ FE_ComponentHeader *chval; /* Component header */ + FE_HomeHeader *hhval; /* Home header */ AST_Expression *exval; /* Expression value */ AST_UnionLabel *ulval; /* Union label */ AST_Field *ffval; /* Field value */ diff --git a/TAO/TAO_IDL/include/ast_attribute.h b/TAO/TAO_IDL/include/ast_attribute.h index de63d57a10f..1a8b7ffd8b0 100644 --- a/TAO/TAO_IDL/include/ast_attribute.h +++ b/TAO/TAO_IDL/include/ast_attribute.h @@ -71,6 +71,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "utl_scoped_name.h" #include "ace/OS.h" +class UTL_ExceptList; +class UTL_NameList; + // Representation of attribute declaration: // An attribute is a field with a readonly property. @@ -93,7 +96,9 @@ public: // Data Accessors. - idl_bool readonly (void); + idl_bool readonly (void) const; + UTL_ExceptList *get_get_exceptions (void) const; + UTL_ExceptList *get_set_exceptions (void) const; // Narrowing. DEF_NARROW_METHODS1(AST_Attribute, AST_Field); @@ -110,6 +115,17 @@ private: const idl_bool pd_readonly; // Is attribute read-only? + + UTL_ExceptList *pd_get_exceptions; + UTL_ExceptList *pd_set_exceptions; + + // Operations. + + // Scope Management Protocol. + + friend int tao_yyparse (void); + virtual UTL_NameList *fe_add_get_exceptions (UTL_NameList *e); + virtual UTL_NameList *fe_add_set_exceptions (UTL_NameList *e); }; #endif // _AST_ATTRIBUTE_AST_ATTRIBUTE_HH diff --git a/TAO/TAO_IDL/include/ast_component.h b/TAO/TAO_IDL/include/ast_component.h index 1a39702d51f..87a09901031 100644 --- a/TAO/TAO_IDL/include/ast_component.h +++ b/TAO/TAO_IDL/include/ast_component.h @@ -24,19 +24,12 @@ public: // This also calls the base class version. virtual void redefine (AST_Interface *from); - // Utility data structure for a 'uses' declaration. - struct uses_description - { - Identifier *id; - UTL_ScopedName *impl; - idl_bool is_multiple; - }; - - // Utility data structure for all other port declarations. + // Utility data structure for port declarations. struct port_description { Identifier *id; - UTL_ScopedName *impl; + AST_Type *impl; + idl_bool is_multiple; }; // Accessors. @@ -48,13 +41,9 @@ public: long n_supports (void) const; ACE_Unbounded_Queue<port_description> &provides (void); - - ACE_Unbounded_Queue<uses_description> &uses (void); - + ACE_Unbounded_Queue<port_description> &uses (void); ACE_Unbounded_Queue<port_description> &emits (void); - ACE_Unbounded_Queue<port_description> &publishes (void); - ACE_Unbounded_Queue<port_description> &consumes (void); // Cleanup function. @@ -78,7 +67,7 @@ public: private: AST_Component *pd_base_component; ACE_Unbounded_Queue<port_description> pd_provides; - ACE_Unbounded_Queue<uses_description> pd_uses; + ACE_Unbounded_Queue<port_description> pd_uses; ACE_Unbounded_Queue<port_description> pd_emits; ACE_Unbounded_Queue<port_description> pd_publishes; ACE_Unbounded_Queue<port_description> pd_consumes; diff --git a/TAO/TAO_IDL/include/ast_decl.h b/TAO/TAO_IDL/include/ast_decl.h index 4620d3b3124..e1e457bd408 100644 --- a/TAO/TAO_IDL/include/ast_decl.h +++ b/TAO/TAO_IDL/include/ast_decl.h @@ -148,8 +148,8 @@ public: , NT_component // Denotes a CORBA component , NT_component_fwd // Denotes a forward declared component , NT_home // Denotes a CORBA component home - , NT_finder // Denotes a home finder , NT_eventtype // Denotes a CCM event source or sink + , NT_eventtype_fwd // Denotes a forward declared CCM event }; // Operations. diff --git a/TAO/TAO_IDL/include/ast_eventtype.h b/TAO/TAO_IDL/include/ast_eventtype.h new file mode 100644 index 00000000000..7e786dddd87 --- /dev/null +++ b/TAO/TAO_IDL/include/ast_eventtype.h @@ -0,0 +1,43 @@ +// This may look like C, but it's really -*- C++ -*- +// $Id$ + +#ifndef _AST_VALUETYPE_AST_EVENTTYPE_HH +#define _AST_VALUETYPE_AST_EVENTTYPE_HH + +#include "ast_valuetype.h" + +class TAO_IDL_FE_Export AST_EventType : public virtual AST_ValueType +{ +public: + AST_EventType (void); + + AST_EventType (UTL_ScopedName *n, + AST_Interface **inherits, + long n_inherits, + AST_ValueType *inherits_concrete, + AST_Interface **inherits_flat, + long n_inherits_flat, + AST_Interface **supports, + long n_supports, + AST_Interface *supports_concrete, + idl_bool abstract, + idl_bool truncatable); + + virtual ~AST_EventType (void); + + // Cleanup function. + virtual void destroy (void); + + // Narrowing. + DEF_NARROW_METHODS1(AST_EventType, AST_ValueType); + DEF_NARROW_FROM_DECL(AST_EventType); + DEF_NARROW_FROM_SCOPE(AST_EventType); + + // AST Dumping. + virtual void dump (ACE_OSTREAM_TYPE &o); + + // Visiting. + virtual int ast_accept (ast_visitor *visitor); +}; + +#endif // _AST_VALUETYPE_AST_EVENTTYPE_HH diff --git a/TAO/TAO_IDL/include/ast_eventtype_fwd.h b/TAO/TAO_IDL/include/ast_eventtype_fwd.h new file mode 100644 index 00000000000..c1533eec4c0 --- /dev/null +++ b/TAO/TAO_IDL/include/ast_eventtype_fwd.h @@ -0,0 +1,35 @@ +// This may look like C, but it's really -*- C++ -*- +// $Id$ + +#ifndef _AST_VALUETYPE_FWD_AST_EVENTTYPE_FWD_HH +#define _AST_VALUETYPE_FWD_AST_EVENTTYPE_FWD_HH + +#include "ast_valuetype_fwd.h" + +// Representation of a forward eventtype declaration. + +class TAO_IDL_FE_Export AST_EventTypeFwd : public virtual AST_ValueTypeFwd +{ +public: + AST_EventTypeFwd (void); + + AST_EventTypeFwd (AST_Interface *dummy, + UTL_ScopedName *n); + + virtual ~AST_EventTypeFwd (void); + + // Cleanup function. + virtual void destroy (void); + + // Narrowing. + DEF_NARROW_METHODS1(AST_EventTypeFwd, AST_ValueTypeFwd); + DEF_NARROW_FROM_DECL(AST_EventTypeFwd); + + // AST Dumping. + virtual void dump (ACE_OSTREAM_TYPE &); + + // Visiting. + virtual int ast_accept (ast_visitor *visitor); +}; + +#endif // _AST_VALUETYPE_FWD_AST_EVENTTYPE_FWD_HH diff --git a/TAO/TAO_IDL/include/ast_generator.h b/TAO/TAO_IDL/include/ast_generator.h index c8ed5e484ca..c69391ebadd 100644 --- a/TAO/TAO_IDL/include/ast_generator.h +++ b/TAO/TAO_IDL/include/ast_generator.h @@ -72,15 +72,11 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_predefined_type.h" #include "ast_union_label.h" -class AST_Root; class UTL_LabelList; class UTL_ExprList; -class AST_StructureFwd; -class AST_UnionFwd; -class AST_ValueTypeFwd; -class AST_Component; -class AST_ComponentFwd; -class AST_Home; +class AST_Root; +class AST_EventType; +class AST_EventTypeFwd; // Defines base class for node generators. @@ -141,6 +137,27 @@ public: idl_bool abstract ); + // Create a node representing an eventtype. + virtual AST_EventType *create_eventtype ( + UTL_ScopedName *n, + AST_Interface **inherits, + long n_inherits, + AST_ValueType *inherits_concrete, + AST_Interface **inherits_flat, + long n_inherits_flat, + AST_Interface **supports, + long n_supports, + AST_Interface *supports_concrete, + idl_bool abstract, + idl_bool truncatable + ); + + // Create a node representing a forward declaration of an eventtype. + virtual AST_EventTypeFwd *create_eventtype_fwd ( + UTL_ScopedName *n, + idl_bool abstract + ); + // Create a node representing a component. virtual AST_Component *create_component ( UTL_ScopedName *n, diff --git a/TAO/TAO_IDL/include/ast_interface.h b/TAO/TAO_IDL/include/ast_interface.h index c1617345af1..b2e0e3de80f 100644 --- a/TAO/TAO_IDL/include/ast_interface.h +++ b/TAO/TAO_IDL/include/ast_interface.h @@ -91,12 +91,11 @@ public: virtual ~AST_Interface (void); - // This serves for both interfaces, value types and components. + // This serves for interfaces, value types, components, and eventtypes. static void fwd_redefinition_helper (AST_Interface *&i, UTL_Scope *s); - // This serves only for interfaces, but it is called - // from the corresponding AST_ValueType function(). + // Overridden for valuetypes, components, and eventtypes. virtual void redefine (AST_Interface *from); AST_Interface **inherits (void) const; diff --git a/TAO/TAO_IDL/include/ast_module.h b/TAO/TAO_IDL/include/ast_module.h index 1b5cf150164..8d46aa7b860 100644 --- a/TAO/TAO_IDL/include/ast_module.h +++ b/TAO/TAO_IDL/include/ast_module.h @@ -144,6 +144,10 @@ private: virtual AST_ValueTypeFwd *fe_add_valuetype_fwd (AST_ValueTypeFwd *i); + virtual AST_EventType *fe_add_eventtype (AST_EventType *i); + + virtual AST_EventTypeFwd *fe_add_eventtype_fwd (AST_EventTypeFwd *i); + virtual AST_Component *fe_add_component (AST_Component *i); virtual AST_ComponentFwd *fe_add_component_fwd (AST_ComponentFwd *i); diff --git a/TAO/TAO_IDL/include/ast_operation.h b/TAO/TAO_IDL/include/ast_operation.h index 1e14ee1071e..e3716c3947c 100644 --- a/TAO/TAO_IDL/include/ast_operation.h +++ b/TAO/TAO_IDL/include/ast_operation.h @@ -142,8 +142,11 @@ public: // Method to add exceptions UTL_ExceptList *be_add_exceptions (UTL_ExceptList *t); - AST_Argument *be_add_argument (AST_Argument *arg); // Add an argument to the scope. + AST_Argument *be_add_argument (AST_Argument *arg); + + // Insert an exception at the head of the list. + int be_insert_exception (AST_Exception *ex); // Cleanup function. virtual void destroy (void); diff --git a/TAO/TAO_IDL/include/ast_structure.h b/TAO/TAO_IDL/include/ast_structure.h index 73ebd34b2d1..c6bdd5b3824 100644 --- a/TAO/TAO_IDL/include/ast_structure.h +++ b/TAO/TAO_IDL/include/ast_structure.h @@ -98,6 +98,13 @@ public: virtual ~AST_Structure (void); + // This serves for both structs and unions. + static void fwd_redefinition_helper (AST_Structure *&i, + UTL_Scope *s); + + // Overridden for unions. + virtual void redefine (AST_Structure *from); + // Narrowing. DEF_NARROW_METHODS2(AST_Structure, AST_ConcreteType, UTL_Scope); DEF_NARROW_FROM_DECL(AST_Structure); @@ -122,6 +129,14 @@ public: virtual int contains_wstring (void); // Do we contain a wstring at some nesting level? + // Is this struct or union defined? This predicate returns FALSE when a + // forward declaration is not defined yet, and TRUE in + // all other cases. + idl_bool is_defined (void) + { + return this->size_type () != AST_Type::SIZE_UNKNOWN; + } + // AST Dumping. virtual void dump (ACE_OSTREAM_TYPE &o); @@ -132,16 +147,6 @@ public: virtual int ast_accept (ast_visitor *visitor); protected: - virtual int compute_size_type (void); - // Compute the size type if it is unknown. - -protected: - ACE_Unbounded_Queue<AST_Field *> fields_; - // Container for this struct's field nodes. Excludes nodes included - // in member_count, i.e., enum values of an enum declared inside - // the struct. - -private: friend int tao_yyparse (void); // Scope Management Protocol. @@ -155,6 +160,16 @@ private: virtual AST_EnumVal *fe_add_enum_val (AST_EnumVal *v); + virtual int compute_size_type (void); + // Compute the size type if it is unknown. + +protected: + ACE_Unbounded_Queue<AST_Field *> fields_; + // Container for this struct's field nodes. Excludes nodes included + // in member_count, i.e., enum values of an enum declared inside + // the struct. + +private: int compute_member_count (void); // Count the number of members. diff --git a/TAO/TAO_IDL/include/ast_structure_fwd.h b/TAO/TAO_IDL/include/ast_structure_fwd.h index 770642c0b81..c447182c240 100644 --- a/TAO/TAO_IDL/include/ast_structure_fwd.h +++ b/TAO/TAO_IDL/include/ast_structure_fwd.h @@ -15,7 +15,8 @@ class TAO_IDL_FE_Export AST_StructureFwd : public virtual AST_Type public: AST_StructureFwd (void); - AST_StructureFwd (UTL_ScopedName *n); + AST_StructureFwd (AST_Structure *dummy, + UTL_ScopedName *n); virtual ~AST_StructureFwd (void); diff --git a/TAO/TAO_IDL/include/ast_union.h b/TAO/TAO_IDL/include/ast_union.h index 1da84ff230b..7c99cc6f237 100644 --- a/TAO/TAO_IDL/include/ast_union.h +++ b/TAO/TAO_IDL/include/ast_union.h @@ -93,6 +93,9 @@ public: // Destructor. virtual ~AST_Union (void); + // This also calls the base class version. + virtual void redefine (AST_Structure *from); + virtual idl_bool in_recursion (AST_Type *node = 0); // Are we or the parameter node involved in some kind of recursion? diff --git a/TAO/TAO_IDL/include/ast_union_fwd.h b/TAO/TAO_IDL/include/ast_union_fwd.h index 96115d06b32..6dab33c7429 100644 --- a/TAO/TAO_IDL/include/ast_union_fwd.h +++ b/TAO/TAO_IDL/include/ast_union_fwd.h @@ -4,31 +4,27 @@ #ifndef _AST_UNION_FWD_AST_UNION_FWD_HH #define _AST_UNION_FWD_AST_UNION_FWD_HH -#include "ast_type.h" +#include "ast_structure_fwd.h" class AST_Union; // Representation of a forward union declaration. -class TAO_IDL_FE_Export AST_UnionFwd : public virtual AST_Type +class TAO_IDL_FE_Export AST_UnionFwd : public virtual AST_StructureFwd { public: AST_UnionFwd (void); - AST_UnionFwd (UTL_ScopedName *n); + AST_UnionFwd (AST_Union *dummy, + UTL_ScopedName *n); virtual ~AST_UnionFwd (void); - AST_Union *full_definition (void); - void set_full_definition (AST_Union *nfd); - - virtual idl_bool is_defined (void); - // Cleanup function. virtual void destroy (void); // Narrowing. - DEF_NARROW_METHODS1(AST_UnionFwd, AST_Type); + DEF_NARROW_METHODS1(AST_UnionFwd, AST_StructureFwd); DEF_NARROW_FROM_DECL(AST_UnionFwd); // AST Dumping. @@ -36,10 +32,6 @@ public: // Visiting. virtual int ast_accept (ast_visitor *visitor); - -private: - AST_Union *pd_full_definition; - // The union this is a forward declaration of. }; #endif // _AST_UNION_FWD_AST_UNION_FWD_HH diff --git a/TAO/TAO_IDL/include/ast_visitor.h b/TAO/TAO_IDL/include/ast_visitor.h index 96f6386faea..b41d64a9420 100644 --- a/TAO/TAO_IDL/include/ast_visitor.h +++ b/TAO/TAO_IDL/include/ast_visitor.h @@ -33,6 +33,8 @@ class AST_ValueType; class AST_ValueTypeFwd; class AST_Component; class AST_ComponentFwd; +class AST_EventType; +class AST_EventTypeFwd; class AST_Home; class AST_Factory; class AST_Structure; @@ -114,6 +116,12 @@ public: virtual int visit_component_fwd (AST_ComponentFwd *node) = 0; // Visit component_fwd + virtual int visit_eventtype (AST_EventType *node) = 0; + // Visit eventtype. + + virtual int visit_eventtype_fwd (AST_EventTypeFwd *node) = 0; + // Visit eventtype_fwd + virtual int visit_factory (AST_Factory *node) = 0; // Visit a OBV factory construct. diff --git a/TAO/TAO_IDL/include/fe_interface_header.h b/TAO/TAO_IDL/include/fe_interface_header.h index b651676de8c..3e9f18fca27 100644 --- a/TAO/TAO_IDL/include/fe_interface_header.h +++ b/TAO/TAO_IDL/include/fe_interface_header.h @@ -84,7 +84,7 @@ class AST_Home; // FE_component_header // Internal class for FE to describe component headers. -class FE_InterfaceHeader +class TAO_IDL_FE_Export FE_InterfaceHeader { public: FE_InterfaceHeader (UTL_ScopedName *n, @@ -138,15 +138,15 @@ protected: idl_bool for_valuetype); }; - -class FE_OBVHeader : public FE_InterfaceHeader +class TAO_IDL_FE_Export FE_OBVHeader : public FE_InterfaceHeader { public: FE_OBVHeader (UTL_ScopedName *n, UTL_NameList *inherits, UTL_NameList *supports, - idl_bool truncatable); + idl_bool truncatable, + idl_bool is_eventtype = I_FALSE); virtual ~FE_OBVHeader (void); // Data Accessors. @@ -172,11 +172,22 @@ protected: idl_bool check_concrete_supported_inheritance (AST_Interface *d); }; +class TAO_IDL_FE_Export FE_EventHeader : public FE_OBVHeader +{ +public: + + FE_EventHeader (UTL_ScopedName *n, + UTL_NameList *inherits, + UTL_NameList *supports, + idl_bool truncatable); + virtual ~FE_EventHeader (void); +}; + // Unlike value types, a component's supported interfaces are simply // added to the inheritance list in generated code, so we use the // existing base class mechanism for managing the inheritance list // to manage the derived class's supported interface list. -class FE_ComponentHeader : public FE_InterfaceHeader +class TAO_IDL_FE_Export FE_ComponentHeader : public FE_InterfaceHeader { public: @@ -195,10 +206,6 @@ public: protected: AST_Component *pd_base_component; - -protected: - virtual void compile_inheritance (UTL_NameList *supports, - idl_bool for_valuetype); }; // We use the 'base_component' member of the base class to @@ -206,7 +213,7 @@ protected: // By inheriting from FE_ComponentHeader, we also get the // reuse of the mechanism described in the comment above // for handling the supported interface list. -class FE_HomeHeader : public FE_ComponentHeader +class TAO_IDL_FE_Export FE_HomeHeader : public FE_ComponentHeader { public: diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index 884e1c490f1..850ab48df34 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -138,6 +138,12 @@ public: , PS_ValueTypeSqSeen // '{' seen for value type , PS_ValueTypeQsSeen // '}' seen for value type , PS_ValueTypeBodySeen // Seen a value type body + , PS_EventTypeSeen // Seen a EVENTTYPE keyword + , PS_EventTypeForwardSeen // Forward eventtype decl seen + , PS_EventTypeIDSeen // Seen the eventtype ID + , PS_EventTypeSqSeen // '{' seen for event type + , PS_EventTypeQsSeen // '}' seen for event type + , PS_EventTypeBodySeen // Seen a event type body , PS_ComponentSeen // Seen a component declaration , PS_ComponentIDSeen // Seen the component ID , PS_ComponentForwardSeen // Seen a forward declaration of a component @@ -226,6 +232,8 @@ public: , PS_OpIDSeen // Seen operation ID , PS_OpParsCompleted // Completed operation param list , PS_OpRaiseCompleted // Completed operation except list + , PS_OpGetRaiseCompleted // Completed attribute get except list + , PS_OpSetRaiseCompleted // Completed attribute set except list , PS_OpContextCompleted // Completed operation context spec , PS_OpCompleted // Completed operation statement , PS_OpSqSeen // Seen '(' for operation @@ -237,6 +245,12 @@ public: , PS_OpRaiseSeen // Seen RAISES keyword , PS_OpRaiseSqSeen // Seen '(' for RAISES , PS_OpRaiseQsSeen // Seen ')' for RAISES + , PS_OpGetRaiseSeen // Seen GETRAISES keyword + , PS_OpGetRaiseSqSeen // Seen '(' for GETRAISES + , PS_OpGetRaiseQsSeen // Seen ')' for GETRAISES + , PS_OpSetRaiseSeen // Seen SETRAISES keyword + , PS_OpSetRaiseSqSeen // Seen '(' for SETRAISES + , PS_OpSetRaiseQsSeen // Seen ')' for SETRAISES , PS_OpContextSeen // Seen CONTEXT keyword , PS_OpContextSqSeen // Seen '(' for CONTEXT , PS_OpContextQsSeen // Seen ')' for CONTEXT @@ -386,12 +400,6 @@ public: virtual idl_bool obv_support (void); // check if OBV (Valuetype) support is enabled - void component_support (idl_bool); - // set enable/disable CORBA component support - - idl_bool component_support (void); - // check if CORBA component support is enabled - virtual void case_diff_error (idl_bool); // report an error (1) for indentifiers in the same scope // that differ only by case, or report a warning (0). @@ -494,9 +502,6 @@ private: idl_bool obv_support_; // Do we support OBV (Valuetype)? - idl_bool component_support_; - // Do we support the CCM (CORBA Component Model)? - idl_bool case_diff_error_; // Do we report an error for indentifiers in the same scope that differ // only by case? or just a warning? diff --git a/TAO/TAO_IDL/include/utl_err.h b/TAO/TAO_IDL/include/utl_err.h index 7e0a1195d55..594be60ef72 100644 --- a/TAO/TAO_IDL/include/utl_err.h +++ b/TAO/TAO_IDL/include/utl_err.h @@ -110,10 +110,13 @@ public: EIDL_LOOKUP_ERROR, // Identifier not found EIDL_INHERIT_FWD_ERROR, // Cannot inherit from fwd decl interface EIDL_SUPPORTS_FWD_ERROR, // Cannot support a fwd decl interface + EIDL_PRIMARY_KEY_ERROR, // Does not inherit from primaryKeyBase EIDL_CONSTANT_EXPECTED, // We got something else.. EIDL_INTERFACE_EXPECTED, // We got something else.. EIDL_VALUETYPE_EXPECTED, // We got something else.. + EIDL_CONCRETE_VT_EXPECTED, // We got something else.. EIDL_ABSTRACT_EXPECTED, // We got something else.. + EIDL_EVENTTYPE_EXPECTED, // We got something else.. EIDL_NAME_CASE_ERROR, // Identifier spellings differ only in case EIDL_NAME_CASE_WARNING, // Same as above, but only a warning EIDL_KEYWORD_ERROR, // Case-insensitive clash with IDL keyword @@ -247,17 +250,32 @@ public: // or inheritance list. void interface_expected (AST_Decl *d); - // Report a situation where an value type was expected but we got + // Report a situation where a value type was expected but we got // something else instead. This most likely is a case in a primary // key, emits, publishes or consumes declaration. void valuetype_expected (AST_Decl *d); + // Report a situation where a concrete value type was expected but we got + // something else instead. This most likely is a case where a valuetype + // inherits from something other than a concrete valuetype. + void concrete_valuetype_expected (AST_Decl *d); + // Report a situation where an abstract type was expected but we got // something else instead. This is the case in an inheritance // list where a concrete type appears after an abstract type, or // where a valuetype inherits more than one concrete valuetype. void abstract_expected (AST_Decl *d); + // Report a situation where an event type was expected but we got + // something else instead. This is the case in an 'emits', 'publishes', + // or 'consumes' declaration in a component and it's not an event type. + void eventtype_expected (AST_Decl *d); + + // Report a situation where a valuetype used as a primary key for a + // component home does not inherit directly or indirectly from + // Components::primaryKeyBase. + void primary_key_error (AST_Decl *d); + // Report a situation where an enumerator was expected but we got // something else instead. This occurs when a union with an enum // discriminator is being parsed and one of the branch labels is diff --git a/TAO/TAO_IDL/include/utl_scope.h b/TAO/TAO_IDL/include/utl_scope.h index a40cc055387..d2eb0b1b982 100644 --- a/TAO/TAO_IDL/include/utl_scope.h +++ b/TAO/TAO_IDL/include/utl_scope.h @@ -95,6 +95,8 @@ class AST_Interface; class AST_InterfaceFwd; class AST_ValueType; class AST_ValueTypeFwd; +class AST_EventType; +class AST_EventTypeFwd; class AST_Component; class AST_ComponentFwd; class AST_Home; @@ -154,6 +156,10 @@ public: virtual AST_ValueTypeFwd *add_valuetype_fwd (AST_ValueTypeFwd *i); + virtual AST_EventType *add_eventtype (AST_EventType *i); + + virtual AST_EventTypeFwd *add_eventtype_fwd (AST_EventTypeFwd *i); + virtual AST_Component *add_component (AST_Component *i); virtual AST_ComponentFwd *add_component_fwd (AST_ComponentFwd *i); @@ -263,6 +269,14 @@ protected: // Additionally, UTL_Scope also maintains a record of what nodes // defined elsewhere were referenced in this scope. + // Replace old_decl with new_decl. + void replace_scope (AST_Decl *old_decl, + AST_Decl *new_decl); + + // Replace old_decl with new_decl. + void replace_referenced (AST_Decl *old_decl, + AST_Decl *new_decl); + // Add to referenced nodes set. // If ex is not 0 'e' will be inserted at the position // after ex, which is already in the list. @@ -274,14 +288,6 @@ protected: // Add to local types. Node represents a local manifest type. void add_to_local_types (AST_Decl *e); - // Replace old_decl with new_decl. - void replace_scope (AST_Decl *old_decl, - AST_Decl *new_decl); - - // Replace old_decl with new_decl. - void replace_referenced (AST_Decl *old_decl, - AST_Decl *new_decl); - // Has this node been referenced here already? idl_bool referenced (AST_Decl *e, Identifier *id = 0); @@ -355,6 +361,10 @@ private: virtual AST_ValueTypeFwd *fe_add_valuetype_fwd (AST_ValueTypeFwd *i); + virtual AST_EventType *fe_add_eventtype (AST_EventType *i); + + virtual AST_EventTypeFwd *fe_add_eventtype_fwd (AST_EventTypeFwd *i); + virtual AST_Component *fe_add_component (AST_Component *i); virtual AST_ComponentFwd *fe_add_component_fwd (AST_ComponentFwd *i); diff --git a/TAO/TAO_IDL/narrow/narrow.cpp b/TAO/TAO_IDL/narrow/narrow.cpp index 8d4529547d7..0421c880c58 100644 --- a/TAO/TAO_IDL/narrow/narrow.cpp +++ b/TAO/TAO_IDL/narrow/narrow.cpp @@ -67,6 +67,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_module.h" #include "ast_root.h" #include "ast_valuetype.h" +#include "ast_eventtype.h" #include "ast_component.h" #include "ast_home.h" #include "ast_operation.h" @@ -98,6 +99,8 @@ ScopeAsDecl (UTL_Scope *s) return AST_Interface::narrow_from_scope (s); case AST_Decl::NT_valuetype: return AST_ValueType::narrow_from_scope (s); + case AST_Decl::NT_eventtype: + return AST_EventType::narrow_from_scope (s); case AST_Decl::NT_component: return AST_Component::narrow_from_scope (s); case AST_Decl::NT_home: @@ -142,6 +145,8 @@ DeclAsScope (AST_Decl *d) return AST_Interface::narrow_from_decl (d); case AST_Decl::NT_valuetype: return AST_ValueType::narrow_from_decl (d); + case AST_Decl::NT_eventtype: + return AST_EventType::narrow_from_decl (d); case AST_Decl::NT_component: return AST_Component::narrow_from_decl (d); case AST_Decl::NT_home: diff --git a/TAO/TAO_IDL/tao_idl.cpp b/TAO/TAO_IDL/tao_idl.cpp index 6a524574b29..aed60c547db 100644 --- a/TAO/TAO_IDL/tao_idl.cpp +++ b/TAO/TAO_IDL/tao_idl.cpp @@ -73,6 +73,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_root.h" #include "ast_extern.h" #include "utl_string.h" +#include "utl_identifier.h" #include "drv_extern.h" #include "ace/Process.h" #include "../tao/Version.h" @@ -99,7 +100,7 @@ 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). AST_Generator * -BE_init (void) +BE_gen (void) { tao_cg = TAO_CODEGEN::instance (); @@ -111,6 +112,20 @@ BE_init (void) return g; } +void +BE_init (void) +{ + Identifier id ("void"); + UTL_ScopedName n (&id, + 0); + AST_Decl *d = + idl_global->scopes ().bottom ()->lookup_primitive_type ( + AST_Expression::EV_void + ); + be_global->void_type (AST_PredefinedType::narrow_from_decl (d)); + id.destroy (); +} + // Print out a version string for the BE. void BE_version (void) @@ -229,7 +244,7 @@ DRV_drive (const char *s) DRV_pre_proc (s); // Initialize BE. - AST_Generator *gen = BE_init (); + AST_Generator *gen = BE_gen (); if (gen == 0) { @@ -247,6 +262,8 @@ DRV_drive (const char *s) // Initialize FE. FE_init (); + // Initialize BE. + BE_init (); // Parse. if (idl_global->compile_flags () & IDL_CF_INFORMATIVE) diff --git a/TAO/TAO_IDL/util/utl_err.cpp b/TAO/TAO_IDL/util/utl_err.cpp index 804d025c1dd..02667ddcf08 100644 --- a/TAO/TAO_IDL/util/utl_err.cpp +++ b/TAO/TAO_IDL/util/utl_err.cpp @@ -148,14 +148,21 @@ error_string (UTL_Error::ErrorCode c) case UTL_Error::EIDL_SUPPORTS_FWD_ERROR: // More intelligible message printed by error routine. return ""; + case UTL_Error::EIDL_PRIMARY_KEY_ERROR: + // More intelligible message printed by error routine. + return ""; case UTL_Error::EIDL_CONSTANT_EXPECTED: return "constant expected: "; case UTL_Error::EIDL_INTERFACE_EXPECTED: return "interface expected: "; case UTL_Error::EIDL_VALUETYPE_EXPECTED: return "value type expected: "; + case UTL_Error::EIDL_CONCRETE_VT_EXPECTED: + return "concrete value type expected: "; case UTL_Error::EIDL_ABSTRACT_EXPECTED: return "abstract type expected: "; + case UTL_Error::EIDL_EVENTTYPE_EXPECTED: + return "event type expected: "; case UTL_Error::EIDL_EVAL_ERROR: return "expression evaluation error: "; case UTL_Error::EIDL_INCOMPATIBLE_TYPE: @@ -280,11 +287,11 @@ parse_state_to_error_message (IDL_GlobalData::ParseState ps) case IDL_GlobalData::PS_ValueTypeDeclSeen: return "Malformed value type declaration"; case IDL_GlobalData::PS_ComponentDeclSeen: - return "Malformed value type declaration"; + return "Malformed component declaration"; case IDL_GlobalData::PS_HomeDeclSeen: return "Malformed home declaration"; case IDL_GlobalData::PS_EventDeclSeen: - return "Malformed value type declaration"; + return "Malformed event type declaration"; case IDL_GlobalData::PS_ModuleDeclSeen: return "Malformed module declaration"; case IDL_GlobalData::PS_AttrDeclSeen: @@ -351,6 +358,18 @@ parse_state_to_error_message (IDL_GlobalData::ParseState ps) return "Illegal syntax following value type '}' closer"; case IDL_GlobalData::PS_ValueTypeBodySeen: return "Illegal syntax following value type body statement(s)"; + case IDL_GlobalData::PS_EventTypeSeen: + return "Missing interface identifier following EVENTTYPE keyword"; + case IDL_GlobalData::PS_EventTypeForwardSeen: + return "Missing ';' following forward event type declaration"; + case IDL_GlobalData::PS_EventTypeIDSeen: + return "Missing '{' or illegal syntax following event type identifier"; + case IDL_GlobalData::PS_EventTypeSqSeen: + return "Illegal syntax following event type '{' opener"; + case IDL_GlobalData::PS_EventTypeQsSeen: + return "Illegal syntax following event type '}' closer"; + case IDL_GlobalData::PS_EventTypeBodySeen: + return "Illegal syntax following event type body statement(s)"; case IDL_GlobalData::PS_ComponentSeen: return "Missing component identifier following COMPONENT keyword"; case IDL_GlobalData::PS_ComponentForwardSeen: @@ -526,6 +545,10 @@ parse_state_to_error_message (IDL_GlobalData::ParseState ps) return "Illegal syntax after operation parameter list"; case IDL_GlobalData::PS_OpRaiseCompleted: return "Illegal syntax after optional RAISES in operation declaration"; + case IDL_GlobalData::PS_OpGetRaiseCompleted: + return "Illegal syntax after optional GETRAISES in operation declaration"; + case IDL_GlobalData::PS_OpSetRaiseCompleted: + return "Illegal syntax after optional SETRAISES in operation declaration"; case IDL_GlobalData::PS_OpContextCompleted: return "Illegal syntax after optional CONTEXT in operation declaration"; case IDL_GlobalData::PS_OpCompleted: @@ -548,6 +571,18 @@ parse_state_to_error_message (IDL_GlobalData::ParseState ps) return "Illegal syntax after RAISES '(' opener"; case IDL_GlobalData::PS_OpRaiseQsSeen: return "Illegal syntax after RAISES ')' closer"; + case IDL_GlobalData::PS_OpGetRaiseSeen: + return "Illegal syntax or missing '(' after GETRAISES keyword"; + case IDL_GlobalData::PS_OpGetRaiseSqSeen: + return "Illegal syntax after GETRAISES '(' opener"; + case IDL_GlobalData::PS_OpGetRaiseQsSeen: + return "Illegal syntax after GETRAISES ')' closer"; + case IDL_GlobalData::PS_OpSetRaiseSeen: + return "Illegal syntax or missing '(' after SETRAISES keyword"; + case IDL_GlobalData::PS_OpSetRaiseSqSeen: + return "Illegal syntax after SETRAISES '(' opener"; + case IDL_GlobalData::PS_OpSetRaiseQsSeen: + return "Illegal syntax after SETRAISES ')' closer"; case IDL_GlobalData::PS_OpContextSeen: return "Illegal syntax or missing '(' after CONTEXT keyword"; case IDL_GlobalData::PS_OpContextSqSeen: @@ -955,8 +990,8 @@ void UTL_Error::interface_expected (AST_Decl *d) { idl_error_header (EIDL_INTERFACE_EXPECTED, - d->line (), - d->file_name ()); + idl_global->lineno (), + idl_global->filename ()); d->name ()->dump (*ACE_DEFAULT_LOG_STREAM); ACE_ERROR ((LM_ERROR, "\n")); @@ -970,8 +1005,23 @@ void UTL_Error::valuetype_expected (AST_Decl *d) { idl_error_header (EIDL_VALUETYPE_EXPECTED, - d->line (), - d->file_name ()); + idl_global->lineno (), + idl_global->filename ()); + d->name ()->dump (*ACE_DEFAULT_LOG_STREAM); + ACE_ERROR ((LM_ERROR, + "\n")); + idl_global->set_err_count (idl_global->err_count () + 1); +} + +// Report a situation where a concrete value type was expected but we got +// something else instead. This most likely is a case where a valuetype +// inherits from something other than a concrete valuetype. +void +UTL_Error::concrete_valuetype_expected (AST_Decl *d) +{ + idl_error_header (EIDL_CONCRETE_VT_EXPECTED, + idl_global->lineno (), + idl_global->filename ()); d->name ()->dump (*ACE_DEFAULT_LOG_STREAM); ACE_ERROR ((LM_ERROR, "\n")); @@ -986,14 +1036,47 @@ void UTL_Error::abstract_expected (AST_Decl *d) { idl_error_header (EIDL_ABSTRACT_EXPECTED, - d->line (), - d->file_name ()); + idl_global->lineno (), + idl_global->filename ()); d->name ()->dump (*ACE_DEFAULT_LOG_STREAM); ACE_ERROR ((LM_ERROR, "\n")); idl_global->set_err_count (idl_global->err_count () + 1); } +// Report a situation where an abstract type was expected but we got +// something else instead. This is the case in an inheritance +// list where a concrete type appears after an abstract type, or +// where a valuetype inherits more than one concrete valuetype. +void +UTL_Error::eventtype_expected (AST_Decl *d) +{ + idl_error_header (EIDL_EVENTTYPE_EXPECTED, + idl_global->lineno (), + idl_global->filename ()); + d->name ()->dump (*ACE_DEFAULT_LOG_STREAM); + ACE_ERROR ((LM_ERROR, + "\n")); + idl_global->set_err_count (idl_global->err_count () + 1); +} + +// Report a situation where a valuetype used as a primary key for a +// component home does not inherit directly or indirectly from +// Components::primaryKeyBase. +void +UTL_Error::primary_key_error (AST_Decl *d) +{ + idl_error_header (EIDL_PRIMARY_KEY_ERROR, + idl_global->lineno (), + idl_global->filename ()); + ACE_ERROR ((LM_ERROR, + "primary key ")); + d->name ()->dump (*ACE_DEFAULT_LOG_STREAM); + ACE_ERROR ((LM_ERROR, + "does not have Components::primaryKeyBase as an ancestor\n")); + idl_global->set_err_count (idl_global->err_count () + 1); +} + // Report a situation where an enumerator was expected but we // got something else. This may occur in a union with an enum // discriminator where a label did not evaluate to a constant diff --git a/TAO/TAO_IDL/util/utl_exceptlist.cpp b/TAO/TAO_IDL/util/utl_exceptlist.cpp index f92c1ccabbe..e3c1c6b2e7e 100644 --- a/TAO/TAO_IDL/util/utl_exceptlist.cpp +++ b/TAO/TAO_IDL/util/utl_exceptlist.cpp @@ -105,7 +105,7 @@ UTL_ExceptlistActiveIterator::item (void) { if (source == 0) { - return 0; + return 0; } return ((UTL_ExceptList *) source)->head (); diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index 61704b145fd..f5dbbcb5be8 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -112,8 +112,7 @@ IDL_GlobalData::IDL_GlobalData (void) gperf_path_ (0), temp_dir_ (0), ident_string_ (0), - obv_support_ (I_FALSE), - component_support_ (I_FALSE), + obv_support_ (I_TRUE), case_diff_error_ (I_TRUE), nest_orb_ (I_FALSE), idl_flags_ (""), @@ -800,18 +799,6 @@ IDL_GlobalData::obv_support (void) } void -IDL_GlobalData::component_support (idl_bool val) -{ - this->component_support_ = val; -} - -idl_bool -IDL_GlobalData::component_support (void) -{ - return this->component_support_; -} - -void IDL_GlobalData::case_diff_error (idl_bool val) { this->case_diff_error_ = val; diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp index 9f43e24fc0e..86378c4a8ea 100644 --- a/TAO/TAO_IDL/util/utl_scope.cpp +++ b/TAO/TAO_IDL/util/utl_scope.cpp @@ -71,6 +71,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "utl_string.h" #include "ast_valuetype.h" #include "ast_valuetype_fwd.h" +#include "ast_eventtype.h" +#include "ast_eventtype_fwd.h" #include "ast_component.h" #include "ast_component_fwd.h" #include "ast_home.h" @@ -504,6 +506,30 @@ UTL_Scope::add_valuetype_fwd (AST_ValueTypeFwd *i) return i; } +AST_EventType * +UTL_Scope::add_eventtype (AST_EventType *i) +{ + if (i == 0) + { + return 0; + } + + i->set_added (I_TRUE); + return i; +} + +AST_EventTypeFwd * +UTL_Scope::add_eventtype_fwd (AST_EventTypeFwd *i) +{ + if (i == 0) + { + return 0; + } + + i->set_added (I_TRUE); + return i; +} + AST_Component * UTL_Scope::add_component (AST_Component *i) { @@ -887,6 +913,18 @@ UTL_Scope::fe_add_valuetype_fwd (AST_ValueTypeFwd *) return 0; } +AST_EventType * +UTL_Scope::fe_add_eventtype (AST_EventType *) +{ + return 0; +} + +AST_EventTypeFwd * +UTL_Scope::fe_add_eventtype_fwd (AST_EventTypeFwd *) +{ + return 0; +} + AST_Component * UTL_Scope::fe_add_component (AST_Component *) { @@ -1444,6 +1482,11 @@ UTL_Scope::lookup_by_name_local (Identifier *e, { d = AST_InterfaceFwd::narrow_from_decl (d)->full_definition (); } + else if (nt == AST_Decl::NT_struct_fwd + || nt == AST_Decl::NT_union_fwd) + { + d = AST_StructureFwd::narrow_from_decl (d)->full_definition (); + } return d; } @@ -1550,7 +1593,9 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e, // We have to look in the inherited interfaces as well. // Look before parent scopes. if (pd_scope_node_type == AST_Decl::NT_interface - || pd_scope_node_type == AST_Decl::NT_valuetype) + || pd_scope_node_type == AST_Decl::NT_valuetype + || pd_scope_node_type == AST_Decl::NT_component + || pd_scope_node_type == AST_Decl::NT_eventtype) { d = look_in_inherited (e, treat_as_ref); |