diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-05-24 14:08:54 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-05-24 14:08:54 +0000 |
commit | 2ab3b7d13d12ea3675cf3cdc8b35a52de0b4533b (patch) | |
tree | 46f249d100005ae02ed6905be6c2c664f76ae0b4 | |
parent | cf555733b4d3bb275e5a81acea429526bbbe0a72 (diff) | |
download | ATCD-2ab3b7d13d12ea3675cf3cdc8b35a52de0b4533b.tar.gz |
ChangeLogTag: Fri May 24 09:04:38 2002 Jeff Parsons <parsons@cs.wustl.edu>
228 files changed, 6987 insertions, 4026 deletions
diff --git a/TAO/TAO_IDL/ast/ast_component.cpp b/TAO/TAO_IDL/ast/ast_component.cpp index 6a292c338f1..7662613f9cd 100644 --- a/TAO/TAO_IDL/ast/ast_component.cpp +++ b/TAO/TAO_IDL/ast/ast_component.cpp @@ -4,6 +4,7 @@ #include "ast_visitor.h" #include "utl_identifier.h" #include "utl_indenter.h" +#include "utl_err.h" #include "global_extern.h" ACE_RCSID (ast, @@ -43,6 +44,29 @@ AST_Component::~AST_Component (void) { } +void +AST_Component::redefine (AST_Interface *from) +{ + AST_Component *c = AST_Component::narrow_from_decl (from); + + if (c == 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_Interface::redefine (from); + + this->pd_base_component = c->pd_base_component; + this->pd_provides = c->pd_provides; + this->pd_uses = c->pd_uses; + this->pd_emits = c->pd_emits; + this->pd_publishes = c->pd_publishes; + this->pd_consumes = c->pd_consumes; +} + AST_Component * AST_Component::base_component (void) const { @@ -61,66 +85,36 @@ AST_Component::n_supports (void) const return this->n_inherits (); } -ACE_Unbounded_Queue<AST_Interface *> & +ACE_Unbounded_Queue<AST_Component::port_description> & AST_Component::provides (void) { return this->pd_provides; } -void -AST_Component::provides (AST_Interface *d) -{ - this->pd_provides.enqueue_tail (d); -} - -ACE_Unbounded_Queue<AST_Component::uses_description *> & +ACE_Unbounded_Queue<AST_Component::uses_description> & AST_Component::uses (void) { return this->pd_uses; } -void -AST_Component::uses (AST_Component::uses_description *d) -{ - this->pd_uses.enqueue_tail (d); -} - -ACE_Unbounded_Queue<AST_ValueType *> & +ACE_Unbounded_Queue<AST_Component::port_description> & AST_Component::emits (void) { return this->pd_emits; } -void -AST_Component::emits (AST_ValueType *d) -{ - this->pd_emits.enqueue_tail (d); -} - -ACE_Unbounded_Queue<AST_ValueType *> & +ACE_Unbounded_Queue<AST_Component::port_description> & AST_Component::publishes (void) { return this->pd_publishes; } -void -AST_Component::publishes (AST_ValueType *d) -{ - this->pd_publishes.enqueue_tail (d); -} - -ACE_Unbounded_Queue<AST_ValueType *> & +ACE_Unbounded_Queue<AST_Component::port_description> & AST_Component::consumes (void) { return this->pd_consumes; } -void -AST_Component::consumes (AST_ValueType *d) -{ - this->pd_consumes.enqueue_tail (d); -} - void AST_Component::destroy (void) { diff --git a/TAO/TAO_IDL/ast/ast_constant.cpp b/TAO/TAO_IDL/ast/ast_constant.cpp index 32871cedeb2..015da4b8657 100644 --- a/TAO/TAO_IDL/ast/ast_constant.cpp +++ b/TAO/TAO_IDL/ast/ast_constant.cpp @@ -75,6 +75,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "utl_identifier.h" #include "ast_visitor.h" #include "ast_generator.h" +#include "nr_extern.h" ACE_RCSID (ast, ast_constant, @@ -83,47 +84,41 @@ ACE_RCSID (ast, // Static functions. // Convert a value from the enum AST_Expression::ExprType to a char *. -static const char * -exprtype_to_string (AST_Expression::ExprType et) +const char * +AST_Constant::exprtype_to_string (AST_Expression::ExprType et) { switch (et) { case AST_Expression::EV_short: - return "short"; + return "Short"; case AST_Expression::EV_ushort: - return "unsigned short"; + return "UShort"; case AST_Expression::EV_long: - return "long"; + return "Long"; case AST_Expression::EV_ulong: - return "unsigned long"; + return "ULong"; case AST_Expression::EV_float: - return "float"; + return "Float"; case AST_Expression::EV_double: - return "double"; + return "Double"; case AST_Expression::EV_char: - return "char"; + return "Char"; case AST_Expression::EV_octet: - return "octet"; + return "Octet"; case AST_Expression::EV_bool: - return "boolean"; + return "Boolean"; case AST_Expression::EV_string: - return "string"; - case AST_Expression::EV_enum: - return "enum"; - case AST_Expression::EV_void: - return "void"; - case AST_Expression::EV_none: - return "none"; + return "Char*"; case AST_Expression::EV_ulonglong: - return "unsigned long long"; + return "ULongLong"; case AST_Expression::EV_longlong: - return "long long"; + return "LongLong"; case AST_Expression::EV_wchar: - return "wchar"; + return "Wchar"; case AST_Expression::EV_wstring: - return "wstring"; + return "Wchar*"; case AST_Expression::EV_longdouble: - return 0; + return "LongDouble"; } return 0; @@ -189,7 +184,7 @@ AST_Constant::~AST_Constant (void) void AST_Constant::dump (ACE_OSTREAM_TYPE &o) { - o << "const " << exprtype_to_string (this->pd_et) << " "; + o << "const " << this->exprtype_to_string () << " "; this->local_name ()->dump (o); @@ -241,6 +236,67 @@ AST_Constant::ifr_added (idl_bool val) this->ifr_added_ = val; } +const char * +AST_Constant::exprtype_to_string (void) +{ + switch (this->pd_et) + { + case AST_Expression::EV_short: + return "CORBA::Short"; + case AST_Expression::EV_ushort: + return "CORBA::UShort"; + case AST_Expression::EV_long: + return "CORBA::Long"; + case AST_Expression::EV_ulong: + return "CORBA::ULong"; + case AST_Expression::EV_float: + return "CORBA::Float"; + case AST_Expression::EV_double: + return "CORBA::Double"; + case AST_Expression::EV_char: + return "CORBA::Char"; + case AST_Expression::EV_octet: + return "CORBA::Octet"; + case AST_Expression::EV_bool: + return "CORBA::Boolean"; + case AST_Expression::EV_string: + return "char *const"; + case AST_Expression::EV_void: + return "void"; + case AST_Expression::EV_none: + return "none"; + case AST_Expression::EV_longlong: + return "CORBA::LongLong"; + case AST_Expression::EV_ulonglong: + return "CORBA::ULongLong"; + case AST_Expression::EV_wchar: + return "CORBA::WChar"; + case AST_Expression::EV_wstring: + return "CORBA::WChar *const"; + case AST_Expression::EV_longdouble: + case AST_Expression::EV_enum: + return 0; + } + + return 0; +} + +UTL_ScopedName * +AST_Constant::enum_full_name (void) +{ + if (this->pd_et == AST_Expression::EV_enum) + { + UTL_Scope *s = this->defined_in (); + AST_Decl *d = s->lookup_by_name (this->pd_constant_value->n (), + 1); + return (ScopeAsDecl (d->defined_in ()))->name (); + } + else + { + return 0; + } +} + // Narrowing methods. IMPL_NARROW_METHODS1(AST_Constant, AST_Decl) IMPL_NARROW_FROM_DECL(AST_Constant) diff --git a/TAO/TAO_IDL/ast/ast_decl.cpp b/TAO/TAO_IDL/ast/ast_decl.cpp index c9409ac9cdf..3bb4c54ff1f 100644 --- a/TAO/TAO_IDL/ast/ast_decl.cpp +++ b/TAO/TAO_IDL/ast/ast_decl.cpp @@ -127,7 +127,21 @@ AST_Decl::AST_Decl (void) prefix_ (0), version_ (0), anonymous_ (I_FALSE), - typeid_set_ (I_FALSE) + typeid_set_ (I_FALSE), + cli_hdr_gen_ (I_FALSE), + cli_stub_gen_ (I_FALSE), + cli_inline_gen_ (I_FALSE), + srv_hdr_gen_ (I_FALSE), + impl_hdr_gen_ (I_FALSE), + srv_skel_gen_ (I_FALSE), + impl_skel_gen_ (I_FALSE), + srv_inline_gen_ (I_FALSE), + cli_hdr_any_op_gen_ (I_FALSE), + cli_stub_any_op_gen_ (I_FALSE), + cli_hdr_cdr_op_gen_ (I_FALSE), + cli_stub_cdr_op_gen_ (I_FALSE), + cli_inline_cdr_op_gen_ (I_FALSE), + flat_name_ (0) { } @@ -151,7 +165,21 @@ AST_Decl::AST_Decl (NodeType nt, prefix_ (0), version_ (0), anonymous_ (anonymous), - typeid_set_ (I_FALSE) + typeid_set_ (I_FALSE), + cli_hdr_gen_ (I_FALSE), + cli_stub_gen_ (I_FALSE), + cli_inline_gen_ (I_FALSE), + srv_hdr_gen_ (I_FALSE), + impl_hdr_gen_ (I_FALSE), + srv_skel_gen_ (I_FALSE), + impl_skel_gen_ (I_FALSE), + srv_inline_gen_ (I_FALSE), + cli_hdr_any_op_gen_ (I_FALSE), + cli_stub_any_op_gen_ (I_FALSE), + cli_hdr_cdr_op_gen_ (I_FALSE), + cli_stub_cdr_op_gen_ (I_FALSE), + cli_inline_cdr_op_gen_ (I_FALSE), + flat_name_ (0) { this->compute_full_name (n); @@ -511,6 +539,104 @@ AST_Decl::compute_repoID (void) // Public operations. +const char * +AST_Decl::flat_name (void) +{ + if (!this->flat_name_) + { + this->compute_flat_name (); + } + + return this->flat_name_; +} + +// Compute stringified flattened fully scoped name. +void +AST_Decl::compute_flat_name (void) +{ + if (this->flat_name_ != 0) + { + return; + } + else + { + long namelen = 0; + long first = I_TRUE; + long second = I_FALSE; + char *item_name = 0; + + // In the first loop, compute the total length. + for (UTL_IdListActiveIterator i (this->name ()); + !i.is_done (); + i.next ()) + { + if (!first) + { + namelen += 1; // for "_" + } + else if (second) + { + first = second = I_FALSE; + } + + // Print the identifier. + item_name = i.item ()->get_string (); + namelen += ACE_OS::strlen (item_name); + + if (first) + { + if (ACE_OS::strcmp (item_name, "") != 0) + { + // Does not start with a "". + first = I_FALSE; + } + else + { + second = I_TRUE; + } + } + } + + ACE_NEW (this->flat_name_, + char[namelen + 1]); + + this->flat_name_[0] = '\0'; + first = I_TRUE; + second = I_FALSE; + + for (UTL_IdListActiveIterator j (this->name ()); + !j.is_done (); + j.next ()) + { + if (!first) + { + ACE_OS::strcat (this->flat_name_, "_"); + } + else if (second) + { + first = second = I_FALSE; + } + + // Print the identifier. + item_name = j.item ()->get_string (); + ACE_OS::strcat (this->flat_name_, item_name); + + if (first) + { + if (ACE_OS::strcmp (item_name, "") != 0) + { + // Does not start with a "". + first = I_FALSE; + } + else + { + second = I_TRUE; + } + } + } + } +} + // Return TRUE if one of my ancestor scopes is "s" // and FALSE otherwise. idl_bool @@ -550,6 +676,21 @@ AST_Decl::is_child (AST_Decl *s) return 0; // Not a child. } +idl_bool +AST_Decl::is_nested (void) +{ + AST_Decl *d = ScopeAsDecl (this->defined_in ()); + + // If we have an outermost scope and if that scope is not that of the Root, + // then we are defined at some nesting level. + if (d != 0 && d->node_type () != AST_Decl::NT_root) + { + return I_TRUE; + } + + return I_FALSE; +} + // Dump this AST_Decl to the ostream o. void AST_Decl::dump (ACE_OSTREAM_TYPE &o) @@ -599,6 +740,9 @@ AST_Decl::destroy (void) delete [] this->version_; this->version_ = 0; + + delete [] this->flat_name_; + this->flat_name_ = 0; } // Data accessors. @@ -994,6 +1138,18 @@ AST_Decl::local_name (void) return this->pd_local_name; } +void +AST_Decl::local_name (Identifier *id) +{ + if (this->pd_local_name != 0) + { + this->pd_local_name->destroy (); + } + + delete this->pd_local_name; + this->pd_local_name = id; +} + Identifier * AST_Decl::compute_local_name (const char *prefix, const char *suffix) @@ -1057,6 +1213,171 @@ AST_Decl::original_local_name (void) return this->pd_original_local_name; } +// Boolean methods to test if code was already generated. +idl_bool +AST_Decl::cli_hdr_gen (void) +{ + return this->cli_hdr_gen_; +} + +idl_bool +AST_Decl::cli_stub_gen (void) +{ + return this->cli_stub_gen_; +} + +idl_bool +AST_Decl::cli_hdr_any_op_gen (void) +{ + return this->cli_hdr_any_op_gen_; +} + +idl_bool +AST_Decl::cli_stub_any_op_gen (void) +{ + return this->cli_stub_any_op_gen_; +} + +idl_bool +AST_Decl::cli_hdr_cdr_op_gen (void) +{ + return this->cli_hdr_cdr_op_gen_; +} + +idl_bool +AST_Decl::cli_stub_cdr_op_gen (void) +{ + return this->cli_stub_cdr_op_gen_; +} + +idl_bool +AST_Decl::cli_inline_cdr_op_gen (void) +{ + return this->cli_inline_cdr_op_gen_; +} + +idl_bool +AST_Decl::cli_inline_cdr_decl_gen (void) +{ + return this->cli_inline_cdr_decl_gen_; +} + +idl_bool +AST_Decl::cli_inline_gen (void) +{ + return this->cli_inline_gen_; +} + +idl_bool +AST_Decl::srv_hdr_gen (void) +{ + return this->srv_hdr_gen_; +} + +idl_bool +AST_Decl::impl_hdr_gen (void) +{ + return this->impl_hdr_gen_; +} + +idl_bool +AST_Decl::srv_skel_gen (void) +{ + return this->srv_skel_gen_; +} + +idl_bool +AST_Decl::impl_skel_gen (void) +{ + return this->impl_skel_gen_; +} + +idl_bool +AST_Decl::srv_inline_gen (void) +{ + return this->srv_inline_gen_; +} + +// Set the flag indicating that code generation is done. +void +AST_Decl::cli_hdr_gen (idl_bool val) +{ + this->cli_hdr_gen_ = val; +} + +void +AST_Decl::cli_stub_gen (idl_bool val) +{ + this->cli_stub_gen_ = val; +} + +void +AST_Decl::cli_hdr_any_op_gen (idl_bool val) +{ + this->cli_hdr_any_op_gen_ = val; +} + +void +AST_Decl::cli_stub_any_op_gen (idl_bool val) +{ + this->cli_stub_any_op_gen_ = val; +} + +void +AST_Decl::cli_hdr_cdr_op_gen (idl_bool val) +{ + this->cli_hdr_cdr_op_gen_ = val; +} + +void +AST_Decl::cli_stub_cdr_op_gen (idl_bool val) +{ + this->cli_stub_cdr_op_gen_ = val; +} + +void +AST_Decl::cli_inline_cdr_op_gen (idl_bool val) +{ + this->cli_inline_cdr_op_gen_ = val; +} + +void +AST_Decl::cli_inline_cdr_decl_gen (idl_bool val) +{ + this->cli_inline_cdr_decl_gen_ = val; +} + +void +AST_Decl::cli_inline_gen (idl_bool val) +{ + this->cli_inline_gen_ = val; +} + +void +AST_Decl::srv_hdr_gen (idl_bool val) +{ + this->srv_hdr_gen_ = val; +} + +void +AST_Decl::impl_hdr_gen (idl_bool val) +{ + this->impl_hdr_gen_ = val; +} + + +void +AST_Decl::srv_skel_gen (idl_bool val) +{ + this->srv_skel_gen_ = val; +} + +void +AST_Decl::srv_inline_gen (idl_bool val) +{ + this->srv_inline_gen_ = val; +} + //Narrowing methods for AST_Decl. IMPL_NARROW_METHODS0(AST_Decl) IMPL_NARROW_FROM_DECL(AST_Decl) diff --git a/TAO/TAO_IDL/ast/ast_generator.cpp b/TAO/TAO_IDL/ast/ast_generator.cpp index f61a4f9f4d6..0c6b6318db1 100644 --- a/TAO/TAO_IDL/ast/ast_generator.cpp +++ b/TAO/TAO_IDL/ast/ast_generator.cpp @@ -350,14 +350,22 @@ AST_Home * AST_Generator::create_home (UTL_ScopedName *n, AST_Home *base_home, AST_Component *managed_component, - AST_ValueType *primary_key) + AST_ValueType *primary_key, + AST_Interface **supports, + long n_supports, + AST_Interface **supports_flat, + long n_supports_flat) { AST_Home *retval = 0; ACE_NEW_RETURN (retval, AST_Home (n, base_home, managed_component, - primary_key), + primary_key, + supports, + n_supports, + supports_flat, + n_supports_flat), 0); return retval; diff --git a/TAO/TAO_IDL/ast/ast_home.cpp b/TAO/TAO_IDL/ast/ast_home.cpp index 69a44d98bf3..32cc57b1b88 100644 --- a/TAO/TAO_IDL/ast/ast_home.cpp +++ b/TAO/TAO_IDL/ast/ast_home.cpp @@ -22,20 +22,24 @@ AST_Home::AST_Home (void) AST_Home::AST_Home (UTL_ScopedName *n, AST_Home *base_home, AST_Component *managed_component, - AST_ValueType *primary_key) + AST_ValueType *primary_key, + AST_Interface **supports, + long n_supports, + AST_Interface **supports_flat, + long n_supports_flat) : AST_Interface (n, - 0, - 0, - 0, - 0, - I_TRUE, + supports, + n_supports, + supports_flat, + n_supports_flat, + I_FALSE, I_FALSE), AST_Type (AST_Decl::NT_home, n), AST_Decl (AST_Decl::NT_home, n), UTL_Scope (AST_Decl::NT_home), - COMMON_Base (I_TRUE, + COMMON_Base (I_FALSE, I_FALSE), pd_base_home (base_home), pd_managed_component (managed_component), @@ -71,24 +75,12 @@ AST_Home::factories (void) return this->pd_factories; } -void -AST_Home::factories (AST_Operation *d) -{ - this->pd_factories.enqueue_tail (d); -} - ACE_Unbounded_Queue<AST_Operation *> & AST_Home::finders (void) { return this->pd_finders; } -void -AST_Home::finders (AST_Operation *d) -{ - this->pd_finders.enqueue_tail (d); -} - void AST_Home::destroy (void) { diff --git a/TAO/TAO_IDL/ast/ast_interface.cpp b/TAO/TAO_IDL/ast/ast_interface.cpp index e060355f1d4..d0fb961db53 100644 --- a/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/TAO/TAO_IDL/ast/ast_interface.cpp @@ -404,6 +404,17 @@ AST_Interface::fe_add_operation (AST_Operation *t) return 0; } } + else if ((d = this->look_in_inherited (t->name (), I_FALSE)) != 0) + { + if (d->node_type () == AST_Decl::NT_op) + { + idl_global->err ()->error3 (UTL_Error::EIDL_REDEF, + t, + this, + d); + return 0; + } + } // Add it to scope. this->add_to_scope (t); @@ -994,7 +1005,7 @@ AST_Interface::dump (ACE_OSTREAM_TYPE &o) o << "}"; } -// This serves for both interfaces and valuetypes. +// This serves for both interfaces, valuetypes and components. void AST_Interface::fwd_redefinition_helper (AST_Interface *&i, UTL_Scope *s) @@ -1028,7 +1039,8 @@ AST_Interface::fwd_redefinition_helper (AST_Interface *&i, // of the module it's defined in, the lookup will find the // forward declaration. if (nt == AST_Decl::NT_interface_fwd - || nt == AST_Decl::NT_valuetype_fwd) + || nt == AST_Decl::NT_valuetype_fwd + || nt == AST_Decl::NT_component_fwd) { AST_InterfaceFwd *fwd_def = AST_InterfaceFwd::narrow_from_decl (d); @@ -1037,7 +1049,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_valuetype + || nt == AST_Decl::NT_component) { fd = AST_Interface::narrow_from_decl (d); } @@ -1283,6 +1296,60 @@ AST_Interface::inherited_name_clash (void) } // end of FOR (i ...) } +AST_Decl * +AST_Interface::lookup_for_add (AST_Decl *d, + idl_bool trea_as_ref) +{ + if (d == 0) + { + return 0; + } + + Identifier *id = d->local_name (); + AST_Decl *prev = 0; + AST_Decl::NodeType nt = NT_root; + long nis = -1; + AST_Interface **is = 0; + + if (this->idl_keyword_clash (id) != 0) + { + return 0; + } + + prev = this->lookup_by_name_local (id, + 0); + + if (prev != 0) + { + nt = prev->node_type (); + + if (nt == AST_Decl::NT_op || nt == AST_Decl::NT_attr) + { + return prev; + } + } + + for (nis = this->n_inherits_flat (), is = this->inherits_flat (); + nis > 0; + nis--, is++) + { + prev = (*is)->lookup_by_name_local (id, + 0); + + if (prev != 0) + { + nt = prev->node_type (); + + if (nt == AST_Decl::NT_op || nt == AST_Decl::NT_attr) + { + return prev; + } + } + } + + return 0; +} + void AST_Interface::destroy (void) { diff --git a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp index 3163ac7ee9f..0b2fbb75a67 100644 --- a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp @@ -171,9 +171,9 @@ AST_InterfaceFwd::is_defined (void) void AST_InterfaceFwd::destroy (void) { - this->pd_full_definition->destroy (); - delete this->pd_full_definition; - this->pd_full_definition = 0; +// this->pd_full_definition->destroy (); +// delete this->pd_full_definition; +// this->pd_full_definition = 0; } // Narrowing methods. diff --git a/TAO/TAO_IDL/ast/ast_operation.cpp b/TAO/TAO_IDL/ast/ast_operation.cpp index 995046a350f..723088fbd17 100644 --- a/TAO/TAO_IDL/ast/ast_operation.cpp +++ b/TAO/TAO_IDL/ast/ast_operation.cpp @@ -147,6 +147,23 @@ AST_Operation::~AST_Operation (void) // Public operations. +int +AST_Operation::void_return_type (void) +{ + AST_Type* type = this->return_type (); + + if (type->node_type () == AST_Decl::NT_pre_defined + && (AST_PredefinedType::narrow_from_decl (type)->pt () + == AST_PredefinedType::PT_void)) + { + return 1; + } + else + { + return 0; + } +} + // Return the member count. int AST_Operation::argument_count (void) @@ -271,6 +288,16 @@ AST_Operation::be_add_exceptions (UTL_ExceptList *t) return this->pd_exceptions; } +AST_Argument * +AST_Operation::be_add_argument (AST_Argument *arg) +{ + this->add_to_scope (arg); + this->add_to_referenced (arg, + 0, + 0); + return arg; +} + // 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 diff --git a/TAO/TAO_IDL/ast/ast_predefined_type.cpp b/TAO/TAO_IDL/ast/ast_predefined_type.cpp index ad0c50ed7b7..d53ee4bddfd 100644 --- a/TAO/TAO_IDL/ast/ast_predefined_type.cpp +++ b/TAO/TAO_IDL/ast/ast_predefined_type.cpp @@ -74,6 +74,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_predefined_type.h" #include "ast_visitor.h" #include "utl_identifier.h" +#include "global_extern.h" #include "ace/Log_Msg.h" ACE_RCSID (ast, @@ -108,12 +109,11 @@ AST_PredefinedType::AST_PredefinedType (PredefinedType t, } else { - Identifier *corba_id = 0; - ACE_NEW (corba_id, - Identifier ("CORBA")); + ACE_NEW (id, + Identifier (idl_global->nest_orb () ? "NORB" : "CORBA")); ACE_NEW (new_name, - UTL_ScopedName (corba_id, + UTL_ScopedName (id, 0)); UTL_ScopedName *conc_name = 0; diff --git a/TAO/TAO_IDL/ast/ast_root.cpp b/TAO/TAO_IDL/ast/ast_root.cpp index eaaf3f0ee3f..86daa23670d 100644 --- a/TAO/TAO_IDL/ast/ast_root.cpp +++ b/TAO/TAO_IDL/ast/ast_root.cpp @@ -85,9 +85,10 @@ AST_Root::AST_Root (void) } AST_Root::AST_Root (UTL_ScopedName *n) - : AST_Decl (AST_Decl::NT_module, + : AST_Module (n), + AST_Decl (AST_Decl::NT_root, n), - UTL_Scope (AST_Decl::NT_module) + UTL_Scope (AST_Decl::NT_root) { } diff --git a/TAO/TAO_IDL/ast/ast_type.cpp b/TAO/TAO_IDL/ast/ast_type.cpp index a7a1d7eee77..a9014341a49 100644 --- a/TAO/TAO_IDL/ast/ast_type.cpp +++ b/TAO/TAO_IDL/ast/ast_type.cpp @@ -69,6 +69,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_type.h" #include "ast_visitor.h" +#include "utl_identifier.h" +#include "idl_defines.h" +#include "nr_extern.h" #include "ace/Log_Msg.h" ACE_RCSID (ast, @@ -79,7 +82,8 @@ AST_Type::AST_Type (void) : ifr_added_ (0), ifr_fwd_added_ (0), size_type_ (AST_Type::SIZE_UNKNOWN), - has_constructor_ (0) + has_constructor_ (0), + nested_type_name_ (0) { } @@ -90,7 +94,8 @@ AST_Type::AST_Type (AST_Decl::NodeType nt, ifr_added_ (0), ifr_fwd_added_ (0), size_type_ (AST_Type::SIZE_UNKNOWN), - has_constructor_ (0) + has_constructor_ (0), + nested_type_name_ (0) { } @@ -198,6 +203,298 @@ AST_Type::has_constructor (idl_bool value) } } +// This code works. However, whether we should generate the +// ACE_NESTED_CLASS macro or not should be based on an option to the +// compiler. The previous version generated a relative path. +// This version always generates ACE_NESTED_CLASS, (leave ace/ACE.h and friends +// do the porting) +// +// Caution: returns the same buffer pointer even if the contents may change +// in the next call. (return std::string anyone?) +// +// Return the type name using the ACE_NESTED_CLASS macro + +const char * +AST_Type::nested_type_name (AST_Decl *use_scope, + const char *suffix, + const char *prefix) +{ + return this->nested_name (this->local_name ()->get_string (), + this->full_name (), + use_scope, + suffix, + prefix); +} + +// This is the real thing used by the method above. +const char * +AST_Type::nested_name (const char* local_name, + const char* full_name, + AST_Decl *use_scope, + const char *suffix, + const char *prefix) +{ + // Some compilers do not like generating a fully scoped name for a type that + // was defined in the same enclosing scope in which it was defined. For such, + // we emit a macro defined in the ACE library. + // + + // The tricky part here is that it is not enough to check if the + // typename we are using was defined in the current scope. But we + // need to ensure that it was not defined in any of our ancestor + // scopes as well. If that is the case, then we can generate a fully + // scoped name for that type, else we use the ACE_NESTED_CLASS macro. + + // Thus we need some sort of relative name to be generated. + + if (this->nested_type_name_ == 0) + { + ACE_NEW_RETURN (this->nested_type_name_, + char[NAMEBUFSIZE], + 0); + } + + // Our defining scope. + AST_Decl *def_scope = 0; + + // Hold the fully scoped name. + char def_name [NAMEBUFSIZE]; + char use_name [NAMEBUFSIZE]; + + // These point to the prev, curr and next component in the scope. + char *def_curr = def_name; + char *def_next = 0; + char *use_curr = use_name; + char *use_next = 0; + + // How many chars to compare. + int len_to_match = 0; + + // Initialize the buffers. + ACE_OS::memset (this->nested_type_name_, + '\0', + NAMEBUFSIZE); + + ACE_OS::memset (def_name, + '\0', + NAMEBUFSIZE); + + ACE_OS::memset (use_name, + '\0', + NAMEBUFSIZE); + + // Traverse every component of the def_scope and use_scope beginning at the + // root and proceeding towards the leaf trying to see if the components + // match. Continue until there is a match and keep accumulating the path + // traversed. This forms the first argument to the ACE_NESTED_CLASS + // macro. Whenever there is no match, the remaining components of the + // def_scope form the second argument. + + UTL_Scope *s = this->defined_in (); + + def_scope = s ? ScopeAsDecl (s) : 0; + + if (def_scope + && def_scope->node_type () != AST_Decl::NT_root + && use_scope) + // If both scopes exist and that we are not in the root scope. + { + ACE_OS::strcpy (def_name, + def_scope->full_name ()); + + ACE_OS::strcpy (use_name, + use_scope->full_name ()); + + // Find the first occurrence of a :: and advance + // the next pointers accordingly. + def_next = ACE_OS::strstr (def_curr, "::"); + use_next = ACE_OS::strstr (use_curr, "::"); + + // If the scopes are identical, don't supply them. + if (ACE_OS::strcmp (def_name, + use_name) + == 0) + { + if (prefix != 0) + { + ACE_OS::strcat (this->nested_type_name_, + prefix); + } + + ACE_OS::strcat (this->nested_type_name_, + local_name); + if (suffix != 0) + { + ACE_OS::strcat (this->nested_type_name_, + suffix); + } + + return this->nested_type_name_; + } + + if (def_next != 0) + { + len_to_match = + ACE_OS::strlen (def_curr) - ACE_OS::strlen (def_next); + } + else + { + len_to_match = ACE_OS::strlen (def_curr); + } + + if (use_next != 0) + { + int len = + ACE_OS::strlen (use_curr) - ACE_OS::strlen (use_next); + + if (len > len_to_match) + { + len_to_match = len; + } + } + else + { + int len = ACE_OS::strlen (use_curr); + + if (len > len_to_match) + { + len_to_match = len; + } + } + + if (ACE_OS::strncmp (def_curr, + use_curr, + len_to_match) + == 0) + { + // Initial prefix matches i.e., they have a common root. + // Start by initializing the macro. + ACE_OS::sprintf (this->nested_type_name_, + "ACE_NESTED_CLASS ("); + + // Initialize the first argument. + ACE_OS::strncat (this->nested_type_name_, + def_curr, + len_to_match); + + // Shift the current scopes to the next level. + def_curr = (def_next ? (def_next + 2) : 0); // Skip the :: + use_curr = (use_next ? (use_next + 2) : 0); // Skip the :: + + while (def_curr && use_curr) + { + // Find the first occurrence of a :: and advance the + // next pointers accordingly. + def_next = ACE_OS::strstr (def_curr, "::"); + use_next = ACE_OS::strstr (use_curr, "::"); + + if (def_next != 0) + { + len_to_match = + ACE_OS::strlen (def_curr) - ACE_OS::strlen (def_next); + } + else + { + len_to_match = ACE_OS::strlen (def_curr); + } + + if (use_next != 0) + { + int len = + ACE_OS::strlen (use_curr) - ACE_OS::strlen (use_next); + + if (len > len_to_match) + { + len_to_match = len; + } + } + else + { + int len = ACE_OS::strlen (use_curr); + + if (len > len_to_match) + { + len_to_match = len; + } + } + + if (ACE_OS::strncmp (def_curr, + use_curr, + len_to_match) + == 0) + { + // They have same prefix, append to arg1. + ACE_OS::strcat (this->nested_type_name_, + "::"); + + ACE_OS::strncat (this->nested_type_name_, + def_curr, + len_to_match); + + def_curr = (def_next ? (def_next + 2) : 0); // Skip the :: + use_curr = (use_next ? (use_next + 2) : 0); // Skip the :: + } + else + { + // No match. This is the end of the first argument. Get out + // of the loop as no more comparisons are necessary. + break; + } + } + + // Start the 2nd argument of the macro. + ACE_OS::strcat (this->nested_type_name_, ", "); + + // Copy the remaining def_name (if any are left). + if (def_curr != 0) + { + ACE_OS::strcat (this->nested_type_name_, + def_curr); + + ACE_OS::strcat (this->nested_type_name_, + "::"); + } + + // Append our local name. + if (prefix != 0) + { + ACE_OS::strcat (this->nested_type_name_, prefix); + } + + ACE_OS::strcat (this->nested_type_name_, + local_name); + + if (suffix != 0) + { + ACE_OS::strcat (this->nested_type_name_, + suffix); + } + + ACE_OS::strcat (this->nested_type_name_, + ")"); + + return this->nested_type_name_; + } // End of if the root prefixes match. + } + + // Otherwise just emit our full_name. + if (prefix != 0) + { + ACE_OS::strcat (this->nested_type_name_, prefix); + } + + ACE_OS::strcat (this->nested_type_name_, + full_name); + + if (suffix != 0) + { + ACE_OS::strcat (this->nested_type_name_, + suffix); + } + + return this->nested_type_name_; +} + int AST_Type::ast_accept (ast_visitor *visitor) { diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp index 51839a4b06e..89147b5999e 100644 --- a/TAO/TAO_IDL/be/be_array.cpp +++ b/TAO/TAO_IDL/be/be_array.cpp @@ -25,6 +25,7 @@ #include "be_helper.h" #include "be_visitor.h" #include "utl_identifier.h" +#include "idl_defines.h" ACE_RCSID (be, be_array, @@ -169,7 +170,7 @@ be_array::gen_dimensions (TAO_OutStream *os, AST_Expression *expr = this->dims ()[i]; // Dimension value. - if ((expr == NULL) || ((expr != NULL) && (expr->ev () == 0))) + if ((expr == 0) || ((expr != 0) && (expr->ev () == 0))) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_array::" diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index 11afca07a2a..7100402a37f 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -23,6 +23,7 @@ #include "be_extern.h" #include "global_extern.h" #include "utl_string.h" +#include "idl_defines.h" ACE_RCSID (be, be_codegen, @@ -146,6 +147,10 @@ TAO_CodeGen::start_client_header (const char *fname) } else { + *this->client_header_ << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Generate the #ident string, if any. this->gen_ident_string (this->client_header_); @@ -306,6 +311,10 @@ TAO_CodeGen::start_client_stubs (const char *fname) return -1; } + *this->client_stubs_ << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Generate the ident string, if any. this->gen_ident_string (this->client_stubs_); @@ -420,6 +429,10 @@ TAO_CodeGen::start_server_header (const char *fname) } else { + *this->server_header_ << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Generate the ident string, if any. this->gen_ident_string (this->server_header_); @@ -579,6 +592,11 @@ TAO_CodeGen::start_server_template_header (const char *fname) } else { + *this->server_template_header_ << be_nl << "// TAO_IDL - Generated from" + << be_nl + << "// " << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Generate the ident string, if any. this->gen_ident_string (this->server_template_header_); @@ -641,6 +659,10 @@ TAO_CodeGen::start_server_skeletons (const char *fname) return -1; } + *this->server_skeletons_ << be_nl << "// TAO_IDL - Generated from " + << be_nl << "// " << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Generate the ident string, if any. this->gen_ident_string (this->server_skeletons_); @@ -743,6 +765,11 @@ TAO_CodeGen::start_server_template_skeletons (const char *fname) } else { + *this->server_template_skeletons_ << be_nl << "// TAO_IDL - Generated from " + << be_nl << "// " + << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Generate the ident string, if any. this->gen_ident_string (this->server_template_skeletons_); @@ -876,6 +903,11 @@ TAO_CodeGen::start_implementation_header (const char *fname) } else { + *this->implementation_header_ << be_nl << "// TAO_IDL - Generated from " + << be_nl << "// " + << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Generate the ident string, if any. this->gen_ident_string (this->implementation_header_); @@ -934,6 +966,11 @@ TAO_CodeGen::start_implementation_skeleton (const char *fname) } else { + *this->implementation_skeleton_ << be_nl << "// TAO_IDL - Generated from " + << be_nl << "// " + << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Generate the ident string, if any. this->gen_ident_string (this->implementation_skeleton_); @@ -961,6 +998,10 @@ TAO_CodeGen::end_client_header (void) { // Generate the <<= and >>= operators here. + *this->client_header_ << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ + << be_nl; + // Insert the code to include the inline file. *this->client_header_ << "\n#if defined (__ACE_INLINE__)\n"; *this->client_header_ << "#include \"" @@ -993,6 +1034,10 @@ TAO_CodeGen::end_client_header (void) int TAO_CodeGen::end_server_header (void) { + *this->server_header_ << be_nl << "// TAO_IDL - Generated from " + << be_nl << "// " << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Insert the template header. if (be_global->gen_tie_classes ()) { @@ -1085,6 +1130,11 @@ 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 " + << be_nl << "// " + << __FILE__ << ":" << __LINE__ + << be_nl << be_nl; + // Insert the code to include the inline file. *this->server_template_header_ << "\n#if defined (__ACE_INLINE__)\n"; *this->server_template_header_ @@ -1301,3 +1351,4 @@ TAO_CodeGen::gen_standard_include (TAO_OutStream *stream, << included_file << end_delimiter << "\n"; } + diff --git a/TAO/TAO_IDL/be/be_constant.cpp b/TAO/TAO_IDL/be/be_constant.cpp index f7f391fe9fd..ef6b810c35e 100644 --- a/TAO/TAO_IDL/be/be_constant.cpp +++ b/TAO/TAO_IDL/be/be_constant.cpp @@ -43,67 +43,6 @@ be_constant::be_constant (AST_Expression::ExprType et, { } -const char * -be_constant::exprtype_to_string (void) -{ - switch (this->pd_et) - { - case AST_Expression::EV_short: - return "CORBA::Short"; - case AST_Expression::EV_ushort: - return "CORBA::UShort"; - case AST_Expression::EV_long: - return "CORBA::Long"; - case AST_Expression::EV_ulong: - return "CORBA::ULong"; - case AST_Expression::EV_float: - return "CORBA::Float"; - case AST_Expression::EV_double: - return "CORBA::Double"; - case AST_Expression::EV_char: - return "CORBA::Char"; - case AST_Expression::EV_octet: - return "CORBA::Octet"; - case AST_Expression::EV_bool: - return "CORBA::Boolean"; - case AST_Expression::EV_string: - return "char *const"; - case AST_Expression::EV_void: - return "void"; - case AST_Expression::EV_none: - return "none"; - case AST_Expression::EV_longlong: - return "CORBA::LongLong"; - case AST_Expression::EV_ulonglong: - return "CORBA::ULongLong"; - case AST_Expression::EV_wchar: - return "CORBA::WChar"; - case AST_Expression::EV_wstring: - return "CORBA::WChar *const"; - case AST_Expression::EV_longdouble: - case AST_Expression::EV_enum: - return 0; - } - - return 0; -} - -UTL_ScopedName * -be_constant::enum_full_name (void) -{ - if (this->pd_et == AST_Expression::EV_enum) - { - UTL_Scope *s = this->defined_in (); - AST_Decl *d = s->lookup_by_name (this->pd_constant_value->n (), - 1); - return (ScopeAsDecl (d->defined_in ()))->name (); - } - else - { - return 0; - } -} - int be_constant::accept (be_visitor *visitor) { diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index 11424e5f491..4dbeb42a225 100644 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ b/TAO/TAO_IDL/be/be_decl.cpp @@ -41,21 +41,6 @@ ACE_RCSID (be, // Default Constructor be_decl::be_decl (void) - : cli_hdr_gen_ (I_FALSE), - cli_stub_gen_ (I_FALSE), - cli_inline_gen_ (I_FALSE), - srv_hdr_gen_ (I_FALSE), - impl_hdr_gen_ (I_FALSE), - srv_skel_gen_ (I_FALSE), - impl_skel_gen_ (I_FALSE), - srv_inline_gen_ (I_FALSE), - cli_hdr_any_op_gen_ (I_FALSE), - cli_stub_any_op_gen_ (I_FALSE), - cli_hdr_cdr_op_gen_ (I_FALSE), - cli_stub_cdr_op_gen_ (I_FALSE), - cli_inline_cdr_op_gen_ (I_FALSE), - cli_inline_cdr_decl_gen_ (I_FALSE), - flat_name_ (0) { } @@ -63,21 +48,7 @@ be_decl::be_decl (void) be_decl::be_decl (AST_Decl::NodeType type, UTL_ScopedName *n) : AST_Decl (type, - n), - cli_hdr_gen_ (I_FALSE), - cli_stub_gen_ (I_FALSE), - cli_inline_gen_ (I_FALSE), - srv_hdr_gen_ (I_FALSE), - impl_hdr_gen_ (I_FALSE), - srv_skel_gen_ (I_FALSE), - impl_skel_gen_ (I_FALSE), - srv_inline_gen_ (I_FALSE), - cli_hdr_any_op_gen_ (I_FALSE), - cli_stub_any_op_gen_ (I_FALSE), - cli_hdr_cdr_op_gen_ (I_FALSE), - cli_stub_cdr_op_gen_ (I_FALSE), - cli_inline_cdr_op_gen_ (I_FALSE), - flat_name_ (0) + n) { } @@ -145,106 +116,6 @@ be_decl::compute_full_name (const char *prefix, name = result_str.rep (); } - -const char* -be_decl::flat_name (void) -{ - if (!this->flat_name_) - { - this->compute_flat_name (); - } - - return this->flat_name_; -} - - -// Compute stringified flattened fully scoped name. -void -be_decl::compute_flat_name (void) -{ - if (this->flat_name_ != 0) - { - return; - } - else - { - long namelen = 0; - long first = I_TRUE; - long second = I_FALSE; - char *item_name = 0; - - // In the first loop, compute the total length. - for (UTL_IdListActiveIterator i (this->name ()); - !i.is_done (); - i.next ()) - { - if (!first) - { - namelen += 1; // for "_" - } - else if (second) - { - first = second = I_FALSE; - } - - // Print the identifier. - item_name = i.item ()->get_string (); - namelen += ACE_OS::strlen (item_name); - - if (first) - { - if (ACE_OS::strcmp (item_name, "") != 0) - { - // Does not start with a "". - first = I_FALSE; - } - else - { - second = I_TRUE; - } - } - } - - ACE_NEW (this->flat_name_, - char[namelen + 1]); - - this->flat_name_[0] = '\0'; - first = I_TRUE; - second = I_FALSE; - - for (UTL_IdListActiveIterator j (this->name ()); - !j.is_done (); - j.next ()) - { - if (!first) - { - ACE_OS::strcat (this->flat_name_, "_"); - } - else if (second) - { - first = second = I_FALSE; - } - - // Print the identifier. - item_name = j.item ()->get_string (); - ACE_OS::strcat (this->flat_name_, item_name); - - if (first) - { - if (ACE_OS::strcmp (item_name, "") != 0) - { - // Does not start with a "". - first = I_FALSE; - } - else - { - second = I_TRUE; - } - } - } - } -} - void be_decl::compute_flat_name (const char *prefix, const char *suffix, @@ -310,32 +181,9 @@ be_decl::compute_flat_name (const char *prefix, void be_decl::destroy (void) { - if (this->flat_name_ != 0) - { - delete [] this->flat_name_; - this->flat_name_ = 0; - } - this->AST_Decl::destroy (); } -idl_bool -be_decl::is_nested (void) -{ - be_decl *d; - - d = be_scope::narrow_from_scope (this->defined_in ())->decl (); - - // If we have an outermost scope and if that scope is not that of the Root, - // then we are defined at some nesting level. - if (d != 0 && d->node_type () != AST_Decl::NT_root) - { - return I_TRUE; - } - - return I_FALSE; -} - // Return the scope created by this node (if one exists, else NULL). be_scope * be_decl::scope (void) @@ -377,171 +225,6 @@ be_decl::scope (void) } } -// Boolean methods to test if code was already generated. -idl_bool -be_decl::cli_hdr_gen (void) -{ - return this->cli_hdr_gen_; -} - -idl_bool -be_decl::cli_stub_gen (void) -{ - return this->cli_stub_gen_; -} - -idl_bool -be_decl::cli_hdr_any_op_gen (void) -{ - return this->cli_hdr_any_op_gen_; -} - -idl_bool -be_decl::cli_stub_any_op_gen (void) -{ - return this->cli_stub_any_op_gen_; -} - -idl_bool -be_decl::cli_hdr_cdr_op_gen (void) -{ - return this->cli_hdr_cdr_op_gen_; -} - -idl_bool -be_decl::cli_stub_cdr_op_gen (void) -{ - return this->cli_stub_cdr_op_gen_; -} - -idl_bool -be_decl::cli_inline_cdr_op_gen (void) -{ - return this->cli_inline_cdr_op_gen_; -} - -idl_bool -be_decl::cli_inline_cdr_decl_gen (void) -{ - return this->cli_inline_cdr_decl_gen_; -} - -idl_bool -be_decl::cli_inline_gen (void) -{ - return this->cli_inline_gen_; -} - -idl_bool -be_decl::srv_hdr_gen (void) -{ - return this->srv_hdr_gen_; -} - -idl_bool -be_decl::impl_hdr_gen (void) -{ - return this->impl_hdr_gen_; -} - -idl_bool -be_decl::srv_skel_gen (void) -{ - return this->srv_skel_gen_; -} - -idl_bool -be_decl::impl_skel_gen (void) -{ - return this->impl_skel_gen_; -} - -idl_bool -be_decl::srv_inline_gen (void) -{ - return this->srv_inline_gen_; -} - -// Set the flag indicating that code generation is done. -void -be_decl::cli_hdr_gen (idl_bool val) -{ - this->cli_hdr_gen_ = val; -} - -void -be_decl::cli_stub_gen (idl_bool val) -{ - this->cli_stub_gen_ = val; -} - -void -be_decl::cli_hdr_any_op_gen (idl_bool val) -{ - this->cli_hdr_any_op_gen_ = val; -} - -void -be_decl::cli_stub_any_op_gen (idl_bool val) -{ - this->cli_stub_any_op_gen_ = val; -} - -void -be_decl::cli_hdr_cdr_op_gen (idl_bool val) -{ - this->cli_hdr_cdr_op_gen_ = val; -} - -void -be_decl::cli_stub_cdr_op_gen (idl_bool val) -{ - this->cli_stub_cdr_op_gen_ = val; -} - -void -be_decl::cli_inline_cdr_op_gen (idl_bool val) -{ - this->cli_inline_cdr_op_gen_ = val; -} - -void -be_decl::cli_inline_cdr_decl_gen (idl_bool val) -{ - this->cli_inline_cdr_decl_gen_ = val; -} - -void -be_decl::cli_inline_gen (idl_bool val) -{ - this->cli_inline_gen_ = val; -} - -void -be_decl::srv_hdr_gen (idl_bool val) -{ - this->srv_hdr_gen_ = val; -} - -void -be_decl::impl_hdr_gen (idl_bool val) -{ - this->impl_hdr_gen_ = val; -} - - -void -be_decl::srv_skel_gen (idl_bool val) -{ - this->srv_skel_gen_ = val; -} - -void -be_decl::srv_inline_gen (idl_bool val) -{ - this->srv_inline_gen_ = val; -} - int be_decl::accept (be_visitor *visitor) { diff --git a/TAO/TAO_IDL/be/be_generator.cpp b/TAO/TAO_IDL/be/be_generator.cpp index f9f8acb541c..9d9cf6cfce4 100644 --- a/TAO/TAO_IDL/be/be_generator.cpp +++ b/TAO/TAO_IDL/be/be_generator.cpp @@ -348,14 +348,22 @@ AST_Home * be_generator::create_home (UTL_ScopedName *n, AST_Home *base_home, AST_Component *managed_component, - AST_ValueType *primary_key) + AST_ValueType *primary_key, + AST_Interface **supports, + long n_supports, + AST_Interface **supports_flat, + long n_supports_flat) { be_home *retval = 0; ACE_NEW_RETURN (retval, be_home (n, base_home, managed_component, - primary_key), + primary_key, + supports, + n_supports, + supports_flat, + n_supports_flat), 0); return retval; diff --git a/TAO/TAO_IDL/be/be_helper.cpp b/TAO/TAO_IDL/be/be_helper.cpp index b1c09be184c..3c523bcb806 100644 --- a/TAO/TAO_IDL/be/be_helper.cpp +++ b/TAO/TAO_IDL/be/be_helper.cpp @@ -21,6 +21,7 @@ #include "be_helper.h" #include "be_codegen.h" +#include "idl_defines.h" ACE_RCSID (be, be_helper, diff --git a/TAO/TAO_IDL/be/be_home.cpp b/TAO/TAO_IDL/be/be_home.cpp index 25a75156378..516ef8c6573 100644 --- a/TAO/TAO_IDL/be/be_home.cpp +++ b/TAO/TAO_IDL/be/be_home.cpp @@ -32,31 +32,39 @@ be_home::be_home (void) be_home::be_home (UTL_ScopedName *n, AST_Home *base_home, AST_Component *managed_component, - AST_ValueType *primary_key) + AST_ValueType *primary_key, + AST_Interface **supports, + long n_supports, + AST_Interface **supports_flat, + long n_supports_flat) : be_interface (n, - 0, - 0, - 0, - 0, - I_TRUE, + supports, + n_supports, + supports_flat, + n_supports_flat, + I_FALSE, I_FALSE), AST_Home (n, base_home, managed_component, - primary_key), + primary_key, + supports, + n_supports, + supports_flat, + n_supports_flat), AST_Interface (n, - 0, - 0, - 0, - 0, - I_TRUE, + supports, + n_supports, + supports_flat, + n_supports_flat, + I_FALSE, I_FALSE), AST_Type (AST_Decl::NT_home, n), AST_Decl (AST_Decl::NT_home, n), UTL_Scope (AST_Decl::NT_home), - COMMON_Base (I_TRUE, + COMMON_Base (I_FALSE, I_FALSE) { this->size_type (AST_Type::VARIABLE); diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index abc7bcb1d41..2b21f4470d7 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -28,7 +28,11 @@ #include "be_extern.h" #include "utl_identifier.h" #include "ast_attribute.h" +#include "ast_operation.h" +#include "ast_generator.h" #include "global_extern.h" +#include "idl_defines.h" +#include "nr_extern.h" #include "ace/Process.h" ACE_RCSID (be, @@ -39,7 +43,8 @@ ACE_RCSID (be, be_interface::be_interface (void) : skel_count_ (0), in_mult_inheritance_ (-1), - original_interface_ (0) + original_interface_ (0), + has_mixed_parentage_ (I_FALSE) { ACE_NEW (this->strategy_, be_interface_default_strategy (this)); @@ -69,12 +74,19 @@ be_interface::be_interface (UTL_ScopedName *n, abstract), skel_count_ (0), in_mult_inheritance_ (-1), - original_interface_ (0) + original_interface_ (0), + has_mixed_parentage_ (I_FALSE) { ACE_NEW (this->strategy_, be_interface_default_strategy (this)); this->size_type (AST_Type::VARIABLE); // always the case this->has_constructor (I_TRUE); // always the case + + if (! abstract) + { + this->analyze_parentage (ih, + nih); + } } be_interface::~be_interface (void) @@ -490,11 +502,48 @@ be_interface::gen_stub_ctor (TAO_OutStream *os) << "TAO_Abstract_ServantBase *servant" << be_uidt_nl << ")" // constructor << be_nl; - *os << ": CORBA_Object (objref, _tao_collocated, servant)" << be_uidt_nl; + *os << ": CORBA_Object (objref, _tao_collocated, servant)" + << be_uidt_nl; *os << "{" << be_idt_nl << "this->" << this->flat_name () - << "_setup_collocation (_tao_collocated);" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + << "_setup_collocation (_tao_collocated);"; + + if (this->has_mixed_parentage_) + { + AST_Interface **parent = 0; + idl_bool nested = this->is_nested (); + + for (ACE_Unbounded_Queue_Iterator<AST_Interface *> iter ( + this->abstract_parents_ + ); + iter.done () == 0; + iter.advance ()) + { + iter.next (parent); + idl_bool both_nested = nested && (*parent)->is_nested (); + + if (both_nested) + { + UTL_Scope *parent_scope = (*parent)->defined_in (); + AST_Decl *parent_decl = ScopeAsDecl (parent_scope); + + *os << be_nl + << "this->ACE_NESTED_CLASS (" + << parent_decl->name () << ", " + << (*parent)->local_name () + << ")::obj_ = this;"; + } + else + { + *os << be_nl + << "this->" << (*parent)->name () + << "::obj_ = this;"; + } + } + } + + *os << be_uidt_nl + << "}" << be_nl << be_nl; } } @@ -527,6 +576,9 @@ 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 + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *ch << "class " << be_global->stub_export_macro () << " " << namebuf << " : public TAO_Base_var" << be_nl; @@ -590,12 +642,30 @@ be_interface::gen_var_defn (char *interface_name) << "static " << interface_name << "_ptr tao_nil (void);" << be_nl << "static " << interface_name - << "_ptr tao_narrow (" << be_idt << be_idt_nl - << "CORBA::Object *" << be_nl - << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl - << ");" << be_uidt_nl - << "static CORBA::Object * tao_upcast (void *);" - << be_uidt_nl << be_nl; + << "_ptr tao_narrow (" << be_idt << be_idt_nl; + + if (this->is_abstract ()) + { + *ch << "CORBA::AbstractBase *" << be_nl; + } + else + { + *ch << "CORBA::Object *" << be_nl; + } + + *ch << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl + << ");" << be_uidt_nl; + + if (this->is_abstract ()) + { + *ch << "static CORBA::AbstractBase * tao_upcast (void *);"; + } + else + { + *ch << "static CORBA::Object * tao_upcast (void *);"; + } + + *ch << be_uidt_nl << be_nl; // Private. *ch << "private:" << be_idt_nl; @@ -805,9 +875,18 @@ be_interface::gen_var_impl (char *interface_local_name, << "}" << be_nl << be_nl; *cs << "::" << interface_full_name << "_ptr" << be_nl - << fname << "::tao_narrow (" << be_idt << be_idt_nl - << "CORBA::Object *p" << be_nl - << "ACE_ENV_ARG_DECL" << be_uidt_nl + << fname << "::tao_narrow (" << be_idt << be_idt_nl; + + if (this->is_abstract ()) + { + *cs << "CORBA::AbstractBase *p" << be_nl; + } + else + { + *cs << "CORBA::Object *p" << be_nl; + } + + *cs << "ACE_ENV_ARG_DECL" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "return ::" << interface_full_name @@ -815,8 +894,16 @@ be_interface::gen_var_impl (char *interface_local_name, << be_uidt_nl << "}" << be_nl << be_nl; - *cs << "CORBA::Object *" << be_nl - << fname << "::tao_upcast (void *src)" << be_nl + if (this->is_abstract ()) + { + *cs << "CORBA::AbstractBase *" << be_nl; + } + else + { + *cs << "CORBA::Object *" << be_nl; + } + + *cs << fname << "::tao_upcast (void *src)" << be_nl << "{" << be_idt_nl << interface_local_name << " **tmp =" << be_idt_nl << "ACE_static_cast (" << interface_local_name @@ -848,6 +935,9 @@ be_interface::gen_out_defn (char *interface_name) TAO_OutStream *ch = tao_cg->client_header (); + *ch << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the out definition (always in the client header) *ch << "class " << be_global->stub_export_macro () << " " << namebuf << be_nl; @@ -1020,13 +1110,22 @@ 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 << "}\n\n"; + *cs << "}" << be_nl << be_nl; + + *cs << "// *************************************************************" + << "\n\n"; return 0; } // **************************************************************** +TAO_IDL_Inheritance_Hierarchy_Worker::~TAO_IDL_Inheritance_Hierarchy_Worker ( + void + ) +{ +} + class TAO_IDL_Gen_OpTable_Worker : public TAO_IDL_Inheritance_Hierarchy_Worker { public: @@ -1420,6 +1519,38 @@ be_interface::gen_optable_entries (const char *full_skeleton_name, return 0; } +void +be_interface::analyze_parentage (AST_Interface **parents, + long n_parents) +{ + for (long i = 0; i < n_parents; ++i) + { + if (parents[i]->is_abstract ()) + { + this->has_mixed_parentage_ = I_TRUE; + be_global->mixed_parentage_interfaces.enqueue_tail (this); + this->abstract_parents_.enqueue_tail (parents[i]); + this->complete_abstract_paths (parents[i]); + } + } +} + +void +be_interface::complete_abstract_paths (AST_Interface *ai) +{ + AST_Interface **parents = ai->inherits (); + long n_parents = ai->n_inherits (); + + for (long i = 0; i < n_parents; ++i) + { + if (parents[i]->is_abstract ()) + { + this->abstract_parents_.enqueue_tail (parents[i]); + this->complete_abstract_paths (parents[i]); + } + } +} + // **************************************************************** class be_code_emitter_wrapper : public TAO_IDL_Inheritance_Hierarchy_Worker @@ -1625,6 +1756,11 @@ be_interface::gen_gperf_things (const char *flat_name) // GPERF can give Binary search, Linear search and Perfect Hash // methods. Generate the class defintion according to that. + TAO_OutStream *os = this->strategy_->get_out_stream (); + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the correct class definition for the operation lookup // strategy. Then, get the lookup method from GPERF. And then, // instantiate the correct class for the operation lookup strategy @@ -1988,9 +2124,10 @@ be_interface::is_a_helper (be_interface * /*derived*/, TAO_OutStream *os) { // Emit the comparison code. - os->indent (); - *os << "(!ACE_OS::strcmp ((char *)value, \"" << bi->repoID () << - "\")) ||\n"; + *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl + << "(char *)value," << be_nl + << "\"" << bi->repoID () << "\"" << be_uidt_nl + << ") ||" << be_uidt_nl; return 0; } @@ -2001,8 +2138,9 @@ be_interface::queryinterface_helper (be_interface *derived, TAO_OutStream *os) { // Emit the comparison code. - *os << "(type == ACE_reinterpret_cast" << be_idt_nl - << "(ptr_arith_t," << be_idt_nl; + *os << "(type == ACE_reinterpret_cast (" + << be_idt << be_idt <<be_idt << be_idt << be_idt << be_idt_nl + << "ptr_arith_t," << be_nl; be_decl *scope = be_scope::narrow_from_scope (ancestor->defined_in ())->decl (); @@ -2013,42 +2151,45 @@ be_interface::queryinterface_helper (be_interface *derived, // If the ancestor is in the root scope, we can use the local name. if (scope->node_type () == AST_Decl::NT_root) { - *os << "&" << ancestor->local_name () << "::_tao_class_id" << be_uidt - << "))" << be_nl; + *os << "&" << ancestor->local_name () << "::_tao_class_id)" + << be_uidt_nl; } // Or, if it's defined in a scope different than the child's, the // ACE_NESTED_CLASS macro won't work - we use the scoped name. else if (scope != derived_scope) { - *os << "&::" << ancestor->name () << "::_tao_class_id" << be_uidt - << "))" << be_nl; + *os << "&::" << ancestor->name () << "::_tao_class_id)" + << be_uidt_nl; } // The ACE_NESTED_CLASS macro is necessary in this case. else { *os << "&ACE_NESTED_CLASS (::" << scope->name () << ", " - << ancestor->local_name () << ")" << "::_tao_class_id" << be_uidt - << "))" << be_nl; + << ancestor->local_name () << ")" << "::_tao_class_id)" + << be_uidt_nl; } + *os << ")" << be_uidt << be_uidt << be_uidt << be_uidt_nl + << "{" << be_idt_nl; + if (derived == ancestor) { *os << "retv = ACE_reinterpret_cast (void*, this);" << be_uidt_nl; } else { - *os << "retv = ACE_reinterpret_cast" << be_idt_nl - << "(" << be_idt_nl + *os << "retv =" << be_idt_nl + << "ACE_reinterpret_cast (" << be_idt << be_idt_nl << "void *," << be_nl - << "ACE_static_cast" << be_idt_nl - << "(" << be_idt_nl + << "ACE_static_cast (" << be_idt << be_idt_nl << ancestor->full_name () << "_ptr," << be_nl << "this" << be_uidt_nl << ")" << be_uidt << be_uidt_nl - << ");" << be_uidt << be_uidt_nl; + << ");" << be_uidt << be_uidt << be_uidt_nl; } - *os << "else if "; + *os << "}" << be_uidt_nl + << "else if "; return 0; } @@ -2060,10 +2201,19 @@ be_interface::downcast_helper (be_interface * /* derived */, be_interface *base, TAO_OutStream *os) { - *os << "if (ACE_OS::strcmp (logical_type_id, \"" + // Abstract interfaces have no code generated on the skeleton side. + if (base->is_abstract ()) + { + return 0; + } + + *os << "if (ACE_OS::strcmp (logical_type_id," << be_nl + << " \"" << base->repoID () << "\") == 0)" << be_idt_nl + << "{" << be_idt_nl << "return ACE_static_cast (" - << base->full_skel_name () << "_ptr, this);" << be_uidt_nl; + << base->full_skel_name () << "_ptr, this);" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; return 0; } @@ -2095,11 +2245,26 @@ be_interface::gen_skel_helper (be_interface *derived, { // Get the next AST decl node AST_Decl *d = si.item (); + + // If an operation or an attribute is abstract (declared in an + // abstract interface), we will either generate the full + // definition (if there are no concrete interfaces between the + // abstract ancestor and us) or, if there is a concrete ancestor + // in between, we will catch its definition elsewhere in this + // iteration. + if (d->is_abstract ()) + { + continue; + } + if (d->node_type () == AST_Decl::NT_op) { // Start from current indentation level. os->indent (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR) { // Generate the static method corresponding to this method. @@ -2251,10 +2416,12 @@ be_interface::copy_ctor_helper (be_interface *derived, be_interface *base, TAO_OutStream *os) { - if (derived == base) - // We are the same. Don't do anything, otherwise we will end up calling - // ourself. - return 0; + // We can't call ourselves in a copy constructor, and + // abstract interfaces don't exist on the skeleton side. + if (derived == base || base->is_abstract ()) + { + return 0; + } if (base->is_nested ()) { @@ -2349,7 +2516,13 @@ be_interface::original_interface () be_interface * be_interface::replacement (void) { - return this->strategy_->replacement (); + return this->strategy_->replacement (); +} + +idl_bool +be_interface::has_mixed_parentage (void) const +{ + return this->has_mixed_parentage_; } const char * @@ -2464,8 +2637,3 @@ be_interface::server_enclosing_scope (void) IMPL_NARROW_METHODS3 (be_interface, AST_Interface, be_scope, be_type) IMPL_NARROW_FROM_DECL (be_interface) IMPL_NARROW_FROM_SCOPE (be_interface) - -TAO_IDL_Inheritance_Hierarchy_Worker:: -~TAO_IDL_Inheritance_Hierarchy_Worker () -{ -} diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp index d05ae7b8964..100027e3577 100644 --- a/TAO/TAO_IDL/be/be_operation.cpp +++ b/TAO/TAO_IDL/be/be_operation.cpp @@ -60,33 +60,6 @@ be_operation::~be_operation (void) { } -int -be_operation::void_return_type (void) -{ - be_type* type = be_type::narrow_from_decl (this->return_type ()); - - if (type->node_type () == AST_Decl::NT_pre_defined - && (be_predefined_type::narrow_from_decl (type)->pt () - == AST_PredefinedType::PT_void)) - { - return 1; - } - else - { - return 0; - } -} - -be_argument * -be_operation::add_argument_to_scope (be_argument *arg) -{ - this->add_to_scope (arg); - this->add_to_referenced (arg, - 0, - 0); - return arg; -} - void be_operation::destroy (void) { diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp index 83e2fbca32c..55dd9b721c0 100644 --- a/TAO/TAO_IDL/be/be_predefined_type.cpp +++ b/TAO/TAO_IDL/be/be_predefined_type.cpp @@ -48,7 +48,7 @@ be_predefined_type::be_predefined_type (AST_PredefinedType::PredefinedType t, this->compute_tc_name (); // Compute the flattened fully scoped name. - this->compute_flat_name (); + this->AST_Decl::compute_flat_name (); } // Overriden method. diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index 2bb0214b0fc..426537092d3 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -26,6 +26,7 @@ #include "be_predefined_type.h" #include "be_visitor.h" #include "utl_identifier.h" +#include "idl_defines.h" ACE_RCSID (be, be_sequence, @@ -236,6 +237,16 @@ be_sequence::managed_type (void) switch (prim_type->node_type ()) { case AST_Decl::NT_interface: + if (prim_type->is_abstract ()) + { + this->mt_ = be_sequence::MNG_ABSTRACT; + } + else + { + this->mt_ = be_sequence::MNG_OBJREF; + } + + break; case AST_Decl::NT_interface_fwd: this->mt_ = be_sequence::MNG_OBJREF; break; @@ -355,6 +366,23 @@ be_sequence::instance_name () this->flat_name (), this->max_size ()->ev ()->u.ulval); } + + break; + case be_sequence::MNG_ABSTRACT: + if (this->unbounded ()) + { + ACE_OS::sprintf (namebuf, + "_TAO_Unbounded_Abstract_Sequence_%s", + this->flat_name ()); + } + else + { + ACE_OS::sprintf (namebuf, + "_TAO_Bounded_Abstract_Sequence_%s_%lu", + this->flat_name (), + this->max_size ()->ev ()->u.ulval); + } + break; case be_sequence::MNG_VALUE: if (this->unbounded ()) @@ -370,6 +398,7 @@ be_sequence::instance_name () this->flat_name (), this->max_size ()->ev ()->u.ulval); } + break; case be_sequence::MNG_STRING: if (this->unbounded ()) @@ -383,6 +412,7 @@ be_sequence::instance_name () "_TAO_Bounded_String_Sequence_%s", this->flat_name ()); } + break; case be_sequence::MNG_WSTRING: if (this->unbounded ()) @@ -396,6 +426,7 @@ be_sequence::instance_name () "_TAO_Bounded_WString_Sequence_%s", this->flat_name ()); } + break; default: // Not a managed type. if (this->unbounded ()) @@ -425,6 +456,7 @@ be_sequence::instance_name () this->flat_name (), this->max_size ()->ev ()->u.ulval); } + break; } diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp index 8ac75472559..89de95bd510 100644 --- a/TAO/TAO_IDL/be/be_structure.cpp +++ b/TAO/TAO_IDL/be/be_structure.cpp @@ -26,6 +26,7 @@ #include "be_extern.h" #include "ast_field.h" #include "utl_identifier.h" +#include "idl_defines.h" ACE_RCSID (be, be_structure, diff --git a/TAO/TAO_IDL/be/be_tmplinst.cpp b/TAO/TAO_IDL/be/be_tmplinst.cpp index 0cf099bca27..9a301cb332d 100644 --- a/TAO/TAO_IDL/be/be_tmplinst.cpp +++ b/TAO/TAO_IDL/be/be_tmplinst.cpp @@ -17,6 +17,10 @@ template class ACE_Node <be_interface *>; template class ACE_Unbounded_Queue <be_interface *>; template class ACE_Unbounded_Queue_Iterator <be_interface *>; +template class ACE_Node <AST_Interface *>; +template class ACE_Unbounded_Queue <AST_Interface *>; +template class ACE_Unbounded_Queue_Iterator <AST_Interface *>; + template class ACE_Node<be_visitor_typecode_defn::QNode*>; template class ACE_Unbounded_Queue<be_visitor_typecode_defn::QNode*>; template class ACE_Unbounded_Queue_Iterator<be_visitor_typecode_defn::QNode*>; @@ -35,6 +39,10 @@ template class ACE_Unbounded_Queue_Iterator <be_interface_fwd *>; #pragma instantiate ACE_Unbounded_Queue <be_interface *> #pragma instantiate ACE_Unbounded_Queue_Iterator <be_interface *> +#pragma instantiate ACE_Node <AST_Interface *> +#pragma instantiate ACE_Unbounded_Queue <AST_Interface *> +#pragma instantiate ACE_Unbounded_Queue_Iterator <AST_Interface *> + #pragma instantiate ACE_Node<be_visitor_typecode_defn::QNode*> #pragma instantiate ACE_Unbounded_Queue<be_visitor_typecode_defn::QNode*> #pragma instantiate ACE_Unbounded_Queue_Iterator<be_visitor_typecode_defn::QNode*> diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp index 2901fdefae6..e6726ad85c3 100644 --- a/TAO/TAO_IDL/be/be_type.cpp +++ b/TAO/TAO_IDL/be/be_type.cpp @@ -24,14 +24,14 @@ #include "be_visitor.h" #include "be_codegen.h" #include "utl_identifier.h" +#include "idl_defines.h" ACE_RCSID (be, be_type, "$Id$") be_type::be_type (void) - : tc_name_ (0), - nested_type_name_ (0) + : tc_name_ (0) { } @@ -43,8 +43,7 @@ be_type::be_type (AST_Decl::NodeType nt, n), AST_Decl (nt, n), - tc_name_ (0), - nested_type_name_ (0) + tc_name_ (0) { } @@ -130,29 +129,6 @@ be_type::tc_name (void) return this->tc_name_; } -// This code works. However, whether we should generate the -// ACE_NESTED_CLASS macro or not should be based on an option to the -// compiler. The previous version generated a relative path. -// This version always generates ACE_NESTED_CLASS, (leave ace/ACE.h and friends -// do the porting) -// -// Caution: returns the same buffer pointer even if the contents may change -// in the next call. (return std::string anyone?) -// -// Return the type name using the ACE_NESTED_CLASS macro - -const char * -be_type::nested_type_name (be_decl *use_scope, - const char *suffix, - const char *prefix) -{ - return nested_name (this->local_name()->get_string(), - this->full_name(), - use_scope, - suffix, - prefix); -} - // This works for the "special" names generated for smart proxy // classes. The form of these names is // scope'TAO_'+flat_name+'_Smart_Proxy_Base'. @@ -204,275 +180,6 @@ be_type::nested_sp_type_name (be_decl *use_scope, prefix); } -// This is the real thing used by the two other methods above. -const char * -be_type::nested_name (const char* local_name, - const char* full_name, - be_decl *use_scope, - const char *suffix, - const char *prefix) -{ - // Some compilers do not like generating a fully scoped name for a type that - // was defined in the same enclosing scope in which it was defined. For such, - // we emit a macro defined in the ACE library. - // - - // The tricky part here is that it is not enough to check if the - // typename we are using was defined in the current scope. But we - // need to ensure that it was not defined in any of our ancestor - // scopes as well. If that is the case, then we can generate a fully - // scoped name for that type, else we use the ACE_NESTED_CLASS macro. - - // Thus we need some sort of relative name to be generated. - - if (this->nested_type_name_ == 0) - { - ACE_NEW_RETURN (this->nested_type_name_, - char[NAMEBUFSIZE], - 0); - } - - // Our defining scope. - be_decl *def_scope = 0; - - // Hold the fully scoped name. - char def_name [NAMEBUFSIZE]; - char use_name [NAMEBUFSIZE]; - - // These point to the prev, curr and next component in the scope. - char *def_curr = def_name; - char *def_next = 0; - char *use_curr = use_name; - char *use_next = 0; - - // How many chars to compare. - int len_to_match = 0; - - // Initialize the buffers. - ACE_OS::memset (this->nested_type_name_, - '\0', - NAMEBUFSIZE); - - ACE_OS::memset (def_name, - '\0', - NAMEBUFSIZE); - - ACE_OS::memset (use_name, - '\0', - NAMEBUFSIZE); - - // Traverse every component of the def_scope and use_scope beginning at the - // root and proceeding towards the leaf trying to see if the components - // match. Continue until there is a match and keep accumulating the path - // traversed. This forms the first argument to the ACE_NESTED_CLASS - // macro. Whenever there is no match, the remaining components of the - // def_scope form the second argument. - - def_scope = this->defined_in () - ? be_scope::narrow_from_scope (this->defined_in ())->decl () - : 0; - - if (def_scope - && def_scope->node_type () != AST_Decl::NT_root - && use_scope) - // If both scopes exist and that we are not in the root scope. - { - ACE_OS::strcpy (def_name, - def_scope->full_name ()); - - ACE_OS::strcpy (use_name, - use_scope->full_name ()); - - // Find the first occurrence of a :: and advance - // the next pointers accordingly. - def_next = ACE_OS::strstr (def_curr, "::"); - use_next = ACE_OS::strstr (use_curr, "::"); - - // If the scopes are identical, don't supply them. - if (ACE_OS::strcmp (def_name, - use_name) - == 0) - { - if (prefix != 0) - { - ACE_OS::strcat (this->nested_type_name_, - prefix); - } - - ACE_OS::strcat (this->nested_type_name_, - local_name); - if (suffix != 0) - { - ACE_OS::strcat (this->nested_type_name_, - suffix); - } - - return this->nested_type_name_; - } - - if (def_next != 0) - { - len_to_match = - ACE_OS::strlen (def_curr) - ACE_OS::strlen (def_next); - } - else - { - len_to_match = ACE_OS::strlen (def_curr); - } - - if (use_next != 0) - { - int len = - ACE_OS::strlen (use_curr) - ACE_OS::strlen (use_next); - - if (len > len_to_match) - { - len_to_match = len; - } - } - else - { - int len = ACE_OS::strlen (use_curr); - - if (len > len_to_match) - { - len_to_match = len; - } - } - - if (ACE_OS::strncmp (def_curr, - use_curr, - len_to_match) - == 0) - { - // Initial prefix matches i.e., they have a common root. - // Start by initializing the macro. - ACE_OS::sprintf (this->nested_type_name_, - "ACE_NESTED_CLASS ("); - - // Initialize the first argument. - ACE_OS::strncat (this->nested_type_name_, - def_curr, - len_to_match); - - // Shift the current scopes to the next level. - def_curr = (def_next ? (def_next + 2) : 0); // Skip the :: - use_curr = (use_next ? (use_next + 2) : 0); // Skip the :: - - while (def_curr && use_curr) - { - // Find the first occurrence of a :: and advance the - // next pointers accordingly. - def_next = ACE_OS::strstr (def_curr, "::"); - use_next = ACE_OS::strstr (use_curr, "::"); - - if (def_next != 0) - { - len_to_match = - ACE_OS::strlen (def_curr) - ACE_OS::strlen (def_next); - } - else - { - len_to_match = ACE_OS::strlen (def_curr); - } - - if (use_next != 0) - { - int len = - ACE_OS::strlen (use_curr) - ACE_OS::strlen (use_next); - - if (len > len_to_match) - { - len_to_match = len; - } - } - else - { - int len = ACE_OS::strlen (use_curr); - - if (len > len_to_match) - { - len_to_match = len; - } - } - - if (ACE_OS::strncmp (def_curr, - use_curr, - len_to_match) - == 0) - { - // They have same prefix, append to arg1. - ACE_OS::strcat (this->nested_type_name_, - "::"); - - ACE_OS::strncat (this->nested_type_name_, - def_curr, - len_to_match); - - def_curr = (def_next ? (def_next + 2) : 0); // Skip the :: - use_curr = (use_next ? (use_next + 2) : 0); // Skip the :: - } - else - { - // No match. This is the end of the first argument. Get out - // of the loop as no more comparisons are necessary. - break; - } - } - - // Start the 2nd argument of the macro. - ACE_OS::strcat (this->nested_type_name_, ", "); - - // Copy the remaining def_name (if any are left). - if (def_curr != 0) - { - ACE_OS::strcat (this->nested_type_name_, - def_curr); - - ACE_OS::strcat (this->nested_type_name_, - "::"); - } - - // Append our local name. - if (prefix != 0) - { - ACE_OS::strcat (this->nested_type_name_, prefix); - } - - ACE_OS::strcat (this->nested_type_name_, - local_name); - - if (suffix != 0) - { - ACE_OS::strcat (this->nested_type_name_, - suffix); - } - - ACE_OS::strcat (this->nested_type_name_, - ")"); - - return this->nested_type_name_; - } // End of if the root prefixes match. - } - - // Otherwise just emit our full_name. - if (prefix != 0) - { - ACE_OS::strcat (this->nested_type_name_, prefix); - } - - ACE_OS::strcat (this->nested_type_name_, - full_name); - - if (suffix != 0) - { - ACE_OS::strcat (this->nested_type_name_, - suffix); - } - - return this->nested_type_name_; -} - // ***************************** // CODE GENERATION // ***************************** diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp index 077e99895b8..c5577a14be0 100644 --- a/TAO/TAO_IDL/be/be_union.cpp +++ b/TAO/TAO_IDL/be/be_union.cpp @@ -26,6 +26,7 @@ #include "be_extern.h" #include "ast_union_branch.h" #include "utl_identifier.h" +#include "idl_defines.h" ACE_RCSID (be, be_union, diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp index 40aa06d18a4..bff427aa4cc 100644 --- a/TAO/TAO_IDL/be/be_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_valuetype.cpp @@ -24,6 +24,7 @@ #include "be_extern.h" #include "be_helper.h" #include "ast_module.h" +#include "idl_defines.h" ACE_RCSID (be, be_valuetype, @@ -147,17 +148,22 @@ be_valuetype::full_obv_skel_name (void) // Generate the var definition. int -be_valuetype::gen_var_defn (char *) +be_valuetype::gen_var_defn (char *local_name) { char namebuf [NAMEBUFSIZE]; + if (local_name == 0) + { + local_name = (char *) this->local_name (); + } + ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); ACE_OS::sprintf (namebuf, "%s_var", - this->local_name ()); + local_name); TAO_OutStream *ch = tao_cg->client_header (); @@ -173,8 +179,8 @@ be_valuetype::gen_var_defn (char *) // Default constructor. *ch << namebuf << " (void); // default constructor" << be_nl; - *ch << namebuf << " (" << this->local_name () << "*);" << be_nl; - *ch << namebuf << " (const " << this->local_name () + *ch << namebuf << " (" << local_name << "*);" << be_nl; + *ch << namebuf << " (const " << local_name << "*); // (TAO extension)" << be_nl; // Copy constructor. @@ -186,7 +192,7 @@ be_valuetype::gen_var_defn (char *) *ch << be_nl; // Assignment operator from a pointer. - *ch << namebuf << " &operator= (" << this->local_name () + *ch << namebuf << " &operator= (" << local_name << "*);" << be_nl; // Assignment from _var. @@ -194,32 +200,32 @@ be_valuetype::gen_var_defn (char *) " &);" << be_nl; // Arrow operator. - *ch << local_name () << "* operator-> (void) const;" << be_nl; + *ch << local_name << "* operator-> (void) const;" << be_nl; *ch << be_nl; // Other extra types (cast operators, [] operator, and others). - *ch << "operator const " << this->local_name () + *ch << "operator const " << local_name << "* () const;" << be_nl; - *ch << "operator " << this->local_name () << "* ();" << be_nl; + *ch << "operator " << local_name << "* ();" << be_nl; *ch << "// in, inout, out, _retn " << be_nl; // The return types of in, out, inout, and _retn are based on the parameter // passing rules and the base type. - *ch << this->local_name () << "* in (void) const;" << be_nl; - *ch << this->local_name () << "* &inout (void);" << be_nl; - *ch << this->local_name () << "* &out (void);" << be_nl; - *ch << this->local_name () << "* _retn (void);" << be_nl; + *ch << local_name << "* in (void) const;" << be_nl; + *ch << local_name << "* &inout (void);" << be_nl; + *ch << local_name << "* &out (void);" << be_nl; + *ch << local_name << "* _retn (void);" << be_nl; // Generate an additional member function that returns // the underlying pointer. - *ch << this->local_name () << "* ptr (void) const;"; + *ch << local_name << "* ptr (void) const;"; *ch << be_uidt_nl << be_nl; // Private. *ch << "private:" << be_idt_nl; - *ch << this->local_name () << "* ptr_;" << be_uidt_nl; + *ch << local_name << "* ptr_;" << be_uidt_nl; *ch << "};" << be_nl << be_nl; @@ -229,12 +235,21 @@ be_valuetype::gen_var_defn (char *) // Implementation of the _var class. All of these get generated in the stubs // file. int -be_valuetype::gen_var_impl (char *, - char *) +be_valuetype::gen_var_impl (char *local_name, + char *full_name) { TAO_OutStream *cs = 0; TAO_NL be_nl; + // Decide on the names to use. + // Even if one argument is 0, there is no point using the + // arguments. Let us then use the name in this node. + if (local_name == 0 || full_name == 0) + { + local_name = (char *) this->local_name (); + full_name = (char *) this->full_name (); + } + // To hold the full and local _var names. char fname [NAMEBUFSIZE]; char lname [NAMEBUFSIZE]; @@ -245,7 +260,7 @@ be_valuetype::gen_var_impl (char *, ACE_OS::sprintf (fname, "%s_var", - this->full_name ()); + full_name); ACE_OS::memset (lname, '\0', @@ -253,7 +268,7 @@ be_valuetype::gen_var_impl (char *, ACE_OS::sprintf (lname, "%s_var", - this->local_name ()); + local_name); cs = tao_cg->client_stubs (); @@ -277,7 +292,7 @@ be_valuetype::gen_var_impl (char *, // Constructor from a pointer. cs->indent (); *cs << fname << "::" << lname << " (" - << this->local_name () << "* p)" << be_nl; + << local_name << "* p)" << be_nl; *cs << " : ptr_ (p)" << be_nl; *cs << "{}\n\n"; @@ -286,9 +301,9 @@ be_valuetype::gen_var_impl (char *, // which reclaims amguity between T(T*) and T(const T_var &) cs->indent (); *cs << fname << "::" << lname << " (const " - << this->local_name () << "* p)" << be_nl; + << local_name << "* p)" << be_nl; *cs << " : ptr_ (ACE_const_cast(" - << this->local_name () << "*, p))" << be_nl; + << local_name << "*, p))" << be_nl; *cs << "{}\n\n"; // The additional ptr () member function. This member function must be @@ -296,7 +311,7 @@ be_valuetype::gen_var_impl (char *, // constructor because this inline function is used elsewhere. Hence to make // inlining of this function possible, we must define it before its use. cs->indent (); - *cs << this->name () << "* " << be_nl; + *cs << full_name << "* " << be_nl; *cs << fname << "::ptr (void) const" << be_nl; *cs << "{\n"; cs->incr_indent (); @@ -325,7 +340,7 @@ be_valuetype::gen_var_impl (char *, // Assignment operator. cs->indent (); *cs << fname << " &" << be_nl; - *cs << fname << "::operator= (" << this->local_name () + *cs << fname << "::operator= (" << local_name << "* p)" << be_nl; *cs << "{\n"; cs->incr_indent (); @@ -346,7 +361,7 @@ be_valuetype::gen_var_impl (char *, *cs << "{\n"; cs->incr_indent (); *cs << "CORBA::remove_ref (this->ptr_);" << be_nl - << this->local_name() << "* tmp = p.ptr ();" << be_nl + << local_name << "* tmp = p.ptr ();" << be_nl << "CORBA::add_ref (tmp);" << be_nl << "this->ptr_ = tmp;\n"; cs->decr_indent (); @@ -357,7 +372,7 @@ be_valuetype::gen_var_impl (char *, // Other extra methods - cast operator (). cs->indent (); - *cs << fname << "::operator const " << this->name () + *cs << fname << "::operator const " << full_name << "* () const // cast" << be_nl; *cs << "{\n"; cs->incr_indent (); @@ -366,7 +381,7 @@ be_valuetype::gen_var_impl (char *, *cs << "}\n\n"; cs->indent (); - *cs << fname << "::operator " << this->name () + *cs << fname << "::operator " << full_name << "* () // cast " << be_nl; *cs << "{\n"; cs->incr_indent (); @@ -376,7 +391,7 @@ be_valuetype::gen_var_impl (char *, // operator-> cs->indent (); - *cs << this->name () << "* " << be_nl; + *cs << full_name << "* " << be_nl; *cs << fname << "::operator-> (void) const" << be_nl; *cs << "{\n"; cs->incr_indent (); @@ -386,7 +401,7 @@ be_valuetype::gen_var_impl (char *, // in, inout, out, and _retn. cs->indent (); - *cs << this->name () << "*" << be_nl; + *cs << full_name << "*" << be_nl; *cs << fname << "::in (void) const" << be_nl; *cs << "{\n"; cs->incr_indent (); @@ -395,7 +410,7 @@ be_valuetype::gen_var_impl (char *, *cs << "}\n\n"; cs->indent (); - *cs << this->name () << "* &" << be_nl; + *cs << full_name << "* &" << be_nl; *cs << fname << "::inout (void)" << be_nl; *cs << "{\n"; cs->incr_indent (); @@ -404,7 +419,7 @@ be_valuetype::gen_var_impl (char *, *cs << "}\n\n"; cs->indent (); - *cs << this->name () << "* &" << be_nl; + *cs << full_name << "* &" << be_nl; *cs << fname << "::out (void)" << be_nl; *cs << "{\n"; cs->incr_indent (); @@ -415,12 +430,12 @@ be_valuetype::gen_var_impl (char *, *cs << "}\n\n"; cs->indent (); - *cs << this->name () << "* " << be_nl; + *cs << full_name << "* " << be_nl; *cs << fname << "::_retn (void)" << be_nl; *cs << "{\n"; cs->incr_indent (); *cs << "// yield ownership of managed obj reference" << be_nl; - *cs << this->local_name () << "* tmp = this->ptr_;" << be_nl; + *cs << local_name << "* tmp = this->ptr_;" << be_nl; *cs << "this->ptr_ = 0;" << be_nl; *cs << "return tmp;\n"; cs->decr_indent (); @@ -643,7 +658,8 @@ be_valuetype::gen_helper_header (char* , os = tao_cg->client_header (); - *os << "//@@ Boris: begin experimental" << be_nl + *os << be_nl + << "//@@ Boris: begin experimental" << be_nl << "TAO_NAMESPACE CORBA" << be_nl << "{" << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp index 7b02d063232..776bfc62e18 100644 --- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp @@ -70,13 +70,13 @@ be_visitor_amh_pre_proc::visit_interface (be_interface *node) return 0; } - // Don't generate AMH classes for imported or local interfaces + // Don't generate AMH classes for imported, local or abstract interfaces // either... // @@ Mayur, maybe we do want to insert the AMH node for imported // interfaces, not because we want to generate code for them, but // because the (imported-AMH-) node could be needed to generate a // non-imported, AMH node, for example, for a derived interface. - if (node->imported () || node->is_local ()) + if (node->imported () || node->is_local () || node->is_abstract ()) { return 0; } @@ -320,7 +320,7 @@ be_visitor_amh_pre_proc::add_exception_reply (be_operation *node, -1); argument->set_defined_in (node_excep); - node_excep->add_argument_to_scope (argument); + node_excep->be_add_argument (argument); node_excep->set_defined_in (response_handler); response_handler->be_add_operation (node_excep); @@ -403,7 +403,7 @@ be_visitor_amh_pre_proc::add_normal_reply (be_operation *node, -1); // Add the response handler to the argument list - operation->add_argument_to_scope (arg); + operation->be_add_argument (arg); } // Iterate over the arguments and put all the out and inout arguments @@ -438,7 +438,7 @@ be_visitor_amh_pre_proc::add_normal_reply (be_operation *node, original_arg->name ()), -1); - operation->add_argument_to_scope (arg); + operation->be_add_argument (arg); } } @@ -920,7 +920,7 @@ be_visitor_amh_pre_proc::generate_set_operation (be_attribute *node) operation->set_name (set_name); operation->set_defined_in (node->defined_in ()); - operation->add_argument_to_scope (arg); + operation->be_add_argument (arg); return operation; } diff --git a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp index 75ae636e316..6ef4779ccc6 100644 --- a/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ami_pre_proc.cpp @@ -88,105 +88,106 @@ be_visitor_ami_pre_proc::visit_module (be_module *node) int be_visitor_ami_pre_proc::visit_interface (be_interface *node) { - if (!node->imported () && !node->is_local ()) + if (node->imported () || node->is_local () || node->is_abstract ()) { - AST_Module *module = - AST_Module::narrow_from_scope (node->defined_in ()); + return 0; + } - if (!module) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ami_pre_proc::" - "visit_interface - " - "module is null\n"), - -1); - } + AST_Module *module = + AST_Module::narrow_from_scope (node->defined_in ()); - be_valuetype *excep_holder = this->create_exception_holder (node); + if (!module) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ami_pre_proc::" + "visit_interface - " + "module is null\n"), + -1); + } + be_valuetype *excep_holder = this->create_exception_holder (node); - be_interface *reply_handler = this->create_reply_handler (node, - excep_holder); - if (reply_handler) - { - reply_handler->set_defined_in (node->defined_in ()); + be_interface *reply_handler = this->create_reply_handler (node, + excep_holder); + if (reply_handler) + { + reply_handler->set_defined_in (node->defined_in ()); - // Insert the ami handler after the node, the - // exception holder will be placed between these two later. - module->be_add_interface (reply_handler, node); + // Insert the ami handler after the node, the + // exception holder will be placed between these two later. + module->be_add_interface (reply_handler, node); - // Remember from whom we were cloned - reply_handler->original_interface (node); - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ami_pre_proc::" - "visit_interface - " - "creating the reply handler failed\n"), - -1); - } + // Remember from whom we were cloned + reply_handler->original_interface (node); + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ami_pre_proc::" + "visit_interface - " + "creating the reply handler failed\n"), + -1); + } + + // Set the proper strategy. + be_interface_ami_strategy *bias = 0; + ACE_NEW_RETURN (bias, + be_interface_ami_strategy (node, + reply_handler), + -1); + be_interface_strategy *old_strategy = node->set_strategy (bias); + + if (old_strategy) + { + delete old_strategy; + old_strategy = 0; + } - // Set the proper strategy. - be_interface_ami_strategy *bias = 0; - ACE_NEW_RETURN (bias, - be_interface_ami_strategy (node, - reply_handler), + if (excep_holder) + { + excep_holder->set_defined_in (node->defined_in ()); + // Insert the exception holder after the original node, + // this way we ensure that it is *before* the + // ami handler, which is the way we want to have it. + module->be_add_interface (excep_holder, node); + module->set_has_nested_valuetype (); + // Remember from whom we were cloned. + excep_holder->original_interface (node); + + // Set the strategy. + be_interface_ami_exception_holder_strategy *biaehs = 0; + ACE_NEW_RETURN (biaehs, + be_interface_ami_exception_holder_strategy ( + excep_holder + ), -1); - be_interface_strategy *old_strategy = node->set_strategy (bias); + + be_interface_strategy *old_strategy = + excep_holder->set_strategy (biaehs); if (old_strategy) { delete old_strategy; old_strategy = 0; } - - if (excep_holder) - { - excep_holder->set_defined_in (node->defined_in ()); - // Insert the exception holder after the original node, - // this way we ensure that it is *before* the - // ami handler, which is the way we want to have it. - module->be_add_interface (excep_holder, node); - module->set_has_nested_valuetype (); - // Remember from whom we were cloned. - excep_holder->original_interface (node); - - // Set the strategy. - be_interface_ami_exception_holder_strategy *biaehs = 0; - ACE_NEW_RETURN (biaehs, - be_interface_ami_exception_holder_strategy ( - excep_holder - ), - -1); - - be_interface_strategy *old_strategy = - excep_holder->set_strategy (biaehs); - - if (old_strategy) - { - delete old_strategy; - old_strategy = 0; - } - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ami_pre_proc::" - "visit_interface - " - "creating the exception holder failed\n"), - -1); - } + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ami_pre_proc::" + "visit_interface - " + "creating the exception holder failed\n"), + -1); + } - if (this->visit_scope (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ami_pre_proc::" - "visit_interface - " - "visit scope failed\n"), - -1); - } + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_ami_pre_proc::" + "visit_interface - " + "visit scope failed\n"), + -1); } return 0; @@ -220,7 +221,7 @@ be_visitor_ami_pre_proc::visit_operation (be_operation *node) // Set the proper strategy, and store the specialized // marshaling and arguments operations in it. - be_operation_ami_sendc_strategy * boass= 0; + be_operation_ami_sendc_strategy * boass = 0; ACE_NEW_RETURN (boass, be_operation_ami_sendc_strategy (node, sendc_marshaling, @@ -839,7 +840,7 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node, 0); // Add the reply handler to the argument list - op->add_argument_to_scope (arg); + op->be_add_argument (arg); } // Iterate over the arguments and put all the in and inout @@ -878,7 +879,7 @@ be_visitor_ami_pre_proc::create_sendc_operation (be_operation *node, original_arg->name ()), 0); - op->add_argument_to_scope (arg); + op->be_add_argument (arg); } } // end of while loop } // end of if @@ -975,7 +976,7 @@ be_visitor_ami_pre_proc::create_reply_handler_operation ( -1); // Add the reply handler to the argument list. - operation->add_argument_to_scope (arg); + operation->be_add_argument (arg); } // Iterate over the arguments and put all the in and inout @@ -1012,7 +1013,7 @@ be_visitor_ami_pre_proc::create_reply_handler_operation ( original_arg->name ()), -1); - operation->add_argument_to_scope (arg); + operation->be_add_argument (arg); } } // end of while loop } // end of if @@ -1127,7 +1128,7 @@ be_visitor_ami_pre_proc::create_excep_operation (be_operation *node, -1); operation->set_name (op_name); - operation->add_argument_to_scope (arg); + operation->be_add_argument (arg); operation->set_defined_in (reply_handler); @@ -1321,7 +1322,7 @@ be_visitor_ami_pre_proc::generate_set_operation (be_attribute *node) operation->set_name (set_name); operation->set_defined_in (node->defined_in ()); - operation->add_argument_to_scope (arg); + operation->be_add_argument (arg); return operation; } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp index e1aeec32c2e..33f70ae17a0 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp @@ -151,7 +151,7 @@ int be_visitor_args_arglist::visit_interface_fwd (be_interface_fwd *node) int be_visitor_args_arglist::visit_native (be_native *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -165,6 +165,7 @@ int be_visitor_args_arglist::visit_native (be_native *node) *os << this->type_name (node) << " &"; break; } + return 0; } @@ -245,7 +246,7 @@ int be_visitor_args_arglist::visit_predefined_type (be_predefined_type *node) int be_visitor_args_arglist::visit_sequence (be_sequence *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -265,7 +266,7 @@ int be_visitor_args_arglist::visit_sequence (be_sequence *node) int be_visitor_args_arglist::visit_string (be_string *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); if (node->width () == (long) sizeof (char)) { @@ -303,7 +304,7 @@ int be_visitor_args_arglist::visit_string (be_string *node) int be_visitor_args_arglist::visit_structure (be_structure *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -323,7 +324,7 @@ int be_visitor_args_arglist::visit_structure (be_structure *node) int be_visitor_args_arglist::visit_union (be_union *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -361,7 +362,7 @@ int be_visitor_args_arglist::visit_typedef (be_typedef *node) int be_visitor_args_arglist::visit_valuetype (be_valuetype *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { diff --git a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp index 82fbad5ac30..3c48f9aacd2 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp @@ -47,21 +47,27 @@ be_visitor_args::type_name (be_type *node, static char namebuf [NAMEBUFSIZE]; ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - be_type *bt; // type to use + be_type *bt; - // use the typedefed name if that is the one used in the IDL defn + // Use the typedefed name if that is the one used in the IDL defn. if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } ACE_OS::sprintf (namebuf, "%s", bt->full_name ()); if (suffix) - ACE_OS::strcat (namebuf, - suffix); + { + ACE_OS::strcat (namebuf, + suffix); + } return namebuf; } @@ -71,7 +77,9 @@ AST_Argument::Direction be_visitor_args::direction (void) { if (this->fixed_direction_ != -1) - return AST_Argument::Direction (this->fixed_direction_); + { + return AST_Argument::Direction (this->fixed_direction_); + } // grab the argument node. We know that our context has stored the right // argument 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 9b0ac9722e7..59672368f62 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/invoke_cs.cpp @@ -41,9 +41,8 @@ be_visitor_args_invoke_cs:: int be_visitor_args_invoke_cs::visit_argument (be_argument *node) { this->ctx_->node (node); // save the argument node - - // retrieve the type of the argument be_type *bt = be_type::narrow_from_decl (node->field_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, @@ -58,8 +57,6 @@ int be_visitor_args_invoke_cs::visit_argument (be_argument *node) TAO_OutStream *os = this->ctx_->stream (); // get output stream - os->indent (); - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { switch (this->direction ()) @@ -140,9 +137,8 @@ int be_visitor_args_invoke_cs::visit_argument (be_argument *node) int be_visitor_args_invoke_cs::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -156,7 +152,7 @@ int be_visitor_args_invoke_cs::visit_array (be_array *node) case AST_Argument::dir_INOUT: *os << node->name () << "_forany (" << arg->local_name () << ")"; - break; + break; case AST_Argument::dir_OUT: break; } @@ -168,17 +164,8 @@ int be_visitor_args_invoke_cs::visit_array (be_array *node) case AST_Argument::dir_IN: break; case AST_Argument::dir_INOUT: - *os << "_tao_argument_" << arg->local_name (); - break; case AST_Argument::dir_OUT: - if (node->size_type () == AST_Type::VARIABLE) - { - *os << "_tao_argument_" << arg->local_name (); - } - else - { - *os << "_tao_argument_" << arg->local_name (); - } + *os << "_tao_argument_" << arg->local_name (); break; } } @@ -190,14 +177,14 @@ int be_visitor_args_invoke_cs::visit_array (be_array *node) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_invoke_cs::visit_enum (be_enum *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -231,14 +218,14 @@ int be_visitor_args_invoke_cs::visit_enum (be_enum *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_invoke_cs::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -274,14 +261,14 @@ int be_visitor_args_invoke_cs::visit_interface (be_interface *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_invoke_cs::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -367,9 +354,8 @@ int be_visitor_args_invoke_cs::visit_valuetype (be_valuetype *) int be_visitor_args_invoke_cs::visit_valuetype_fwd (be_valuetype_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -405,13 +391,14 @@ be_visitor_args_invoke_cs::visit_valuetype_fwd (be_valuetype_fwd *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_invoke_cs::visit_predefined_type (be_predefined_type *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get argument node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -553,14 +540,14 @@ int be_visitor_args_invoke_cs::visit_predefined_type (be_predefined_type *node) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_invoke_cs::visit_sequence (be_sequence *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -596,14 +583,14 @@ int be_visitor_args_invoke_cs::visit_sequence (be_sequence *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_invoke_cs::visit_string (be_string *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -619,10 +606,10 @@ int be_visitor_args_invoke_cs::visit_string (be_string *node) } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { - // we need to make a distinction between bounded and unbounded strings + // We need to make a distinction between bounded and unbounded strings. if (node->max_size ()->ev ()->u.ulval == 0) { - // unbounded + // Unbounded. switch (this->direction ()) { case AST_Argument::dir_IN: @@ -637,7 +624,7 @@ int be_visitor_args_invoke_cs::visit_string (be_string *node) } else { - // bounded + // Bounded. switch (this->direction ()) { case AST_Argument::dir_IN: @@ -679,14 +666,14 @@ int be_visitor_args_invoke_cs::visit_string (be_string *node) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_invoke_cs::visit_structure (be_structure *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -725,14 +712,14 @@ int be_visitor_args_invoke_cs::visit_structure (be_structure *node) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_invoke_cs::visit_union (be_union *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { @@ -778,6 +765,7 @@ int be_visitor_args_invoke_cs::visit_union (be_union *node) int be_visitor_args_invoke_cs::visit_typedef (be_typedef *node) { this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -786,6 +774,7 @@ int be_visitor_args_invoke_cs::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp index 344aa38e2b2..0be2a5f206d 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/marshal_ss.cpp @@ -42,10 +42,9 @@ be_visitor_args_marshal_ss:: int be_visitor_args_marshal_ss::visit_argument (be_argument *node) { - this->ctx_->node (node); // save the argument node - - // retrieve the type of the argument + this->ctx_->node (node); be_type *bt = be_type::narrow_from_decl (node->field_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, @@ -142,9 +141,8 @@ int be_visitor_args_marshal_ss::visit_argument (be_argument *node) int be_visitor_args_marshal_ss::visit_array (be_array *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -182,14 +180,14 @@ int be_visitor_args_marshal_ss::visit_array (be_array *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_enum (be_enum *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -223,14 +221,14 @@ int be_visitor_args_marshal_ss::visit_enum (be_enum *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -264,14 +262,14 @@ int be_visitor_args_marshal_ss::visit_interface (be_interface *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -305,14 +303,14 @@ int be_visitor_args_marshal_ss::visit_interface_fwd (be_interface_fwd *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_valuetype (be_valuetype *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -346,14 +344,14 @@ int be_visitor_args_marshal_ss::visit_valuetype (be_valuetype *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_valuetype_fwd (be_valuetype_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -387,6 +385,7 @@ int be_visitor_args_marshal_ss::visit_valuetype_fwd (be_valuetype_fwd *) "Bad substate\n"), -1); } + return 0; } @@ -526,11 +525,14 @@ int be_visitor_args_marshal_ss::visit_predefined_type ( *os << "CORBA::Any::from_octet (" << arg->local_name () << ")"; break; default: - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_operation_rettype_compiled_marshal_ss::" - "visit_array - " - "Bad predefined type\n"), - -1); + ACE_ERROR_RETURN (( + LM_ERROR, + "be_visitor_operation_rettype_compiled_marshal_ss::" + "visit_array - " + "Bad predefined type\n" + ), + -1 + ); } break; } @@ -543,14 +545,14 @@ int be_visitor_args_marshal_ss::visit_predefined_type ( "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_sequence (be_sequence *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -586,14 +588,14 @@ int be_visitor_args_marshal_ss::visit_sequence (be_sequence *) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_string (be_string *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -674,14 +676,14 @@ int be_visitor_args_marshal_ss::visit_string (be_string *node) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_structure (be_structure *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -720,14 +722,14 @@ int be_visitor_args_marshal_ss::visit_structure (be_structure *node) "Bad substate\n"), -1); } + return 0; } int be_visitor_args_marshal_ss::visit_union (be_union *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -773,6 +775,7 @@ int be_visitor_args_marshal_ss::visit_union (be_union *node) int be_visitor_args_marshal_ss::visit_typedef (be_typedef *node) { this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -781,6 +784,7 @@ int be_visitor_args_marshal_ss::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/post_invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_invoke_cs.cpp index a9d8480eed4..2e8ebf3f89e 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 @@ -45,10 +45,11 @@ be_visitor_args_post_invoke_cs::~be_visitor_args_post_invoke_cs (void) int be_visitor_args_post_invoke_cs::visit_argument (be_argument *node) { - this->ctx_->node (node); // save the argument node + this->ctx_->node (node); - // retrieve the type of the argument + // Retrieve the type of the argument. be_type *bt = be_type::narrow_from_decl (node->field_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, @@ -76,10 +77,9 @@ be_visitor_args_post_invoke_cs::visit_argument (be_argument *node) int be_visitor_args_post_invoke_cs::visit_interface (be_interface *node) { - // we must narrow the out object reference to the appropriate type - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + // We must narrow the out object reference to the appropriate type. + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); switch (this->direction ()) { @@ -100,16 +100,16 @@ be_visitor_args_post_invoke_cs::visit_interface (be_interface *node) default: break; } + return 0; } int be_visitor_args_post_invoke_cs::visit_interface_fwd (be_interface_fwd *node) { - // we must narrow the out object reference to the appropriate type - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + // We must narrow the out object reference to the appropriate type. + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); switch (this->direction ()) { @@ -130,16 +130,16 @@ be_visitor_args_post_invoke_cs::visit_interface_fwd (be_interface_fwd *node) default: break; } + return 0; } int be_visitor_args_post_invoke_cs::visit_valuetype (be_valuetype *) { - // we must narrow the out object reference to the appropriate type - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + // We must narrow the out object reference to the appropriate type. + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); switch (this->direction ()) { @@ -153,16 +153,16 @@ be_visitor_args_post_invoke_cs::visit_valuetype (be_valuetype *) default: break; } + return 0; } int be_visitor_args_post_invoke_cs::visit_valuetype_fwd (be_valuetype_fwd *) { - // we must narrow the out object reference to the appropriate type - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + // We must narrow the out object reference to the appropriate type. + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); switch (this->direction ()) { @@ -176,15 +176,16 @@ be_visitor_args_post_invoke_cs::visit_valuetype_fwd (be_valuetype_fwd *) default: break; } + return 0; } int be_visitor_args_post_invoke_cs::visit_string (be_string *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); + switch (this->direction ()) { case AST_Argument::dir_IN: @@ -207,6 +208,7 @@ be_visitor_args_post_invoke_cs::visit_string (be_string *node) case AST_Argument::dir_OUT: break; } + return 0; } @@ -214,6 +216,7 @@ int be_visitor_args_post_invoke_cs::visit_typedef (be_typedef *node) { this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -222,6 +225,7 @@ be_visitor_args_post_invoke_cs::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp index 8af31c3246f..e3362d2bf16 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/post_marshal_ss.cpp @@ -42,6 +42,7 @@ int be_visitor_args_post_marshal_ss::visit_argument (be_argument *node) // retrieve the type be_type *bt = be_type::narrow_from_decl (node->field_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, @@ -66,164 +67,10 @@ int be_visitor_args_post_marshal_ss::visit_argument (be_argument *node) return 0; } -int be_visitor_args_post_marshal_ss::visit_array (be_array *) -{ - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - return 0; -} - -int be_visitor_args_post_marshal_ss::visit_enum (be_enum *) -{ - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - return 0; -} - -int be_visitor_args_post_marshal_ss::visit_interface (be_interface *) -{ - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: // inout - case AST_Argument::dir_OUT: - break; - } - return 0; -} - -int be_visitor_args_post_marshal_ss::visit_interface_fwd (be_interface_fwd *) -{ - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: // inout - case AST_Argument::dir_OUT: - break; - } - return 0; -} - -int be_visitor_args_post_marshal_ss::visit_predefined_type ( - be_predefined_type *node - ) -{ - AST_PredefinedType::PredefinedType pt = node->pt (); - - if pt == AST_PredefinedType::PT_any) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - } - else if (pt == AST_PredefinedType::PT_pseudo - || pt == AST_PredefinedType::PT_object) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - } - else - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - } - - return 0; -} - -int be_visitor_args_post_marshal_ss::visit_sequence (be_sequence *) -{ - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - return 0; -} - -int be_visitor_args_post_marshal_ss::visit_string (be_string *) -{ - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - return 0; -} - -int be_visitor_args_post_marshal_ss::visit_structure (be_structure *) -{ - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - return 0; -} - -int be_visitor_args_post_marshal_ss::visit_union (be_union *) -{ - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - break; - case AST_Argument::dir_OUT: - break; - } - return 0; -} - int be_visitor_args_post_marshal_ss::visit_typedef (be_typedef *node) { this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -232,6 +79,7 @@ int be_visitor_args_post_marshal_ss::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/request_info_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/request_info_arglist.cpp index 35083b755d4..e4c9831a881 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 @@ -148,6 +148,7 @@ int be_visitor_args_request_info_arglist::visit_interface (be_interface *node) *os << this->type_name (node, "_out"); break; } + return 0; } @@ -169,6 +170,7 @@ int be_visitor_args_request_info_arglist::visit_interface_fwd ( *os << this->type_name (node, "_out"); break; } + return 0; } @@ -188,6 +190,7 @@ int be_visitor_args_request_info_arglist::visit_native (be_native *node) *os << this->type_name (node) << " &"; break; } + return 0; } 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 62901c0999b..993c3d44b18 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 @@ -39,8 +39,8 @@ be_visitor_args_request_info_ch::~be_visitor_args_request_info_ch (void) int be_visitor_args_request_info_ch::visit_argument (be_argument *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - this->ctx_->node (node); // save the argument node + TAO_OutStream *os = this->ctx_->stream (); + this->ctx_->node (node); // retrieve the type be_type *bt = be_type::narrow_from_decl (node->field_type ()); @@ -73,7 +73,7 @@ int be_visitor_args_request_info_ch::visit_argument (be_argument *node) int be_visitor_args_request_info_ch::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -102,7 +102,7 @@ int be_visitor_args_request_info_ch::visit_array (be_array *node) int be_visitor_args_request_info_ch::visit_enum (be_enum *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -132,7 +132,7 @@ int be_visitor_args_request_info_ch::visit_enum (be_enum *node) int be_visitor_args_request_info_ch::visit_interface (be_interface *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -146,6 +146,7 @@ int be_visitor_args_request_info_ch::visit_interface (be_interface *node) *os << this->type_name (node, "_out"); break; } + return 0; } @@ -153,7 +154,7 @@ int be_visitor_args_request_info_ch::visit_interface_fwd ( be_interface_fwd *node ) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -167,12 +168,13 @@ int be_visitor_args_request_info_ch::visit_interface_fwd ( *os << this->type_name (node, "_out"); break; } + return 0; } int be_visitor_args_request_info_ch::visit_native (be_native *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -186,6 +188,7 @@ int be_visitor_args_request_info_ch::visit_native (be_native *node) *os << this->type_name (node) << " &"; break; } + return 0; } @@ -266,7 +269,7 @@ int be_visitor_args_request_info_ch::visit_predefined_type ( int be_visitor_args_request_info_ch::visit_sequence (be_sequence *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -293,7 +296,7 @@ int be_visitor_args_request_info_ch::visit_sequence (be_sequence *node) int be_visitor_args_request_info_ch::visit_string (be_string *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); if (node->width () == 1) { @@ -331,7 +334,7 @@ int be_visitor_args_request_info_ch::visit_string (be_string *node) int be_visitor_args_request_info_ch::visit_structure (be_structure *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -353,14 +356,14 @@ int be_visitor_args_request_info_ch::visit_structure (be_structure *node) break; } - } + return 0; } int be_visitor_args_request_info_ch::visit_union (be_union *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -382,8 +385,8 @@ int be_visitor_args_request_info_ch::visit_union (be_union *node) break; } - } + return 0; } @@ -407,7 +410,7 @@ int be_visitor_args_request_info_ch::visit_typedef (be_typedef *node) int be_visitor_args_request_info_ch::visit_valuetype (be_valuetype *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -421,6 +424,7 @@ int be_visitor_args_request_info_ch::visit_valuetype (be_valuetype *node) *os << this->type_name (node, "_out"); break; } + return 0; } @@ -428,7 +432,7 @@ int be_visitor_args_request_info_ch::visit_valuetype_fwd ( be_valuetype_fwd *node ) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -442,6 +446,7 @@ int be_visitor_args_request_info_ch::visit_valuetype_fwd ( *os << this->type_name (node, "_out"); break; } + return 0; } 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 65488d6d2cc..ea9a7062592 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 @@ -43,14 +43,12 @@ be_visitor_args_request_info_result::~be_visitor_args_request_info_result ( int be_visitor_args_request_info_result::visit_argument (be_argument *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - this->ctx_->node (node); // save the argument node - be_type *bt; + TAO_OutStream *os = this->ctx_->stream (); + this->ctx_->node (node); os->indent (); + be_type *bt = be_type::narrow_from_decl (node->field_type ()); - // retrieve the type - bt = be_type::narrow_from_decl (node->field_type ()); if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, @@ -61,40 +59,47 @@ int be_visitor_args_request_info_result::visit_argument (be_argument *node) } if (bt->accept (this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_vardecl_ss::" - "visit_argument - " - "cannot accept visitor\n"), - -1); - } + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_args_vardecl_ss::" + "visit_argument - " + "cannot accept visitor\n"), + -1); + } *os << be_nl; + // Set the appropriate mode for each parameter. return 0; } int be_visitor_args_request_info_result::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); - // if the current type is an alias, use that be_type *bt; + if (this->ctx_->alias ()) - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } os->indent (); + *os << bt->name () << "_forany _tao_forany_result" << " (this->result_);" << be_nl - << "this->result_val_ <<= _tao_forany_result;"<< be_nl; + << "this->result_val_ <<= _tao_forany_result;" << be_nl; + return 0; } int be_visitor_args_request_info_result::visit_enum (be_enum *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); os->indent (); *os << "this->result_val_ <<= this->result_;"; @@ -104,7 +109,7 @@ int be_visitor_args_request_info_result::visit_enum (be_enum *) int be_visitor_args_request_info_result::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); os->indent (); *os << "this->result_val_ <<= this->result_;"; @@ -112,90 +117,98 @@ int be_visitor_args_request_info_result::visit_interface (be_interface *) return 0; } -int be_visitor_args_request_info_result::visit_interface_fwd (be_interface_fwd *) +int be_visitor_args_request_info_result::visit_interface_fwd ( + be_interface_fwd * + ) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); os->indent (); *os << "this->result_val_ <<= this->result_;"; return 0; - } int be_visitor_args_request_info_result::visit_valuetype (be_valuetype *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); os->indent (); *os << "this->result_val_ <<= this->result_;"; return 0; - } -int be_visitor_args_request_info_result::visit_valuetype_fwd (be_valuetype_fwd *) +int be_visitor_args_request_info_result::visit_valuetype_fwd ( + be_valuetype_fwd * + ) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); os->indent (); *os << "this->result_val_ <<= this->result_;"; return 0; - } int -be_visitor_args_request_info_result::visit_predefined_type (be_predefined_type *node) +be_visitor_args_request_info_result::visit_predefined_type ( + be_predefined_type *node + ) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); os->indent (); + *os << "this->result_val_ <<= "; + switch (node->pt ()) { case AST_PredefinedType::PT_boolean: *os << "CORBA::Any::from_boolean (this->result_);" << be_nl; + break; case AST_PredefinedType::PT_char: *os << "CORBA::Any::from_char (this->result_);"<<be_nl; + break; case AST_PredefinedType::PT_wchar: *os << "CORBA::Any::from_wchar (this->result_);"<<be_nl; + break; case AST_PredefinedType::PT_octet: *os << "CORBA::Any::from_octet (this->result_);"<<be_nl; - break; + break; default: *os << "this->result_;"<<be_nl; + break; } - return 0; + return 0; } int be_visitor_args_request_info_result::visit_sequence (be_sequence *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - + TAO_OutStream *os = this->ctx_->stream (); os->indent (); + *os << "this->result_val_ <<= this->result_;"; return 0; - } int be_visitor_args_request_info_result::visit_string (be_string *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - + TAO_OutStream *os = this->ctx_->stream (); os->indent (); + *os << "this->result_val_ <<= "; - // we need to make a distinction between bounded and unbounded strings + + // We need to make a distinction between bounded and unbounded strings. if (node->max_size ()->ev ()->u.ulval != 0) { - // bounded strings if (node->width () == (long) sizeof (char)) { *os << "CORBA::Any::from_string ((char *)"; @@ -204,44 +217,45 @@ be_visitor_args_request_info_result::visit_string (be_string *node) { *os << "CORBA::Any::from_wstring ((CORBA::WChar *)"; } + *os <<"this->result_, " << node->max_size ()->ev ()->u.ulval << ");"; } else + { *os << "this->result_; "; -return 0; + } + + return 0; } int be_visitor_args_request_info_result::visit_structure (be_structure *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - + TAO_OutStream *os = this->ctx_->stream (); os->indent (); + *os << "this->result_val_ <<= this->result_;"; return 0; - } int be_visitor_args_request_info_result::visit_union (be_union *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - + TAO_OutStream *os = this->ctx_->stream (); os->indent (); + *os << "this->result_val_ <<= this->result_;"; return 0; - } int be_visitor_args_request_info_result::visit_typedef (be_typedef *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - + TAO_OutStream *os = this->ctx_->stream (); os->indent (); + *os << "this->result_val_ <<= this->result_;"; return 0; - } 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 ffd869bc85b..049d3e7d874 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 @@ -43,8 +43,6 @@ int be_visitor_args_request_info_sh::visit_argument (be_argument *node) { TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); - - // retrieve the type be_type *bt = be_type::narrow_from_decl (node->field_type ()); if (!bt) @@ -70,8 +68,10 @@ 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; + return 0; } + int be_visitor_args_request_info_sh::visit_array (be_array *node) { TAO_OutStream *os = this->ctx_->stream (); @@ -88,12 +88,13 @@ int be_visitor_args_request_info_sh::visit_array (be_array *node) *os << this->type_name (node, "_out"); break; } + return 0; } int be_visitor_args_request_info_sh::visit_enum (be_enum *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -107,12 +108,13 @@ int be_visitor_args_request_info_sh::visit_enum (be_enum *node) *os << this->type_name (node, "_out"); break; } + return 0; } int be_visitor_args_request_info_sh::visit_interface (be_interface *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -126,12 +128,13 @@ int be_visitor_args_request_info_sh::visit_interface (be_interface *node) *os << this->type_name (node, "_out"); break; } + return 0; } int be_visitor_args_request_info_sh::visit_interface_fwd (be_interface_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -145,12 +148,13 @@ int be_visitor_args_request_info_sh::visit_interface_fwd (be_interface_fwd *node *os << this->type_name (node, "_out"); break; } + return 0; } int be_visitor_args_request_info_sh::visit_native (be_native *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -164,6 +168,7 @@ int be_visitor_args_request_info_sh::visit_native (be_native *node) *os << this->type_name (node) << " &"; break; } + return 0; } @@ -226,7 +231,7 @@ int be_visitor_args_request_info_sh::visit_predefined_type ( int be_visitor_args_request_info_sh::visit_sequence (be_sequence *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -240,12 +245,13 @@ int be_visitor_args_request_info_sh::visit_sequence (be_sequence *node) *os << this->type_name (node, "_out"); break; } + return 0; } int be_visitor_args_request_info_sh::visit_string (be_string *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); if (node->width () == 1) { @@ -283,7 +289,7 @@ int be_visitor_args_request_info_sh::visit_string (be_string *node) int be_visitor_args_request_info_sh::visit_structure (be_structure *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -297,6 +303,7 @@ int be_visitor_args_request_info_sh::visit_structure (be_structure *node) *os << this->type_name (node, "_out"); break; } + return 0; } @@ -316,12 +323,14 @@ int be_visitor_args_request_info_sh::visit_union (be_union *node) *os << this->type_name (node, "_out"); break; } + return 0; } int be_visitor_args_request_info_sh::visit_typedef (be_typedef *node) { this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -330,6 +339,7 @@ int be_visitor_args_request_info_sh::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } @@ -337,7 +347,7 @@ int be_visitor_args_request_info_sh::visit_typedef (be_typedef *node) int be_visitor_args_request_info_sh::visit_valuetype (be_valuetype *node) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -351,12 +361,15 @@ int be_visitor_args_request_info_sh::visit_valuetype (be_valuetype *node) *os << this->type_name (node, "_out"); break; } + return 0; } -int be_visitor_args_request_info_sh::visit_valuetype_fwd (be_valuetype_fwd *node) +int be_visitor_args_request_info_sh::visit_valuetype_fwd ( + be_valuetype_fwd *node + ) { - TAO_OutStream *os = this->ctx_->stream (); // get the stream + TAO_OutStream *os = this->ctx_->stream (); switch (this->direction ()) { @@ -370,6 +383,7 @@ int be_visitor_args_request_info_sh::visit_valuetype_fwd (be_valuetype_fwd *node *os << this->type_name (node, "_out"); break; } + return 0; } 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 0fa622fc8d3..434f4f02025 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp @@ -39,10 +39,9 @@ be_visitor_args_upcall_ss::~be_visitor_args_upcall_ss (void) int be_visitor_args_upcall_ss::visit_argument (be_argument *node) { - this->ctx_->node (node); // save the argument node - - // retrieve the type + this->ctx_->node (node); be_type *bt = be_type::narrow_from_decl (node->field_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, @@ -68,9 +67,8 @@ int be_visitor_args_upcall_ss::visit_argument (be_argument *node) int be_visitor_args_upcall_ss::visit_array (be_array *node) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); switch (this->direction ()) { @@ -83,29 +81,40 @@ int be_visitor_args_upcall_ss::visit_array (be_array *node) } *os << arg->local_name (); + break; case AST_Argument::dir_INOUT: *os << arg->local_name (); + break; case AST_Argument::dir_OUT: if (node->size_type () == AST_Type::VARIABLE) - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); - else - *os << arg->local_name () << ".out ()"; + { + if (this->ctx_->state () + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } + else + { + *os << arg->local_name () << ".out ()"; + } + } else - *os << arg->local_name (); + { + *os << arg->local_name (); + } + break; } + return 0; } int be_visitor_args_upcall_ss::visit_enum (be_enum *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); switch (this->direction ()) { @@ -113,136 +122,202 @@ int be_visitor_args_upcall_ss::visit_enum (be_enum *) case AST_Argument::dir_INOUT: case AST_Argument::dir_OUT: *os << arg->local_name (); + break; } + return 0; } int be_visitor_args_upcall_ss::visit_interface (be_interface *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); + switch (this->direction ()) { case AST_Argument::dir_IN: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".in ()"; + { + *os << arg->local_name () << ".in ()"; + } + break; case AST_Argument::dir_INOUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".inout ()"; + { + *os << arg->local_name () << ".inout ()"; + } + break; case AST_Argument::dir_OUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".out ()"; + { + *os << arg->local_name () << ".out ()"; + } + break; } + return 0; } int be_visitor_args_upcall_ss::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); + switch (this->direction ()) { case AST_Argument::dir_IN: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".in ()"; + { + *os << arg->local_name () << ".in ()"; + } + break; case AST_Argument::dir_INOUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".inout ()"; + { + *os << arg->local_name () << ".inout ()"; + } + break; case AST_Argument::dir_OUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".out ()"; + { + *os << arg->local_name () << ".out ()"; + } + break; } + return 0; } int be_visitor_args_upcall_ss::visit_valuetype (be_valuetype *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); + switch (this->direction ()) { case AST_Argument::dir_IN: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".in ()"; + { + *os << arg->local_name () << ".in ()"; + } + break; case AST_Argument::dir_INOUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".inout ()"; + { + *os << arg->local_name () << ".inout ()"; + } + break; case AST_Argument::dir_OUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".out ()"; + { + *os << arg->local_name () << ".out ()"; + } + break; } + return 0; } int be_visitor_args_upcall_ss::visit_valuetype_fwd (be_valuetype_fwd *) { - TAO_OutStream *os = this->ctx_->stream (); // get output stream - be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument - // node + TAO_OutStream *os = this->ctx_->stream (); + be_argument *arg = this->ctx_->be_node_as_argument (); + switch (this->direction ()) { case AST_Argument::dir_IN: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".in ()"; + { + *os << arg->local_name () << ".in ()"; + } + break; case AST_Argument::dir_INOUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".inout ()"; + { + *os << arg->local_name () << ".inout ()"; + } + break; case AST_Argument::dir_OUT: if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } else - *os << arg->local_name () << ".out ()"; + { + *os << arg->local_name () << ".out ()"; + } + break; } + return 0; } @@ -326,6 +401,7 @@ int be_visitor_args_upcall_ss::visit_predefined_type (be_predefined_type *node) case AST_Argument::dir_INOUT: case AST_Argument::dir_OUT: *os << arg->local_name (); + break; } // end switch direction } // end of else @@ -358,6 +434,7 @@ int be_visitor_args_upcall_ss::visit_sequence (be_sequence *) break; } + return 0; } @@ -405,6 +482,7 @@ int be_visitor_args_upcall_ss::visit_string (be_string *) break; } + return 0; } @@ -440,6 +518,7 @@ int be_visitor_args_upcall_ss::visit_structure (be_structure *node) break; } + return 0; } @@ -453,24 +532,36 @@ int be_visitor_args_upcall_ss::visit_union (be_union *node) case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: *os << arg->local_name (); + break; case AST_Argument::dir_OUT: if (node->size_type () == AST_Type::VARIABLE) - if (this->ctx_->state () - == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) - *os << arg->local_name (); - else - *os << arg->local_name () << ".out ()"; + { + if (this->ctx_->state () + == TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS) + { + *os << arg->local_name (); + } + else + { + *os << arg->local_name () << ".out ()"; + } + } else - *os << arg->local_name (); + { + *os << arg->local_name (); + } + break; } + return 0; } int be_visitor_args_upcall_ss::visit_typedef (be_typedef *node) { this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -479,6 +570,7 @@ int be_visitor_args_upcall_ss::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp index 42a0de16d52..2f5e82c63f5 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp @@ -61,6 +61,10 @@ 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; + // Generate the ifdefined macro. os->gen_ifdef_macro (node->flat_name ()); @@ -214,22 +218,24 @@ int be_visitor_array_ch::visit_array (be_array *node) { // Typedefed array. *os << storage_class << node->nested_type_name (scope, "_slice") - << " *"; - *os << node->nested_type_name (scope, "_alloc") << " (void);" << be_nl; - *os << storage_class << "void " + << " *" << be_nl; + *os << node->nested_type_name (scope, "_alloc") << " (void);" + << be_nl << be_nl; + *os << storage_class << "void" << be_nl << node->nested_type_name (scope, "_free") << " (" << be_idt << be_idt_nl; *os << node->nested_type_name (scope, "_slice") << " *_tao_slice " << be_uidt_nl - << ");" << be_uidt_nl; - *os << storage_class << node->nested_type_name (scope, "_slice") << " *"; + << ");" << be_uidt_nl << be_nl; + *os << storage_class << node->nested_type_name (scope, "_slice") + << " *" << be_nl; *os << node->nested_type_name (scope, "_dup") << " (" << be_idt << be_idt_nl << "const "; *os << node->nested_type_name (scope, "_slice") << " *_tao_slice" << be_uidt_nl - << ");" << be_uidt_nl; - *os << storage_class << "void " + << ");" << be_uidt_nl << be_nl; + *os << storage_class << "void" << be_nl << node->nested_type_name (scope, "_copy") << " (" << be_idt << be_idt_nl; *os << node->nested_type_name (scope, "_slice") << " *_tao_to," << be_nl @@ -242,24 +248,24 @@ int be_visitor_array_ch::visit_array (be_array *node) { // Anonymous array. *os << storage_class << node->nested_type_name (scope, "_slice", "_") - << " *"; + << " *" << be_nl; *os << node->nested_type_name (scope, "_alloc", "_") - << " (void);" << be_nl; - *os << storage_class << "void " + << " (void);" << be_nl << be_nl; + *os << storage_class << "void" << be_nl << node->nested_type_name (scope, "_free", "_") << " (" << be_idt << be_idt_nl; *os << node->nested_type_name (scope, "_slice", "_") << " *_tao_slice" << be_uidt_nl - << ");" << be_uidt_nl; + << ");" << be_uidt_nl << be_nl; *os << storage_class << node->nested_type_name (scope, "_slice", "_") - << " *"; + << " *" << be_nl; *os << node->nested_type_name (scope, "_dup", "_") << " (" << be_idt << be_idt_nl << "const "; *os << node->nested_type_name (scope, "_slice", "_") << " *_tao_slice" << be_uidt_nl - << ");" << be_uidt_nl; - *os << storage_class << "void " + << ");" << be_uidt_nl << be_nl; + *os << storage_class << "void" << be_nl << node->nested_type_name (scope, "_copy", "_") << " (" << be_idt << be_idt_nl; *os << node->nested_type_name (scope, "_slice", "_") 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 86e7c060e7a..d5dc7a1647c 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp @@ -135,9 +135,14 @@ be_visitor_array_ci::gen_var_impl (be_array *node) if (this->ctx_->tdef ()) { // typedefed node - ACE_OS::sprintf (nodename, "%s", node->full_name ()); - ACE_OS::sprintf (fname, "%s_var", node->full_name ()); - ACE_OS::sprintf (lname, "%s_var", + ACE_OS::sprintf (nodename, + "%s", + node->full_name ()); + ACE_OS::sprintf (fname, + "%s_var", + node->full_name ()); + ACE_OS::sprintf (lname, + "%s_var", node->local_name ()->get_string ()); } else @@ -149,25 +154,38 @@ be_visitor_array_ci::gen_var_impl (be_array *node) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), + ACE_OS::sprintf (nodename, + "%s::_%s", + parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (fname, "%s::_%s_var", parent->full_name (), + ACE_OS::sprintf (fname, + "%s::_%s_var", + parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (lname, "_%s_var", + ACE_OS::sprintf (lname, + "_%s_var", node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (nodename, "_%s", node->full_name ()); - ACE_OS::sprintf (fname, "_%s_var", node->full_name ()); - ACE_OS::sprintf (lname, "_%s_var", + ACE_OS::sprintf (nodename, + "_%s", + node->full_name ()); + ACE_OS::sprintf (fname, + "_%s_var", + node->full_name ()); + ACE_OS::sprintf (lname, + "_%s_var", node->local_name ()->get_string ()); } } - // generate the var implementation in the inline file + // Generate the var implementation in the inline file. - os->indent (); // start with whatever was our current indent level + os->indent (); + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" << be_nl; @@ -177,133 +195,139 @@ be_visitor_array_ci::gen_var_impl (be_array *node) // default constr *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << - " (void) // default constructor" << be_nl; + " (void)" << be_nl; *os << " " << ": ptr_ (0)" << be_nl; - *os << "{}\n\n"; + *os << "{}" << be_nl << be_nl; // constr from a _slice * - os->indent (); *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << " (" << nodename << "_slice *p)" << be_nl; *os << " : ptr_ (p)" << be_nl; - *os << "{}\n\n"; + *os << "{}" << be_nl << be_nl; // copy constructor (deep copy) - os->indent (); *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << " (const " << fname - << " &p) // copy constructor" << be_nl; + << " &p)" << be_nl; *os << "{" << be_idt_nl; - *os << "this->ptr_ = " << nodename << "_dup " << "(ACE_const_cast (const " - << nodename << "_slice *, p.ptr_));" << be_uidt_nl; - *os << "}\n\n"; + *os << "this->ptr_ =" << be_idt_nl << nodename << "_dup " << "(" + << be_idt << be_idt_nl + << "ACE_const_cast (" << be_idt << be_idt_nl + << "const " + << nodename << "_slice *," << be_nl + << "p.ptr_" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ");" << be_uidt << be_uidt << be_uidt_nl; + *os << "}" << be_nl << be_nl; // destructor - os->indent (); *os << "ACE_INLINE" << be_nl; - *os << fname << "::~" << lname << " (void) // destructor" << be_nl; + *os << fname << "::~" << lname << " (void)" << be_nl; *os << "{" << be_idt_nl; *os << nodename << "_free (this->ptr_);" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // assignment operator - os->indent (); *os << "ACE_INLINE " << fname << " &" << be_nl; *os << fname << "::operator= (" << nodename << "_slice *p)" << be_nl; *os << "{" << be_idt_nl; - *os << "// is what we own the same that is being assigned to us?" + *os << "// Is what we own the same that is being assigned to us?" << be_nl; - *os << "if (this->ptr_ != p)" << be_nl; + *os << "if (this->ptr_ != p)" << be_idt_nl; *os << "{" << be_idt_nl; - *os << "// delete our stuff and assume ownership of p" << be_nl; + *os << "// Delete our stuff and assume ownership of p." << be_nl; *os << nodename << "_free (this->ptr_);" << be_nl; *os << "this->ptr_ = p;" << be_uidt_nl; - *os << "}" << be_nl; + *os << "}" << be_uidt_nl << be_nl; *os << "return *this;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // assignment operator from _var - os->indent (); *os << "ACE_INLINE " << fname << " &" << be_nl; *os << fname << "::operator= (const " << fname << " &p)" << be_nl; *os << "{" << be_idt_nl; - *os << "if (this != &p)" << be_nl; + *os << "if (this != &p)" << be_idt_nl; *os << "{" << be_idt_nl; - *os << "// not assigning to ourselves" << be_nl; - *os << nodename << "_free (this->ptr_); // free old stuff" << be_nl; - *os << "// deep copy" << be_nl; - *os << "this->ptr_ = " << nodename << "_dup (ACE_const_cast (const " - << nodename << "_slice *, p.ptr_));" << be_uidt_nl; - *os << "}" << be_nl; + *os << nodename << "_free (this->ptr_);" << be_nl; + *os << "// Deep copy." << be_nl; + *os << "this->ptr_ =" << be_idt_nl + << nodename << "_dup (" << be_idt << be_idt_nl + << "ACE_const_cast (" << be_idt << be_idt_nl + << "const " << nodename << "_slice *," << be_nl\ + << "p.ptr_" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ");" << be_uidt << be_uidt << be_uidt_nl; + *os << "}" << be_uidt_nl << be_nl; *os << "return *this;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // other extra methods - cast operators () - os->indent (); *os << "ACE_INLINE " << be_nl; *os << fname << "::operator " << nodename - << "_slice * const &() const // cast" << be_nl; + << "_slice * const &() const" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; if (node->size_type () == AST_Type::VARIABLE) { - os->indent (); *os << "ACE_INLINE " << be_nl; *os << fname << "::operator " << nodename << "_slice *&() // cast " << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; } // two operator []s instead of -> - os->indent (); *os << "ACE_INLINE " << be_nl; *os << "const " << nodename << "_slice &" << be_nl; *os << fname << "::operator[] (CORBA::ULong index) const" << be_nl; *os << "{" << be_nl; *os << "#if defined (ACE_HAS_BROKEN_IMPLICIT_CONST_CAST)" << be_idt_nl; - *os << "return ACE_const_cast (const " << nodename - << "_slice &, this->ptr_[index]);" << be_uidt_nl; + *os << "return ACE_const_cast (" << be_idt << be_idt_nl + << "const " << nodename + << "_slice &," << be_nl + << "this->ptr_[index]" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl; *os << "#else" << be_idt_nl; *os << "const " << nodename << "_slice &tmp = this->ptr_[index];" << be_nl; *os << "return tmp;" << be_uidt_nl; *os << "#endif /* ACE_HAS_BROKEN_IMPLICIT_CONST_CAST */" << be_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "ACE_INLINE " << be_nl; *os << 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 << "}" << be_nl << be_nl; // copy (in case we are a sequence element) - os->indent (); *os << "ACE_INLINE void" << be_nl; - *os << fname << "::copy (" << nodename << "_slice *_tao_to, " - << "const " << nodename << "_slice *_tao_from)" << be_nl; + *os << fname << "::copy (" << be_idt << be_idt_nl + << nodename << "_slice *_tao_to," << be_nl + << "const " << nodename << "_slice *_tao_from" << be_uidt_nl + << ")" << be_uidt_nl; *os << "{" << be_idt_nl; *os << nodename << "_copy (_tao_to, _tao_from);" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // in, inout, out, and _retn - os->indent (); *os << "ACE_INLINE const " << nodename << "_slice *" << be_nl; *os << fname << "::in (void) const" << be_nl; *os << "{" << be_idt_nl; - *os << "return ACE_const_cast (const " << nodename - << "_slice *, this->ptr_);" << be_uidt_nl; - *os << "}\n\n"; + *os << "return ACE_const_cast (" << be_idt << be_idt_nl + << "const " << nodename + << "_slice *," << be_nl + << "this->ptr_" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl; + *os << "}" << be_nl << be_nl; - os->indent (); if (node->size_type () == AST_Type::FIXED) { *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; @@ -316,28 +340,25 @@ be_visitor_array_ci::gen_var_impl (be_array *node) *os << fname << "::inout (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "ACE_INLINE " << nodename << "_slice * &" << be_nl; *os << fname << "::out (void)" << be_nl; *os << "{" << be_idt_nl; *os << nodename << "_free (this->ptr_);" << be_nl; *os << "this->ptr_ = (" << nodename << "_slice *)0;" << be_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; *os << fname << "::_retn (void)" << be_nl; *os << "{" << be_idt_nl; *os << nodename << "_slice *tmp = this->ptr_;" << be_nl; *os << "this->ptr_ = (" << nodename << "_slice *)0;" << be_nl; *os << "return tmp;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // the additional ptr () member function - os->indent (); *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; *os << fname << "::ptr (void) const" << be_nl; *os << "{" << be_idt_nl; @@ -357,15 +378,26 @@ be_visitor_array_ci::gen_out_impl (be_array *node) char lname [NAMEBUFSIZE]; // local names of the out class // save the node's local name and full name in a buffer for quick use later // on - ACE_OS::memset (nodename, '\0', NAMEBUFSIZE); - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); + ACE_OS::memset (nodename, + '\0', + NAMEBUFSIZE); + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); + ACE_OS::memset (lname, + '\0', + NAMEBUFSIZE); if (this->ctx_->tdef ()) { // typedefed node - ACE_OS::sprintf (nodename, "%s", node->full_name ()); - ACE_OS::sprintf (fname, "%s_out", node->full_name ()); - ACE_OS::sprintf (lname, "%s_out", + ACE_OS::sprintf (nodename, + "%s", + node->full_name ()); + ACE_OS::sprintf (fname, + "%s_out", + node->full_name ()); + ACE_OS::sprintf (lname, + "%s_out", node->local_name ()->get_string ()); } else @@ -377,42 +409,54 @@ be_visitor_array_ci::gen_out_impl (be_array *node) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), + ACE_OS::sprintf (nodename, + "%s::_%s", + parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (fname, "%s::_%s_out", parent->full_name (), + ACE_OS::sprintf (fname, + "%s::_%s_out", + parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (lname, "_%s_out", + ACE_OS::sprintf (lname, + "_%s_out", node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (nodename, "_%s", node->full_name ()); - ACE_OS::sprintf (fname, "_%s_out", node->full_name ()); - ACE_OS::sprintf (lname, "_%s_out", + ACE_OS::sprintf (nodename, + "_%s", + node->full_name ()); + ACE_OS::sprintf (fname, + "_%s_out", + node->full_name ()); + ACE_OS::sprintf (lname, + "_%s_out", node->local_name ()->get_string ()); } } - // generate the out implementation in the inline file + // Generate the out implementation in the inline file. - os->indent (); // start with whatever was our current indent level + os->indent (); + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; *os << "// *************************************************************" << be_nl; *os << "// Inline operations for class " << fname << be_nl; - *os << "// *************************************************************\n\n"; + *os << "// *************************************************************" + << be_nl << be_nl; - // constr from a pointer to slice - os->indent (); + // Constructor from a pointer to slice. *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << " (" << nodename << "_slice *&p)" << be_nl; *os << " : ptr_ (p)" << be_nl; *os << "{" << be_idt_nl; *os << "this->ptr_ = 0;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // constructor from _var & - os->indent (); *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << " (" << nodename << "_var &p) // constructor from _var" << be_nl; @@ -420,19 +464,17 @@ be_visitor_array_ci::gen_out_impl (be_array *node) *os << "{" << be_idt_nl; *os << nodename << "_free (this->ptr_);" << be_nl; *os << "this->ptr_ = 0;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // copy constructor - os->indent (); *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << " (const " << fname << " &p) // copy constructor" << be_nl; *os << " : ptr_ (ACE_const_cast (" << fname << "&,p).ptr_)" << be_nl; - *os << "{}\n\n"; + *os << "{}" << be_nl << be_nl; // assignment operator from _out & - os->indent (); *os << "ACE_INLINE " << fname << " &" << be_nl; *os << fname << "::operator= (const " << fname << " &p)" << be_nl; @@ -440,39 +482,35 @@ be_visitor_array_ci::gen_out_impl (be_array *node) *os << "this->ptr_ = ACE_const_cast (" << fname << "&,p).ptr_;" << be_nl; *os << "return *this;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // assignment from _var is not allowed // assignment operator from _ptr - os->indent (); *os << "ACE_INLINE " << fname << " &" << be_nl; *os << fname << "::operator= (" << nodename << "_slice *p)" << be_nl; *os << "{" << be_idt_nl; *os << "this->ptr_ = p;" << be_nl; *os << "return *this;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // other extra methods - cast operator () - os->indent (); *os << "ACE_INLINE " << be_nl; *os << fname << "::operator " << nodename << "_slice *&() // cast" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // ptr function - os->indent (); *os << "ACE_INLINE " << nodename << "_slice *&" << be_nl; *os << fname << "::ptr (void) // ptr" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // operator [] instead of -> - os->indent (); *os << "ACE_INLINE " << nodename << "_slice &" << be_nl; *os << fname << "::operator[] (CORBA::ULong index)" << be_nl; *os << "{" << be_idt_nl; @@ -488,22 +526,35 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) if (node->is_local ()) return 0; - TAO_OutStream *os = this->ctx_->stream (); // output stream + TAO_OutStream *os = this->ctx_->stream (); char nodename [NAMEBUFSIZE]; // node name char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local names of the var - // save the node's local name and full name in a buffer for quick use later + char lname [NAMEBUFSIZE]; // local names of the forany + + // Save the node's local name and full name in a buffer for quick use later // on - ACE_OS::memset (nodename, '\0', NAMEBUFSIZE); - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); + ACE_OS::memset (nodename, + '\0', + NAMEBUFSIZE); + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); + ACE_OS::memset (lname, + '\0', + NAMEBUFSIZE); + if (this->ctx_->tdef ()) { // typedefed node - ACE_OS::sprintf (nodename, "%s", node->full_name ()); - ACE_OS::sprintf (fname, "%s_forany", node->full_name ()); - ACE_OS::sprintf (lname, "%s_forany", + ACE_OS::sprintf (nodename, + "%s", + node->full_name ()); + ACE_OS::sprintf (fname, + "%s_forany", + node->full_name ()); + ACE_OS::sprintf (lname, + "%s_forany", node->local_name ()->get_string ()); } else @@ -515,18 +566,28 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), + ACE_OS::sprintf (nodename, + "%s::_%s", + parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (fname, "%s::_%s_forany", parent->full_name (), + ACE_OS::sprintf (fname, + "%s::_%s_forany", + parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (lname, "_%s_forany", + ACE_OS::sprintf (lname, + "_%s_forany", node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (nodename, "_%s", node->full_name ()); - ACE_OS::sprintf (fname, "_%s_forany", node->full_name ()); - ACE_OS::sprintf (lname, "_%s_forany", + ACE_OS::sprintf (nodename, + "_%s", + node->full_name ()); + ACE_OS::sprintf (fname, + "_%s_forany", + node->full_name ()); + ACE_OS::sprintf (lname, + "_%s_forany", node->local_name ()->get_string ()); } } @@ -535,101 +596,109 @@ 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 + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "// *************************************************************" << be_nl; *os << "// Inline operations for class " << fname << be_nl; - *os << "// *************************************************************\n\n"; + *os << "// *************************************************************" + << be_nl << be_nl; // default constr *os << "ACE_INLINE" << be_nl; *os << fname << "::" << lname << - " (void) // default constructor" << be_nl; + " (void)" << be_nl; *os << " " << ": ptr_ (0)," << be_nl; *os << " nocopy_ (0)" << be_nl; - *os << "{}\n\n"; + *os << "{}" << be_nl << be_nl; // constr from a _slice * - os->indent (); *os << "ACE_INLINE" << be_nl; - *os << fname << "::" << lname << " (" << nodename << "_slice *p, " - << "CORBA::Boolean nocopy)" << be_nl; + *os << fname << "::" << lname << " (" << be_idt << be_idt_nl + << nodename << "_slice *p," << be_nl + << "CORBA::Boolean nocopy" << be_uidt_nl + << ")" << be_uidt_nl; *os << " : ptr_ (p)," << be_nl; *os << " nocopy_ (nocopy)" << be_nl; - *os << "{}\n\n"; + *os << "{}" << be_nl << be_nl; // copy constructor (deep copy) - os->indent (); *os << "ACE_INLINE" << be_nl; - *os << fname << "::" << lname << " (const " << fname - << " &p) // copy constructor" << be_nl; - *os << "{" << be_idt_nl; - *os << "this->ptr_ = " << nodename << "_dup (ACE_const_cast (const " - << nodename << "_slice *, p.ptr_));" << be_nl; + *os << fname << "::" << lname << " (" << be_idt << be_idt_nl + << "const " << fname << " &p" << be_uidt_nl + << ")" << be_uidt_nl; + *os << "{" << be_idt_nl; + *os << "this->ptr_ =" << be_idt_nl + << nodename << "_dup (" << be_idt << be_idt_nl + << "ACE_const_cast (" << be_idt << be_idt_nl + << "const " << nodename << "_slice *," << be_nl + << "p.ptr_" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ");" << be_uidt << be_uidt_nl; *os << "this->nocopy_ = p.nocopy_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // destructor - os->indent (); *os << "ACE_INLINE" << be_nl; - *os << fname << "::~" << lname << " (void) // destructor" << be_nl; - *os << "{" << be_nl; - *os << " // don't do anything" << be_nl; - *os << "}\n\n"; + *os << fname << "::~" << lname << " (void)" << be_nl; + *os << "{" << be_idt_nl; + *os << "// don't do anything" << be_uidt_nl; + *os << "}" << be_nl << be_nl; // assignment operator - os->indent (); *os << "ACE_INLINE " << fname << " &" << be_nl; *os << fname << "::operator= (" << nodename << "_slice *p)" << be_nl; *os << "{" << be_idt_nl; - *os << "// is what we own the same that is being assigned to us?" + *os << "// Is what we own the same that is being assigned to us?" << be_nl; - *os << "if (this->ptr_ != p)" << be_nl; + *os << "if (this->ptr_ != p)" << be_idt_nl; *os << "{" << be_idt_nl; - *os << "// delete our stuff and assume ownership of p" << be_nl; + *os << "// Delete our stuff and assume ownership of p." << be_nl; *os << nodename << "_free (this->ptr_);" << be_nl; *os << "this->ptr_ = p;" << be_uidt_nl; - *os << "}" << be_nl; + *os << "}" << be_uidt_nl << be_nl; *os << "return *this;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // assignment operator from _forany - os->indent (); *os << "ACE_INLINE " << fname << " &" << be_nl; *os << fname << "::operator= (const " << fname << " &p)" << be_nl; *os << "{" << be_idt_nl; - *os << "if (this != &p)" << be_nl; + *os << "if (this != &p)" << be_idt_nl; *os << "{" << be_idt_nl; - *os << "// not assigning to ourselves" << be_nl; - *os << nodename << "_free (this->ptr_); // free old stuff" << be_nl; - *os << "// deep copy" << be_nl; - *os << "this->ptr_ = " << nodename << "_dup (ACE_const_cast (const " - << nodename << "_slice *, p.ptr_));" << be_nl; + *os << nodename << "_free (this->ptr_);" << be_nl; + *os << "// Deep copy." << be_nl; + *os << "this->ptr_ =" << be_idt_nl + << nodename << "_dup (" << be_idt << be_idt_nl + << "ACE_const_cast (" << be_idt << be_idt_nl + << "const " << nodename << "_slice *," << be_nl + << "p.ptr_" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ");" << be_uidt << be_uidt_nl; *os << "this->nocopy_ = p.nocopy_;" << be_uidt_nl; - *os << "}" << be_nl; + *os << "}" << be_uidt_nl << be_nl; *os << "return *this;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // other extra methods - cast operators () - os->indent (); *os << "ACE_INLINE " << be_nl; *os << fname << "::operator " << nodename - << "_slice * const &() const // cast" << be_nl; + << "_slice * const &() const" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "ACE_INLINE " << be_nl; *os << fname << "::operator " << nodename - << "_slice *&() // cast " << be_nl; + << "_slice *&()" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // two operator []s instead of -> - os->indent (); *os << "ACE_INLINE " << be_nl; *os << "const " << nodename << "_slice &" << be_nl; *os << fname << "::operator[] (CORBA::ULong index) const" << be_nl; @@ -639,63 +708,60 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) // not accept one, but will do it implicitly with a temporary. // It's only a problem with multidimensional arrays. #if defined (ACE_HAS_BROKEN_IMPLICIT_CONST_CAST) - *os << "return ACE_const_cast (const " << nodename - << "_slice &, this->ptr_[index]);" << be_uidt_nl; + *os << "return ACE_const_cast (" << be_idt << be_idt_nl + << "const " << nodename << "_slice &," << be_nl + << "this->ptr_[index]" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl; #else *os << "const " << nodename << "_slice &tmp = this->ptr_[index];" << be_nl; *os << "return tmp;" << be_uidt_nl; #endif /* ACE_HAS_BROKEN_IMPLICIT_CONST_CAST */ - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "ACE_INLINE " << be_nl; *os << 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 << "}" << be_nl << be_nl; // in, inout, out, and _retn - os->indent (); *os << "ACE_INLINE const " << nodename << "_slice *" << be_nl; *os << fname << "::in (void) const" << be_nl; *os << "{" << be_idt_nl; - *os << "return ACE_const_cast (const " << nodename - << "_slice *, this->ptr_);" << be_uidt_nl; - *os << "}\n\n"; + *os << "return ACE_const_cast (" << be_idt << be_idt_nl + << "const " << nodename << "_slice *," << be_nl + << "this->ptr_" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; *os << fname << "::inout (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "ACE_INLINE " << nodename << "_slice * &" << be_nl; *os << fname << "::out (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "ACE_INLINE " << nodename << "_slice *" << be_nl; *os << fname << "::_retn (void)" << be_nl; *os << "{" << be_idt_nl; *os << "return this->ptr_;" << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // the additional ptr () member function - os->indent (); *os << "ACE_INLINE " << 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 << "}" << be_nl << be_nl; // the additional nocopy member function - os->indent (); *os << "ACE_INLINE CORBA::Boolean" << be_nl; *os << fname << "::nocopy (void) const" << be_nl; *os << "{" << be_idt_nl; 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 3bdc5265e17..7fd36801c75 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp @@ -109,6 +109,9 @@ int be_visitor_array_cs::visit_array (be_array *node) os->indent (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + if (!node->is_local ()) { *os << "void " << fname << "_forany" @@ -125,10 +128,13 @@ int be_visitor_array_cs::visit_array (be_array *node) << fname << "_dup (const " << fname << "_slice *_tao_src_array)" << be_nl; *os << "{" << be_idt_nl; - *os << fname << "_slice *_tao_dup_array = " << fname - << "_alloc ();" << be_nl; - *os << "if (!_tao_dup_array) return (" << fname - << "_slice *)0;" << be_nl; + *os << fname << "_slice *_tao_dup_array =" << be_idt_nl + << fname << "_alloc ();" << be_uidt_nl << be_nl; + *os << "if (!_tao_dup_array)" << be_idt_nl + << "{" << be_idt_nl + << "return (" << fname + << "_slice *)0;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; *os << fname << "_copy (_tao_dup_array, _tao_src_array);" << be_nl; *os << "return _tao_dup_array;" << be_uidt_nl; *os << "}\n\n"; @@ -175,13 +181,17 @@ int be_visitor_array_cs::visit_array (be_array *node) // copy method. os->indent (); *os << "void " << be_nl; - *os << fname << "_copy (" << fname << "_slice * _tao_to, " - << "const " << fname << "_slice *_tao_from)" << be_nl; + *os << fname << "_copy (" << be_idt << be_idt_nl + << fname << "_slice * _tao_to," << be_nl + << "const " << fname << "_slice *_tao_from" << be_uidt_nl + << ")" << be_uidt_nl; *os << "{" << be_idt_nl; - *os << "// copy each individual element" << be_nl; + *os << "// Copy each individual element." << be_nl; + + unsigned long ndims = node->n_dims (); // Generate nested loops for as many dimensions as there are. - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { // Retrieve the ith dimension value. AST_Expression *expr = node->dims ()[i]; @@ -199,7 +209,8 @@ int be_visitor_array_cs::visit_array (be_array *node) { // Generate a loop for each dimension. *os << "for (CORBA::ULong i" << i << " = 0; i" << i << " < " - << expr->ev ()->u.ulval << "; i" << i << "++)" << be_idt_nl; + << expr->ev ()->u.ulval << "; ++i" << i << ")" << be_idt_nl + << "{" << be_idt_nl; } else { @@ -251,7 +262,7 @@ int be_visitor_array_cs::visit_array (be_array *node) *os << "_copy (_tao_to"; - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { *os << "[i" << i << "]"; } @@ -259,7 +270,7 @@ int be_visitor_array_cs::visit_array (be_array *node) *os << ", "; *os << "_tao_from"; - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { *os << "[i" << i << "]"; } @@ -273,7 +284,7 @@ int be_visitor_array_cs::visit_array (be_array *node) *os << "_tao_to"; - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { *os << "[i" << i << "]"; } @@ -281,7 +292,7 @@ int be_visitor_array_cs::visit_array (be_array *node) *os << " = "; *os << "_tao_from"; - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { *os << "[i" << i << "]"; } @@ -289,10 +300,10 @@ int be_visitor_array_cs::visit_array (be_array *node) *os << ";"; } - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { - // Decrement indentation as many times as the number of dimensions. - *os << be_uidt; + // Add closing braces as many times as the number of dimensions. + *os << be_uidt_nl << "}" << be_uidt; } *os << be_uidt_nl << "}\n\n"; 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 fd9bbe6f07a..731c15ddc32 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 @@ -74,8 +74,7 @@ be_visitor_array_cdr_op_ch::visit_array (be_array *node) // Generate the CDR << and >> operator declarations. *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const "; - // @@ TODO: this should be done in the node, it is absurd to repeat - // this code all over the visitors!!!! + if (!this->ctx_->tdef ()) { be_scope* scope = be_scope::narrow_from_scope (node->defined_in ()); 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 7c0c52c16dd..99bafc854f1 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 @@ -52,17 +52,14 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) } else { - TAO_OutStream *os = this->ctx_->stream (); - - be_type *bt; // base type of the array - if (node->cli_inline_cdr_op_gen () || node->imported ()) { return 0; } // Retrieve the type. - bt = be_type::narrow_from_decl (node->base_type ()); + be_type *bt = be_type::narrow_from_decl (node->base_type ()); + TAO_OutStream *os = this->ctx_->stream (); if (!bt) { @@ -136,8 +133,10 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) // Set the sub state as generating code for the output operator. this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_OUTPUT); - *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, " - << "const " << fname << "_forany &_tao_array)" << be_nl + *os << "ACE_INLINE CORBA::Boolean operator<< (" << be_idt << be_idt_nl + << "TAO_OutputCDR &strm," << be_nl + << "const " << fname << "_forany &_tao_array" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl; if (bt->accept (this) == -1) @@ -154,8 +153,10 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) // Set the sub state as generating code for the input operator. os->indent (); this->ctx_->sub_state (TAO_CodeGen::TAO_CDR_INPUT); - *os << "ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, " - << fname << "_forany &_tao_array)" << be_nl + *os << "ACE_INLINE CORBA::Boolean operator>> (" << be_idt << be_idt_nl + << "TAO_InputCDR &strm," << be_nl + << fname << "_forany &_tao_array" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl; if (bt->accept (this) == -1) @@ -171,6 +172,7 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) node->cli_inline_cdr_op_gen (1); } + return 0; } @@ -393,14 +395,16 @@ be_visitor_array_cdr_op_ci::visit_predefined_type (be_predefined_type *node) -1); } + unsigned long ndims = array->n_dims (); + // Generate a product of all the dimensions. This will be the total length // of the "unfolded" single dimensional array. - for (i = 0; i < array->n_dims (); i++) + for (i = 0; i < ndims; ++i) { // Retrieve the ith dimension value. AST_Expression *expr = array->dims ()[i]; - if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL))) + if ((expr == 0) || ((expr != 0) && (expr->ev () == 0))) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_array_cdr_op_ci::" @@ -499,17 +503,19 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) // Initialize a boolean variable. *os << "CORBA::Boolean _tao_marshal_flag = 1;" << be_nl; + unsigned long ndims = node->n_dims (); + // We get here if the "type" of individual elements of the array is not a // primitive type. In this case, we are left with no other alternative but to // encode/decode element by element. // generate nested loops for as many dimensions as there are - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { // Retrieve the ith dimension value. AST_Expression *expr = node->dims ()[i]; - if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL))) + if ((expr == 0) || ((expr != 0) && (expr->ev () == 0))) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_array_cdr_op_ci::" @@ -551,7 +557,7 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) *os << "_tao_marshal_flag = (strm >> tmp);" << be_nl; *os << bt->name () << "_copy (_tao_array"; - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { *os << "[i" << i << "]"; } @@ -623,7 +629,7 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) *os << bt->name () << "_var tmp_var (" << bt->name () << "_dup (_tao_array"; - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { *os << "[i" << i << "]"; } @@ -637,7 +643,7 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) *os << "_tao_marshal_flag = (strm << "; *os << "_tao_array "; - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { *os << "[i" << i << "]"; } @@ -694,7 +700,7 @@ be_visitor_array_cdr_op_ci::visit_node (be_type *bt) -1); } - for (i = 0; i < node->n_dims (); i++) + for (i = 0; i < ndims; ++i) { // Decrement indentation as many times as the number of dimensions. *os << be_uidt; diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp index f2ab8557d58..e334ded9602 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp @@ -45,6 +45,7 @@ be_visitor_array_cdr_op_cs::visit_array (be_array *node) { // retrieve the base type be_type *bt = be_type::narrow_from_decl (node->base_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp index 40101b9fe37..660724cee65 100644 --- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp +++ b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp @@ -196,13 +196,6 @@ be_visitor_attribute::visit_attribute (be_attribute *node) status = get_op.accept (&visitor); break; } - case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH: - { - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); - be_visitor_operation_interceptors_ch visitor (&ctx); - status = get_op.accept (&visitor); - break; - } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS: { ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); @@ -325,7 +318,7 @@ be_visitor_attribute::visit_attribute (be_attribute *node) node->is_abstract ()); set_op.set_name ((UTL_IdList *) node->name ()->copy ()); set_op.set_defined_in (node->defined_in ()); - set_op.add_argument_to_scope (&arg); + set_op.be_add_argument (&arg); // Get the strategy from the attribute and hand it over // to the operation, thereby deleting the old one. @@ -448,13 +441,6 @@ be_visitor_attribute::visit_attribute (be_attribute *node) status = set_op.accept (&visitor); break; } - case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH: - { - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); - be_visitor_operation_interceptors_ch visitor (&ctx); - status = set_op.accept (&visitor); - break; - } case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS: { ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); @@ -550,6 +536,5 @@ be_visitor_attribute::visit_attribute (be_attribute *node) visitor = 0; } - 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 1a17a450edc..db20c61b3c8 100644 --- a/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_constant/constant_cs.cpp @@ -94,7 +94,18 @@ be_visitor_constant_cs::visit_constant (be_constant *node) // they get assigned to their values in the impl file. os->indent (); - *os << "const " << node->exprtype_to_string () << " " + *os << "const "; + + if (node->et () == AST_Expression::EV_enum) + { + *os << node->enum_full_name (); + } + else + { + *os << node->exprtype_to_string (); + } + + *os << " " << node->name () << " = " << node->constant_value () << ";\n\n"; } 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 fd061e87e90..a0161e9cb06 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 @@ -28,7 +28,7 @@ ACE_RCSID (be_visitor_enum, // *************************************************************************** be_visitor_enum_cdr_op_ch::be_visitor_enum_cdr_op_ch (be_visitor_context *ctx) - : be_visitor_scope (ctx) + : be_visitor_decl (ctx) { } @@ -40,7 +40,9 @@ int be_visitor_enum_cdr_op_ch::visit_enum (be_enum *node) { if (node->cli_hdr_cdr_op_gen () || node->imported ()) - return 0; + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); @@ -49,7 +51,7 @@ be_visitor_enum_cdr_op_ch::visit_enum (be_enum *node) os->indent (); *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator<< (TAO_OutputCDR &, const " << node->name () - << " &); // " << be_nl; + << " &);" << be_nl; *os << be_global->stub_export_macro () << " CORBA::Boolean" << " operator>> (TAO_InputCDR &, " << node->name () << " &);\n"; 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 bba973773c4..cab73d5328c 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 @@ -29,7 +29,7 @@ ACE_RCSID (be_visitor_enum, // *************************************************************************** be_visitor_enum_cdr_op_ci::be_visitor_enum_cdr_op_ci (be_visitor_context *ctx) - : be_visitor_scope (ctx) + : be_visitor_decl (ctx) { } 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 c8824a9c064..58e7c9ae69a 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 @@ -81,7 +81,7 @@ be_visitor_exception_cdr_op_ci::visit_exception (be_exception *node) // some members *os << "// first marshal the repository ID" << be_nl - << "if (strm << _tao_aggregate._id ())" << be_nl + << "if (strm << _tao_aggregate._rep_id ())" << be_nl << "{" << be_idt_nl << "// now marshal the members (if any)" << be_nl << "if (" << be_idt_nl; @@ -108,7 +108,7 @@ be_visitor_exception_cdr_op_ci::visit_exception (be_exception *node) { // No members. *os << "// first marshal the repository ID" << be_nl - << "if (strm << _tao_aggregate._id ())" << be_idt_nl + << "if (strm << _tao_aggregate._rep_id ())" << be_idt_nl << "return 1;" << be_uidt_nl << "else" << be_idt_nl << "return 0;" << be_uidt << be_uidt_nl; 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 a165fcc200f..59abb6dfc2c 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp @@ -57,12 +57,17 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) -1); } + *os << "// 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_nl; - *os << " : CORBA_UserException (\"" - << node->repoID () << "\")\n"; + << " (void)" << be_idt_nl; + *os << ": CORBA_UserException (" << be_idt << be_idt << be_idt_nl + << "\"" << node->repoID () << "\"," << be_nl + << "\"" << node->local_name () << "\"" << be_uidt_nl + << ")" << be_uidt << be_uidt << be_uidt_nl; *os << "{" << be_nl; *os << "}" << be_nl << be_nl; @@ -77,9 +82,11 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) // Copy constructor. *os << "// Copy constructor." << be_nl; *os << node->name () << "::" << node->local_name () << " (const ::" - << node->name () << " &_tao_excp)" << be_nl; - *os << " : CORBA_UserException (" - << "_tao_excp._id ())" << be_nl; + << node->name () << " &_tao_excp)" << be_idt_nl; + *os << ": CORBA_UserException (" << be_idt << be_idt << be_idt_nl + << "_tao_excp._rep_id ()," << be_nl + << "_tao_excp._name ()" << be_uidt_nl + << ")" << be_uidt << be_uidt << be_uidt_nl; *os << "{\n"; be_visitor_context ctx (*this->ctx_); @@ -149,7 +156,7 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) *os << node->name () << "::_downcast (CORBA::Exception *exc)" << be_nl; *os << "{" << be_idt_nl; *os << "if (!ACE_OS::strcmp (\"" << node->repoID () - << "\", exc->_id ()))" << be_idt_nl; + << "\", exc->_rep_id ()))" << be_idt_nl; *os << "{" << be_idt_nl; *os << "return ACE_dynamic_cast (" << node->local_name () << " *, exc);" << be_uidt_nl; @@ -293,8 +300,11 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) -1); } - *os << " : CORBA_UserException " - << "(\"" << node->repoID () << "\")" << be_uidt_nl; + *os << " : CORBA_UserException (" + << be_idt << be_idt << be_idt << be_idt_nl + << "\"" << node->repoID () << "\"," << be_nl + << "\"" << node->local_name () << "\"" << be_uidt_nl + << ")" << be_uidt << be_uidt << be_uidt << be_uidt_nl; *os << "{\n"; // Assign each individual member. We need yet another state. diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp index 6f98b8d346f..703f3835d69 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp @@ -81,8 +81,6 @@ int be_visitor_field_cdr_op_ci::visit_array (be_array *node) { TAO_OutStream *os = this->ctx_->stream (); - - // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); if (f == 0) @@ -100,7 +98,9 @@ be_visitor_field_cdr_op_ci::visit_array (be_array *node) // Save the node's local name and full name in a buffer for quick // use later on. - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); if (this->ctx_->alias () == 0 // Not a typedef. && node->is_child (this->ctx_->scope ())) @@ -140,10 +140,12 @@ be_visitor_field_cdr_op_ci::visit_array (be_array *node) case TAO_CodeGen::TAO_CDR_INPUT: *os << "(strm >> " << "_tao_aggregate_" << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_OUTPUT: *os << "(strm << " << "_tao_aggregate_" << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_SCOPE: // This is done in cdr_op_cs and hacked into *.i. @@ -213,9 +215,11 @@ be_visitor_field_cdr_op_ci::visit_enum (be_enum *node) { case TAO_CodeGen::TAO_CDR_INPUT: *os << "(strm >> _tao_aggregate." << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_OUTPUT: *os << "(strm << _tao_aggregate." << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_SCOPE: // Proceed further. @@ -263,16 +267,15 @@ int be_visitor_field_cdr_op_ci::visit_interface (be_interface *) { TAO_OutStream *os = this->ctx_->stream (); - - // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); + if (!f) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_interface - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } // Check what is the code generations substate. Are we generating code for @@ -281,12 +284,14 @@ be_visitor_field_cdr_op_ci::visit_interface (be_interface *) { case TAO_CodeGen::TAO_CDR_INPUT: *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())"; + break; case TAO_CodeGen::TAO_CDR_OUTPUT: *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; + break; case TAO_CodeGen::TAO_CDR_SCOPE: - // Nothing to be done because an interface cannit be declared inside a + // Nothing to be done because an interface cannot be declared inside a // structure. break; default: @@ -325,12 +330,14 @@ be_visitor_field_cdr_op_ci::visit_interface_fwd (be_interface_fwd *) { case TAO_CodeGen::TAO_CDR_INPUT: *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())"; + break; case TAO_CodeGen::TAO_CDR_OUTPUT: *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; + break; case TAO_CodeGen::TAO_CDR_SCOPE: - // Nothing to be done because an interface cannit be declared inside a + // Nothing to be done because an interface cannot be declared inside a // structure. break; default: @@ -469,9 +476,11 @@ be_visitor_field_cdr_op_ci::visit_sequence (be_sequence *node) { case TAO_CodeGen::TAO_CDR_INPUT: *os << "(strm >> _tao_aggregate." << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_OUTPUT: *os << "(strm << _tao_aggregate." << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_SCOPE: // Proceed further. @@ -540,9 +549,11 @@ be_visitor_field_cdr_op_ci::visit_string (be_string *) { case TAO_CodeGen::TAO_CDR_INPUT: *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())"; + break; case TAO_CodeGen::TAO_CDR_OUTPUT: *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; + break; case TAO_CodeGen::TAO_CDR_SCOPE: // Nothing to be done. @@ -583,9 +594,11 @@ be_visitor_field_cdr_op_ci::visit_structure (be_structure *node) { case TAO_CodeGen::TAO_CDR_INPUT: *os << "(strm >> _tao_aggregate." << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_OUTPUT: *os << "(strm << _tao_aggregate." << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_SCOPE: // Proceed further. @@ -677,9 +690,11 @@ be_visitor_field_cdr_op_ci::visit_union (be_union *node) { case TAO_CodeGen::TAO_CDR_INPUT: *os << "(strm >> _tao_aggregate." << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_OUTPUT: *os << "(strm << _tao_aggregate." << f->local_name () << ")"; + return 0; case TAO_CodeGen::TAO_CDR_SCOPE: // Proceed further. @@ -791,7 +806,9 @@ be_visitor_cdr_op_field_decl::visit_array (be_array *node) // the full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); if (this->ctx_->alias () == 0 // Not a typedef. && node->is_child (this->ctx_->scope ())) @@ -837,6 +854,7 @@ be_visitor_cdr_op_field_decl::visit_array (be_array *node) << "_tao_aggregate." << f->local_name () << be_uidt_nl << ")" << be_uidt << be_uidt_nl << ");" << be_uidt_nl; + break; case TAO_CodeGen::TAO_CDR_SCOPE: default: diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp index a5f4f2f35da..d62b67833e5 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp @@ -87,8 +87,8 @@ be_visitor_field_cdr_op_cs::visit_array (be_array *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_cs::" "visit_array - " - "codegen failed\n" - ), -1); + "codegen failed\n"), + -1); } } diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp index 021fbb55cc4..0b312d528f9 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp @@ -73,7 +73,6 @@ #include "be_visitor_interface/smart_proxy_ch.cpp" #include "be_visitor_interface/smart_proxy_cs.cpp" #include "be_visitor_interface/ami_interface_ch.cpp" -#include "be_visitor_interface/interceptors_ch.cpp" #include "be_visitor_interface/interceptors_cs.cpp" #include "be_visitor_interface/interceptors_sh.cpp" #include "be_visitor_interface/interceptors_ss.cpp" diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp index 1e4deb2c634..24c03a490fe 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ch.cpp @@ -134,6 +134,5 @@ be_visitor_amh_interface_ch::visit_interface (be_interface *node) } node->cli_hdr_gen (I_TRUE); - return 0; } 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 edd83a64f1c..943f5c9f8a1 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 @@ -93,5 +92,6 @@ be_visitor_amh_rh_interface_sh::visit_interface (be_interface *node) } *os << be_uidt_nl << "};\n\n"; + return 0; } 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 a2b2d5a8c4c..7ca7785afff 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 @@ -56,17 +56,17 @@ be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node) delete [] buf; ACE_CString rh_skel_class_name_prefix (rh_skel_prefix.c_str ()); + if (!node->is_nested ()) { // ...or the "POA_TAO_" prefix if we are in the global // namespace.... rh_skel_class_name_prefix = "POA_TAO_"; } - //node->compute_full_name (rh_skel_class_name_prefix.c_str(), "", buf); + ACE_CString rh_skel_class_name (rh_skel_class_name_prefix); rh_skel_class_name += node->local_name (); - // constructor *os << be_nl << "// TAO_IDL - Generated from " << __FILE__ << ":" << __LINE__ << be_nl; @@ -90,7 +90,7 @@ be_visitor_amh_rh_interface_ss::visit_interface (be_interface *node) *os << "}\n\n"; - // generate code for elements in the scope (e.g., operations) + // Generate code for elements in the scope (e.g., operations) // We'll rely on the base class (be_visitor_scope) to do the // right thing for us. if (this->visit_scope (node) == -1) 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 375e648e774..a4a17c11b7c 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp @@ -26,10 +26,10 @@ be_visitor_amh_interface_sh::~be_visitor_amh_interface_sh (void) { } -/** The node is the original interface node but we 'tweak' with the - local_name and the the operation signatures to generate the AMH - skeleton on the 'fly'. -*/ +// The node is the original interface node but we 'tweak' with the +// local_name and the the operation signatures to generate the AMH +// skeleton on the 'fly'. + int be_visitor_amh_interface_sh::visit_interface (be_interface *node) { @@ -44,10 +44,8 @@ be_visitor_amh_interface_sh::visit_interface (be_interface *node) return 0; } - TAO_OutStream *os = this->ctx_->stream (); // output stream - - ACE_CString class_name; // holds the class name - + TAO_OutStream *os = this->ctx_->stream (); + ACE_CString class_name; os->indent (); // We shall have a POA_ prefix only if we are at the topmost level. @@ -355,7 +353,7 @@ be_visitor_amh_interface_sh::add_amh_operation (be_operation *node, original_arg->name ()), -1); - operation->add_argument_to_scope (arg); + operation->be_add_argument (arg); } } } 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 a82c25a2dae..11c5e47e19c 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 @@ -51,7 +51,6 @@ be_visitor_ami_interface_ch::visit_interface (be_interface *node) // Grab the stream. TAO_OutStream *os = this->ctx_->stream (); - os->gen_ifdef_macro (node->replacement ()->flat_name (), "_ptr"); // Forward declaration. @@ -63,6 +62,5 @@ be_visitor_ami_interface_ch::visit_interface (be_interface *node) << "_ptr;" << be_nl << be_nl; 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 cb532488e1e..e1fec2f0efe 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,6 +48,9 @@ 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 + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the Any <<= and >>= operator declarations. os->indent (); *os << "// Any operators for interface " << node->name () << be_nl; 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 677050637b0..887099d631a 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 @@ -40,13 +40,18 @@ be_visitor_interface_any_op_cs::~be_visitor_interface_any_op_cs (void) int be_visitor_interface_any_op_cs::visit_interface (be_interface *node) { - if (node->cli_stub_any_op_gen () || - node->imported ()) - return 0; + if (node->cli_stub_any_op_gen () || node->imported ()) + { + return 0; + } + TAO_OutStream *os = this->ctx_->stream (); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; os->indent (); + if (!node->is_local ()) { os->indent (); @@ -110,26 +115,45 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) *os << "#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) || \\" << be_idt_nl - << " defined (ACE_HAS_GNU_REPO)" << be_idt_nl - << "template class TAO_Object_Manager<" - << node->full_name () << "," + << " defined (ACE_HAS_GNU_REPO)" << be_nl; + + if (node->is_abstract ()) + { + *os << "template class TAO_Abstract_Manager<"; + } + else + { + *os << "template class TAO_Object_Manager<"; + } + + *os << node->full_name () << "," << node->full_name () << "_var>;" << be_uidt_nl - << "#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)" << be_nl - << "# pragma instantiate TAO_Object_Manager<" - << node->full_name () << "," + << "#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)" << be_nl; + + if (node->is_abstract ()) + { + *os << "# pragma instantiate TAO_Abstract_Manager<"; + } + else + { + *os << "# pragma instantiate TAO_Object_Manager<"; + } + + *os << node->full_name () << "," << node->full_name () << "_var>" << be_uidt_nl << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */\n\n"; - // all we have to do is to visit the scope and generate code + // All we have to do is to visit the scope and generate code. if (!node->is_local ()) - if (this->visit_scope (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_interface::visit_interface - " - "codegen for scope failed\n"), -1); - } + { + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::visit_interface - " + "codegen for scope failed\n"), -1); + } + } node->cli_stub_any_op_gen (1); - return 0; } 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 dd31ed71f79..2de0f8bf792 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 @@ -31,9 +31,10 @@ be_visitor_interface_base_proxy_broker_ch::visit_interface ( << "// Base Proxy Broker Declaration " << be_nl << "//" << be_nl << be_nl; - // Generate the class declaration. - os->indent (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the class declaration. *os << "class " << be_global->stub_export_macro () << " " << node->base_proxy_broker_name () << be_nl << "{" << be_nl << "public:" diff --git a/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/base_proxy_impl_ch.cpp index 21ed2aa4263..217757a940c 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 @@ -25,31 +25,42 @@ be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); - // os->indent (); - *os << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl << "// Base Proxy Impl. Declaration" << be_nl << "//" << be_nl << be_nl; + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate Class Declaration. *os << "class " << be_global->stub_export_macro () << " " << node->base_proxy_impl_name () << be_idt_nl << ": "; - if (node->n_inherits () > 0) + int n_parents = node->n_inherits (); + int has_concrete_parent = 0; + + if (n_parents > 0) { *os << be_idt; - for (int i = 0; i < node->n_inherits (); i++) + for (int i = 0; i < n_parents; ++i) { be_interface *inherited = be_interface::narrow_from_decl (node->inherits ()[i]); + if (inherited->is_abstract ()) + { + continue; + } + *os << "public virtual "; *os << inherited->full_base_proxy_impl_name (); + has_concrete_parent = 1; + if (i < node->n_inherits () - 1) { // Node is the case of multiple @@ -58,11 +69,15 @@ be_visitor_interface_base_proxy_impl_ch::visit_interface (be_interface *node) } } - *os << be_uidt << be_uidt_nl; // idt = 0 + if (has_concrete_parent == 1) + { + *os << be_uidt << be_uidt_nl; + } } - else + + if (has_concrete_parent == 0) { - *os << "public virtual TAO_Object_Proxy_Impl" << be_uidt_nl; + *os << "public virtual TAO_Object_Proxy_Impl" << be_uidt << be_uidt_nl; } *os << "{" << be_nl << "public:" 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 75bc62dab06..22b6bd53d8a 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 @@ -49,6 +49,9 @@ 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 + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the CDR << and >> operator declarations. os->indent (); 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 da9d79e98d0..b4da4d11ae5 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 @@ -97,7 +97,8 @@ be_visitor_interface_cdr_op_ci::visit_interface (be_interface *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_cdr_op_ci" "::visit_interface - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } node->cli_inline_cdr_op_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 f1dc99bcad1..97ca519c180 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,6 +59,9 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); + *os << "// 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); @@ -67,7 +70,17 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) << "const " << node->full_name () << "_ptr _tao_objref" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl; - *os << "CORBA::Object_ptr _tao_corba_obj = _tao_objref;" << be_nl; + + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase_ptr"; + } + else + { + *os << "CORBA::Object_ptr"; + } + + *os << " _tao_corba_obj = _tao_objref;" << be_nl; *os << "return (strm << _tao_corba_obj);" << be_uidt_nl << "}\n\n"; @@ -81,9 +94,20 @@ be_visitor_interface_cdr_op_cs::visit_interface (be_interface *node) << "{" << be_idt_nl; *os << "ACE_TRY_NEW_ENV" << be_nl << "{" << be_idt_nl; - *os << "CORBA::Object_var obj;" << be_nl; + + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase_var obj;" << be_nl << be_nl; + } + else + { + *os << "CORBA::Object_var obj;" << be_nl << be_nl; + } + *os << "if ((strm >> obj.inout ()) == 0)" << be_idt_nl + << "{" << be_idt_nl << "return 0;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "// narrow to the right type" << be_nl; *os << "_tao_objref =" << be_idt_nl << node->full_name () << "::_unchecked_narrow (" diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ch.cpp deleted file mode 100644 index 1c62595a748..00000000000 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ch.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// interceptors_ch.cpp -// -// = DESCRIPTION -// This provides code generation for interceptor classes for an -// interface in the client header. -// -// = AUTHOR -// Kirthika Parameswaran <kirthika@cs.wustl.edu> -// -// ============================================================================ - -ACE_RCSID (be_visitor_interface, - interceptors_ch, - "$Id$") - - -// ************************************************************ -// interceptor class in header -// ************************************************************ - - -be_visitor_interface_interceptors_ch::be_visitor_interface_interceptors_ch ( - be_visitor_context *ctx - ) - : be_visitor_interface (ctx) -{ -} - -be_visitor_interface_interceptors_ch::~be_visitor_interface_interceptors_ch ( - void - ) -{ -} - -int be_visitor_interface_interceptors_ch::visit_interface (be_interface *) -{ - return 0; -} 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 38632e5f43d..cd163a43a14 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_cs.cpp @@ -52,6 +52,9 @@ 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->indent (); *os << "\n#if (TAO_HAS_INTERCEPTORS == 1)" << be_nl; @@ -74,5 +77,4 @@ int be_visitor_interface_interceptors_cs::visit_interface (be_interface *node) *os << "#endif /* TAO_HAS_INTERCEPTORS */\n"; 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 b3735ec3360..71af3db39f3 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interceptors_ss.cpp @@ -48,6 +48,9 @@ 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; + // 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. diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp index a3bf1523e1a..e1993f4f3b4 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp @@ -42,19 +42,95 @@ be_visitor_interface::visit_interface (be_interface *) return -1; } +// Overridden so we can deal with possible operations or attributes +// in abstract parent classes. +int +be_visitor_interface::visit_scope (be_scope *node) +{ + if (this->be_visitor_scope::visit_scope (node) == -1) + { + return -1; + } + + be_interface *intf = be_interface::narrow_from_scope (node); + AST_Interface **parent = 0; + AST_Decl *d = 0; + be_decl *bd = 0; + + for (ACE_Unbounded_Queue_Iterator<AST_Interface *> iter ( + intf->abstract_parents_ + ); + iter.done () == 0; + iter.advance ()) + { + iter.next (parent); + + for (UTL_ScopeActiveIterator si ((*parent), UTL_Scope::IK_decls); + !si.is_done (); + si.next ()) + { + d = si.item (); + + if (d == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::visit_scope - " + "bad node in this scope\n"), + -1); + } + + AST_Decl::NodeType nt = d->node_type (); + + if (nt == AST_Decl::NT_op || nt == AST_Decl::NT_attr) + { + UTL_ScopedName *item_new_name = + (UTL_ScopedName *)intf->name ()->copy (); + + Identifier *id = 0; + ACE_NEW_RETURN (id, + Identifier (d->local_name ()->get_string ()), + -1); + + UTL_ScopedName *sn = 0; + ACE_NEW_RETURN (sn, + UTL_ScopedName (id, + 0), + -1); + + item_new_name->nconc (sn); + d->set_name (item_new_name); + d->set_defined_in (node); + bd = be_decl::narrow_from_decl (d); + + if (bd == 0 || bd->accept (this) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_scope - " + "codegen for scope failed\n"), + -1); + } + } + } + } + + return 0; +} + int be_visitor_interface::is_amh_rh_node (be_interface *node) { //If, is implied-IDL if (node->original_interface () != 0) - { - // and the name starts with AMH - if (ACE_OS::strncmp (node->local_name (), "AMH", 3) == 0) - { - // then it is an AMH node. - return 1; - } - } + { + // and the name starts with AMH + if (ACE_OS::strncmp (node->local_name (), "AMH", 3) == 0) + { + // then it is an AMH node. + return 1; + } + } + return 0; } @@ -106,9 +182,6 @@ be_visitor_interface::visit_attribute (be_attribute *node) case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CS); break; - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: - ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH); - break; case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS); break; @@ -234,7 +307,6 @@ be_visitor_interface::visit_constant (be_constant *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: @@ -362,7 +434,6 @@ be_visitor_interface::visit_enum (be_enum *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: @@ -497,7 +568,6 @@ be_visitor_interface::visit_exception (be_exception *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: @@ -658,13 +728,6 @@ be_visitor_interface::visit_operation (be_operation *node) status = node->accept (&visitor); break; } - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: - { - ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); - be_visitor_operation_interceptors_ch visitor (&ctx); - status = node->accept (&visitor); - break; - } case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: { ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); @@ -910,7 +973,6 @@ be_visitor_interface::visit_structure (be_structure *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: @@ -1001,7 +1063,6 @@ be_visitor_interface::visit_structure_fwd (be_structure_fwd *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: @@ -1134,7 +1195,6 @@ be_visitor_interface::visit_union (be_union *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: @@ -1225,7 +1285,6 @@ be_visitor_interface::visit_union_fwd (be_union_fwd *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: @@ -1358,7 +1417,6 @@ be_visitor_interface::visit_typedef (be_typedef *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: - case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: 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 eda8d7b45e2..6cef4c07873 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp @@ -40,336 +40,398 @@ be_visitor_interface_ch::~be_visitor_interface_ch (void) int be_visitor_interface_ch::visit_interface (be_interface *node) { + if (node->cli_hdr_gen () || node->imported ()) + { + return 0; + } + TAO_OutStream *os = this->ctx_->stream (); long i; - // If not already generated and not imported. - if (!node->cli_hdr_gen () && !node->imported ()) - { - // == STEP 1: generate the class name and class names we inherit == + // == STEP 1: generate the class name and class names we inherit == - // Generate the ifdefined macro for the _ptr type. - os->gen_ifdef_macro (node->flat_name (), - "_ptr"); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl; + // 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; - // Generate the _ptr declaration. - *os << "typedef " << node->local_name () << " *" - << node->local_name () << "_ptr;" << be_nl; + // The following two are required to be under the ifdef macro to avoid + // multiple declarations. - os->gen_endif (); + // Forward declaration. + *os << "class " << node->local_name () << ";" << be_nl; + // Generate the _ptr declaration. + *os << "typedef " << node->local_name () << " *" + << node->local_name () << "_ptr;" << be_nl; - // Generate the ifdefined macro for the var type. - os->gen_ifdef_macro (node->flat_name (), "_var"); + os->gen_endif (); - // 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); - } + // Generate the ifdefined macro for the var type. + os->gen_ifdef_macro (node->flat_name (), "_var"); - os->gen_endif (); + // 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); + } - // Generate the ifdef macro for the _out class. - os->gen_ifdef_macro (node->flat_name (), - "_out"); + os->gen_endif (); - // 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 ifdef macro for the _out class. + os->gen_ifdef_macro (node->flat_name (), + "_out"); - // Generate the endif macro. - os->gen_endif (); + // 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); + } - // 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; - } + // Generate the endif macro. + os->gen_endif (); - // Now the interface definition itself. - os->gen_ifdef_macro (node->flat_name ()); + // 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; + } - if (!node->is_local ()) - { - // Forward class declaration - *os << "// Forward Classes Declaration." << 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; - } + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // 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 + << "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 - << ": " ; + // Now generate the class definition. + *os << "class " << be_global->stub_export_macro () + << " " << node->local_name () << be_idt_nl + << ": " ; - // If node interface inherits from other interfaces. - if (node->n_inherits () > 0) + long nparents = node->n_inherits (); + int has_concrete_parent = 0; + + // If node interface inherits from other interfaces. + if (nparents > 0) + { + *os << be_idt; + + for (i = 0; i < nparents; ++i) { - *os << be_idt; + if (! node->inherits ()[i]->is_abstract ()) + { + has_concrete_parent = 1; + } - for (i = 0; i < node->n_inherits (); i++) + *os << "public virtual " + << node->inherits ()[i]->name (); + + if (i < nparents - 1) { - *os << "public virtual " - << node->inherits ()[i]->name (); - - if (i < node->n_inherits () - 1) - { - // Node has multiple inheritance, so put a comma. - *os << "," << be_nl; - } + // Node has multiple inheritance, so put a comma. + *os << "," << be_nl; } + } + if (has_concrete_parent == 1 || node->is_abstract ()) + { *os << be_uidt << be_uidt_nl; } - else + else if (! node->is_abstract ()) { - // We do not inherit from anybody, hence we do so from the base - // CORBA::Object class. - *os << "public virtual CORBA_Object" << be_uidt_nl; + *os << "," << be_nl; } + } + else if (node->is_abstract ()) + { + *os << "public virtual CORBA::AbstractBase" << be_uidt_nl; + } - // Generate the body. + if (has_concrete_parent == 0 && ! node->is_abstract ()) + { + *os << "public virtual CORBA::Object"; + + if (nparents > 0) + { + *os << be_uidt; + } + + *os << be_uidt_nl; + } - *os << "{" << be_nl - << "public:" << be_idt_nl + // Generate the body. - // 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 variable that we use for narrowing. - *os << "static int _tao_class_id;" << be_nl << 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 - << "CORBA::Object_ptr obj" << be_nl - << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; + *os << "{" << 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 variable that we use for narrowing. + *os << "static int _tao_class_id;" << be_nl << 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; + + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase_ptr obj" << be_nl; + } + else + { + *os << "CORBA::Object_ptr obj" << be_nl; + } + + *os << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ");" << be_uidt_nl << be_nl; + + // There's no need for an _unchecked_narrow for locality + // constrained object. + *os << "static " << node->local_name () << "_ptr " + << "_unchecked_narrow (" << be_idt << be_idt_nl; + + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase_ptr obj" << be_nl; + } + else + { + *os << "CORBA::Object_ptr obj" << be_nl; + } + + *os << "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; + + // No Any operator for local interfaces. + if (! node->is_local () && be_global->any_support ()) + { + *os << "static void _tao_any_destructor (void*);" << be_nl << be_nl; + } + + // 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_interface_ch::" + "visit_interface - " + "codegen for scope failed\n"), + -1); + } + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + // If we inherit from both CORBA::Object and CORBA::AbstractBase, + // we have to override _add_ref() to avoid ambiguity, because it is + // called in _tao_Queryinterface(). + if (node->has_mixed_parentage ()) + { + *os << "virtual void _add_ref (void);" << be_nl << be_nl; + } - // There's no need for an _unchecked_narrow for locality - // constrained object. - *os << "static " << node->local_name () << "_ptr " - << "_unchecked_narrow (" << be_idt << be_idt_nl - << "CORBA::Object_ptr obj" << be_nl + // The _is_a method + if (! node->is_local ()) + { + *os << "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_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; + // The _tao_QueryInterface method. + *os << "virtual void *_tao_QueryInterface (ptr_arith_t type);" + << be_nl << be_nl; - // No Any operator for local interfaces. - if (! node->is_local ()) - { - *os << "static void _tao_any_destructor (void*);" << be_nl << be_nl; - } + // The _interface_repository_id method. + *os << "virtual const char* _interface_repository_id (void) const;\n" + << be_uidt_nl; - // 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 (! node->is_local () && ! node->is_abstract ()) + { + // Add the Proxy Broker member variable. + *os << "private:" << be_idt_nl + << node->base_proxy_broker_name () << " *" + << "the" << node->base_proxy_broker_name () + << "_;" << be_nl << be_uidt_nl; + } - if (this->visit_scope (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_interface_ch::" - "visit_interface - " - "codegen for scope failed\n"), -1); - } + *os << "protected:" << be_idt_nl; - // The _is_a method - if (! node->is_local ()) - { - *os << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl - << "const CORBA::Char *type_id" << be_nl - << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl - << ");" << be_uidt_nl << be_nl; - } + if (! node->is_local () && ! node->is_abstract ()) + { + // Generate the "protected" constructor so that users cannot + // instantiate us. - // The _tao_QueryInterface method. - *os << "virtual void *_tao_QueryInterface (ptr_arith_t type);" + *os << node->local_name () << " (int collocated = 0);" << be_nl << be_nl; - // The _interface_repository_id method. - *os << "virtual const char* _interface_repository_id (void) const;\n" - << be_uidt_nl; + *os << "// 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);" << be_nl << be_nl; + } + else + { + *os << node->local_name () << " (void);" << be_nl << be_nl; + } + + // Local and abstract interfaces don't support stub objects. + if (! node->is_local () && ! node->is_abstract ()) + { + *os << 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_nl << be_nl; - if (!node->is_local ()) - { - // Add the Proxy Broker member variable. - *os << "private:" << be_idt_nl - << node->base_proxy_broker_name () << " *" - << "the" << node->base_proxy_broker_name () - << "_;" << be_nl << be_uidt_nl; - } + // Friends declarations. + *os << "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 () << ";" + << be_nl << be_nl; + } - *os << "protected:" << be_idt_nl; + // Protected copy constructor for abstract interfaces. + if (node->is_abstract ()) + { + *os << node->local_name () << " (const " + << node->local_name () << " &);" << be_nl << be_nl; + } - if (!node->is_local ()) - { - // Generate the "protected" constructor so that users cannot - // instantiate us. - - *os << node->local_name () << " (int collocated = 0);" - << be_nl << be_nl; - - *os << "// 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);" << be_nl << be_nl; - } - else - { - *os << node->local_name () << " (void);" << be_nl << be_nl; - } + // Protected destructor. + *os << "virtual ~" << node->local_name () << " (void);" + << be_uidt_nl << be_nl; - // Local interfaces don't support stub objects. - if (! node->is_local ()) - { - *os << 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_nl << be_nl; - - // Friends declarations. - *os << "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 () << ";" - << be_nl << be_nl; - } - // Protected destructor. - *os << "virtual ~" << node->local_name () << " (void);" - << be_uidt_nl << be_nl; + // Private copy constructor and assignment operator. These are not + // allowed, hence they are private. + *os << "private:" << be_idt_nl; - // private copy constructor and assignment operator. These are not - // allowed, hence they are private. - *os << "private:" << be_idt_nl; + // Abstract interfaces have a *protected* copy constructor. + if (! node->is_abstract ()) + { *os << node->local_name () << " (const " - << node->local_name () << " &);" - << be_nl - << "void operator= (const " << node->local_name () << " &);"; + << node->local_name () << " &);" << be_nl; + } + + *os << "void operator= (const " << node->local_name () << " &);"; + + // Generate the embedded RequestInfo classes per operation. + // This is to be used by interceptors. + be_visitor *visitor = 0; + be_visitor_context ctx (*this->ctx_); - // Generate the embedded RequestInfo classes per operation. - // This is to be used by interceptors. - be_visitor *visitor = 0; - be_visitor_context ctx (*this->ctx_); + ctx = *this->ctx_; - // Interceptor related classes. - ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH); - be_visitor_interface_interceptors_ch interceptor_visitor (&ctx); + *os << be_uidt_nl; + *os << "};" << be_nl << be_nl; + + // Don't support smart proxies for local interfaces. + if (! node->is_local () && ! node->is_abstract ()) + { + // Smart Proxy related classes. + ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH); + be_visitor_interface_smart_proxy_ch sp_visitor (&ctx); - if (node->accept (&interceptor_visitor) == -1) + if (node->accept (&sp_visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ch::" "visit_interface - " - "codegen for interceptor classes failed\n"), + "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); - *os << be_uidt_nl; - *os << "};" << be_nl << be_nl; - - // Don't support smart proxies for local interfaces. - if (! node->is_local ()) + if (node->accept (&spi_visitor) == -1) { - // Smart Proxy related classes. - 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_interface_ch::" - "visit_interface - " - "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_interface_ch::" - "visit_interface - " - "codegen for Proxy Broker classes failed\n"), - -1); - } + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_ch::" + "visit_interface - " + "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); + // 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_interface_ch::" - "visit_interface - " - "codegen for Proxy Broker classes failed\n"), - -1); - } + if (node->accept (&pb_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_ch::" + "visit_interface - " + "codegen for Proxy Broker classes failed\n"), + -1); } + } - os->gen_endif (); + os->gen_endif (); - if (be_global->tc_support ()) - { - ctx.state (TAO_CodeGen::TAO_TYPECODE_DECL); - be_visitor_typecode_decl td_visitor (&ctx); + 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_interface_ch::" - "visit_interface - " - "TypeCode declaration failed\n"), - -1); - } + if (node->accept (&td_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface_ch::" + "visit_interface - " + "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_interface/interface_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp index 8df081761e1..107a6b9067e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp @@ -64,10 +64,30 @@ 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->gen_ifdef_macro (node->flat_name (), ""); - // Generate the constructor from stub and servant. - node->gen_stub_ctor (os); + if (node->is_abstract ()) + { + *os << "ACE_INLINE" << be_nl + << node->name () << "::" << node->local_name () + << " (void)" << be_idt_nl + << ": CORBA_AbstractBase ()" << be_uidt_nl + << "{}" << be_nl << be_nl; + + *os << "ACE_INLINE" << be_nl + << node->name () << "::" << node->local_name () + << " (const " << node->local_name () << " &rhs)" << be_idt_nl + << ": CORBA_AbstractBase (rhs)" << be_uidt_nl + << "{}" << be_nl << be_nl; + } + else + { + // Generate the constructor from stub and servant. + node->gen_stub_ctor (os); + } os->gen_endif (); 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 b6af6ab2270..5e2248810a8 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -59,8 +59,8 @@ be_visitor_interface_cs::visit_interface (be_interface *node) TAO_OutStream *os = this->ctx_->stream (); - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Initialize the static narrrowing helper variable. *os << "int " << node->full_name () << "::_tao_class_id = 0;" @@ -99,9 +99,18 @@ be_visitor_interface_cs::visit_interface (be_interface *node) *os << node->full_name () << "_ptr" << be_nl << "tao_" << node->flat_name () - << "_narrow (" << be_idt << be_idt_nl - << "CORBA::Object *p" << be_nl - << "ACE_ENV_ARG_DECL" << be_uidt_nl + << "_narrow (" << be_idt << be_idt_nl; + + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase *p" << be_nl; + } + else + { + *os << "CORBA::Object *p" << be_nl; + } + + *os << "ACE_ENV_ARG_DECL" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "return " << node->full_name () @@ -109,8 +118,16 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << be_uidt_nl << "}" << be_nl << be_nl; - *os << "CORBA::Object *" << be_nl - << "tao_" << node->flat_name () + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase *" << be_nl; + } + else + { + *os << "CORBA::Object *" << be_nl; + } + + *os << "tao_" << node->flat_name () << "_upcast (" << be_idt << be_idt_nl << "void *src" << be_uidt_nl << ")" << be_uidt_nl @@ -121,6 +138,25 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << "return *tmp;" << be_uidt_nl << "}" << be_nl << be_nl; + if (node->has_mixed_parentage ()) + { + *os << "void" << be_nl + << "CORBA::release (" << node->name () << "_ptr p)" << be_nl + << "{" << be_idt_nl + << "CORBA::Object_ptr obj = p;" << be_nl + << "CORBA::release (obj);" << be_nl + << "CORBA::AbstractBase_ptr abs = p;" << be_nl + << "CORBA::release (abs);" << be_uidt_nl + << "}" << be_nl << be_nl; + + *os << "CORBA::Boolean" << be_nl + << "CORBA::is_nil (" << node->name () << "_ptr p)" << be_nl + << "{" << 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. if (node->gen_var_impl () == -1) { @@ -141,154 +177,186 @@ be_visitor_interface_cs::visit_interface (be_interface *node) -1); } - be_visitor_context 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 = (*this->ctx_); - - ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS); - be_visitor_interface_interceptors_cs ii_visitor (&ctx); + be_visitor_context ctx = (*this->ctx_); - if (node->accept (&ii_visitor) == -1) + if (! node->is_abstract ()) { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_cs::" - "visit_interface - " - "codegen for interceptors classes failed\n"), - -1); - } + // Interceptor classes. The interceptors helper classes must be + // defined before the interface operations because they are used in + // the implementation of said operations. - if (!node->is_local ()) - { - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS); - be_visitor_interface_remote_proxy_impl_cs irpi_visitor (&ctx); + ctx.state (TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS); + be_visitor_interface_interceptors_cs ii_visitor (&ctx); - if (node->accept (&irpi_visitor) == -1) + if (node->accept (&ii_visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_cs::" "visit_interface - " - "codegen for Base Proxy Broker class failed\n"), + "codegen for interceptors classes 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) + if (!node->is_local ()) { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_cs::" - "visit_interface - " - "codegen for Base Proxy Broker class 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); - // Generate the destructor and default constructor. - *os << be_nl; - *os << "// TAO_IDL - Generated from " << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - *os << node->name () << "::" << node->local_name (); + if (node->accept (&irpi_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_cs::" + "visit_interface - " + "codegen for Base Proxy Broker class failed\n"), + -1); + } - if (!node->is_local ()) - { - *os << " (int collocated)" << be_nl - << "{" << be_idt_nl - << "this->" << node->flat_name () - << "_setup_collocation (collocated);" << be_uidt_nl - << be_uidt << "}" << be_nl << be_nl; - } - else - { - *os << " (void)" << be_nl - << "{}" << be_nl << be_nl; - } + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS); + be_visitor_interface_remote_proxy_broker_cs irpb_visitor (&ctx); - *os << node->name () << "::~" << node->local_name () - << " (void)" << be_nl; - *os << "{}" << be_nl << be_nl; - - if (!node->is_local ()) - { - // 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; + if (node->accept (&irpb_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_cs::" + "visit_interface - " + "codegen for Base Proxy Broker class failed\n"), + -1); + } + } - // Now we setup the immediate parents. - int n_parents = node->n_inherits (); + // Generate the destructor and default constructor. + *os << be_nl; + *os << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << node->name () << "::" << node->local_name (); - if (n_parents > 0) + if (!node->is_local ()) + { + *os << " (int collocated)" << be_nl + << "{" << be_idt_nl + << "this->" << node->flat_name () + << "_setup_collocation (collocated);" << be_uidt_nl + << be_uidt << "}" << be_nl << be_nl; + } + else { - *os << be_nl; + *os << " (void)" << be_nl + << "{}" << be_nl << be_nl; + } - for (int i = 0; i < n_parents; i++) + if (!node->is_local ()) + { + // 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; + + // Now we setup the immediate parents. + int n_parents = node->n_inherits (); + int has_concrete_parent = 0; + + if (n_parents > 0) { - be_interface *inherited = - be_interface::narrow_from_decl (node->inherits ()[i]); - - *os << be_nl - << "this->" << inherited->flat_name () - << "_setup_collocation" << " (collocated);"; - - if (i == n_parents - 1) - { - *os << be_uidt_nl; - } - else + for (int i = 0; i < n_parents; ++i) { - *os << be_nl; + be_interface *inherited = + be_interface::narrow_from_decl (node->inherits ()[i]); + + if (inherited->is_abstract ()) + { + continue; + } + + if (has_concrete_parent == 0) + { + *os << be_nl; + } + + has_concrete_parent = 1; + + *os << be_nl + << "this->" << inherited->flat_name () + << "_setup_collocation" << " (collocated);"; + + if (i == n_parents - 1) + { + *os << be_uidt_nl; + } + else + { + *os << be_nl; + } } } - } - else - { - *os << be_uidt_nl; - } - *os << "}" << be_nl << be_nl; + if (has_concrete_parent == 0) + { + *os << be_uidt_nl; + } + + *os << "}" << be_nl << be_nl; + } } + *os << 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 ()) { - *os << "void " + *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 - << "}\n" << be_nl; + << "}" << be_nl << be_nl; + } + + if (node->has_mixed_parentage ()) + { + *os << "void" << be_nl + << node->name () << "::_add_ref (void)" << be_nl + << "{" << be_idt_nl + << "this->CORBA_Object::_add_ref ();" << be_nl + << "this->CORBA_AbstractBase::_add_ref ();" << be_uidt_nl + << "}" << be_nl << be_nl; } // The _narrow method - *os << node->full_name () << "_ptr " << node->full_name () - << "::_narrow (" << be_idt << be_idt_nl - << "CORBA::Object_ptr obj" << be_nl - << "ACE_ENV_ARG_DECL" << be_uidt_nl + *os << node->full_name () << "_ptr" << be_nl << node->full_name () + << "::_narrow (" << be_idt << be_idt_nl; + + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase_ptr obj" << be_nl; + } + else + { + *os << "CORBA::Object_ptr obj" << be_nl; + } + + *os << "ACE_ENV_ARG_DECL" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl; @@ -297,19 +365,40 @@ be_visitor_interface_cs::visit_interface (be_interface *node) { // Remote _narrow implementation. *os << "if (CORBA::is_nil (obj))" << be_idt_nl + << "{" << be_idt_nl << "return " << bt->nested_type_name (this->ctx_->scope ()) - << "::_nil ();" << be_uidt_nl; + << "::_nil ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; - *os << "if (! obj->_is_local ())" << be_idt_nl - << "{" << be_idt_nl - << "CORBA::Boolean is_a = obj->_is_a (\"" - << node->repoID () << "\" ACE_ENV_ARG_PARAMETER);" << be_nl + if (! node->is_abstract ()) + { + *os << "if (! obj->_is_local ())" << be_idt_nl + << "{" << be_idt_nl; + } + + *os << "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 + << "::_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 << be_uidt_nl - << "}" << be_uidt_nl; + << "::_nil ();" << be_uidt_nl; + + if (node->is_abstract ()) + { + *os << "}" << be_uidt_nl; + } + else + { + *os << "}" << be_uidt << be_uidt_nl; + *os << "}" << be_uidt_nl; + } + + *os << be_nl; } *os << "return " << bt->nested_type_name (this->ctx_->scope ()) @@ -320,42 +409,56 @@ be_visitor_interface_cs::visit_interface (be_interface *node) *os << node->full_name () << "_ptr " << be_nl << node->full_name () << "::_unchecked_narrow (" - << be_idt << be_idt_nl - << "CORBA::Object_ptr obj" << be_nl - << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl + << be_idt << be_idt_nl; + + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase_ptr obj" << be_nl; + } + else + { + *os << "CORBA::Object_ptr obj" << be_nl; + } + + *os << "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; + << "::_nil ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; - if (! node->is_local ()) + if (! node->is_local () && ! node->is_abstract ()) { // Remote _uncheck_narrow implementation. *os << "if (! obj->_is_local ())" << be_idt_nl << "{" << be_idt_nl - << "TAO_Stub* stub = obj->_stubobj ();" << be_nl + << "TAO_Stub* stub = obj->_stubobj ();" << be_nl << be_nl << "if (stub)" << be_idt_nl + << "{" << be_idt_nl << "stub->_incr_refcnt ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl // Declare the default proxy. << bt->nested_type_name (this->ctx_->scope ()) << "_ptr default_proxy = " << bt->nested_type_name (this->ctx_->scope ()) <<"::_nil ();\n\n"; - // If the policy didtates that the proxy be collocated, use the + // If the policy dictates that the proxy be collocated, use the // function to create one. os->indent (); - *os << "if (" << be_idt << be_idt_nl // 2 idt - << "!CORBA::is_nil (stub->servant_orb_var ().ptr ()) &&" << be_nl - << "stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects () &&" + + *os << "if (! CORBA::is_nil (stub->servant_orb_var ().ptr ())" + << be_idt << be_idt_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 << ")" // 1 idt - << be_nl << "{" // 0 idt - << be_idt_nl // 1 idt + << "&& obj->_is_collocated ()" << be_nl + << "&& " << node->flat_client_enclosing_scope () + << node->base_proxy_broker_name () + << "_Factory_function_pointer != 0)" << be_uidt_nl + << "{" << be_idt_nl << "ACE_NEW_RETURN (" << be_idt << be_idt_nl // 2 idt << "default_proxy," << be_nl << "::" << bt->name () @@ -397,29 +500,28 @@ be_visitor_interface_cs::visit_interface (be_interface *node) } *os << "}" << be_uidt_nl - << "else " << be_idt_nl; - } - else - { - *os << be_idt; + << "else " << be_idt_nl + << "{" << be_idt_nl; } *os << "return" << be_idt_nl - << "ACE_reinterpret_cast" << be_idt_nl - <<"(" << be_idt_nl - << node->local_name () << "_ptr," << be_idt_nl - << "obj->_tao_QueryInterface" << be_idt_nl - << "(" << be_idt_nl - << "ACE_reinterpret_cast" << be_idt_nl - << "(" << be_idt_nl + << "ACE_reinterpret_cast (" << be_idt << be_idt_nl + << node->local_name () << "_ptr," << be_nl + << "obj->_tao_QueryInterface (" << be_idt << be_idt_nl + << "ACE_reinterpret_cast (" << be_idt << be_idt_nl << "ptr_arith_t," << be_nl << "&" << node->local_name () << "::_tao_class_id" << be_uidt_nl << ")" << be_uidt << be_uidt_nl - << ")" << be_uidt << be_uidt << be_uidt_nl - << ");" << be_uidt << be_uidt << be_uidt << be_uidt_nl; + << ")" << be_uidt << be_uidt_nl + << ");" << be_uidt << be_uidt << be_uidt_nl; - *os << "}\n" << be_nl; + if (! node->is_local () && ! node->is_abstract ()) + { + *os << "}" << be_uidt << be_uidt_nl; + } + + *os << "}" << be_nl << be_nl; // The _duplicate method @@ -428,28 +530,34 @@ be_visitor_interface_cs::visit_interface (be_interface *node) << bt->nested_type_name (this->ctx_->scope ()) << "_ptr obj)" << be_nl << "{" << be_idt_nl - << "if (!CORBA::is_nil (obj))" << 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; - // generate the is_a method. _is_a is not supported on local objects. + // Generate the is_a method. _is_a is not supported on local + // or abstract objects. if (! node->is_local ()) { os->indent (); - *os << "CORBA::Boolean " << node->full_name () - << "::_is_a (" - << "const CORBA::Char *value ACE_ENV_ARG_DECL)" - << be_nl + + *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 (\n"; + *os << "if (" << be_idt << be_idt_nl; - os->incr_indent (0); - - if (node->traverse_inheritance_graph (be_interface::is_a_helper, os) == -1) + if (node->traverse_inheritance_graph ( + be_interface::is_a_helper, + os + ) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_cs::" @@ -457,25 +565,67 @@ be_visitor_interface_cs::visit_interface (be_interface *node) "_is_a method codegen failed\n"), -1); } - os->indent (); - *os << "(!ACE_OS::strcmp ((char *)value, \"IDL:omg.org/CORBA/Object:1.0\")))\n"; - *os << " return 1; // success using local knowledge\n"; - os->decr_indent (); - *os << "else" << be_nl; - *os << " return this->CORBA_Object::_is_a (value ACE_ENV_ARG_PARAMETER);\n"; - os->decr_indent (); - *os << "}\n\n"; + if (node->is_abstract () || node->has_mixed_parentage ()) + { + *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl + << "(char *)value," << be_nl + << "\"IDL:omg.org/CORBA/AbstractBase:1.0\"" << be_uidt_nl + << ")"; + } + + if (node->has_mixed_parentage ()) + { + *os << " ||" << be_uidt_nl; + } + else if (node->is_abstract ()) + { + *os << be_uidt << be_uidt_nl; + } + + if (! node->is_abstract ()) + { + *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl + << "(char *)value," << be_nl + << "\"IDL:omg.org/CORBA/Object:1.0\"" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl; + } + + *os << " )" << be_nl + << "{" << be_idt_nl + << "return 1; // success using local knowledge" << be_uidt_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl + << "{" << be_idt_nl; + + if (node->is_abstract ()) + { + *os << "return 0;" << be_uidt_nl; + } + else + { + *os << "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; + } + + *os << "}" << be_uidt << be_uidt_nl + << "}\n\n"; } // Generating _tao_QueryInterface method. os->indent (); + *os << "void *" << node->full_name () << "::_tao_QueryInterface (ptr_arith_t type)" << be_nl << "{" << be_idt_nl - << "void *retv = 0;" << be_nl + << "void *retv = 0;" << be_nl << be_nl << "if "; - if (node->traverse_inheritance_graph (be_interface::queryinterface_helper, os) == -1) + if (node->traverse_inheritance_graph ( + be_interface::queryinterface_helper, + os + ) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_cs::" @@ -484,15 +634,49 @@ be_visitor_interface_cs::visit_interface (be_interface *node) -1); } - *os << "(type == ACE_reinterpret_cast (ptr_arith_t, &CORBA::Object::_tao_class_id))" - << be_idt_nl << "retv = ACE_reinterpret_cast (void *," << be_idt_nl - << "ACE_static_cast (CORBA::Object_ptr, this));" << be_uidt_nl << be_uidt_nl - << "if (retv)" << be_idt_nl + *os << "(type == ACE_reinterpret_cast (" + << be_idt << be_idt << be_idt << be_idt << be_idt << be_idt_nl + << " ptr_arith_t," << be_nl; + + if (node->is_abstract ()) + { + *os << " &CORBA::AbstractBase"; + } + else + { + *os << " &CORBA::Object"; + } + + *os << "::_tao_class_id)" << be_uidt_nl + << " )" << be_uidt << be_uidt << be_uidt << be_uidt_nl + << "{" << be_idt_nl + << "retv =" << be_idt_nl + << "ACE_reinterpret_cast (" << be_idt << be_idt_nl + << "void *," << be_nl + << "ACE_static_cast ("; + + if (node->is_abstract ()) + { + *os << "CORBA::AbstractBase_ptr"; + } + else + { + *os << "CORBA::Object_ptr"; + } + + *os << ", this)" << be_uidt_nl + << ");" << be_uidt << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + + *os << "if (retv != 0)" << be_idt_nl + << "{" << be_idt_nl << "this->_add_ref ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl << "return retv;" << be_uidt_nl << "}\n\n"; os->indent (); + *os << "const char* " << node->full_name () << "::_interface_repository_id (void) const" << be_nl @@ -503,34 +687,37 @@ be_visitor_interface_cs::visit_interface (be_interface *node) os->decr_indent (0); - // generate code for the elements of the interface - if (this->visit_scope (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_interface_cs::" - "visit_interface - " - "codegen for scope failed\n"), - -1); - } - - - // Smart Proxy classes. - if (! node->is_local ()) + if (! node->is_abstract ()) { - be_visitor_context ctx (*this->ctx_); - be_visitor *visitor = 0; - - ctx.state (TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS); - be_visitor_interface_smart_proxy_cs isp_visitor (&ctx); - - if (node->accept (&isp_visitor) == -1) + // Generate code for the elements of the interface. + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_cs::" + "(%N:%l) be_visitor_interface_cs::" "visit_interface - " - "codegen for smart proxy classes failed\n"), + "codegen for scope failed\n"), -1); } + + + // Smart Proxy classes. + if (! node->is_local () && ! node->is_abstract ()) + { + be_visitor_context ctx (*this->ctx_); + be_visitor *visitor = 0; + + 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_interface_cs::" + "visit_interface - " + "codegen for smart proxy classes failed\n"), + -1); + } + } } if (be_global->tc_support ()) 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 ae6190babf9..8b08b686d62 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -39,7 +39,7 @@ 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 ()) + if (node->srv_hdr_gen () || node->imported () || node->is_abstract ()) { return 0; } @@ -63,11 +63,9 @@ be_visitor_interface_sh::visit_interface (be_interface *node) } TAO_OutStream *os = this->ctx_->stream (); - ACE_CString class_name; - os->indent (); - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + os->indent (); + ACE_CString class_name; // We shall have a POA_ prefix only if we are at the topmost level. if (!node->is_nested ()) @@ -81,6 +79,9 @@ be_visitor_interface_sh::visit_interface (be_interface *node) 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; @@ -115,13 +116,24 @@ be_visitor_interface_sh::visit_interface (be_interface *node) << " " << class_name.c_str () << be_idt_nl << ": " << be_idt; long n_parents = node->n_inherits (); + AST_Interface *parent = 0; + int has_concrete_parent = 0; if (n_parents > 0) { for (int i = 0; i < n_parents; ++i) { + parent = node->inherits ()[i]; + + if (parent->is_abstract ()) + { + continue; + } + *os << "public virtual " << "POA_" - << node->inherits ()[i]->name (); + << parent->name (); + + has_concrete_parent = 1; if (i < n_parents - 1) { @@ -129,7 +141,8 @@ be_visitor_interface_sh::visit_interface (be_interface *node) } } } - else + + if (has_concrete_parent == 0) { // We don't inherit from another user defined object, hence our // base class is the ServantBase class. @@ -203,6 +216,8 @@ 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. diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp index 059eb0e52dc..ecc0f5e998e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp @@ -39,7 +39,10 @@ be_visitor_interface_si::~be_visitor_interface_si (void) int be_visitor_interface_si::visit_interface (be_interface *node) { - if (node->srv_inline_gen () || node->imported () || node->is_local ()) + if (node->srv_inline_gen () + || node->imported () + || node->is_local () + || node->is_abstract ()) { return 0; } @@ -69,7 +72,8 @@ be_visitor_interface_si::visit_interface (be_interface *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_si::" "visit_interface - " - "codegen for base class skeletons failed\n"), -1); + "codegen for base class skeletons failed\n"), + -1); } if (be_global->gen_tie_classes ()) 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 3bed48dda8d..48aaad64572 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -39,7 +39,7 @@ be_visitor_interface_ss::~be_visitor_interface_ss (void) int be_visitor_interface_ss::visit_interface (be_interface *node) { - if (node->srv_skel_gen () || node->imported ()) + if (node->srv_skel_gen () || node->imported () || node->is_abstract ()) { return 0; } @@ -96,7 +96,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) } *os << "// TAO_IDL - Generated from " << be_nl - << "// " << __FILE__ << ":" << __LINE__ << be_nl; + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; // Find if we are at the top scope or inside some module, // pre-compute the prefix that must be added to the local name in @@ -160,6 +160,9 @@ be_visitor_interface_ss::visit_interface (be_interface *node) -1); } + *os << "// 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 @@ -296,8 +299,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) << "ACE_ENV_ARG_DECL_NOT_USED" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl - << "const char *base_id = \"IDL:org.omg/CORBA/Object:1.0\";" << be_nl - << "if (\n" << be_idt; + << "if (" << be_idt << be_idt_nl; if (node->traverse_inheritance_graph (be_interface::is_a_helper, os) == -1) { @@ -308,12 +310,29 @@ be_visitor_interface_ss::visit_interface (be_interface *node) -1); } - os->indent (); + *os << "!ACE_OS::strcmp (" << be_idt << be_idt_nl + << "(char *)value," << be_nl + << "\"IDL:org.omg/CORBA/Object:1.0\"" << be_uidt_nl + << ")"; - *os << "(!ACE_OS::strcmp ((char *)value, base_id)))" - << be_idt_nl << "return 1;" << be_uidt_nl + if (node->has_mixed_parentage ()) + { + *os << " ||" << be_uidt_nl + << "!ACE_OS::strcmp (" << be_idt << be_idt_nl + << "(char *)value," << be_nl + << "\"IDL:org.omg/CORBA/AbstractBase:1.0\"" << be_uidt_nl + << ")"; + } + + *os << be_uidt << be_uidt_nl + << " )" << be_nl + << "{" << be_idt_nl + << "return 1;" << be_uidt_nl + << "}" << be_uidt_nl << "else" << be_idt_nl - << "return 0;" << be_uidt << be_uidt << be_uidt_nl + << "{" << be_idt_nl + << "return 0;" << be_uidt_nl + << "}" << be_uidt << be_uidt_nl << "}" << be_nl << be_nl; // the downcast method. @@ -332,10 +351,13 @@ be_visitor_interface_ss::visit_interface (be_interface *node) -1); } - *os << "if (ACE_OS::strcmp (logical_type_id, " - << "\"IDL:omg.org/CORBA/Object:1.0\") == 0)" << be_idt_nl + *os << "if (ACE_OS::strcmp (logical_type_id," << be_nl + << " \"IDL:omg.org/CORBA/Object:1.0\") == 0)" + << be_idt_nl + << "{" << be_idt_nl << "return ACE_static_cast(PortableServer::Servant, this);" - << be_uidt_nl; + << be_uidt_nl + << "}" << be_uidt_nl << be_nl; *os << "return 0;" << be_uidt_nl << "}" << be_nl << be_nl; @@ -365,34 +387,52 @@ be_visitor_interface_ss::this_method (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // the _this () operation. - *os << node->full_name () << "*" << be_nl + *os << node->full_name () << " *" << be_nl << node->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 - << "TAO_Stub_Auto_Ptr safe_stub (stub);" << be_nl << be_nl; + << "TAO_Stub_Auto_Ptr safe_stub (stub);" << be_nl; *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 - << "ACE_NEW_RETURN (tmp, CORBA::Object (stub, 1, this), 0);" - << be_uidt_nl // idt = 1 - << "else" - << be_idt_nl // idt = 2 - << "ACE_NEW_RETURN (tmp, CORBA::Object (stub, 0, this), 0);" - << be_uidt_nl << be_nl // idt = 1 - << "CORBA::Object_var obj = tmp;" << be_nl << be_nl; - - *os << "(void) safe_stub.release ();" << be_nl << be_nl; - - *os << "return " << "::" << node->full_name () + << "optimize_collocation_objects ())" << be_idt_nl + << "{" << be_idt_nl + << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + << "tmp," << be_nl + << "CORBA::Object (" << be_idt << be_idt_nl + << "stub," << be_nl + << "1," << be_nl + << "this" << be_uidt_nl + << ")," << be_uidt_nl + << "0" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl + << "else" << be_idt_nl + << "{" << be_idt_nl + << "ACE_NEW_RETURN (" << be_idt << be_idt_nl + << "tmp," << be_nl + << "CORBA::Object (" << be_idt << be_idt_nl + << "stub," << be_nl + << "0," << be_nl + << "this" << be_uidt_nl + << ")," << be_uidt_nl + << "0" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + + *os << "CORBA::Object_var obj = tmp;" << be_nl + << "(void) safe_stub.release ();" << be_nl + << "return " << "::" << node->full_name () << "::_unchecked_narrow (obj.in ());" - << be_uidt_nl // idt = 0 + << be_uidt_nl << "}" << be_nl; } @@ -401,6 +441,9 @@ be_visitor_interface_ss::dispatch_method (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "void " << node->full_skel_name () << "::_dispatch (" << be_idt << be_idt_nl << "TAO_ServerRequest &req," << be_nl @@ -413,7 +456,7 @@ be_visitor_interface_ss::dispatch_method (be_interface *node) << " this" << be_nl << " ACE_ENV_ARG_PARAMETER);" << be_uidt_nl; - *os << "}" << be_nl << be_nl; + *os << "}" << be_nl; } int @@ -464,6 +507,9 @@ be_visitor_interface_ss::generate_proxy_classes (be_interface *node) -1); } + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl; + // Proxy Broker Factory Function. *os << be_nl << node->full_base_proxy_broker_name () << " *" << be_nl 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 c077c5d1de3..3b2047a85b3 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 @@ -30,9 +30,9 @@ be_visitor_interface_proxy_impls_ch::visit_interface (be_interface *node) // Generate Guards. *os << "// The Proxy Implementations are used by each interface to" << be_nl - << "// perform a call. Each different implementation encapsulate" + << "// perform a call. Each different implementation encapsulates" << be_nl - << "// an invocation logics." << be_nl << be_nl; + << "// an invocation logic." << be_nl << be_nl; // Code Generation for the proxy imlpementations base class. be_visitor *visitor = 0; 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 4f753277315..e197ce1bc46 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 @@ -36,6 +36,9 @@ be_visitor_interface_remote_proxy_broker_ch::visit_interface ( << "// Remote Proxy Broker Declaration " << be_nl << "//" << be_nl << be_nl; + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "class " << be_global->stub_export_macro () << " " << node->remote_proxy_broker_name () << be_idt_nl << ": public virtual " 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 fdde98f011c..d2b53e17245 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 @@ -27,6 +27,9 @@ be_visitor_interface_remote_proxy_broker_cs::visit_interface ( { TAO_OutStream *os = this->ctx_->stream (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl; + // Generate the class declaration. os->indent (); 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 abc77d0d014..bb2987e5c47 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 @@ -33,6 +33,9 @@ be_visitor_interface_remote_proxy_impl_ch::visit_interface ( << "// Remote Proxy Impl. Declaration" << be_nl << "//" << be_nl << be_nl; + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate Class Declaration. *os << "class " << be_global->stub_export_macro () << " " << node->remote_proxy_impl_name () << be_idt_nl; @@ -40,25 +43,23 @@ be_visitor_interface_remote_proxy_impl_ch::visit_interface ( << "," << be_idt_nl << "public virtual " << "TAO_Remote_Object_Proxy_Impl"; - if (node->n_inherits () > 0) - { - *os << "," << be_nl; + int nparents = node->n_inherits (); - for (int i = 0; i < node->n_inherits (); i++) + if (nparents > 0) + { + for (int i = 0; i < nparents; ++i) { be_interface *inherited = be_interface::narrow_from_decl (node->inherits ()[i]); - *os << "public virtual "; - *os << inherited->full_remote_proxy_impl_name (); - - if (i < node->n_inherits () - 1) + if (inherited->is_abstract ()) { - // Node is the case of multiple - // inheritance, so put a comma. - *os << ", "; - *os << be_nl; + continue; } + + *os << "," << be_nl; + *os << "public virtual "; + *os << inherited->full_remote_proxy_impl_name (); } } 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 47c8bb227c3..c12fcdfe6bf 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 @@ -13,7 +13,6 @@ be_visitor_interface_remote_proxy_impl_cs (be_visitor_context *ctx) // No-Op. } - be_visitor_interface_remote_proxy_impl_cs:: ~be_visitor_interface_remote_proxy_impl_cs (void) { @@ -28,6 +27,9 @@ be_visitor_interface_remote_proxy_impl_cs::visit_interface ( TAO_OutStream *os = this->ctx_->stream (); os->decr_indent (0); + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_nl << "///////////////////////////////////////////////////////////////////////" << be_nl @@ -40,12 +42,7 @@ be_visitor_interface_remote_proxy_impl_cs::visit_interface ( *os << node->full_base_proxy_impl_name () << "::" << node->base_proxy_impl_name () << " (void)" << be_nl << "{}" << be_nl << be_nl; - /* - // Dtor Impl. - *os << node->full_base_proxy_impl_name () << "::~" - << node->base_proxy_impl_name () << " (void)" << be_nl - << "{}" << be_nl << be_nl; - */ + // Create the destructor implementation for the remote // proxy implementation. @@ -54,13 +51,6 @@ be_visitor_interface_remote_proxy_impl_cs::visit_interface ( << node->remote_proxy_impl_name () << " (void)" << be_nl << "{}" << be_nl << be_nl; - /* - // Dtor Impl - *os << node->full_remote_proxy_impl_name () << "::~" - << node->remote_proxy_impl_name () << " (void)" << be_nl - << "{}" << be_nl << be_nl; - */ - // Generate the code for the Remote Proxy Impl. // operations *os << "// Remote Implementation of the IDL interface methods" @@ -82,5 +72,4 @@ be_visitor_interface_remote_proxy_impl_cs::visit_interface ( << be_nl << be_nl; return 0; - } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/smart_proxy_ch.cpp index 382d0bc065f..7452a474649 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 @@ -57,6 +57,9 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) bt = node; } + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "class " << be_global->stub_export_macro ()<< " " << "TAO_" << node->flat_name () << "_Default_Proxy_Factory" << be_nl @@ -202,5 +205,4 @@ int be_visitor_interface_smart_proxy_ch::visit_interface (be_interface *node) } return 0; - } 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 1043c0da448..152974f5126 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 @@ -35,6 +35,9 @@ be_visitor_interface_strategized_proxy_broker_sh::visit_interface ( << "// Strategized Proxy Broker Declaration " << be_nl << "//" << be_nl << be_nl; + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "class " << be_global->skel_export_macro () << " " << node->strategized_proxy_broker_name () << " : public virtual " << "::" << node->full_base_proxy_broker_name () << be_nl << "{" 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 a01027c80f7..26d27cc6675 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 @@ -36,6 +36,9 @@ be_visitor_interface_strategized_proxy_broker_ss::visit_interface ( << "// Strategized Proxy Broker Implementation" << be_nl << "//" << be_nl << be_nl; + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "// Factory function Implementation." << be_nl << node->full_strategized_proxy_broker_name () << " *" << node->full_strategized_proxy_broker_name () << "::the" 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 b777b8bc5ec..83f0263cb1a 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 @@ -32,6 +32,10 @@ be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface ( << be_nl << "// ThruPOA Impl. Declaration" << be_nl << "//" << be_nl << be_nl; + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate Class Declaration. *os << "class " << be_global->skel_export_macro () << " " << node->thru_poa_proxy_impl_name (); @@ -41,22 +45,24 @@ be_visitor_interface_thru_poa_proxy_impl_sh::visit_interface ( if (node->n_inherits () > 0) { - *os << "," << be_nl; + AST_Interface *parent = 0; for (int i = 0; i < node->n_inherits (); i++) { - be_interface *inherited = - be_interface::narrow_from_decl (node->inherits ()[i]); - - *os << "public virtual "; - *os << "::" << inherited->full_thru_poa_proxy_impl_name (); + parent = node->inherits ()[i]; - if (i < node->n_inherits () - 1) + if (parent->is_abstract ()) { - *os << ", "; + continue; } - *os << be_nl; + *os << "," << be_nl; + + be_interface *inherited = + be_interface::narrow_from_decl (parent); + + *os << "public virtual "; + *os << "::" << inherited->full_thru_poa_proxy_impl_name (); } } 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 3c1853c0ac6..2043482b952 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 @@ -33,6 +33,9 @@ be_visitor_interface_thru_poa_proxy_impl_ss::visit_interface ( << "// ThruPOA Proxy Implementation\n" << "//\n\n"; + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Ctor Implementation *os << node->full_thru_poa_proxy_impl_name () << "::" << node->thru_poa_proxy_impl_name () << " (void)" << be_nl 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 f341f2f2c55..41262e9ddb8 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp @@ -45,7 +45,7 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node) static char namebuf [NAMEBUFSIZE]; static char tiename [NAMEBUFSIZE]; - if (node->imported ()) + if (node->imported () || node->is_abstract ()) { return 0; } @@ -86,8 +86,8 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node) // Now generate the class definition. os->indent (); - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl << be_nl; + *os << "// 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; *os << "template <class T>" << be_nl; @@ -156,6 +156,15 @@ be_visitor_interface_tie_sh::method_helper (be_interface *, be_interface *node, TAO_OutStream *os) { + // Any methods from abstract parents have already been + // "added" to the derived interface scope by the overridden + // visit_scope() method in be_visitor_interface, so we can skip + // this base interface, if it is abstract. + if (node->is_abstract ()) + { + return 0; + } + be_visitor_context ctx; ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SH); ctx.stream (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 5fede5e61c4..560b8213187 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp @@ -42,16 +42,16 @@ 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 ()) + { + return 0; + } + TAO_OutStream *os; static char fulltiename [NAMEBUFSIZE]; static char localtiename [NAMEBUFSIZE]; static char localskelname [NAMEBUFSIZE]; - if (node->srv_inline_gen () || node->imported ()) - { - return 0; - } - ACE_OS::memset (fulltiename, '\0', NAMEBUFSIZE); @@ -91,6 +91,9 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) node->local_name ()); } + *os << "// 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"; @@ -214,6 +217,15 @@ be_visitor_interface_tie_si::method_helper (be_interface *derived, be_interface *node, TAO_OutStream *os) { + // Any methods from abstract parents have already been + // "added" to the derived interface scope by the overridden + // visit_scope() method in be_visitor_interface, so we can skip + // this base interface, if it is abstract. + if (node->is_abstract ()) + { + return 0; + } + be_visitor_context ctx; ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SI); ctx.interface (derived); 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 e52a310c5a5..34b287aa202 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 @@ -57,6 +57,7 @@ be_visitor_interface_fwd_cdr_op_ci::visit_interface_fwd ( // generate the CDR << and >> operator declarations os->indent (); + *os << be_global->stub_export_macro () << " CORBA::Boolean operator<< (" << be_idt << be_idt_nl << "TAO_OutputCDR &," << be_nl 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 e7c2bb750ef..7984871f1ee 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 @@ -42,13 +42,13 @@ be_visitor_interface_fwd_ch::~be_visitor_interface_fwd_ch (void) int be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node) { - TAO_OutStream *os = this->ctx_->stream (); - if (node->cli_hdr_gen () || node->imported ()) { return 0; } + TAO_OutStream *os = this->ctx_->stream (); + // All we do in this is generate a forward declaration of the class. *os << "class " << node->local_name () << ";" << be_nl; @@ -103,6 +103,5 @@ be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node) os->gen_endif (); node->cli_hdr_gen (I_TRUE); - return 0; } 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 835618eb26a..85e5719acc8 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module_ch.cpp @@ -40,6 +40,10 @@ be_visitor_module_ch::visit_module (be_module *node) if (!node->cli_hdr_gen () && !node->imported ()) { TAO_OutStream *os = this->ctx_->stream (); + + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + os->indent (); *os << "TAO_NAMESPACE " @@ -58,7 +62,10 @@ be_visitor_module_ch::visit_module (be_module *node) -1); } - *os << be_uidt_nl + *os << be_uidt_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl; + + *os << be_nl << "}\nTAO_NAMESPACE_CLOSE // module " << node->name () << "\n\n"; } 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 9fcc61d3d86..69277ece870 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp @@ -42,6 +42,9 @@ be_visitor_module_sh::visit_module (be_module *node) { TAO_OutStream *os = this->ctx_->stream (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the skeleton class name. os->indent (); @@ -74,6 +77,9 @@ be_visitor_module_sh::visit_module (be_module *node) os->decr_indent (); + *os << 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"; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp index fad8b320eed..6ba019ca283 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp @@ -104,7 +104,7 @@ be_visitor_operation_arglist::visit_operation (be_operation *node) case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH: case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH: case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH: - if (node->is_local ()) + if (node->is_local () || node->defined_in ()->is_abstract ()) { *os << " = 0;" << be_nl << be_nl; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp index f8eacca5521..d222235b04d 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument_invoke.cpp @@ -67,7 +67,7 @@ be_visitor_operation_argument_invoke::pre_process (be_decl *bd) { if (this->last_arg_printed_ != be_visitor_operation_argument_invoke::TAO_ARG_NONE) - *os << " &&\n"; + *os << " &&" << be_nl; } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -79,13 +79,13 @@ be_visitor_operation_argument_invoke::pre_process (be_decl *bd) { if (this->last_arg_printed_ != be_visitor_operation_argument_invoke::TAO_ARG_NONE) - *os << " &&\n"; + *os << " &&" << be_nl; } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { if (this->last_arg_printed_ != be_visitor_operation_argument_invoke::TAO_ARG_NONE) - *os << " &&\n"; + *os << " &&" << be_nl; } break; case AST_Argument::dir_OUT: @@ -97,7 +97,7 @@ be_visitor_operation_argument_invoke::pre_process (be_decl *bd) { if (this->last_arg_printed_ != be_visitor_operation_argument_invoke::TAO_ARG_NONE) - *os << " &&\n"; + *os << " &&" << be_nl; } 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 d5554155600..ec59c0045c8 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp @@ -205,38 +205,49 @@ be_visitor_args_decl::visit_array (be_array *node) "(%N:%l) be_visitor_args_decl::" "visit_array - " "cannot retrieve argument node\n" - ), -1); + ), + -1); } // for anonymous arrays, the type name has a _ prepended. We compute // the full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); + if (!this->ctx_->alias () // not a typedef && node->is_child (this->ctx_->scope ())) { - // for anonymous arrays ... - // we have to generate a name for us that has an underscope + // For anonymous arrays ... + // We have to generate a name for us that has an underscope // prepended to our local name. This needs to be inserted after - // the parents's name + // the parents's name. if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), + + ACE_OS::sprintf (fname, + "%s::_%s", + parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->full_name ()); + ACE_OS::sprintf (fname, + "_%s", + node->full_name ()); } } else { - // typedefed node - ACE_OS::sprintf (fname, "%s", node->full_name ()); + // Typedefed node. + ACE_OS::sprintf (fname, + "%s", + node->full_name ()); } if (f->direction () != AST_Argument::dir_IN) @@ -247,6 +258,7 @@ be_visitor_args_decl::visit_array (be_array *node) << f->local_name () << be_uidt_nl << ");" << be_uidt_nl; } + return 0; } @@ -258,13 +270,15 @@ be_visitor_args_decl::visit_typedef (be_typedef *node) // the node to be visited in the base primitve type that gets typedefed be_type *bt = node->primitive_base_type (); + if (!bt || (bt->accept (this) == -1)) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_args_decl::" "visit_typedef - " "Bad primitive type\n" - ), -1); + ), + -1); } this->ctx_->alias (0); 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 e85a9229a9c..ce6431704a0 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp @@ -140,7 +140,7 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( } } - *os << " (" << be_idt_nl + *os << " (" << be_idt << be_idt_nl << "TAO_ServerRequest &_tao_server_request," << be_nl; be_interface *intf; @@ -158,10 +158,10 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( } // Pass in the pointer to the Servant_Upcall. - *os << "TAO_Object_Adapter::Servant_Upcall *tao_servant_upcall,"; + *os << "TAO_Object_Adapter::Servant_Upcall *tao_servant_upcall," << be_nl; // Get the right object implementation. - *os << intf->full_skel_name () << " *tao_impl" << be_nl; + *os << intf->full_skel_name () << " *tao_impl"; // Generate the argument list with the appropriate mapping. For these // we grab a visitor that generates the parameter listing. @@ -179,12 +179,7 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( -1); } - *os << ");\n\n"; - - os->indent (); - - *os << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl; + *os << be_uidt_nl << ");" << be_uidt_nl << be_nl; // Here I still need to generate the other methods + private args. *os << "virtual Dynamic::ParameterList * arguments (" @@ -210,16 +205,16 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( *os << "virtual char * target_most_derived_interface (" << be_idt << be_idt_nl - << "ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)" - << be_uidt_nl + << "ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ")" << be_nl << "ACE_THROW_SPEC ((CORBA::SystemException));" << be_uidt_nl << be_nl; *os << "virtual CORBA::Boolean target_is_a (" << be_idt << be_idt_nl << "const char * id" << be_nl - << "ACE_ENV_ARG_DECL_WITH_DEFAULTS)" - << be_uidt_nl - << "ACE_THROW_SPEC ((CORBA::SystemException));\n" + << "ACE_ENV_ARG_DECL_WITH_DEFAULTS" << be_uidt_nl + << ")" << be_nl + << "ACE_THROW_SPEC ((CORBA::SystemException));" << be_uidt_nl; // Store the result for later use. @@ -239,7 +234,8 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( // void since we cant have a private member to be of void type. if (!this->void_return_type (bt)) { - *os << "void result ("; + *os << be_nl << "void result ("; + ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_OPERATION_RETTYPE_CH); be_visitor_operation_rettype or_visitor (&ctx); @@ -289,7 +285,8 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( } } - *os << " (const "<< "TAO_ServerRequestInfo_"<< node->flat_name (); + *os << " (" << be_idt << be_idt_nl + << "const "<< "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 @@ -322,8 +319,10 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( } - *os << " &);" << be_nl - << "void operator= (const " + *os << " &" << be_uidt_nl + << ");" << be_uidt_nl << be_nl + << "void operator= (" << be_idt << be_idt_nl + << "const " << "TAO_ServerRequestInfo_"<< node->flat_name (); // We need the interface node in which this operation was defined. However, @@ -357,7 +356,8 @@ be_visitor_operation_interceptors_ss::generate_class_declaration ( } - *os << " &);" << be_nl; + *os << " &" << be_uidt_nl + << ");" << be_uidt_nl; *os << be_uidt_nl << "private:" << be_idt_nl; @@ -602,7 +602,9 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( } } - *os << "::arguments (ACE_ENV_SINGLE_ARG_DECL)" << be_idt_nl + *os << "::arguments (" << be_idt << be_idt_nl + << "ACE_ENV_SINGLE_ARG_DECL" << be_uidt_nl + << ")" << be_nl << "ACE_THROW_SPEC ((CORBA::SystemException))" << be_uidt_nl << "{" << be_idt_nl << "// Generate the argument list on demand." << be_nl @@ -703,7 +705,9 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( } } - *os << "::exceptions (ACE_ENV_SINGLE_ARG_DECL)"<< be_idt_nl + *os << "::exceptions (" << be_idt << be_idt_nl + << "ACE_ENV_SINGLE_ARG_DECL" << be_uidt_nl + << ")"<< be_nl << "ACE_THROW_SPEC ((CORBA::SystemException))" << be_uidt_nl << "{" << be_idt_nl; @@ -798,7 +802,9 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( } } - *os << "::result (ACE_ENV_SINGLE_ARG_DECL)"<< be_idt_nl + *os << "::result (" << be_idt << be_idt_nl + << "ACE_ENV_SINGLE_ARG_DECL" << be_uidt_nl + << ")"<< be_nl << "ACE_THROW_SPEC ((CORBA::SystemException))" << be_uidt_nl << "{" << be_idt_nl; @@ -904,7 +910,8 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( *os << "::target_most_derived_interface (" << be_idt << be_idt_nl - << "ACE_ENV_SINGLE_ARG_DECL_NOT_USED)" << be_uidt_nl + << "ACE_ENV_SINGLE_ARG_DECL_NOT_USED" << be_uidt_nl + << ")" << be_nl << "ACE_THROW_SPEC ((CORBA::SystemException))" << be_uidt_nl << "{" << be_idt_nl << "return" << be_idt_nl @@ -950,7 +957,8 @@ be_visitor_operation_interceptors_ss::generate_class_definition ( *os << "::target_is_a (" << be_idt << be_idt_nl << "const char * id" << be_nl - << "ACE_ENV_ARG_DECL)" << be_uidt_nl + << "ACE_ENV_ARG_DECL" << be_uidt_nl + << ")" << be_nl << "ACE_THROW_SPEC ((CORBA::SystemException))" << be_uidt_nl << "{" << be_idt_nl << "return this->_tao_impl->_is_a (id ACE_ENV_ARG_PARAMETER);" diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp index e9558a59220..892e96267b7 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp @@ -276,11 +276,10 @@ int be_visitor_operation::gen_check_exception (be_type *return_type) { TAO_OutStream *os = this->ctx_->stream (); - os->indent (); if (return_type == 0 || this->void_return_type (return_type)) { - *os << "ACE_CHECK;\n"; + *os << "ACE_CHECK;" << be_nl; return 0; } @@ -300,7 +299,7 @@ be_visitor_operation::gen_check_exception (be_type *return_type) -1); } - *os << ");\n"; + *os << ");" << be_nl; return 0; } @@ -308,7 +307,6 @@ int be_visitor_operation::gen_check_interceptor_exception (be_type *return_type) { TAO_OutStream *os = this->ctx_->stream (); - os->indent (); if (return_type == 0 || this->void_return_type (return_type)) { 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 797c69fe67e..af66778bbf7 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ch.cpp @@ -42,6 +42,9 @@ be_visitor_operation_ch::visit_operation (be_operation *node) this->ctx_->node (node); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Every operation is declared virtual in the client code. *os << "virtual "; 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 9a21bc6a12a..57c42290687 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp @@ -43,6 +43,9 @@ be_visitor_operation_sh::visit_operation (be_operation *node) os->indent (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "virtual "; // STEP I: generate the return type. @@ -92,7 +95,6 @@ be_visitor_operation_sh::visit_operation (be_operation *node) // if there was no "native" type. if (!node->has_native ()) { - os->indent (); *os << "static void "; // Check if we are an attribute node in disguise. @@ -109,13 +111,13 @@ be_visitor_operation_sh::visit_operation (be_operation *node) } } - *os << node->local_name () << - "_skel (" << be_idt << be_idt_nl + *os << node->local_name () + << "_skel (" << be_idt << be_idt_nl << "TAO_ServerRequest &_tao_req," << be_nl << "void *_tao_obj," << be_nl << "void *_tao_servant_upcall" << be_nl << "ACE_ENV_ARG_DECL" << be_uidt_nl - << ");" << be_uidt << "\n\n"; + << ");" << be_uidt << "\n"; } 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 fd0245978f8..f8604acf2b5 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp @@ -98,6 +98,10 @@ be_visitor_operation_ss::visit_operation (be_operation *node) // Generate the signature of the static skeleton. os->indent (); + + *os << "// TAO_IDL - Generated from " << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + *os << "void " << intf->full_skel_name () << "::"; // Check if we are an attribute node in disguise. @@ -339,10 +343,9 @@ 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#if (TAO_HAS_INTERCEPTORS == 1)" << be_uidt_nl; - *os << be_uidt - << "}" << be_nl << be_nl; + *os << "}" << be_nl << be_nl; // Grab the right visitor to generate the return type accessor if // it's not void since we can't have a private member to be of void @@ -411,14 +414,21 @@ be_visitor_operation_ss::visit_operation (be_operation *node) *os << be_nl << "if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION" << be_nl << " || _tao_status == PortableInterceptor::USER_EXCEPTION)" - << be_idt_nl; + << be_idt_nl + << "{" << be_idt_nl; if (be_global->use_raw_throw ()) - *os << "throw;" << be_uidt << be_uidt_nl; + { + *os << "throw;"; + } else - *os << "ACE_RE_THROW;" << be_uidt << be_uidt_nl; + { + *os << "ACE_RE_THROW;"; + } - *os << "}" << be_uidt_nl + *os << be_uidt_nl + << "}" << be_uidt << be_uidt_nl + << "}" << be_uidt_nl << "ACE_ENDTRY;" << be_nl; *os << "ACE_CHECK;\n" << "#endif /* TAO_HAS_INTERCEPTORS */" << be_nl << be_nl; @@ -447,9 +457,9 @@ be_visitor_operation_ss::visit_operation (be_operation *node) *os << "// In case _tao_servant_upcall is not used in this function" << be_nl - << "ACE_UNUSED_ARG (_tao_servant_upcall);" << be_nl << be_nl; + << "ACE_UNUSED_ARG (_tao_servant_upcall);" << be_uidt_nl + << "}\n\n"; - *os << be_uidt << "}\n\n"; return 0; } 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 415510955c3..16c36304b37 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 @@ -164,9 +164,10 @@ be_visitor_operation_remote_proxy_impl_cs::visit_operation ( { // Generate code that retrieves the underlying stub object and then // invokes do_static_call on it. - *os << be_nl - << "TAO_Stub *istub = _collocated_tao_target_->_stubobj ();" - << be_nl << "if (istub == 0)" << be_idt_nl; + *os << "TAO_Stub *istub = _collocated_tao_target_->_stubobj ();" + << be_nl << be_nl + << "if (istub == 0)" << be_idt_nl + << "{" << be_idt_nl; // If the stub object was bad, then we raise a system exception. if (this->gen_raise_exception (bt, "CORBA::INTERNAL", "") == -1) @@ -181,7 +182,11 @@ be_visitor_operation_remote_proxy_impl_cs::visit_operation ( ); } - *os << be_uidt_nl << "\n"; + *os << be_uidt; + + os->indent (); + + *os << "}" << be_uidt_nl << be_nl; // Do any pre marshal and invoke processing with return type. This // includes allocating memory, initialization. @@ -333,6 +338,8 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( os->indent (); + *os << be_nl; + // Create the GIOP_Invocation and grab the outgoing CDR stream. switch (node->flags ()) { @@ -419,7 +426,7 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( } } - *os << " _tao_ri (" << be_idt_nl + *os << " _tao_ri (" << be_idt << be_idt_nl << "&_tao_call," << be_nl << "_collocated_tao_target_"; @@ -438,7 +445,7 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( -1); } - *os << be_uidt_nl << ");" << be_nl; + *os << be_uidt_nl << ");" << be_uidt_nl; if (this->gen_check_exception (bt) == -1) { @@ -451,8 +458,6 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( *os << "\n#endif /* TAO_HAS_INTERCEPTORS */" << be_nl; - *os << be_nl; - // Prepare the request header. *os << be_nl << "CORBA::Short _tao_response_flag = "; @@ -476,10 +481,10 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( // This is done before the Invocation::start() call so that a // connection can be avoided if send_request() throws an exception, // i.e. this is an optimization. - *os << "_tao_vfr.send_request (" << be_idt_nl + *os << "_tao_vfr.send_request (" << be_idt << be_idt_nl << "&_tao_ri" << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl - << ");" << be_nl + << ");" << be_uidt_nl << "ACE_TRY_CHECK;" << be_nl; // _invoke_status is potentially set (via a reference) in @@ -539,7 +544,7 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( { *os << be_nl << "TAO_OutputCDR &_tao_out = _tao_call.out_stream ();" - << be_nl + << be_nl << be_nl << "if (!(" << be_idt << be_idt_nl; // Marshal each in and inout argument. @@ -558,8 +563,9 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( -1); } - *os << be_uidt_nl - << "))" << be_nl; + *os << be_nl + << "))" << be_uidt_nl + << "{" << be_idt_nl; // If marshaling fails, raise exception. if (this->gen_raise_interceptor_exception (bt, "CORBA::MARSHAL", "") @@ -572,11 +578,12 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( -1); } - *os << be_uidt_nl; + *os << be_uidt_nl << be_nl; + *os << "}" << be_uidt_nl << be_nl; } else { - *os << be_nl; + *os << be_nl << be_nl; } *os << "_invoke_status =" << be_idt_nl; @@ -641,14 +648,14 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( // the client (e.g. SYNC_WITH_TARGET). *os << "else if (_invoke_status == TAO_INVOKE_RESTART)" << be_idt_nl << "{" << be_idt_nl - << "TAO_INTERCEPTOR (" << be_idt_nl + << "TAO_INTERCEPTOR (" << be_idt << be_idt_nl << "_tao_ri.reply_status (_invoke_status);" << be_nl - << "_tao_vfr.receive_other (" << be_idt_nl + << "_tao_vfr.receive_other (" << be_idt << be_idt_nl << "&_tao_ri" << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl - << ");" << be_nl + << ");" << be_uidt_nl << "ACE_TRY_CHECK;" << be_uidt_nl - << ")" << be_nl + << ")" << be_uidt_nl << be_nl << "continue;" << be_uidt_nl << "}" << be_uidt_nl @@ -707,7 +714,9 @@ be_visitor_operation_remote_proxy_impl_cs::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 << "TAO_InputCDR &_tao_in = _tao_call.inp_stream ();" << be_nl + *os << be_nl + << "TAO_InputCDR &_tao_in = _tao_call.inp_stream ();" + << be_nl << be_nl << "if (!(" << be_idt << be_idt_nl; if (!this->void_return_type (bt)) @@ -812,13 +821,15 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( if (bt->size_type () == AST_Type::VARIABLE || bt->base_node_type () == AST_Decl::NT_array) { - *os << " _tao_retval_info = _tao_retval._retn ();" << be_nl + *os << " _tao_retval_info =" << be_idt_nl + << "_tao_retval._retn ();" << be_uidt_nl << "_tao_ri.result (_tao_retval_info);" << be_nl << "_tao_retval = _tao_retval_info;" << be_nl; } else { - *os << " _tao_retval_info = _tao_retval;" << be_nl + *os << " _tao_retval_info =" << be_idt_nl + << "_tao_retval;" << be_uidt_nl << "_tao_ri.result (_tao_retval_info);" << be_nl; } } @@ -835,10 +846,10 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( // Invoke receive_reply() interception point. *os << be_nl << "_tao_ri.reply_status (_invoke_status);" << be_nl - << "_tao_vfr.receive_reply (" << be_idt_nl + << "_tao_vfr.receive_reply (" << be_idt << be_idt_nl << "&_tao_ri" << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl - << ");" << be_nl; + << ");" << be_uidt_nl; } else if (node->flags () == AST_Operation::OP_oneway) { @@ -851,9 +862,8 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( << ");" << be_nl; } - *os << "ACE_TRY_CHECK;" << be_uidt_nl; - - *os << be_uidt_nl + *os << "ACE_TRY_CHECK;" + << be_uidt_nl << "}" << be_uidt_nl; // Note that we do NOT catch the PortableInterceptor::ForwardRequest @@ -868,10 +878,10 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( // Update the exception field of the ClientRequestInfo. *os << "_tao_ri.exception (&ACE_ANY_EXCEPTION);"<< be_nl; - *os << "_tao_vfr.receive_exception (" << be_idt_nl + *os << "_tao_vfr.receive_exception (" << be_idt << be_idt_nl << "&_tao_ri" << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl - << ");" << be_nl + << ");" << be_uidt_nl << "ACE_TRY_CHECK;" << be_nl; // The receive_exception() interception point may have thrown a @@ -885,18 +895,22 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( *os << be_nl << "if (_tao_status == PortableInterceptor::SYSTEM_EXCEPTION" << be_nl - << " || _tao_status == PortableInterceptor::USER_EXCEPTION)" - << be_idt_nl; + << " || _tao_status == PortableInterceptor::USER_EXCEPTION)" + << be_idt_nl + << "{" << be_idt_nl; if (be_global->use_raw_throw ()) { - *os << "throw;" << be_uidt << be_uidt_nl; + *os << "throw;"; } else { - *os << "ACE_RE_THROW;" << be_uidt << be_uidt_nl; + *os << "ACE_RE_THROW;"; } + *os << be_uidt_nl + << "}" << be_uidt << be_uidt_nl; + *os << "}" << be_uidt_nl << "ACE_ENDTRY;" << be_nl; @@ -932,12 +946,14 @@ be_visitor_operation_remote_proxy_impl_cs::gen_marshal_and_invoke ( << "if (_tao_status == PortableInterceptor::LOCATION_FORWARD" << be_nl << " || _tao_status == PortableInterceptor::TRANSPORT_RETRY)" << be_idt_nl - << "continue;" << be_uidt_nl; + << "{" << be_idt_nl + << "continue;" << be_uidt_nl + << "}" << be_uidt_nl; *os << "\n#endif /* TAO_HAS_INTERCEPTORS */" << be_nl; *os << be_nl << "break;" << be_uidt_nl - << "}" << be_uidt_nl; + << "}" << be_uidt_nl << be_nl; return 0; } @@ -959,10 +975,11 @@ be_visitor_operation_remote_proxy_impl_cs::gen_raise_interceptor_exception ( } else { - *os << "TAO_INTERCEPTOR_THROW (" << be_idt_nl - << excep << " (" << completion_status - << ")" << be_uidt_nl - << ");" << be_nl; + *os << "TAO_INTERCEPTOR_THROW (" << be_idt << be_idt_nl + << excep << " (" << be_idt << be_idt_nl + << completion_status << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ");" << be_uidt; } } else @@ -970,17 +987,21 @@ be_visitor_operation_remote_proxy_impl_cs::gen_raise_interceptor_exception ( if (bt->size_type () == AST_Type::VARIABLE || bt->base_node_type () == AST_Decl::NT_array) { - *os << "TAO_INTERCEPTOR_THROW_RETURN (" << be_idt_nl - << excep << " (" << completion_status << ")," << be_nl + *os << "TAO_INTERCEPTOR_THROW_RETURN (" << be_idt << be_idt_nl + << excep << " (" << be_idt << be_idt_nl + << completion_status << be_uidt_nl + << ")," << be_uidt_nl << "0" << be_uidt_nl - << ");" << be_nl; + << ");" << be_uidt; } else { - *os << "TAO_INTERCEPTOR_THROW_RETURN (" << be_idt_nl - << excep << " (" << completion_status << ")," << be_nl + *os << "TAO_INTERCEPTOR_THROW_RETURN (" << be_idt << be_idt_nl + << excep << " (" << be_idt << be_idt_nl + << completion_status << be_uidt_nl + << ")," << be_uidt_nl << "_tao_retval" << be_uidt_nl - << ");" << be_nl; + << ");" << be_uidt; } } 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 5d987d4cf1e..ee688d485cb 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 @@ -66,12 +66,10 @@ int be_visitor_operation_rettype_marshal_ss::visit_operation ( if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - os->indent (); *os << "(_tao_out << "; } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { - os->indent (); *os << "(_tao_in >> "; } else 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 c8409801afd..f6dfc8e7e3f 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 - << ");\n" << be_uidt; + << ");" << be_uidt_nl; return 0; } @@ -55,7 +55,8 @@ be_visitor_operation_rettype_post_invoke_cs::visit_array (be_array *node) int be_visitor_operation_rettype_post_invoke_cs::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // set the alias node + this->ctx_->alias (node); + if (node->primitive_base_type ()->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -64,6 +65,7 @@ be_visitor_operation_rettype_post_invoke_cs::visit_typedef (be_typedef *node) "accept on primitive type failed\n"), -1); } + this->ctx_->alias (0); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_pre_invoke_cs.cpp index 10b1afe61a6..ca2f69c51e4 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,8 +53,6 @@ be_visitor_operation_rettype_pre_invoke_cs::visit_array (be_array *node) bt = node; } - os->indent (); - *os << "{" << be_idt_nl << bt->name () << "_slice *tmp;" << be_nl << "ACE_ALLOCATOR_RETURN (tmp, " @@ -87,7 +85,6 @@ visit_predefined_type (be_predefined_type *node) switch (node->pt ()) { case AST_PredefinedType::PT_any: - os->indent (); *os << "{" << be_idt_nl << "CORBA::Any *tmp;" << be_nl 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 b86e31d3883..ddfae38a161 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 @@ -200,7 +200,9 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd * } int -be_visitor_operation_rettype_vardecl_cs::visit_predefined_type (be_predefined_type *node) +be_visitor_operation_rettype_vardecl_cs::visit_predefined_type ( + be_predefined_type *node + ) { TAO_OutStream *os = this->ctx_->stream (); be_type *bt; @@ -246,7 +248,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_predefined_type (be_predefined_ty break; } - *os << be_nl << be_nl; + *os << be_nl; return 0; } 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 ac4f698f973..db4d71260a6 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 @@ -144,7 +144,7 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( { *os << be_nl << "ACE_ENV_ARG_PARAMETER" << be_uidt_nl - << ");" << be_nl << be_uidt; + << ");" << be_uidt_nl; } else { @@ -165,8 +165,6 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( ); } - os->indent (); - if (!this->void_return_type (bt)) { *os << "return "; @@ -184,15 +182,8 @@ be_visitor_operation_thru_poa_proxy_impl_ss::visit_operation ( return -1; } - if (this->void_return_type (bt)) - { - *os << "return;\n"; - } - *os << "}\n\n"; - os->decr_indent (0); - return 0; } @@ -231,14 +222,7 @@ be_visitor_operation_thru_poa_proxy_impl_ss::gen_invoke ( // Retrieve the operation return type. be_type *bt = be_type::narrow_from_decl (node->return_type ()); - if (this->void_return_type (bt)) - { - *os << be_uidt << be_uidt_nl; - } - else - { - *os << be_uidt << be_uidt << be_uidt_nl; - } + *os << be_uidt << be_uidt << be_uidt_nl; 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 82316d23899..5db849fd050 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root.cpp @@ -65,18 +65,18 @@ int be_visitor_root::visit_root (be_root *node) if (this->ctx_->state () == TAO_CodeGen::TAO_ROOT_CH) { TAO_OutStream *os = this->ctx_->stream (); - - size_t size = be_global->non_local_interfaces.size (); be_interface *i = 0; be_interface_fwd *ifwd = 0; size_t index = 0; + size_t size = be_global->non_local_interfaces.size (); + if (size > 0) { *os << "// Proxy Broker Factory function pointer declarations." - << be_nl << be_nl; - *os << be_nl << "// TAO_IDL - Generated from " - << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + << be_nl; + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; } for (index = 0; index < size; ++index) @@ -97,7 +97,7 @@ int be_visitor_root::visit_root (be_root *node) if (size > 0) { - *os << be_nl << "// TAO_IDL - Generated from " + *os << "// TAO_IDL - Generated from " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; } @@ -141,6 +141,39 @@ int be_visitor_root::visit_root (be_root *node) << "void *" << be_uidt_nl << ");" << be_uidt_nl << be_nl; } + + size = be_global->mixed_parentage_interfaces.size (); + + if (size > 0) + { + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + + *os << "// Overrides of CORBA::release and CORBA::is_nil for" + << be_nl + << "// interfaces that inherit from both CORBA::Object" << be_nl + << "// and CORBA::AbstractBase." << be_nl << be_nl + << "TAO_NAMESPACE CORBA" << be_nl + << "{" << be_idt; + } + + for (index = 0; index < size; ++index) + { + be_global->mixed_parentage_interfaces.dequeue_head (i); + + *os << be_nl + << "TAO_NAMESPACE_STORAGE_CLASS void release (" + << i->name () << "_ptr);" << be_nl + << "TAO_NAMESPACE_STORAGE_CLASS CORBA::Boolean is_nil (" + << i->name () << "_ptr);"; + } + + if (size > 0) + { + *os << be_uidt_nl + << "}" << be_nl + << "TAO_NAMESPACE_CLOSE" << be_nl << be_nl; + } } be_visitor_context ctx (*this->ctx_); @@ -460,8 +493,8 @@ be_visitor_root::visit_enum (be_enum *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: 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 a0c622bc66f..979e52c743b 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_sth.cpp @@ -162,7 +162,7 @@ be_visitor_root_sth::visit_module (be_module *node) if (!node->is_nested ()) { - *os << "#endif /* ACE_HAS_USING_KEYWORD */\n"; + *os << "#endif /* ACE_HAS_USING_KEYWORD */\n\n"; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp index 1e80b210750..6ef79bbb44e 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/elemtype.cpp @@ -94,6 +94,10 @@ be_visitor_sequence_elemtype::visit_predefined_type (be_predefined_type *node) { *os << "TAO_Pseudo_Object_Manager<"; } + else if (node->is_abstract ()) + { + *os << "TAO_Abstract_Manager<"; + } else { *os << "TAO_Object_Manager<"; @@ -148,13 +152,29 @@ be_visitor_sequence_elemtype::visit_interface (be_interface *node) if (this->ctx_->state () == TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH) { - *os << "TAO_Object_Manager<"; + if (node->is_abstract ()) + { + *os << "TAO_Abstract_Manager<"; + } + else + { + *os << "TAO_Object_Manager<"; + } + *os << bt->nested_type_name (this->ctx_->scope ()) << ", "; *os << bt->nested_type_name (this->ctx_->scope (), "_var") << ">"; } else { - *os << "TAO_Object_Manager<"; + if (node->is_abstract ()) + { + *os << "TAO_Abstract_Manager<"; + } + else + { + *os << "TAO_Object_Manager<"; + } + *os << bt->name () << ", "; *os << bt->name () << "_var>"; } 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 0265a1210fe..625703b4056 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 @@ -119,7 +119,14 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node) } else if (nt == AST_Decl::NT_interface) { - *os << "TAO_Object_Manager<"; + if (node->base_type ()->is_abstract ()) + { + *os << "TAO_Abstract_Manager<"; + } + else + { + *os << "TAO_Object_Manager<"; + } } *os << bt->name () << "," 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 8666f781c07..662f31fea20 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 @@ -415,7 +415,11 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) { if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "TAO_Valuetype_Manager<"; + *os << "ACE_INLINE TAO_Valuetype_Manager<"; + } + else if (node->base_type ()->is_abstract ()) + { + *os << "ACE_INLINE TAO_Abstract_Manager<"; } else { @@ -446,7 +450,11 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) { if (pt->node_type () == AST_Decl::NT_valuetype) { - *os << "return TAO_Valuetype_Manager<"; + *os << "return TAO_Valuetype_Manager<"; + } + else if (node->base_type()->is_abstract ()) + { + *os << "return TAO_Abstract_Manager<"; } else { 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 d5b4289f389..e39a02df0a4 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 @@ -121,7 +121,11 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node) { *os << "TAO_Valuetype_Manager<"; } - else if (nt == AST_Decl::NT_interface) + else if (node->base_type ()->is_abstract ()) + { + *os << "TAO_Abstract_Manager<"; + } + else { *os << "TAO_Object_Manager<"; } 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 b37b5072346..79fe87eda25 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 @@ -394,6 +394,10 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) { *os << "ACE_INLINE TAO_Valuetype_Manager<"; } + else if (node->base_type ()->is_abstract ()) + { + *os << "ACE_INLINE TAO_Abstract_Manager<"; + } else { *os << "ACE_INLINE TAO_Object_Manager<"; @@ -426,6 +430,10 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) { *os << "return TAO_Valuetype_Manager<"; } + else if (node->base_type ()->is_abstract ()) + { + *os << "return TAO_Abstract_Manager<"; + } else { *os << "return TAO_Object_Manager<"; 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 0430122901e..14f0697b73c 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp @@ -68,6 +68,17 @@ be_visitor_sequence_ch::gen_base_sequence_class (be_sequence *node) } break; + case be_sequence::MNG_ABSTRACT: + if (node->unbounded ()) + { + *os << "TAO_Unbounded_Abstract_Sequence<"; + } + else + { + *os << "TAO_Bounded_Abstract_Sequence<"; + } + + break; case be_sequence::MNG_PSEUDO: if (node->unbounded ()) { @@ -224,6 +235,7 @@ be_visitor_sequence_ch::instantiate_sequence (be_sequence *node) case be_sequence::MNG_PSEUDO: case be_sequence::MNG_OBJREF: case be_sequence::MNG_VALUE: + case be_sequence::MNG_ABSTRACT: if (node->unbounded ()) { this->gen_unbounded_obj_sequence (node); @@ -654,6 +666,7 @@ be_visitor_sequence_ch::gen_var_defn (be_sequence *node) && nt != AST_Decl::NT_wstring && nt != AST_Decl::NT_interface && nt != AST_Decl::NT_interface_fwd + && nt != AST_Decl::NT_valuetype && nt != AST_Decl::NT_array && pdt != AST_PredefinedType::PT_pseudo && pdt != AST_PredefinedType::PT_object) 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 ff1196c2cdb..0213f8a7498 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp @@ -113,6 +113,7 @@ be_visitor_sequence_ci::instantiate_sequence (be_sequence *node) case be_sequence::MNG_PSEUDO: case be_sequence::MNG_OBJREF: case be_sequence::MNG_VALUE: + case be_sequence::MNG_ABSTRACT: if (node->unbounded ()) { this->gen_unbounded_obj_sequence (node); @@ -436,6 +437,7 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) && nt != AST_Decl::NT_wstring && nt != AST_Decl::NT_interface && nt != AST_Decl::NT_interface_fwd + && nt != AST_Decl::NT_valuetype && nt != AST_Decl::NT_array && pdt != AST_PredefinedType::PT_pseudo && pdt != AST_PredefinedType::PT_object) 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 e4c94964bbd..5273361760e 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp @@ -65,49 +65,94 @@ be_visitor_sequence_cs::gen_base_sequence_class (be_sequence *node) { case be_sequence::MNG_OBJREF: if (node->unbounded ()) - *os << "TAO_Unbounded_Object_Sequence<"; + { + *os << "TAO_Unbounded_Object_Sequence<"; + } else - *os << "TAO_Bounded_Object_Sequence<"; + { + *os << "TAO_Bounded_Object_Sequence<"; + } + + break; + case be_sequence::MNG_ABSTRACT: + if (node->unbounded ()) + { + *os << "TAO_Unbounded_Abstract_Sequence<"; + } + else + { + *os << "TAO_Bounded_Abstract_Sequence<"; + } + break; case be_sequence::MNG_PSEUDO: if (node->unbounded ()) - *os << "TAO_Unbounded_Pseudo_Sequence<"; + { + *os << "TAO_Unbounded_Pseudo_Sequence<"; + } else - *os << "TAO_Bounded_Pseudo_Sequence<"; + { + *os << "TAO_Bounded_Pseudo_Sequence<"; + } + break; case be_sequence::MNG_VALUE: if (node->unbounded ()) - *os << "TAO_Unbounded_Valuetype_Sequence<"; + { + *os << "TAO_Unbounded_Valuetype_Sequence<"; + } else - *os << "TAO_Bounded_Valuetype_Sequence<"; + { + *os << "TAO_Bounded_Valuetype_Sequence<"; + } + break; case be_sequence::MNG_STRING: if (node->unbounded ()) - *os << "TAO_Unbounded_String_Sequence"; + { + *os << "TAO_Unbounded_String_Sequence"; + } else - *os << "TAO_Bounded_String_Sequence"; + { + *os << "TAO_Bounded_String_Sequence"; + } + break; case be_sequence::MNG_WSTRING: if (node->unbounded ()) - *os << "TAO_Unbounded_WString_Sequence"; + { + *os << "TAO_Unbounded_WString_Sequence"; + } else - *os << "TAO_Bounded_WString_Sequence"; + { + *os << "TAO_Bounded_WString_Sequence"; + } + break; default: // not a managed type if (bt->base_node_type () == AST_Decl::NT_array) { if (node->unbounded ()) - *os << "TAO_Unbounded_Array_Sequence<"; + { + *os << "TAO_Unbounded_Array_Sequence<"; + } else - *os << "TAO_Bounded_Array_Sequence<"; + { + *os << "TAO_Bounded_Array_Sequence<"; + } } else { if (node->unbounded ()) - *os << "TAO_Unbounded_Sequence<"; + { + *os << "TAO_Unbounded_Sequence<"; + } else - *os << "TAO_Bounded_Sequence<"; + { + *os << "TAO_Bounded_Sequence<"; + } } + break; } @@ -341,6 +386,7 @@ be_visitor_sequence_cs::instantiate_sequence (be_sequence *node) case be_sequence::MNG_PSEUDO: case be_sequence::MNG_OBJREF: case be_sequence::MNG_VALUE: + case be_sequence::MNG_ABSTRACT: if (node->unbounded ()) { this->gen_unbounded_obj_sequence (node); 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 6b171c4c67f..03f39600204 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 @@ -69,6 +69,7 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) // Set the sub state as generating code for the output operator. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_OUTPUT); + *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, " << "const " << node->name () << " &_tao_aggregate)" << be_nl << "{" << be_idt_nl; @@ -78,6 +79,7 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) be_visitor_cdr_op_field_decl field_decl (&new_ctx); field_decl.visit_scope (node); } + *os << "if (" << be_idt_nl; if (this->visit_scope (node) == -1) @@ -88,6 +90,7 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) "codegen for scope failed\n"), -1); } + *os << be_uidt_nl << ")" << be_idt_nl << "return 1;" << be_uidt_nl @@ -97,6 +100,7 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) // Set the substate as generating code for the input operator. this->ctx_->sub_state(TAO_CodeGen::TAO_CDR_INPUT); + *os << "ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &strm, " << node->name () << " &_tao_aggregate)" << be_nl << "{" << be_idt_nl; @@ -106,6 +110,7 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) be_visitor_cdr_op_field_decl field_decl (&new_ctx); field_decl.visit_scope (node); } + *os << "if (" << be_idt_nl; if (this->visit_scope (node) == -1) @@ -116,6 +121,7 @@ be_visitor_structure_cdr_op_ci::visit_structure (be_structure *node) "codegen for scope failed\n"), -1); } + *os << be_uidt_nl << ")" << be_idt_nl << "return 1;" << be_uidt_nl @@ -140,12 +146,12 @@ be_visitor_structure_cdr_op_ci::post_process (be_decl *bd) case TAO_CodeGen::TAO_CDR_OUTPUT: case TAO_CodeGen::TAO_CDR_INPUT: *os << " &&" << be_nl; - break; case TAO_CodeGen::TAO_CDR_SCOPE: default: break; }; } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp index a064c72541d..c80cd5f007d 100644 --- a/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_ci.cpp @@ -45,25 +45,32 @@ int be_visitor_structure_ci::visit_structure (be_structure *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_ci::" "visit_structure - " - "codegen for _var failed\n"), -1); + "codegen for _var failed\n"), + -1); } + if (node->size_type () == AST_Type::VARIABLE && node->gen_out_impl () == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_structure_ci::" "visit_structure - " - "codegen for _out failed\n"), -1); + "codegen for _out failed\n"), + -1); } + // 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_ci::" "visit_structure - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } + node->cli_inline_gen (I_TRUE); } + return 0; } 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 4ee204f3cd7..cc4ec464ae7 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp @@ -40,6 +40,9 @@ be_visitor_typecode_decl::visit_type (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); + *os << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + if (node->is_nested ()) { // We have a scoped name. @@ -57,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; + << ";" << be_nl; } else { @@ -65,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; + << ";" << be_nl; } return 0; 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 bf100e3b665..56bf623159e 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp @@ -279,6 +279,9 @@ be_visitor_typecode_defn::visit_type (be_type *node) -1); } + *os << be_nl << "// TAO_IDL - Generated from" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + os->indent (); // start from current indentation level // Generate the typecode information here @@ -376,6 +379,7 @@ be_visitor_typecode_defn::visit_type (be_type *node) { *os << "TAO_NAMESPACE_TYPE (CORBA::TypeCode_ptr)" << be_nl; be_module *module = be_module::narrow_from_scope (node->defined_in ()); + if (!module || (this->gen_nested_namespace_begin (module) == -1)) { ACE_ERROR_RETURN ((LM_ERROR, @@ -383,17 +387,21 @@ be_visitor_typecode_defn::visit_type (be_type *node) "Error parsing nested name\n"), -1); } - *os << "TAO_NAMESPACE_DEFINE (::CORBA::TypeCode_ptr, _tc_"; + + *os << "TAO_NAMESPACE_DEFINE (" << be_idt << be_idt_nl + << "::CORBA::TypeCode_ptr," << be_nl + << "_tc_"; // Local name generation. *os << node->local_name (); - *os << ", &_tc_TAO_tc_"; + *os << "," << be_nl + << "&_tc_TAO_tc_"; // Flat name generation. *os << node->flat_name (); - *os << ")" << be_nl; + *os << be_uidt_nl << ")" << be_uidt_nl; if (this->gen_nested_namespace_end (module) == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp index 07cbcf6a804..573a3125c1f 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_ci.cpp @@ -46,12 +46,6 @@ be_visitor_typedef_cdr_op_ci::visit_typedef (be_typedef *node) return 0; } - TAO_OutStream *os = this->ctx_->stream (); - - // Generate the CDR << and >> operator impls. - - os->indent (); - // In general, we may have a chain of typedefs. i.e., // typedef sequence<long> X; // typedef X Y; diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp index 51ce0958d04..ba1e87f43be 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/cdr_op_cs.cpp @@ -42,13 +42,9 @@ int be_visitor_typedef_cdr_op_cs::visit_typedef (be_typedef *node) { if (node->cli_stub_cdr_op_gen () || node->imported ()) - return 0; - - TAO_OutStream *os = this->ctx_->stream (); - - // Generate the CDR << and >> operator impls. - - os->indent (); + { + return 0; + } // In general, we may have a chain of typedefs. i.e., // typedef sequence<long> X; @@ -84,13 +80,14 @@ be_visitor_typedef_cdr_op_cs::visit_typedef (be_typedef *node) // grab the most primitive base type in the chain to avoid recusrsively // going thru this visit method bt = node->primitive_base_type (); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_cdr_op_cs::" "visit_typedef - " - "bad primitive base type\n" - ), -1); + "bad primitive base type\n"), + -1); } // accept on this base type, but generate code for the typedef node @@ -99,9 +96,10 @@ be_visitor_typedef_cdr_op_cs::visit_typedef (be_typedef *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_cdr_op_cs::" "visit_typedef - " - "failed to accept visitor\n" - ), -1); + "failed to accept visitor\n"), + -1); } + this->ctx_->alias (0); // reset } else @@ -112,13 +110,14 @@ be_visitor_typedef_cdr_op_cs::visit_typedef (be_typedef *node) // grab the immediate base type node bt = be_type::narrow_from_decl (node->base_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_cdr_op_cs::" "visit_typedef - " - "bad base type\n" - ), -1); + "bad base type\n"), + -1); } // accept on this base type, but generate code for the typedef node @@ -127,8 +126,8 @@ be_visitor_typedef_cdr_op_cs::visit_typedef (be_typedef *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_cdr_op_cs::" "visit_typedef - " - "failed to accept visitor\n" - ), -1); + "failed to accept visitor\n"), + -1); } this->ctx_->tdef (0); // reset @@ -144,9 +143,13 @@ be_visitor_typedef_cdr_op_cs::visit_array (be_array *node) be_type *bt; if (this->ctx_->alias ()) // typedef of a typedef - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (!bt->imported () && bt->node_type () == AST_Decl::NT_array) // direct typedef of a base node @@ -158,8 +161,8 @@ be_visitor_typedef_cdr_op_cs::visit_array (be_array *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_cdr_op_cs::" "visit_array - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } @@ -167,41 +170,18 @@ be_visitor_typedef_cdr_op_cs::visit_array (be_array *node) } int -be_visitor_typedef_cdr_op_cs::visit_enum (be_enum *node) +be_visitor_typedef_cdr_op_cs::visit_sequence (be_sequence *node) { be_type *bt; if (this->ctx_->alias ()) // typedef of a typedef - bt = this->ctx_->alias (); - else - bt = node; - - if (bt->node_type () == AST_Decl::NT_enum) // direct typedef of a base node - // type { - // let the base class visitor handle this case - if (this->be_visitor_typedef::visit_enum (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_typedef_cdr_op_cs::" - "visit_enum - " - "base class visitor failed \n" - ), -1); - } + bt = this->ctx_->alias (); } - - return 0; -} - -int -be_visitor_typedef_cdr_op_cs::visit_sequence (be_sequence *node) -{ - be_type *bt; - - if (this->ctx_->alias ()) // typedef of a typedef - bt = this->ctx_->alias (); else - bt = node; + { + bt = node; + } if (bt->node_type () == AST_Decl::NT_sequence) // direct typedef of a base node // type @@ -212,8 +192,8 @@ be_visitor_typedef_cdr_op_cs::visit_sequence (be_sequence *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_cdr_op_cs::" "visit_sequence - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } @@ -226,9 +206,13 @@ be_visitor_typedef_cdr_op_cs::visit_structure (be_structure *node) be_type *bt; if (this->ctx_->alias ()) // typedef of a typedef - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (bt->node_type () == AST_Decl::NT_struct) // direct typedef of a base node // type @@ -239,8 +223,8 @@ be_visitor_typedef_cdr_op_cs::visit_structure (be_structure *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_cdr_op_cs::" "visit_structure - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } @@ -253,9 +237,13 @@ be_visitor_typedef_cdr_op_cs::visit_union (be_union *node) be_type *bt; if (this->ctx_->alias ()) // typedef of a typedef - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (bt->node_type () == AST_Decl::NT_union) // direct typedef of a base node // type @@ -266,8 +254,8 @@ be_visitor_typedef_cdr_op_cs::visit_union (be_union *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_cdr_op_cs::" "visit_union - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp index d4285985149..baa0f690316 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef.cpp @@ -63,14 +63,14 @@ be_visitor_typedef::visit_array (be_array *node) case TAO_CodeGen::TAO_TYPEDEF_CS: { ctx.state (TAO_CodeGen::TAO_ARRAY_CI); - be_visitor_array_ci visitor (&ctx); + be_visitor_array_cs visitor (&ctx); status = node->accept (&visitor); break; } case TAO_CodeGen::TAO_TYPEDEF_CI: { ctx.state (TAO_CodeGen::TAO_ARRAY_CS); - be_visitor_array_cs visitor (&ctx); + be_visitor_array_ci visitor (&ctx); status = node->accept (&visitor); break; } @@ -210,12 +210,6 @@ be_visitor_typedef::visit_enum (be_enum *node) } int -be_visitor_typedef::visit_predefined_type (be_predefined_type *) -{ - return 0; -} - -int be_visitor_typedef::visit_sequence (be_sequence *node) { // Instantiate a visitor context with a copy of our context. This info @@ -304,66 +298,6 @@ be_visitor_typedef::visit_sequence (be_sequence *node) return 0; } -int -be_visitor_typedef::visit_string (be_string *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_TYPEDEF_CH: - { - ctx.state (TAO_CodeGen::TAO_STRUCT_CH); - be_visitor_structure_ch visitor (&ctx); - status = node->accept (&visitor); - break; - } - case TAO_CodeGen::TAO_TYPEDEF_CI: - { - ctx.state (TAO_CodeGen::TAO_STRUCT_CI); - be_visitor_structure_ci visitor (&ctx); - status = node->accept (&visitor); - break; - } - case TAO_CodeGen::TAO_TYPEDEF_CS: - { - ctx.state (TAO_CodeGen::TAO_STRUCT_CS); - be_visitor_structure_cs visitor (&ctx); - status = node->accept (&visitor); - break; - } - case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH: - case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS: - case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH: - case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI: - case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS: - return 0; // nothing to be done - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_typedef::" - "visit_string - " - "Bad context state\n"), - -1); - } - } - - if (status == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_typedef::" - "visit_string - " - "failed to accept visitor\n"), - -1); - } - - return 0; -} - // visit an structure int be_visitor_typedef::visit_structure (be_structure *node) 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 13ad7c06f50..87f974ce764 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ch.cpp @@ -251,8 +251,7 @@ be_visitor_typedef_ch::visit_enum (be_enum *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ch::" "visit_enum - " - "base class visitor failed \n" - ), + "base class visitor failed \n"), -1); } } @@ -403,8 +402,8 @@ be_visitor_typedef_ch::visit_sequence (be_sequence *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ch::" "visit_sequence - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } else @@ -448,8 +447,8 @@ be_visitor_typedef_ch::visit_structure (be_structure *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ch::" "visit_structure - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } @@ -491,8 +490,8 @@ be_visitor_typedef_ch::visit_union (be_union *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ch::" "visit_union - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp index 61767ff05de..8e0587ef0a1 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_ci.cpp @@ -72,22 +72,24 @@ be_visitor_typedef_ci::visit_typedef (be_typedef *node) // grab the most primitive base type in the chain to avoid recusrsively // going thru this visit method bt = node->primitive_base_type (); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ch::" "visit_typedef - " - "bad primitive base type\n" - ), -1); + "bad primitive base type\n"), + -1); } + // accept on this base type if (bt->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ch::" "visit_typedef - " - "failed to accept visitor\n" - ), -1); + "failed to accept visitor\n"), + -1); } this->ctx_->alias (0); @@ -100,26 +102,29 @@ be_visitor_typedef_ci::visit_typedef (be_typedef *node) // grab the immediate base type node bt = be_type::narrow_from_decl (node->base_type ()); + if (!bt) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ch::" "visit_typedef - " - "bad base type\n" - ), -1); + "bad base type\n"), + -1); } + // accept on this base type if (bt->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ch::" "visit_typedef - " - "failed to accept visitor\n" - ), -1); + "failed to accept visitor\n"), + -1); } this->ctx_->tdef (0); } + return 0; } @@ -208,6 +213,7 @@ be_visitor_typedef_ci::visit_array (be_array *node) *os << bt->name () << "_free (_tao_src);" << be_uidt_nl; *os << "}\n\n"; } + return 0; } @@ -217,9 +223,13 @@ be_visitor_typedef_ci::visit_sequence (be_sequence *node) be_type *bt; if (this->ctx_->alias ()) // typedef of a typedef - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (bt->node_type () == AST_Decl::NT_sequence) // direct typedef of a base node // type @@ -230,10 +240,11 @@ be_visitor_typedef_ci::visit_sequence (be_sequence *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ci::" "visit_sequence - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } + return 0; } @@ -243,9 +254,13 @@ be_visitor_typedef_ci::visit_structure (be_structure *node) be_type *bt; if (this->ctx_->alias ()) // typedef of a typedef - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (bt->node_type () == AST_Decl::NT_struct) // direct typedef of a base node // type @@ -256,10 +271,11 @@ be_visitor_typedef_ci::visit_structure (be_structure *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ci::" "visit_structure - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } + return 0; } @@ -269,9 +285,13 @@ be_visitor_typedef_ci::visit_union (be_union *node) be_type *bt; if (this->ctx_->alias ()) // typedef of a typedef - bt = this->ctx_->alias (); + { + bt = this->ctx_->alias (); + } else - bt = node; + { + bt = node; + } if (bt->node_type () == AST_Decl::NT_union) // direct typedef of a base node // type @@ -282,9 +302,10 @@ be_visitor_typedef_ci::visit_union (be_union *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_typedef_ci::" "visit_union - " - "base class visitor failed \n" - ), -1); + "base class visitor failed \n"), + -1); } } + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp index 6d7beaa49a1..d0cc395424e 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp @@ -81,6 +81,7 @@ be_visitor_typedef_cs::visit_typedef (be_typedef *node) "bad primitive base type\n"), -1); } + // Accept on this base type. if (bt->accept (this) == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp index 1fd15085a81..b094ad35002 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp @@ -208,7 +208,7 @@ be_visitor_valuetype::visit_attribute (be_attribute *node) 0); set_op.set_name ((UTL_IdList *) node->name ()->copy ()); - set_op.add_argument_to_scope (&arg); + set_op.be_add_argument (&arg); if (this->visit_operation (&set_op) == -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 bfbecf388bd..91ee0780aa3 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp @@ -215,41 +215,38 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) // The static T::_tao_unmarshal method *os << "CORBA::Boolean " << node->name() - << "::_tao_unmarshal (TAO_InputCDR &strm, " - << node->local_name () <<" *&new_object)" << be_nl + << "::_tao_unmarshal (" << be_idt << be_idt_nl + << "TAO_InputCDR &strm," << be_nl + << node->local_name () << " *&new_object" << be_uidt_nl + << ")" << be_uidt_nl << "{" << be_idt_nl - << "CORBA::Boolean retval = 1;" << be_nl - << "CORBA::ValueBase *base; // %! should be a _var" - << be_nl - << "CORBA::ValueFactory_ptr factory; // %! should be a _var" - << be_nl - << "if (!CORBA::ValueBase::_tao_unmarshal_pre (strm, factory, base," - << be_idt_nl - << " " << node->local_name () - << "::_tao_obv_static_repository_id ()) )" << be_nl + << "CORBA::ValueBase *base = 0;" << be_nl + << "CORBA::ValueFactory_var factory;" << be_nl + << "CORBA::Boolean retval =" << be_idt_nl + << "CORBA::ValueBase::_tao_unmarshal_pre (" << be_idt << be_idt_nl + << "strm," << be_nl + << "factory," << be_nl + << "base," << be_nl + << node->local_name () << "::_tao_obv_static_repository_id ()" << be_uidt_nl + << ");" << be_uidt << be_uidt_nl << be_nl + << "if (retval == 0 || factory.in () == 0)" << be_idt_nl << "{" << be_idt_nl << "return 0;" << be_uidt_nl - << "}" << be_uidt_nl - << "if (factory != 0)" << be_idt_nl + << "}" << be_uidt_nl << be_nl + << "base = factory->create_for_unmarshal ();" << be_nl << be_nl + << "if (base == 0)" << be_idt_nl << "{" << be_idt_nl - << "base = factory->create_for_unmarshal ();" << be_nl - << "factory->_remove_ref ();" << be_nl - << "if (base == 0) return 0; // %! except.?" << be_nl - << "//%! ACE_DEBUG ((LM_DEBUG, \"" << node->name() - << "::_tao_unmarshal %s\\n\", " - << "base->_tao_obv_repository_id () ));" << be_nl - << "retval = base->_tao_unmarshal_v (strm);" << be_nl - << "//%! ACE_DEBUG ((LM_DEBUG, \"" << node->name() - << "::_tao_unmarshal retval unmarshal_v is %d\\n\", " - << "retval));" << be_nl - << "if (!retval) return 0;" - << be_uidt_nl << "}" << be_uidt_nl - << "// Now base must be null or point to the unmarshaled object." - << be_nl + << "return 0; // %! except.?" << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "retval = base->_tao_unmarshal_v (strm);" << be_nl << be_nl + << "if (retval == 0)" << be_idt_nl + << "{" << be_idt_nl + << "return 0;" << be_uidt_nl + << "}" << be_uidt_nl << be_nl + << "// Now base must be null or point to the unmarshaled object." << be_nl << "// Align the pointer to the right subobject." << be_nl << "new_object = " << node->local_name () << "::_downcast (base);" << be_nl - << "// %! unmarshal_post" << be_nl - << "return 1;" << be_uidt_nl + << "return retval;" << be_uidt_nl << "}\n" << 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 ecf8f6fc3d7..e9f1bcce497 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 @@ -132,7 +132,15 @@ be_visitor_valuetype_init_ch::visit_valuetype (be_valuetype *node) os << node->local_name () << "_init ();"; } - os << be_uidt_nl << "};" << be_nl; + os << be_uidt_nl << "};" << be_nl << be_nl; + + ACE_CString conc (node->local_name (), + 0, + 0); + + conc += "_init"; + + node->gen_var_defn ((char *) conc.c_str ()); // Generate the endif macro. os.gen_endif (); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp index 1dd99e30f41..b5d36ce4f13 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_ci.cpp @@ -36,8 +36,164 @@ be_visitor_valuetype_init_ci::~be_visitor_valuetype_init_ci (void) } int -be_visitor_valuetype_init_ci::visit_valuetype (be_valuetype *) +be_visitor_valuetype_init_ci::visit_valuetype (be_valuetype *node) { + // Just generate the factory _var impl. + + // To hold the full and local _var names. + char fname [NAMEBUFSIZE]; + char lname [NAMEBUFSIZE]; + + ACE_OS::memset (fname, + '\0', + NAMEBUFSIZE); + + ACE_OS::sprintf (fname, + "%s_init_var", + node->full_name ()); + + ACE_OS::memset (lname, + '\0', + NAMEBUFSIZE); + + ACE_OS::sprintf (lname, + "%s_init_var", + node->local_name ()); + + TAO_OutStream *ci = tao_cg->client_inline (); + + // Generate the var implementation in the stubs file + // Depending upon the data type, there are some differences which we account + // for over here. + + ci->indent (); // start with whatever was our current indent level + + *ci << "// *************************************************************" + << be_nl; + *ci << "// Operations for class " << fname << be_nl; + *ci << "// *************************************************************\n\n"; + + // Default constructor. + *ci << fname << "::" << lname << + " (void) // default constructor" << be_nl; + *ci << " " << ": ptr_ (0)" << be_nl; + *ci << "{}\n\n"; + + // Constructor from a pointer. + ci->indent (); + *ci << fname << "::" << lname << " (" + << node->local_name () << "_init" << "* p)" << be_nl; + *ci << " : ptr_ (p)" << be_nl; + *ci << "{}" << be_nl << be_nl; + + // Constructor from a const pointer. + // TAO extension - it appears that there are problems with at least g++ + // which reclaims amguity between T(T*) and T(const T_var &) + *ci << fname << "::" << lname << " (const " + << node->local_name () << "_init" << "* p)" << be_nl; + *ci << " : ptr_ (ACE_const_cast (" + << node->local_name () << "_init" << "*, p))" << be_nl; + *ci << "{}" << be_nl << be_nl; + + // The additional ptr () member function. This member function must be + // defined before the remaining member functions including the copy + // constructor because this inline function is used elsewhere. Hence to make + // inlining of this function possible, we must define it before its use. + *ci << node->full_name () << "_init" << "* " << 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; + + // Copy constructor. + *ci << fname << "::" << lname << " (const " << lname << + " &p) // copy constructor" << be_nl; + *ci << "{" << be_idt_nl + << "p.ptr ()->_add_ref ();" << be_nl + << "this->ptr_ = p.ptr ();" << be_uidt_nl + << "}" << be_nl << be_nl; + + // Destructor. + *ci << fname << "::~" << lname << " (void) // destructor" << be_nl; + *ci << "{" << be_idt_nl; + *ci << "this->ptr_->_remove_ref ();" << be_uidt_nl; + *ci << "}" << be_nl << be_nl; + + // Assignment operator. + *ci << fname << " &" << be_nl; + *ci << fname << "::operator= (" << node->local_name () << "_init" + << "* p)" << be_nl; + *ci << "{" << be_idt_nl; + *ci << "this->ptr_->_remove_ref ();" << be_nl; + *ci << "this->ptr_ = p;" << be_nl; + *ci << "return *this;" << be_uidt_nl; + *ci << "}" << be_nl << be_nl; + + // Assignment operator from _var. + *ci << fname << " &" << be_nl; + *ci << fname << "::operator= (const " << lname + << " &p)" << be_nl; + *ci << "{" << be_idt_nl; + *ci << "if (this != &p)" << be_nl; + *ci << "{" << be_idt_nl; + *ci << "this->ptr_->_remove_ref ();" << be_nl + << node->local_name () << "_init" << "* tmp = p.ptr ();" << be_nl + << "tmp->_add_ref ();" << be_nl + << "this->ptr_ = tmp;" << be_uidt_nl; + *ci << "}" << be_nl; + *ci << "return *this;" << be_uidt_nl; + *ci << "}" << be_nl << be_nl; + + // Other extra methods - cast operator (). + *ci << fname << "::operator const " << node->full_name () << "_init" + << "* () const // cast" << be_nl; + *ci << "{" << be_idt_nl; + *ci << "return this->ptr_;" << be_uidt_nl; + *ci << "}" << be_nl << be_nl; + + *ci << fname << "::operator " << node->full_name () << "_init" + << "* () // cast " << be_nl; + *ci << "{" << be_idt_nl; + *ci << "return this->ptr_;" << be_uidt_nl; + *ci << "}" << be_nl << be_nl; + + // operator-> + *ci << node->full_name () << "_init" << "* " << 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; + + // in, inout, out, and _retn. + *ci << node->full_name () << "_init" << "*" << 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 << node->full_name () << "_init" << "* &" << be_nl; + *ci << fname << "::inout (void)" << be_nl; + *ci << "{" << be_idt_nl; + *ci << "return this->ptr_;" << be_uidt_nl; + *ci << "}" << be_nl << be_nl; + + *ci << node->full_name () << "_init" << "* &" << be_nl; + *ci << fname << "::out (void)" << be_nl; + *ci << "{" << be_idt_nl; + *ci << "this->ptr_->_remove_ref ();" << be_nl; + *ci << "this->ptr_ = 0;" << be_nl; + *ci << "return this->ptr_;" << be_uidt_nl; + *ci << "}" << be_nl << be_nl; + + *ci << node->full_name () << "_init" << "* " << be_nl; + *ci << fname << "::_retn (void)" << be_nl; + *ci << "{" << be_idt_nl; + *ci << "// yield ownership of managed obj reference" << be_nl; + *ci << node->local_name () << "_init" << "* tmp = this->ptr_;" << be_nl; + *ci << "this->ptr_ = 0;" << be_nl; + *ci << "return tmp;" << be_uidt_nl; + *ci << "}\n\n"; + return 0; } 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 21980d94e69..e6e53263f96 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 @@ -96,7 +96,7 @@ be_visitor_valuetype_init_cs::visit_valuetype (be_valuetype *node) << be_uidt_nl << "}\n"; - if(factory_style == FS_CONCRETE_FACTORY) + if (factory_style == FS_CONCRETE_FACTORY) { // generate create_for_unmarshal() *os << be_nl @@ -112,6 +112,8 @@ be_visitor_valuetype_init_cs::visit_valuetype (be_valuetype *node) << be_uidt_nl << "}\n"; } + *os << be_nl; + return 0; } diff --git a/TAO/TAO_IDL/be_include/be_array.h b/TAO/TAO_IDL/be_include/be_array.h index 87193cc5f0a..c1a7f9588fb 100644 --- a/TAO/TAO_IDL/be_include/be_array.h +++ b/TAO/TAO_IDL/be_include/be_array.h @@ -45,8 +45,8 @@ public: ~be_array (void); - virtual int gen_dimensions (TAO_OutStream *os, - unsigned short slice = 0); + int gen_dimensions (TAO_OutStream *os, + unsigned short slice = 0); // Generate dimensions. If slice == 1, generate dimensions for the slice // definition. diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h index 4bfa4e1f274..1707a66e3f6 100644 --- a/TAO/TAO_IDL/be_include/be_codegen.h +++ b/TAO/TAO_IDL/be_include/be_codegen.h @@ -3,7 +3,7 @@ // ================================================================ // // = LIBRARY -// TAO IDL +// TAO_IDL_BE // // = FILENAME // be_codegen.h @@ -23,9 +23,6 @@ #include "ace/Synch.h" #include "TAO_IDL_BE_Export.h" -#define NAMEBUFSIZE 1024 -// Maximum length of static buffers used to store names. - class TAO_Visitor_Factory; class TAO_OutStream; class be_visitor_context; @@ -114,7 +111,6 @@ public: TAO_ATTRIBUTE_SMART_PROXY_CH, // in client header TAO_ATTRIBUTE_SMART_PROXY_CS, // in client source - TAO_ATTRIBUTE_INTERCEPTORS_CH, // in client header TAO_ATTRIBUTE_INTERCEPTORS_CS, // in client source TAO_ATTRIBUTE_INTERCEPTORS_SH, // in server header TAO_ATTRIBUTE_INTERCEPTORS_SS, // in server source @@ -190,7 +186,6 @@ 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, diff --git a/TAO/TAO_IDL/be_include/be_constant.h b/TAO/TAO_IDL/be_include/be_constant.h index d62db0481d5..b23fbc2734c 100644 --- a/TAO/TAO_IDL/be_include/be_constant.h +++ b/TAO/TAO_IDL/be_include/be_constant.h @@ -40,12 +40,6 @@ public: UTL_ScopedName *n); // Constructor. - const char *exprtype_to_string (void); - // Returns the appropriate type. - - UTL_ScopedName *enum_full_name (void); - // If our type is enum, we have to generate the scoped name. - // Visiting. virtual int accept (be_visitor *visitor); diff --git a/TAO/TAO_IDL/be_include/be_decl.h b/TAO/TAO_IDL/be_include/be_decl.h index f89bfa70bbd..7b37598a8ce 100644 --- a/TAO/TAO_IDL/be_include/be_decl.h +++ b/TAO/TAO_IDL/be_include/be_decl.h @@ -46,9 +46,6 @@ public: ~be_decl (void); // Destructor. - const char *flat_name (void); - // Return the flattened full scoped name. - // Methods used by the interface type strategy. void compute_full_name (const char *prefix, const char *suffix, @@ -64,9 +61,6 @@ public: // End of Methods use by the interface type strategy. - virtual idl_bool is_nested (void); - // Determines if we are inside of a nested scope or not. - virtual be_scope *scope (void); // Return the scope created by this node (if one exists). @@ -76,65 +70,9 @@ public: virtual void destroy (void); // Cleanup function. - // Boolean methods to test if code was already generated. - idl_bool cli_hdr_gen (void); - idl_bool cli_stub_gen (void); - idl_bool cli_inline_gen (void); - idl_bool srv_hdr_gen (void); - idl_bool impl_hdr_gen (void); - idl_bool srv_skel_gen (void); - idl_bool impl_skel_gen (void); - idl_bool srv_inline_gen (void); - idl_bool cli_hdr_any_op_gen (void); - idl_bool cli_stub_any_op_gen (void); - idl_bool cli_hdr_cdr_op_gen (void); - idl_bool cli_stub_cdr_op_gen (void); - idl_bool cli_inline_cdr_op_gen (void); - idl_bool cli_inline_cdr_decl_gen (void); - - // Set the flag indicating that code generation is done. - void cli_hdr_gen (idl_bool); - void cli_stub_gen (idl_bool); - void cli_inline_gen (idl_bool); - void srv_hdr_gen (idl_bool); - void impl_hdr_gen (idl_bool); - void srv_skel_gen (idl_bool); - void impl_skel_gen (idl_bool); - void srv_inline_gen (idl_bool); - void cli_hdr_any_op_gen (idl_bool); - void cli_stub_any_op_gen (idl_bool); - void cli_hdr_cdr_op_gen (idl_bool); - void cli_stub_cdr_op_gen (idl_bool); - void cli_inline_cdr_op_gen (idl_bool); - void cli_inline_cdr_decl_gen (idl_bool); - // Narrowing DEF_NARROW_METHODS1 (be_decl, AST_Decl); DEF_NARROW_FROM_DECL (be_decl); - -protected: - virtual void compute_flat_name (void); - // Compute the flattened fully scoped name. - - // Variables that indicate if the code generation for that node is already - // been done. This way we avoid regenerating same code. - idl_bool cli_hdr_gen_; - idl_bool cli_stub_gen_; - idl_bool cli_inline_gen_; - idl_bool srv_hdr_gen_; - idl_bool impl_hdr_gen_; - idl_bool srv_skel_gen_; - idl_bool impl_skel_gen_; - idl_bool srv_inline_gen_; - idl_bool cli_hdr_any_op_gen_; - idl_bool cli_stub_any_op_gen_; - idl_bool cli_hdr_cdr_op_gen_; - idl_bool cli_stub_cdr_op_gen_; - idl_bool cli_inline_cdr_op_gen_; - idl_bool cli_inline_cdr_decl_gen_; - - char *flat_name_; - // Flattened fully scoped name. }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_generator.h b/TAO/TAO_IDL/be_include/be_generator.h index 323857b5059..73012b08b63 100644 --- a/TAO/TAO_IDL/be_include/be_generator.h +++ b/TAO/TAO_IDL/be_include/be_generator.h @@ -129,7 +129,11 @@ public: virtual AST_Home *create_home (UTL_ScopedName *n, AST_Home *base_home, AST_Component *managed_component, - AST_ValueType *primary_key); + AST_ValueType *primary_key, + AST_Interface **supports, + long n_supports, + AST_Interface **supports_flat, + long n_supports_flat); virtual AST_Exception *create_exception (UTL_ScopedName *n, idl_bool local, diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index bf4773ecd0c..917a120947c 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -385,6 +385,11 @@ public: // Used in the generation of extern function declarations so we // can use non-defined interfaces as members and parameters. + ACE_Unbounded_Queue<be_interface *> mixed_parentage_interfaces; + // Used in the generation of overrides for CORBA::release and + // CORBA::is_nil, needed when the interface inherits versions from + // both CORBA::Object and CORBA::AbstractBase. + private: size_t changing_standard_include_files_; // To switch between changing or non-changing standard include diff --git a/TAO/TAO_IDL/be_include/be_helper.h b/TAO/TAO_IDL/be_include/be_helper.h index ca2d09b34ba..b2caf8864e6 100644 --- a/TAO/TAO_IDL/be_include/be_helper.h +++ b/TAO/TAO_IDL/be_include/be_helper.h @@ -108,7 +108,7 @@ public: // destructor. int open (const char *fname, - TAO_OutStream::STREAM_TYPE st=TAO_OutStream::TAO_CLI_HDR); + TAO_OutStream::STREAM_TYPE st = TAO_OutStream::TAO_CLI_HDR); // open the underlying low-level handle for output. void stream_type (TAO_OutStream::STREAM_TYPE); @@ -120,11 +120,11 @@ public: FILE *file (void); // Return the underlying lowlevel file pointer. - int incr_indent (unsigned short flag=1); + int incr_indent (unsigned short flag = 1); // increment the indentation level and by default actually indent the output // accordingly - int decr_indent (unsigned short flag=1); + int decr_indent (unsigned short flag = 1); // decrease the indentation level and by default actually indent the output // accordingly @@ -140,7 +140,8 @@ public: int print (const char *format, ...); // "printf" style variable argument print - int gen_ifdef_macro (const char *flat_name, const char *suffix=0); + int gen_ifdef_macro (const char *flat_name, + const char *suffix = 0); // generate a #if !defined, #defined macro int gen_endif (void); diff --git a/TAO/TAO_IDL/be_include/be_home.h b/TAO/TAO_IDL/be_include/be_home.h index 05231951924..3e0f8e6b356 100644 --- a/TAO/TAO_IDL/be_include/be_home.h +++ b/TAO/TAO_IDL/be_include/be_home.h @@ -38,7 +38,11 @@ public: be_home (UTL_ScopedName *n, AST_Home *base_home, AST_Component *managed_component, - AST_ValueType *primary_key); + AST_ValueType *primary_key, + AST_Interface **supports, + long n_supports, + AST_Interface **supports_flat, + long n_supports_flat); virtual ~be_home (void); diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h index 0dff0bda4a5..334c36364b8 100644 --- a/TAO/TAO_IDL/be_include/be_interface.h +++ b/TAO/TAO_IDL/be_include/be_interface.h @@ -28,6 +28,7 @@ #include "be_type.h" #include "be_codegen.h" #include "ast_interface.h" +#include "ace/Unbounded_Queue.h" class TAO_OutStream; class TAO_IDL_Inheritance_Hierarchy_Worker; @@ -309,6 +310,11 @@ public: TAO_OutStream *os); // generate the operation table entries. + void analyze_parentage (AST_Interface **parents, + long n_parents); + // Compute whether or not we have both abstract and concrete parents, + // and make a list of the abstract parents, if any. + TAO_CodeGen::CG_STATE next_state (TAO_CodeGen::CG_STATE current_state, int is_extra_state = 0); // Find the next state, used to hide differences between variants of @@ -330,6 +336,13 @@ public: // Returns an interface, which can be used instead. // Needs to get set by the strategy. + idl_bool has_mixed_parentage (void) const; + // Do we have both abstract and concrete parents? + + ACE_Unbounded_Queue<AST_Interface *> abstract_parents_; + // List of all our abstract parents, and all our other ancestors + // that are abstract with no concrete parent in between. We must + // implement the operations of all these interfaces. private: void gen_gperf_input_header (TAO_OutStream *ss); // Output the header (type declaration and %%) to the gperf's input @@ -365,6 +378,10 @@ private: void gen_linear_search_instance (const char *flat_name); // Create an instance of the linear search optable. + void complete_abstract_paths (AST_Interface *ai); + // Recursively gather all abstract ancestors we have without a concrete + // ancestor in between. + int skel_count_; // Number of static skeletons in the operation table. @@ -376,6 +393,11 @@ private: // Member for holding the strategy for generating names. be_interface *original_interface_; + // The original interface from which this one was created, + // applies only to implied IDL + + idl_bool has_mixed_parentage_; + // Do we have both abstract and concrete parents? }; /** diff --git a/TAO/TAO_IDL/be_include/be_operation.h b/TAO/TAO_IDL/be_include/be_operation.h index 97bd426b492..0e004b3b682 100644 --- a/TAO/TAO_IDL/be_include/be_operation.h +++ b/TAO/TAO_IDL/be_include/be_operation.h @@ -50,12 +50,6 @@ public: ~be_operation (void); // Destructor. - int void_return_type (void); - // Returns 1 if the operation has a void return type. - - be_argument *add_argument_to_scope (be_argument *arg); - // Add an argument to the scope. - virtual void destroy (void); // Cleanup method. diff --git a/TAO/TAO_IDL/be_include/be_sequence.h b/TAO/TAO_IDL/be_include/be_sequence.h index e04d9c141a5..c0a563690b1 100644 --- a/TAO/TAO_IDL/be_include/be_sequence.h +++ b/TAO/TAO_IDL/be_include/be_sequence.h @@ -48,6 +48,7 @@ public: MNG_STRING, MNG_WSTRING, MNG_OBJREF, + MNG_ABSTRACT, MNG_VALUE, MNG_PSEUDO }; diff --git a/TAO/TAO_IDL/be_include/be_type.h b/TAO/TAO_IDL/be_include/be_type.h index 53981f7c67a..760f53b9d0e 100644 --- a/TAO/TAO_IDL/be_include/be_type.h +++ b/TAO/TAO_IDL/be_include/be_type.h @@ -69,11 +69,6 @@ public: // are non null, it computes and returns a tc name. Else, it also // stores the result in a member variable. - virtual const char *nested_type_name (be_decl *d, - const char *suffix = 0, - const char *prefix = 0); - // Type name of a node used when generating declarations. - virtual const char *nested_sp_type_name (be_decl *use_scope, const char *suffix = 0, const char *prefix = 0); @@ -100,18 +95,8 @@ protected: virtual void compute_tc_name (void); // Computes the fully scoped typecode name. - virtual const char *nested_name (const char* local_name, - const char* full_name, - be_decl *use_scope, - const char *suffix, - const char *prefix); - // Type name of a node used when generating declarations. - UTL_ScopedName *tc_name_; // Typecode name. - - char *nested_type_name_; - // For the corresponding method. }; #endif // end of if !defined diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument.h b/TAO/TAO_IDL/be_include/be_visitor_argument.h index 9de37aa8bba..e9ce10fd640 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument.h @@ -22,6 +22,8 @@ #ifndef _BE_VISITOR_ARGUMENT_H #define _BE_VISITOR_ARGUMENT_H +#include "idl_defines.h" + #include "be_visitor_scope.h" #include "be_visitor_argument/argument.h" #include "be_visitor_argument/arglist.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 3b9aa9c8b63..2c9af16ce5d 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 @@ -44,35 +44,6 @@ public: virtual int visit_argument (be_argument *node); // visit the argument node - // =visit all the nodes that can be the types for the argument - - virtual int visit_array (be_array *node); - // visit array type - - virtual int visit_enum (be_enum *node); - // visit the enum node - - virtual int visit_interface (be_interface *node); - // visit interface - - virtual int visit_interface_fwd (be_interface_fwd *node); - // visit interface forward - - virtual int visit_predefined_type (be_predefined_type *node); - // visit predefined type - - virtual int visit_sequence (be_sequence *node); - // visit sequence type - - virtual int visit_string (be_string *node); - // visit string type - - virtual int visit_structure (be_structure *node); - // visit structure type - - virtual int visit_union (be_union *node); - // visit union type - virtual int visit_typedef (be_typedef *node); // visit the typedef type diff --git a/TAO/TAO_IDL/be_include/be_visitor_array.h b/TAO/TAO_IDL/be_include/be_visitor_array.h index cbf86c2142a..cd50794076b 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_array.h +++ b/TAO/TAO_IDL/be_include/be_visitor_array.h @@ -21,6 +21,8 @@ #ifndef TAO_BE_VISITOR_ARRAY_H #define TAO_BE_VISITOR_ARRAY_H +#include "idl_defines.h" + #include "be_visitor_decl.h" #include "be_visitor_array/array.h" #include "be_visitor_array/array_ch.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_array/array.h b/TAO/TAO_IDL/be_include/be_visitor_array/array.h index 5fa6a4aab4c..a762f64a596 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_array/array.h +++ b/TAO/TAO_IDL/be_include/be_visitor_array/array.h @@ -78,7 +78,6 @@ protected: int visit_node (be_type *); // helper that does the common job - }; #endif /* _BE_VISITOR_ARRAY_ARRAY_H_*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_array/array_cs.h b/TAO/TAO_IDL/be_include/be_visitor_array/array_cs.h index 98c3e8f6c2c..1a6509e579b 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_array/array_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_array/array_cs.h @@ -43,7 +43,6 @@ public: virtual int visit_array (be_array *node); // visit the array node - }; #endif /* _BE_VISITOR_ARRAY_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ch.h index a45af118541..2a0d889efe5 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ch.h @@ -46,7 +46,6 @@ public: virtual int visit_array (be_array *node); // visit array - }; #endif /* _BE_VISITOR_ARRAY_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ci.h index ef8caeabe43..fcda7343531 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_ci.h @@ -77,10 +77,8 @@ public: // visit union protected: - int visit_node (be_type *); // helper that does the common job - }; #endif /* _BE_VISITOR_ARRAY_CDR_OP_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_cs.h index dc79510ed78..1f57c759dfe 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_array/cdr_op_cs.h @@ -50,7 +50,6 @@ public: virtual int visit_array (be_array *node); // visit array - }; #endif /* _BE_VISITOR_ARRAY_CDR_OP_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h b/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h index 1c2493722c0..39e0f8f08c8 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h +++ b/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h @@ -46,7 +46,6 @@ public: virtual int visit_attribute (be_attribute *node); // visit attribute. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_ATTRIBUTE_ATTRIBUTE_H*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_constant/constant_ch.h b/TAO/TAO_IDL/be_include/be_visitor_constant/constant_ch.h index c0e53447176..f902c16864d 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_constant/constant_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_constant/constant_ch.h @@ -41,7 +41,6 @@ public: virtual int visit_constant (be_constant *node); // visit constant. - }; #endif /* _BE_VISITOR_CONSTANT_CONSTANT_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ch.h index c8ba0e49f81..70880813b57 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ch.h @@ -22,7 +22,7 @@ #ifndef _BE_VISITOR_ENUM_CDR_OP_CH_H_ #define _BE_VISITOR_ENUM_CDR_OP_CH_H_ -class be_visitor_enum_cdr_op_ch : public be_visitor_scope +class be_visitor_enum_cdr_op_ch : public be_visitor_decl { // // = TITLE diff --git a/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ci.h index 59ea94f3486..71cbfe57906 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_enum/cdr_op_ci.h @@ -22,7 +22,7 @@ #ifndef _BE_VISITOR_ENUM_CDR_OP_CI_H_ #define _BE_VISITOR_ENUM_CDR_OP_CI_H_ -class be_visitor_enum_cdr_op_ci : public be_visitor_scope +class be_visitor_enum_cdr_op_ci : public be_visitor_decl { // // = TITLE diff --git a/TAO/TAO_IDL/be_include/be_visitor_enum/enum_cs.h b/TAO/TAO_IDL/be_include/be_visitor_enum/enum_cs.h index a40455f2190..412842ed536 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_enum/enum_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_enum/enum_cs.h @@ -41,7 +41,6 @@ public: virtual int visit_enum (be_enum *node); // visit enum and generate the typecode - }; #endif /* _BE_VISITOR_ENUM_ENUM_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_field.h b/TAO/TAO_IDL/be_include/be_visitor_field.h index 79a2f83c358..a788e759bea 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field.h @@ -21,7 +21,9 @@ #ifndef TAO_BE_VISITOR_FIELD_H #define TAO_BE_VISITOR_FIELD_H -#include "be_visitor_decl.h" +#include "idl_defines.h" + +#include "be_visitor_scope.h" #include "be_visitor_field/field_ch.h" #include "be_visitor_field/field_ci.h" #include "be_visitor_field/field_cs.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h index 0e3a9555fd6..16cad59d193 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ch.h @@ -60,7 +60,6 @@ public: virtual int visit_union (be_union *node); // visit union type - }; #endif /* _BE_VISITOR_FIELD_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ci.h index 35d1a4a136b..eb180f8945f 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_ci.h @@ -22,8 +22,6 @@ #ifndef _BE_VISITOR_FIELD_CDR_OP_CI_H_ #define _BE_VISITOR_FIELD_CDR_OP_CI_H_ -#include "be_visitor_scope.h" - class be_visitor_field_cdr_op_ci : public be_visitor_decl { // @@ -74,7 +72,6 @@ public: virtual int visit_union (be_union *node); // visit union type - }; class be_visitor_cdr_op_field_decl : public be_visitor_scope diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h index dd5731bac68..5e8fe547b4d 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field/cdr_op_cs.h @@ -22,8 +22,6 @@ #ifndef _BE_VISITOR_FIELD_CDR_OP_CS_H_ #define _BE_VISITOR_FIELD_CDR_OP_CS_H_ -#include "be_visitor_scope.h" - class be_visitor_field_cdr_op_cs : public be_visitor_decl { // @@ -51,7 +49,6 @@ public: virtual int visit_structure (be_structure *node); virtual int visit_typedef (be_typedef *node); virtual int visit_union (be_union *node); - }; #endif /* _BE_VISITOR_FIELD_CDR_OP_CS_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 942d3f19e1b..61f417722ae 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,7 +78,6 @@ public: virtual int visit_union (be_union *node); // visit union type - }; #endif /* _BE_VISITOR_FIELD_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h b/TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h index b2b71678b70..583a6fd92c9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field/field_ci.h @@ -59,7 +59,6 @@ public: virtual int visit_union (be_union *node); // visit union type - }; #endif /* _BE_VISITOR_FIELD_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h b/TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h index c48a1fd5969..787babe68f9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_field/field_cs.h @@ -62,7 +62,6 @@ public: virtual int visit_union (be_union *node); // visit union type - }; #endif /* _BE_VISITOR_FIELD_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface.h index 8135651e883..6a998ac9947 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface.h @@ -21,6 +21,7 @@ #ifndef TAO_BE_VISITOR_INTERFACE_H #define TAO_BE_VISITOR_INTERFACE_H +#include "idl_defines.h" #include "ace/SString.h" #include "be_visitor_scope.h" @@ -47,7 +48,6 @@ #include "be_visitor_interface/ami_interface_ch.h" #include "be_visitor_interface/smart_proxy_ch.h" #include "be_visitor_interface/smart_proxy_cs.h" -#include "be_visitor_interface/interceptors_ch.h" #include "be_visitor_interface/interceptors_cs.h" #include "be_visitor_interface/interceptors_sh.h" #include "be_visitor_interface/interceptors_ss.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ch.h index 353659c3bcc..9d4a989f36d 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ch.h @@ -44,7 +44,6 @@ public: virtual int visit_interface (be_interface *node); // visit interface - }; #endif /* _BE_VISITOR_INTERFACE_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ci.h index 47639725412..f938fe193be 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_ci.h @@ -44,7 +44,6 @@ public: virtual int visit_interface (be_interface *node); // visit interface - }; #endif /* _BE_VISITOR_INTERFACE_CDR_OP_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_cs.h index 05a062d594f..9d684ff8e9d 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/cdr_op_cs.h @@ -44,7 +44,6 @@ public: virtual int visit_interface (be_interface *node); // visit interface - }; #endif /* _BE_VISITOR_INTERFACE_CDR_OP_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_ch.h deleted file mode 100644 index aefd8f0cbdf..00000000000 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/interceptors_ch.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// $Id$ -// -/* -*- c++ -*- */ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// interceptors_ch.h -// -// = DESCRIPTION -// Concrete visitor for the Interface node. -// This provides code generation for interceptor classes for an -// interface in the client header. -// -// = AUTHOR -// Kirthika Parameswaran -// -// ============================================================================ - -#ifndef _BE_INTERFACE_INTERCEPTORS_CH_H_ -#define _BE_INTERFACE_INTERCEPTORS_CH_H_ - -class be_visitor_interface_interceptors_ch : public be_visitor_interface -{ - // = TITLE - // Generate the "thru_poa collocated" class declaration. - -public: - be_visitor_interface_interceptors_ch (be_visitor_context *ctx); - // constructor - - virtual ~be_visitor_interface_interceptors_ch (void); - // destructor - - virtual int visit_interface (be_interface *node); - // visit an interface - -}; - -#endif /* _BE_INTERFACE_INTERCEPTORS_CH_H_ */ 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 697d3714e3e..19159d8050a 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 @@ -37,7 +37,6 @@ public: virtual int visit_interface (be_interface *node); // visit an interface - }; #endif /* _BE_INTERFACE_INTERCEPTORS_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interface.h index b70d2c613d3..db2905fc6d3 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/interface.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interface.h @@ -60,6 +60,10 @@ public: virtual int visit_interface (be_interface *node); // visit the interface node + virtual int visit_scope (be_scope *node); + // Overrides the method so we can deal with possible operations or + // attributes from a parent abstract interface. + // =visit methods on all elements syntactically valid in a Interface scope virtual int visit_attribute (be_attribute *node); diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ci.h b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ci.h index ad1a5b31063..c9791f74cac 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface/interface_ci.h @@ -41,7 +41,6 @@ public: virtual int visit_interface (be_interface *node); // set the right context and make a visitor - }; #endif /* _BE_INTERFACE_INTERFACE_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/cdr_op_ch.h index 4befc6aca9e..9a75dc8bdc6 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/cdr_op_ch.h @@ -44,7 +44,6 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit forward declared interface - }; #endif /* _BE_VISITOR_INTERFACE_FWD_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/cdr_op_ci.h index 4b1449eeae0..4c759442240 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/cdr_op_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/cdr_op_ci.h @@ -45,7 +45,6 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface - }; #endif /* BE_VISITOR_INTERFACE_FWD_CDR_OP_CI_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/interface_fwd_ch.h b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/interface_fwd_ch.h index 02c788c071b..71d37c0ee70 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/interface_fwd_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface_fwd/interface_fwd_ch.h @@ -41,7 +41,6 @@ public: virtual int visit_interface_fwd (be_interface_fwd *node); // visit interface_fwd. - }; #endif /* _BE_INTERFACE_INTERFACE_FWD_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 index f8c765d986f..66d3d4e1924 100644 --- 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 @@ -41,7 +41,6 @@ public: 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 a26aef94d1f..60fa15695d5 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_module/module.h +++ b/TAO/TAO_IDL/be_include/be_visitor_module/module.h @@ -80,7 +80,6 @@ public: virtual int visit_typedef (be_typedef *node); // visit the typedef node - }; #endif /* _BE_VISITOR_MODULE_MODULE_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_module/module_ch.h b/TAO/TAO_IDL/be_include/be_visitor_module/module_ch.h index 5de940fa34f..da55a641498 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_module/module_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_module/module_ch.h @@ -42,7 +42,6 @@ public: virtual int visit_module (be_module *node); // visit module. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_MODULE_MODULE_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_module/module_sh.h b/TAO/TAO_IDL/be_include/be_visitor_module/module_sh.h index c0b6dfc5b37..b70f41e6f86 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_module/module_sh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_module/module_sh.h @@ -42,7 +42,6 @@ public: virtual int visit_module (be_module *node); // visit module. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_MODULE_MODULE_SH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation.h index e832c262fb2..65e2cd52e78 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation.h @@ -22,6 +22,8 @@ #ifndef TAO_BE_VISITOR_OPERATION_H #define TAO_BE_VISITOR_OPERATION_H +#include "idl_defines.h" + #include "be_visitor_scope.h" #include "be_visitor_operation/operation.h" #include "be_visitor_operation/operation_ch.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/arglist.h b/TAO/TAO_IDL/be_include/be_visitor_operation/arglist.h index a42834b2868..a37510cca05 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/arglist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/arglist.h @@ -51,7 +51,6 @@ public: virtual int post_process (be_decl *); // stuff to o/p after each element of the scope is handled - }; #endif /* _BE_VISITOR_OPERATION_ARGLIST_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_ch.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_ch.h index 2171d0ef62f..484a4d4dd34 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_ch.h @@ -44,7 +44,6 @@ public: virtual int visit_operation (be_operation *node); // visit operation. - }; #endif /* _BE_VISITOR_OPERATION_OPERATION_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h index d59fa55d7ec..2a8faa405bc 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_cs.h @@ -51,7 +51,6 @@ public: // =helper virtual int post_process (be_decl *); // stuff to output after every member of the scope is handled - }; #endif /* _BE_VISITOR_OPERATION_OPERATION_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_sh.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_sh.h index d33d61533d8..2074b69417e 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_sh.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_sh.h @@ -44,7 +44,6 @@ public: virtual int visit_operation (be_operation *node); // visit operation. - }; #endif /* _BE_VISITOR_OPERATION_OPERATION_SH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_sequence.h b/TAO/TAO_IDL/be_include/be_visitor_sequence.h index 47a92008307..17713905c9e 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_sequence.h +++ b/TAO/TAO_IDL/be_include/be_visitor_sequence.h @@ -6,6 +6,8 @@ #ifndef TAO_BE_VISITOR_SEQUENCE_H #define TAO_BE_VISITOR_SEQUENCE_H +#include "idl_defines.h" + #include "be_visitor_decl.h" #include "be_visitor_sequence/sequence_ch.h" #include "be_visitor_sequence/sequence_ci.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_ch.h index ca3f1b85856..4e625f0656c 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_sequence/cdr_op_ch.h @@ -44,7 +44,6 @@ public: virtual int visit_sequence (be_sequence *node); // visit sequence - }; #endif /* _BE_VISITOR_SEQUENCE_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ch.h index 4c082357b19..5ab95eb05d4 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ch.h @@ -44,7 +44,6 @@ public: virtual int visit_structure (be_structure *node); // visit structure - }; #endif /* _BE_VISITOR_STRUCTURE_CDR_OP_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ci.h index c321ed901e3..2ce7aff080c 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_structure/cdr_op_ci.h @@ -47,7 +47,6 @@ public: virtual int post_process (be_decl *); // any post processing that needs to be done after a scope element is handled - }; #endif /* _BE_VISITOR_STRUCTURE_CDR_OP_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure/structure_ch.h b/TAO/TAO_IDL/be_include/be_visitor_structure/structure_ch.h index 1ec6f9d6ccb..1b19214ecc9 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_structure/structure_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_structure/structure_ch.h @@ -42,7 +42,6 @@ public: virtual int visit_structure (be_structure *node); // visit structure. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_STRUCTURE_STRUCTURE_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure/structure_ci.h b/TAO/TAO_IDL/be_include/be_visitor_structure/structure_ci.h index 8665832e078..313657b6bac 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_structure/structure_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_structure/structure_ci.h @@ -42,7 +42,6 @@ public: virtual int visit_structure (be_structure *node); // visit structure. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_STRUCTURE_STRUCTURE_CI_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h b/TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h index bf4adfa0000..24ebf61be18 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_structure/structure_cs.h @@ -42,7 +42,6 @@ public: virtual int visit_structure (be_structure *node); // visit structure. - }; #endif /* _BE_VISITOR_STRUCTURE_STRUCTURE_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode.h b/TAO/TAO_IDL/be_include/be_visitor_typecode.h index c1865fcdaaa..1942889a4c8 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typecode.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode.h @@ -22,6 +22,8 @@ #ifndef TAO_BE_VISITOR_TYPECODE_H #define TAO_BE_VISITOR_TYPECODE_H +#include "idl_defines.h" + #include "be_visitor_decl.h" #include "be_visitor_typecode/typecode_decl.h" #include "be_visitor_typecode/typecode_defn.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ch.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ch.h index 0cb82ce2ff0..f832928c425 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ch.h @@ -62,7 +62,6 @@ public: virtual int visit_union (be_union *node); // visit a union - }; #endif /* _BE_VISITOR_TYPEDEF_CDR_OP_CH_H_*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ci.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ci.h index 26d8f6ee546..4924fed4dd4 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_ci.h @@ -62,7 +62,6 @@ public: virtual int visit_union (be_union *node); // visit a union - }; #endif /* _BE_VISITOR_TYPEDEF_CDR_OP_CI_H_*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_cs.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_cs.h index 742ce34fd08..03af2ece923 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/cdr_op_cs.h @@ -51,9 +51,6 @@ public: virtual int visit_array (be_array *node); // visit a array - virtual int visit_enum (be_enum *node); - // visit an enum - virtual int visit_sequence (be_sequence *node); // visit a sequence @@ -62,7 +59,6 @@ public: virtual int visit_union (be_union *node); // visit a union - }; #endif /* _BE_VISITOR_TYPEDEF_CDR_OP_CS_H_*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef.h index d0d1b297ae2..8a4a586917c 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef.h @@ -52,12 +52,6 @@ public: virtual int visit_enum (be_enum *node); // visit an enum - virtual int visit_predefined_type (be_predefined_type *node); - // visit predefined type node - - virtual int visit_string (be_string *node); - // visit a typedef - virtual int visit_sequence (be_sequence *node); // visit a sequence @@ -66,7 +60,6 @@ public: virtual int visit_union (be_union *node); // visit a union - }; #endif /* _BE_VISITOR_TYPEDEF_TYPEDEF_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ch.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ch.h index eda0adf5441..9b1f8f7f00f 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ch.h @@ -70,7 +70,6 @@ public: virtual int visit_union (be_union *node); // visit a union - }; #endif /* _BE_VISITOR_TYPEDEF_TYPEDEF_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ci.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ci.h index 9f308d33d52..818bf9e91cc 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ci.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_ci.h @@ -1,4 +1,3 @@ - /* -*- c++ -*- */ // // $Id$ @@ -59,7 +58,6 @@ public: virtual int visit_union (be_union *node); // visit a union - }; #endif /* _BE_VISITOR_TYPEDEF_TYPEDEF_CI_H_*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_cs.h b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_cs.h index a546de4c38d..6a48d19eaa1 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_cs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typedef/typedef_cs.h @@ -1,4 +1,3 @@ - /* -*- c++ -*- */ // // $Id$ @@ -44,7 +43,6 @@ public: virtual int visit_typedef (be_typedef *node); // visit typedef. We provide code for this method in the derived class - }; #endif /* _BE_VISITOR_TYPEDEF_TYPEDEF_CS_H_*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch.h index 7f4b039f2b7..89f51664fbb 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union_branch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch.h @@ -21,6 +21,8 @@ #ifndef TAO_BE_VISITOR_UNION_BRANCH_H #define TAO_BE_VISITOR_UNION_BRANCH_H +#include "idl_defines.h" + #include "be_visitor_decl.h" #include "be_visitor_union_branch/public_ch.h" #include "be_visitor_union_branch/public_ci.h" diff --git a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h index 13833d3c657..93506c700ec 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h +++ b/TAO/TAO_IDL/be_include/be_visitor_union_branch/public_ch.h @@ -82,7 +82,6 @@ public: virtual int visit_union (be_union *node); // visit union type - }; #endif /* _BE_VISITOR_UNION_BRANCH_PUBLIC_CH_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype.h index ef01361bac9..6fe7d7a9f37 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype.h @@ -18,6 +18,8 @@ #ifndef TAO_BE_VISITOR_VALUETYPE_H #define TAO_BE_VISITOR_VALUETYPE_H +#include "idl_defines.h" + #include "be_visitor_scope.h" #include "be_visitor_valuetype/valuetype.h" #include "be_visitor_valuetype/valuetype_ch.h" diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp index 255fe6a0a5a..6d01acf1b00 100644 --- a/TAO/TAO_IDL/driver/drv_preproc.cpp +++ b/TAO/TAO_IDL/driver/drv_preproc.cpp @@ -313,8 +313,8 @@ DRV_cpp_init (void) #endif /* TAO_IDL_INCLUDE_DIR */ DRV_cpp_putarg (option); - } - } + } + } // Add any flags in cpp_args to cpp's arglist. ACE_ARGV arglist (cpp_args); @@ -784,7 +784,7 @@ DRV_pre_proc (const char *myfile) if (idl_global->compile_flags() & IDL_CF_ONLY_PREPROC) { FILE *preproc = ACE_OS::fopen (tmp_file, "r"); - char buffer[ACE_Log_Record::MAXLOGMSGLEN]; + char buffer[ACE_MAXLOGMSGLEN]; int bytes; if (preproc == 0) @@ -809,7 +809,7 @@ DRV_pre_proc (const char *myfile) while ((bytes = ACE_OS::fread (buffer, sizeof (char), - ACE_Log_Record::MAXLOGMSGLEN - 1, + ACE_MAXLOGMSGLEN - 1, preproc)) != 0) { diff --git a/TAO/TAO_IDL/fe/fe_interface_header.cpp b/TAO/TAO_IDL/fe/fe_interface_header.cpp index c95346a5434..3c39e4d3155 100644 --- a/TAO/TAO_IDL/fe/fe_interface_header.cpp +++ b/TAO/TAO_IDL/fe/fe_interface_header.cpp @@ -64,13 +64,14 @@ trademarks or registered trademarks of Sun Microsystems, Inc. */ -// FE_InterfaceHeader instances are used to store information about an -// interface header as the interface is being parsed and before the -// AST_Interface node used to represent this interface is created. -// Same for FE_obv_header. +// These utility classes are used to store information about a +// node type as the node type is being parsed and before the +// node itself is created. #include "fe_interface_header.h" #include "ast_valuetype.h" +#include "ast_component.h" +#include "ast_home.h" #include "ast_module.h" #include "utl_namelist.h" #include "utl_err.h" @@ -402,10 +403,8 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, if (inh_err) { - idl_global->err ()->inheritance_error (this->pd_interface_name, - d); - inh_err = 0; - continue; + idl_global->err ()->interface_expected (d); + break; } // Forward declared interface? @@ -413,7 +412,7 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces, { idl_global->err ()->inheritance_fwd_error (this->pd_interface_name, i); - continue; + break; } if (!for_valuetype && this->pd_is_abstract && !i->is_abstract ()) @@ -507,10 +506,12 @@ FE_InterfaceHeader::n_inherits_flat (void) const return this->pd_n_inherits_flat; } -FE_obv_header::FE_obv_header (UTL_ScopedName *n, - UTL_NameList *inherits, - UTL_NameList *supports, - idl_bool truncatable) +//************************************************************************ + +FE_OBVHeader::FE_OBVHeader (UTL_ScopedName *n, + UTL_NameList *inherits, + UTL_NameList *supports, + idl_bool truncatable) : FE_InterfaceHeader (n, inherits, I_FALSE, @@ -554,42 +555,42 @@ FE_obv_header::FE_obv_header (UTL_ScopedName *n, } } -FE_obv_header::~FE_obv_header (void) +FE_OBVHeader::~FE_OBVHeader (void) { } AST_Interface ** -FE_obv_header::supports (void) const +FE_OBVHeader::supports (void) const { return this->pd_supports; } long -FE_obv_header::n_supports (void) const +FE_OBVHeader::n_supports (void) const { return this->pd_n_supports; } AST_ValueType * -FE_obv_header::inherits_concrete (void) const +FE_OBVHeader::inherits_concrete (void) const { return this->pd_inherits_concrete; } AST_Interface * -FE_obv_header::supports_concrete (void) const +FE_OBVHeader::supports_concrete (void) const { return this->pd_supports_concrete; } idl_bool -FE_obv_header::truncatable (void) const +FE_OBVHeader::truncatable (void) const { return this->pd_truncatable; } void -FE_obv_header::compile_supports (UTL_NameList *supports) +FE_OBVHeader::compile_supports (UTL_NameList *supports) { if (supports == 0) { @@ -696,7 +697,7 @@ FE_obv_header::compile_supports (UTL_NameList *supports) } idl_bool -FE_obv_header::check_concrete_supported_inheritance (AST_Interface *d) +FE_OBVHeader::check_concrete_supported_inheritance (AST_Interface *d) { AST_ValueType *vt = 0; AST_Interface *concrete = 0; @@ -728,3 +729,228 @@ FE_obv_header::check_concrete_supported_inheritance (AST_Interface *d) return 0; } + +//************************************************************************ + +FE_ComponentHeader::FE_ComponentHeader (UTL_ScopedName *n, + UTL_ScopedName *base_component, + UTL_NameList *supports, + idl_bool compile_now) + : FE_InterfaceHeader (n, + supports, + I_FALSE, + I_FALSE, + I_FALSE), + pd_base_component (0) +{ + // If there is a base component, look up the decl and assign our member. + // We also inherit its supported interfaces. + if (base_component != 0) + { + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Decl *d = s->lookup_by_name (base_component, + I_TRUE); + + if (d == 0) + { + idl_global->err ()->lookup_error (base_component); + } + else + { + this->pd_base_component = AST_Component::narrow_from_decl (d); + + if (this->pd_base_component == 0) + { + idl_global->err ()->error1 (UTL_Error::EIDL_ILLEGAL_USE, + d); + } + else if (!this->pd_base_component->is_defined ()) + { + idl_global->err ()->inheritance_fwd_error ( + this->name (), + this->pd_base_component + ); + } + } + } + + 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); + } +} + +FE_ComponentHeader::~FE_ComponentHeader (void) +{ +} + +AST_Component * +FE_ComponentHeader::base_component (void) const +{ + return this->pd_base_component; +} + +AST_Interface ** +FE_ComponentHeader::supports (void) const +{ + return this->pd_inherits; +} + +long +FE_ComponentHeader::n_supports (void) const +{ + return this->pd_n_inherits; +} + +AST_Interface ** +FE_ComponentHeader::supports_flat (void) const +{ + return this->pd_inherits_flat; +} + +long +FE_ComponentHeader::n_supports_flat (void) const +{ + return this->pd_n_inherits_flat; +} + +//************************************************************************ + +FE_HomeHeader::FE_HomeHeader (UTL_ScopedName *n, + UTL_ScopedName *base_home, + UTL_NameList *supports, + UTL_ScopedName *managed_component, + UTL_ScopedName *primary_key) + : FE_ComponentHeader (n, + managed_component, + supports, + I_FALSE), + pd_base_home (0), + pd_primary_key (0) +{ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Decl *d = 0; + + if (base_home != 0) + { + d = s->lookup_by_name (base_home, + I_TRUE); + + if (d == 0) + { + idl_global->err ()->lookup_error (base_home); + } + else + { + this->pd_base_home = AST_Home::narrow_from_decl (d); + + if (this->pd_base_home == 0) + { + idl_global->err ()->inheritance_error (this->name (), + d); + } + } + } + + if (managed_component != 0) + { + d = s->lookup_by_name (managed_component, + I_TRUE); + + if (d == 0) + { + idl_global->err ()->lookup_error (managed_component); + } + else + { + this->pd_base_component = AST_Component::narrow_from_decl (d); + + if (this->pd_base_component == 0) + { + idl_global->err ()->error1 (UTL_Error::EIDL_ILLEGAL_USE, + d); + } + } + } + + if (primary_key != 0) + { + d = s->lookup_by_name (primary_key, + I_TRUE); + + if (d == 0) + { + idl_global->err ()->lookup_error (primary_key); + } + else + { + this->pd_primary_key = AST_ValueType::narrow_from_decl (d); + + if (this->pd_primary_key == 0) + { + idl_global->err ()->valuetype_expected (d); + } + } + } + + this->compile_inheritance (supports, + I_FALSE); +} + +void +FE_HomeHeader::compile_inheritance (UTL_NameList *supports, + idl_bool for_valuetype) +{ + if (this->pd_base_home != 0) + { + UTL_NameList *base_home_name = 0; + ACE_NEW (base_home_name, + UTL_NameList (this->pd_base_home->name (), + supports)); + + supports = base_home_name; + this->FE_InterfaceHeader::compile_inheritance (supports, + for_valuetype); + } +} + +FE_HomeHeader::~FE_HomeHeader (void) +{ +} + +AST_Home * +FE_HomeHeader::base_home (void) const +{ + return this->pd_base_home; +} + +AST_Component * +FE_HomeHeader::managed_component (void) const +{ + return this->pd_base_component; +} + +AST_ValueType * +FE_HomeHeader::primary_key (void) const +{ + return this->pd_primary_key; +} + diff --git a/TAO/TAO_IDL/fe/fe_tmplinst.cpp b/TAO/TAO_IDL/fe/fe_tmplinst.cpp index e1cef6d420f..65a2c7f82b1 100644 --- a/TAO/TAO_IDL/fe/fe_tmplinst.cpp +++ b/TAO/TAO_IDL/fe/fe_tmplinst.cpp @@ -49,21 +49,13 @@ template class ACE_Node<AST_Field *>; template class ACE_Unbounded_Queue<AST_Field *>; template class ACE_Unbounded_Queue_Iterator<AST_Field *>; -template class ACE_Node<AST_Interface *>; -template class ACE_Unbounded_Queue<AST_Interface *>; -template class ACE_Unbounded_Queue_Iterator<AST_Interface *>; +template class ACE_Node<AST_Component::uses_description>; +template class ACE_Unbounded_Queue<AST_Component::uses_description>; +template class ACE_Unbounded_Queue_Iterator<AST_Component::uses_description>; -template class ACE_Node<AST_ValueType *>; -template class ACE_Unbounded_Queue<AST_ValueType *>; -template class ACE_Unbounded_Queue_Iterator<AST_ValueType *>; - -template class ACE_Node<AST_Component::uses_description *>; -template class ACE_Unbounded_Queue<AST_Component::uses_description *>; -template class ACE_Unbounded_Queue_Iterator<AST_Component::uses_description *>; - -template class ACE_Node<AST_Operation *>; -template class ACE_Unbounded_Queue<AST_Operation *>; -template class ACE_Unbounded_Queue_Iterator<AST_Operation *>; +template class ACE_Node<AST_Component::port_description>; +template class ACE_Unbounded_Queue<AST_Component::port_description>; +template class ACE_Unbounded_Queue_Iterator<AST_Component::port_description>; template class ACE_Node<Identifier *>; template class ACE_Unbounded_Queue<Identifier *>; @@ -110,17 +102,13 @@ template class ACE_Unbounded_Stack_Iterator<char *>; #pragma instantiate ACE_Unbounded_Queue<AST_Field *>; #pragma instantiate ACE_Unbounded_Queue_Iterator<AST_Field *>; -#pragma instantiate ACE_Node<AST_Interface *>; -#pragma instantiate ACE_Unbounded_Queue<AST_Interface *>; -#pragma instantiate ACE_Unbounded_Queue_Iterator<AST_Interface *>; - -#pragma instantiate ACE_Node<AST_ValueType *>; -#pragma instantiate ACE_Unbounded_Queue<AST_ValueType *>; -#pragma instantiate ACE_Unbounded_Queue_Iterator<AST_ValueType *>; +#pragma instantiate ACE_Node<AST_Component::uses_description>; +#pragma instantiate ACE_Unbounded_Queue<AST_Component::uses_description>; +#pragma instantiate ACE_Unbounded_Queue_Iterator<AST_Component::uses_description>; -#pragma instantiate ACE_Node<AST_Operation *>; -#pragma instantiate ACE_Unbounded_Queue<AST_Operation *>; -#pragma instantiate ACE_Unbounded_Queue_Iterator<AST_Operation *>; +#pragma instantiate ACE_Node<AST_Component::port_description>; +#pragma instantiate ACE_Unbounded_Queue<AST_Component::port_description>; +#pragma instantiate ACE_Unbounded_Queue_Iterator<AST_Component::port_description>; #pragma instantiate ACE_Node<Identifier *>; #pragma instantiate ACE_Unbounded_Queue<Identifier *>; diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index d046489db50..7c5cab91e63 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -653,6 +653,7 @@ idl_store_pragma (char *buf) if (new_id != 0) { d->repoID (new_id); + d->typeid_set (1); } } } diff --git a/TAO/TAO_IDL/fe/idl.yy b/TAO/TAO_IDL/fe/idl.yy index 5c8bece4c6b..a233004c0ee 100644 --- a/TAO/TAO_IDL/fe/idl.yy +++ b/TAO/TAO_IDL/fe/idl.yy @@ -88,6 +88,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_module.h" #include "ast_valuetype.h" #include "ast_valuetype_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" @@ -131,7 +134,9 @@ extern int yyleng; UTL_LabelList *llval; /* Label list */ UTL_DeclList *dlval; /* Declaration list */ FE_InterfaceHeader *ihval; /* Interface header */ - FE_obv_header *vhval; /* Valuetype header */ + FE_OBVHeader *vhval; /* Valuetype 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 */ @@ -250,7 +255,9 @@ extern int yyleng; %type <dcval> array_declarator op_type_spec seq_head wstring_type_spec %type <dcval> param_type_spec -%type <idlist> scoped_name +%type <idlist> scoped_name interface_type component_inheritance_spec +%type <idlist> home_inheritance_spec primary_key_spec + %type <slval> opt_context at_least_one_string_literal %type <slval> string_literals @@ -268,6 +275,10 @@ extern int yyleng; %type <vhval> value_header +%type <chval> component_header + +%type <hhval> home_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 @@ -286,7 +297,7 @@ extern int yyleng; %type <deval> declarator simple_declarator complex_declarator -%type <bval> opt_readonly, opt_truncatable +%type <bval> opt_readonly opt_truncatable opt_multiple %type <idval> interface_decl value_decl union_decl struct_decl id @@ -377,7 +388,7 @@ definition | value_def { // | value_def - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeDeclSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeDeclSeen); } ';' { @@ -387,7 +398,7 @@ definition | component { // | component - idl_global->set_parse_state (IDL_GlobalData::PS_ComponentSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentDeclSeen); } ';' { @@ -407,7 +418,7 @@ definition | event { // | event - idl_global->set_parse_state (IDL_GlobalData::PS_EventSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_EventDeclSeen); } ';' { @@ -490,7 +501,7 @@ interface : AST_Interface *i = 0; /* - * Make a new interface node and add it to its enclosing scope + * Make a new interface node and add it to its enclosing scope. */ if (s != 0 && $1 != 0) { @@ -510,17 +521,17 @@ interface : * Add the interface to its definition scope. */ (void) s->fe_add_interface (i); + + // This FE_InterfaceHeader class isn't destroyed with the AST. + $1->name ()->destroy (); + delete $1; + $1 = 0; } /* * Push it on the scope stack. */ idl_global->scopes ().push (i); - - // This FE_InterfaceHeader class isn't destroyed with the AST. - $1->name ()->destroy (); - delete $1; - $1 = 0; } '{' { @@ -606,13 +617,23 @@ interface_header : IDL_ABSTRACT interface_decl inheritance_spec { // | IDL_ABSTRACT interface_decl inheritance_spec - 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 abstract") - ACE_TEXT (" interfaces yet\n"))); + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + + /* + * Create an AST representation of the information in the header + * part of an interface - this representation contains a computed + * list of all interfaces which this interface inherits from, + * recursively + */ + UTL_ScopedName n ($2, + 0); + ACE_NEW_RETURN ($$, + FE_InterfaceHeader (&n, + $3, + I_FALSE, + I_TRUE, + I_TRUE), + 1); } ; @@ -683,10 +704,10 @@ value_concrete_decl : i = AST_Interface::narrow_from_decl (v); AST_Interface::fwd_redefinition_helper (i, s); - v = AST_ValueType::narrow_from_decl (i); /* * Add the valuetype to its definition scope */ + v = AST_ValueType::narrow_from_decl (i); (void) s->fe_add_valuetype (v); } @@ -698,20 +719,20 @@ value_concrete_decl : '{' { // '{' - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceSqSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeSqSeen); } value_elements { // value_elements - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceBodySeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeBodySeen); } '}' { // '}' - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceQsSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); /* - * Done with this interface - pop it off the scopes stack + * Done with this value type - pop it off the scopes stack */ UTL_Scope* s = idl_global->scopes ().top (); AST_Interface* m = AST_Interface::narrow_from_scope (s); @@ -726,7 +747,7 @@ value_abs_decl : { // value_abs_decl : IDL_ABSTRACT value_header UTL_Scope *s = idl_global->scopes ().top_non_null (); - AST_Valuetype *v = 0; + AST_ValueType *v = 0; AST_Interface *i = 0; if (s != 0 && $2 != 0) @@ -748,10 +769,10 @@ value_abs_decl : i = AST_Interface::narrow_from_decl (v); AST_Interface::fwd_redefinition_helper (i, s); - v = AST_ValueType::narrow_from_decl (i); /* * Add the valuetype to its definition scope */ + v = AST_ValueType::narrow_from_decl (i); (void) s->fe_add_valuetype (v); } @@ -763,17 +784,17 @@ value_abs_decl : '{' { // '{' - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceSqSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeSqSeen); } exports { // exports - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceBodySeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeBodySeen); } '}' { // '}' - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceQsSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); /* * Done with this interface - pop it off the scopes stack. @@ -789,19 +810,25 @@ value_header : value_decl opt_truncatable inheritance_spec + { +// value_header : value_decl opt_truncatable inheritance_spec + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + } supports_spec { -// value_header : value_decl opt_truncatable inheritance_spec supports_spec +// supports_spec + idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); + UTL_ScopedName *sn = 0; ACE_NEW_RETURN (sn, UTL_ScopedName ($1, 0), 1); ACE_NEW_RETURN ($$, - FE_obv_header (sn, - $3, - $4, - $2), + FE_OBVHeader (sn, + $3, + $5, + $2), 1); } ; @@ -810,12 +837,12 @@ value_decl : IDL_VALUETYPE { // value_decl : IDL_VALUETYPE - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeSeen); } id { // id - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeIDSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeIDSeen); $$ = $3; } ; @@ -863,7 +890,7 @@ value_forward_decl : UTL_ScopedName n ($2, 0); AST_ValueTypeFwd *f = 0; - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeForwardSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeForwardSeen); /* * Create a node representing a forward declaration of an @@ -884,7 +911,7 @@ value_forward_decl : UTL_ScopedName n ($1, 0); AST_ValueTypeFwd *f = 0; - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeForwardSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeForwardSeen); /* * Create a node representing a forward declaration of an @@ -1547,7 +1574,7 @@ primary_expr */ UTL_Scope *s = idl_global->scopes ().top_non_null (); AST_Decl *d = s->lookup_by_name ($1, - 1); + I_TRUE); /* * If the scoped name is an IDL constant, it may be used in an @@ -3382,7 +3409,8 @@ operation : // IDENTIFIER UTL_Scope *s = idl_global->scopes ().top_non_null (); Identifier id ($4); - UTL_ScopedName n (&id, 0); + UTL_ScopedName n (&id, + 0); AST_Operation *o = 0; idl_global->set_parse_state (IDL_GlobalData::PS_OpIDSeen); @@ -3575,7 +3603,7 @@ init_parameter_list } ; -at_least_one_in_parameter : in_parameter in_parameters ; +at_least_one_in_parameter : in_parameters in_parameter ; in_parameters : in_parameters @@ -3936,26 +3964,142 @@ component component_forward_decl : IDL_COMPONENT id + { +// component_forward_decl : IDL_COMPONENT id + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n ($2, + 0); + AST_ComponentFwd *f = 0; + idl_global->set_parse_state ( + IDL_GlobalData::PS_ComponentForwardSeen + ); + + /* + * Create a node representing a forward declaration of a + * component. Store it in the enclosing scope. + */ + if (s != 0) + { + f = idl_global->gen ()->create_component_fwd (&n); + (void) s->fe_add_component_fwd (f); + } + } ; component_decl : component_header + { +// component_decl : component_header + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Component *c = 0; + + /* + * Make a new component node and add it to the enclosing scope. + */ + if (s != 0 && $1 != 0) + { + c = + idl_global->gen ()->create_component ( + $1->name (), + $1->base_component (), + $1->supports (), + $1->n_supports (), + $1->supports_flat (), + $1->n_supports_flat () + ); + AST_Interface *i = AST_Interface::narrow_from_decl (c); + AST_Interface::fwd_redefinition_helper (i, + s); + /* + * Add the component to its definition scope. + */ + c = AST_Component::narrow_from_decl (i); + (void) s->fe_add_component (c); + + // This FE_ComponentHeader class isn't destroyed with the AST. + $1->name ()->destroy (); + delete $1; + $1 = 0; + } + + /* + * Push it on the scope stack. + */ + idl_global->scopes ().push (c); + } '{' - component_exports + { +// '{' + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentSqSeen); + } + component_exports + { +// component_exports + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentBodySeen); + } '}' + { +// '}' + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentQsSeen); + + /* + * Done with this component - pop it off the scopes stack. + */ + UTL_Scope* s = idl_global->scopes ().top (); + AST_Interface* m = AST_Interface::narrow_from_scope (s); + m->inherited_name_clash (); + idl_global->scopes ().pop (); + } ; component_header : IDL_COMPONENT id + { +// id + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentIDSeen); + } component_inheritance_spec + { +// component_inheritance_spec + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + } supports_spec + { +// supports_spec + idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); + + /* + * Create an AST representation of the information in the header + * part of a component. + */ + UTL_ScopedName n ($2, + 0); + ACE_NEW_RETURN ($$, + FE_ComponentHeader (&n, + $4, + $6, + I_FALSE), + 1); + } ; component_inheritance_spec : ':' + { +// component_inheritance_spec : ':' + idl_global->set_parse_state (IDL_GlobalData::PS_InheritColonSeen); + } scoped_name + { +// scoped_name + $$ = $3; + } | /* EMPTY */ + { +// | /* EMPTY */ + $$ = 0; + } ; component_exports @@ -3965,28 +4109,127 @@ component_exports component_export : provides_decl + { +// component_export : provides_decl + idl_global->set_parse_state (IDL_GlobalData::PS_ProvidesDeclSeen); + } ';' + { +// ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } | uses_decl + { +// | uses_decl + idl_global->set_parse_state (IDL_GlobalData::PS_UsesDeclSeen); + } ';' + { +// ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } | emits_decl + { +// | emits_decl + idl_global->set_parse_state (IDL_GlobalData::PS_EmitsDeclSeen); + } ';' + { +// ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } | publishes_decl + { +// | publishes_decl + idl_global->set_parse_state (IDL_GlobalData::PS_PublishesDeclSeen); + } ';' + { +// ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } | consumes_decl + { +// | consumes_decl + idl_global->set_parse_state (IDL_GlobalData::PS_ConsumesDeclSeen); + } ';' + { +// ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } | attribute + { +// | attribute + idl_global->set_parse_state (IDL_GlobalData::PS_AttrDeclSeen); + } ';' + { +// ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } ; provides_decl : IDL_PROVIDES interface_type id + { +// provides_decl : IDL_PROVIDES 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_Component::port_description pd; + pd.id = $3; + pd.impl = $2; + c->provides ().enqueue_tail (pd); + } + } ; interface_type : scoped_name + { +// interface_type : scoped_name + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Decl *d = s->lookup_by_name ($1, + I_TRUE); + + if (d == 0) + { + idl_global->err ()->lookup_error ($1); + } + else if (d->node_type () != AST_Decl::NT_interface) + { + idl_global->err ()->interface_expected (d); + } + + $$ = $1; + } | IDL_OBJECT + { +// | IDL_OBJECT + Identifier *corba_id = 0; + ACE_NEW_RETURN (corba_id, + Identifier ("Object"), + 1); + UTL_IdList *conc_name = 0; + ACE_NEW_RETURN (conc_name, + UTL_IdList (corba_id, + 0), + 1); + ACE_NEW_RETURN (corba_id, + Identifier ("CORBA"), + 1); + UTL_IdList *corba_name = 0; + ACE_NEW_RETURN (corba_name, + UTL_IdList (corba_id, + conc_name), + 1); + $$ = corba_name; + } ; uses_decl : @@ -3994,62 +4237,270 @@ uses_decl : opt_multiple interface_type id + { +// 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_Component::uses_description ud; + ud.id = $4; + ud.impl = $3; + ud.is_multiple = $2; + c->uses ().enqueue_tail (ud); + } + } ; opt_multiple : IDL_MULTIPLE + { +// opt_multiple : IDL_MULTIPLE + $$ = I_TRUE; + } | /* EMPTY */ + { +// | /* EMPTY */ + $$ = I_FALSE; + } ; emits_decl : IDL_EMITS scoped_name id + { +// emits_decl : IDL_EMITS scoped_name id + UTL_Scope *s = idl_global->scopes ().top_non_null (); + 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_valuetype) + { + idl_global->err ()->valuetype_expected (d); + } + + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = $3; + pd.impl = $2; + c->emits ().enqueue_tail (pd); + } + } ; publishes_decl : IDL_PUBLISHES scoped_name id + { +// publishes_decl : IDL_PUBLISHES scoped_name id + UTL_Scope *s = idl_global->scopes ().top_non_null (); + 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_valuetype) + { + idl_global->err ()->valuetype_expected (d); + } + + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = $3; + pd.impl = $2; + c->publishes ().enqueue_tail (pd); + } + } ; consumes_decl : IDL_CONSUMES scoped_name id + { +// consumes_decl : IDL_CONSUMES scoped_name id + UTL_Scope *s = idl_global->scopes ().top_non_null (); + 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_valuetype) + { + idl_global->err ()->valuetype_expected (d); + } + + AST_Component *c = AST_Component::narrow_from_scope (s); + + if (c != 0) + { + AST_Component::port_description pd; + pd.id = $3; + pd.impl = $2; + c->consumes ().enqueue_tail (pd); + } + } ; home_decl : home_header + { +// home_decl : home_header + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Home *h = 0; + + /* + * Make a new home node and add it to the enclosing scope. + */ + if (s != 0 && $1 != 0) + { + h = + idl_global->gen ()->create_home ( + $1->name (), + $1->base_home (), + $1->managed_component (), + $1->primary_key (), + $1->supports (), + $1->n_supports (), + $1->supports_flat (), + $1->n_supports_flat () + ); + /* + * Add the home to its definition scope. + */ + (void) s->fe_add_home (h); + + // This FE_HomeHeader class isn't destroyed with the AST. + $1->name ()->destroy (); + delete $1; + $1 = 0; + } + + /* + * Push it on the scope stack. + */ + idl_global->scopes ().push (h); + } home_body ; home_header : IDL_HOME + { +// home_header : IDL_HOME + idl_global->set_parse_state (IDL_GlobalData::PS_HomeSeen); + } id + { +// id + idl_global->set_parse_state (IDL_GlobalData::PS_HomeIDSeen); + } home_inheritance_spec + { +// home_inheritance_spec + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + } supports_spec + { +// supports_spec + idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); + } IDL_MANAGES + { +// IDL_MANAGES + idl_global->set_parse_state (IDL_GlobalData::PS_ManagesSeen); + } scoped_name + { +// scoped_name + idl_global->set_parse_state (IDL_GlobalData::PS_ManagesIDSeen); + } primary_key_spec + { +// primary_key_spec + idl_global->set_parse_state (IDL_GlobalData::PS_PrimaryKeySpecSeen); + + /* + * Create an AST representation of the information in the header + * part of a component home. + */ + UTL_ScopedName n ($3, + 0); + ACE_NEW_RETURN ($$, + FE_HomeHeader (&n, + $5, + $7, + $11, + $13), + 1); + } ; home_inheritance_spec : ':' + { +// home_inheritance_spec ':' + idl_global->set_parse_state (IDL_GlobalData::PS_InheritColonSeen); + } scoped_name + { +// scoped_name + $$ = $3; + } | /* EMPTY */ + { +// | /* EMPTY */ + $$ = 0; + } ; primary_key_spec : IDL_PRIMARYKEY scoped_name + { +// primary_key_spec : IDL_PRIMARYKEY scoped_name + $$ = $2; + } | /* EMPTY */ + { +// | /* EMPTY */ + $$ = 0; + } ; home_body : '{' + { +// home_body : '{' + idl_global->set_parse_state (IDL_GlobalData::PS_HomeSqSeen); + } home_exports + { +// home_exports + idl_global->set_parse_state (IDL_GlobalData::PS_HomeBodySeen); + } '}' + { +// '}' + idl_global->set_parse_state (IDL_GlobalData::PS_HomeQsSeen); + } ; home_exports @@ -4060,23 +4511,139 @@ home_exports home_export : export | factory_decl + { +// home_export : factory_decl + idl_global->set_parse_state (IDL_GlobalData::PS_FactoryDeclSeen); + } ';' + { +// | ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } | finder_decl + { +// | finder_decl + idl_global->set_parse_state (IDL_GlobalData::PS_FinderDeclSeen); + } ';' + { +// | ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } ; factory_decl : IDL_FACTORY id + { +// factory_decl : IDL_FACTORY id + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n ($2, + 0); + AST_Operation *o = 0; + idl_global->set_parse_state (IDL_GlobalData::PS_OpIDSeen); + + /* + * Create a node representing a factory operation + * and add it to the enclosing scope. + */ + 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, + AST_Operation::OP_noflags, + &n, + I_TRUE, + I_FALSE + ); + (void) s->fe_add_operation (o); + home->factories ().enqueue_tail (o); + } + + ACE_OS::free ($2); + $2 = 0; + + /* + * Push the operation scope onto the scopes stack. + */ + idl_global->scopes ().push (o); + } init_parameter_list + { +// init_parameter_list + idl_global->set_parse_state (IDL_GlobalData::PS_OpParsCompleted); + } opt_raises + { +// opt_raises + idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); + + /* + * Done with this operation. Pop its scope from the scopes stack. + */ + idl_global->scopes ().pop (); + } ; finder_decl : IDL_FINDER id + { +// finder_decl : IDL_FINDER id + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n ($2, + 0); + AST_Operation *o = 0; + idl_global->set_parse_state (IDL_GlobalData::PS_OpIDSeen); + + /* + * Create a node representing a finder operation + * and add it to the enclosing scope. + */ + 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, + AST_Operation::OP_noflags, + &n, + I_TRUE, + I_FALSE + ); + (void) s->fe_add_operation (o); + home->finders ().enqueue_tail (o); + } + + ACE_OS::free ($2); + $2 = 0; + + /* + * Push the operation scope onto the scopes stack. + */ + idl_global->scopes ().push (o); + } init_parameter_list + { +// init_parameter_list + idl_global->set_parse_state (IDL_GlobalData::PS_OpParsCompleted); + } opt_raises + { +// opt_raises + idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); + + /* + * Done with this operation. Pop its scope from the scopes stack. + */ + idl_global->scopes ().pop (); + } ; event diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index 8ad58b2eacb..d7fcb04e074 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -2838,6 +2838,7 @@ idl_store_pragma (char *buf) if (new_id != 0) { d->repoID (new_id); + d->typeid_set (1); } } } diff --git a/TAO/TAO_IDL/fe/y.tab.cpp b/TAO/TAO_IDL/fe/y.tab.cpp index ce77354aec5..f953c3e2ccf 100644 --- a/TAO/TAO_IDL/fe/y.tab.cpp +++ b/TAO/TAO_IDL/fe/y.tab.cpp @@ -20,6 +20,9 @@ char tao_yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90 \n\ #include "ast_module.h" #include "ast_valuetype.h" #include "ast_valuetype_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" @@ -57,7 +60,9 @@ typedef union { UTL_LabelList *llval; /* Label list */ UTL_DeclList *dlval; /* Declaration list */ FE_InterfaceHeader *ihval; /* Interface header */ - FE_obv_header *vhval; /* Valuetype header */ + FE_OBVHeader *vhval; /* Valuetype 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 */ @@ -157,49 +162,52 @@ typedef union { #define IDL_WSTRING_LITERAL 332 #define TAO_YYERRCODE 256 short tao_yylhs[] = { -1, - 0, 75, 75, 77, 76, 79, 76, 81, 76, 83, - 76, 85, 76, 87, 76, 89, 76, 91, 76, 93, - 76, 95, 76, 97, 76, 98, 76, 99, 100, 101, - 102, 88, 86, 86, 105, 107, 108, 103, 109, 69, - 33, 33, 33, 110, 22, 22, 90, 90, 90, 90, - 111, 111, 116, 118, 119, 115, 120, 121, 122, 112, - 34, 123, 70, 68, 68, 24, 24, 113, 113, 114, - 117, 117, 124, 124, 124, 129, 125, 130, 125, 106, - 106, 131, 126, 132, 126, 133, 126, 134, 126, 135, - 126, 137, 126, 139, 126, 140, 126, 20, 141, 21, - 21, 16, 142, 16, 143, 16, 73, 104, 104, 104, - 144, 145, 146, 147, 82, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 35, 36, 37, 37, 38, 38, - 39, 39, 40, 40, 40, 41, 41, 41, 42, 42, - 42, 42, 43, 43, 43, 43, 44, 44, 44, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 46, 149, - 74, 74, 74, 74, 74, 74, 151, 148, 1, 1, - 2, 2, 2, 59, 59, 59, 59, 59, 59, 59, - 59, 4, 4, 4, 3, 3, 3, 150, 150, 29, - 154, 30, 30, 64, 64, 31, 155, 32, 32, 65, - 66, 51, 51, 57, 57, 57, 58, 58, 58, 54, - 54, 54, 55, 52, 52, 60, 53, 56, 61, 156, - 72, 157, 159, 160, 7, 158, 162, 162, 163, 161, - 164, 165, 128, 166, 128, 167, 71, 168, 169, 170, - 171, 173, 174, 10, 9, 9, 9, 9, 9, 9, - 172, 176, 176, 177, 178, 175, 179, 175, 27, 28, - 28, 180, 48, 181, 182, 48, 183, 49, 152, 153, - 184, 185, 187, 188, 8, 186, 191, 190, 190, 189, - 192, 193, 5, 5, 194, 195, 13, 197, 198, 6, - 6, 196, 200, 201, 14, 14, 199, 202, 11, 25, - 26, 26, 203, 204, 47, 205, 206, 136, 67, 67, - 207, 208, 209, 210, 84, 211, 213, 214, 215, 138, - 63, 63, 63, 12, 12, 216, 218, 127, 219, 217, - 221, 217, 220, 224, 223, 223, 225, 226, 222, 227, - 212, 229, 212, 228, 232, 231, 231, 233, 234, 230, - 15, 15, 15, 15, 62, 62, 62, 235, 236, 23, - 23, 237, 238, 17, 17, 18, 239, 19, 19, 78, - 80, 92, 92, 241, 240, 242, 244, 244, 243, 243, - 245, 245, 245, 245, 245, 245, 246, 251, 251, 247, - 252, 252, 248, 249, 250, 94, 253, 255, 255, 256, - 256, 254, 257, 257, 258, 258, 258, 259, 260, 96, - 96, 96, 263, 263, 265, 264, 262, 266, 268, 269, - 267, 261, 270, 270, + 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, 230, 230, 233, 234, 231, + 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, }; short tao_yylen[] = { 2, 1, 2, 0, 0, 3, 0, 3, 0, 3, 0, @@ -208,546 +216,563 @@ short tao_yylen[] = { 2, 0, 9, 1, 1, 0, 0, 0, 7, 0, 3, 2, 3, 3, 0, 3, 0, 1, 1, 1, 1, 2, 1, 0, 0, 0, 7, 0, 0, 0, 8, - 4, 0, 3, 1, 0, 2, 0, 2, 1, 2, - 2, 0, 1, 1, 2, 0, 3, 0, 3, 2, - 0, 0, 3, 0, 3, 0, 3, 0, 3, 0, - 3, 0, 3, 0, 3, 0, 3, 2, 0, 4, - 0, 1, 0, 3, 0, 4, 1, 1, 2, 2, - 0, 0, 0, 0, 9, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, - 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, - 3, 3, 1, 2, 2, 2, 1, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 3, 1, 1, 1, 2, 1, 0, 3, 1, 1, + 0, 5, 0, 3, 1, 0, 2, 0, 2, 1, + 2, 2, 0, 1, 1, 2, 0, 3, 0, 3, + 2, 0, 0, 3, 0, 3, 0, 3, 0, 3, + 0, 3, 0, 3, 0, 3, 0, 3, 2, 0, + 4, 0, 1, 0, 3, 0, 4, 1, 1, 2, + 2, 0, 0, 0, 0, 9, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, + 3, 3, 3, 1, 2, 2, 2, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 0, 4, 0, 1, 1, 2, 0, 4, 0, 1, - 1, 1, 1, 1, 2, 1, 2, 3, 2, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, - 3, 0, 0, 0, 7, 2, 2, 0, 0, 2, - 0, 0, 5, 0, 3, 0, 3, 0, 0, 0, - 0, 0, 0, 14, 1, 1, 1, 1, 1, 1, - 2, 2, 0, 0, 0, 5, 0, 3, 2, 2, - 0, 0, 3, 0, 0, 5, 0, 3, 1, 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, + 0, 3, 1, 1, 1, 2, 1, 0, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 0, 4, 0, 1, 1, 2, 0, 4, 0, + 1, 1, 1, 1, 1, 2, 1, 2, 3, 2, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 0, 3, 0, 0, 0, 7, 2, 2, 0, 0, + 2, 0, 0, 5, 0, 3, 0, 3, 0, 0, + 0, 0, 0, 0, 14, 1, 1, 1, 1, 1, + 1, 2, 2, 0, 0, 0, 5, 0, 3, 2, + 2, 0, 0, 3, 0, 0, 5, 0, 3, 1, + 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, - 1, 1, 1, 1, 1, 1, 1, 0, 0, 6, - 0, 0, 0, 6, 0, 2, 0, 4, 0, 3, - 3, 1, 1, 2, 4, 4, 2, 0, 2, 0, - 2, 2, 2, 2, 2, 2, 3, 1, 1, 4, - 1, 0, 3, 3, 3, 2, 7, 2, 0, 2, - 0, 3, 2, 0, 1, 2, 2, 4, 4, 1, - 1, 1, 1, 1, 2, 3, 5, 3, 3, 2, - 3, 5, 1, 1, + 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, }; short tao_yydefred[] = { 3, - 0, 0, 26, 111, 28, 39, 160, 220, 236, 271, - 311, 0, 0, 0, 0, 62, 0, 0, 0, 0, - 0, 162, 164, 163, 35, 53, 0, 0, 0, 0, - 4, 2, 6, 8, 10, 12, 14, 16, 18, 20, - 22, 24, 33, 34, 47, 48, 49, 50, 52, 166, - 188, 189, 372, 373, 0, 0, 410, 411, 412, 413, - 414, 0, 423, 424, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 107, 165, 200, 0, 0, 57, - 0, 0, 0, 0, 51, 0, 0, 0, 0, 103, - 0, 102, 0, 0, 0, 44, 41, 0, 206, 0, - 210, 211, 214, 215, 216, 217, 213, 218, 219, 285, - 292, 297, 64, 70, 169, 170, 172, 182, 183, 185, - 187, 186, 0, 184, 0, 174, 176, 177, 175, 179, - 180, 202, 203, 171, 178, 181, 0, 0, 222, 0, - 0, 238, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 380, 404, 396, 0, 0, 0, - 27, 122, 123, 0, 112, 116, 117, 119, 120, 121, - 118, 29, 40, 167, 161, 221, 237, 272, 312, 42, - 0, 0, 43, 419, 63, 0, 0, 0, 0, 0, - 370, 105, 371, 36, 54, 0, 205, 212, 0, 209, - 0, 281, 284, 0, 288, 293, 0, 223, 5, 7, + 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, + 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, + 207, 0, 211, 212, 215, 216, 217, 218, 214, 219, + 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, + 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, - 0, 0, 81, 72, 0, 0, 0, 0, 0, 58, - 0, 0, 376, 0, 0, 104, 0, 81, 72, 0, - 45, 208, 286, 0, 61, 0, 0, 239, 229, 309, - 0, 0, 0, 0, 0, 375, 0, 0, 379, 0, - 0, 0, 0, 0, 96, 321, 322, 0, 0, 402, - 0, 82, 84, 86, 88, 90, 405, 92, 94, 403, - 0, 0, 421, 0, 0, 113, 30, 201, 168, 193, - 194, 195, 0, 273, 313, 81, 66, 0, 106, 0, - 0, 0, 0, 150, 151, 152, 154, 156, 157, 158, - 155, 153, 0, 0, 0, 0, 0, 159, 0, 0, - 0, 0, 0, 0, 139, 143, 148, 282, 289, 294, - 0, 224, 228, 0, 0, 0, 389, 0, 0, 0, - 391, 0, 306, 386, 381, 382, 383, 384, 385, 0, - 0, 0, 325, 352, 316, 353, 324, 0, 351, 0, - 0, 0, 0, 0, 0, 0, 406, 407, 417, 80, - 326, 78, 76, 422, 71, 73, 74, 0, 0, 3, - 0, 0, 0, 228, 0, 0, 0, 0, 99, 287, - 144, 145, 146, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 249, 240, - 0, 245, 246, 248, 247, 0, 0, 234, 231, 230, - 395, 393, 387, 394, 0, 0, 97, 0, 0, 0, - 0, 83, 85, 87, 89, 91, 93, 95, 0, 0, - 0, 75, 114, 0, 191, 303, 299, 302, 280, 274, - 279, 0, 0, 0, 397, 38, 56, 0, 149, 0, - 0, 0, 0, 0, 0, 0, 140, 141, 142, 283, - 290, 295, 0, 225, 227, 0, 0, 390, 307, 0, - 0, 358, 408, 409, 317, 327, 79, 77, 0, 0, - 0, 0, 0, 0, 0, 0, 60, 0, 0, 241, - 235, 232, 0, 330, 337, 0, 336, 0, 0, 0, - 115, 125, 32, 192, 304, 301, 275, 277, 315, 0, - 0, 308, 199, 0, 332, 0, 359, 0, 318, 328, - 0, 0, 242, 233, 0, 338, 334, 0, 0, 0, - 0, 305, 278, 0, 197, 0, 0, 0, 341, 355, - 356, 357, 348, 0, 347, 319, 257, 264, 262, 254, - 261, 243, 253, 0, 339, 335, 360, 0, 343, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 198, 349, - 345, 362, 320, 258, 265, 263, 267, 255, 260, 244, - 252, 0, 0, 0, 0, 0, 0, 350, 346, 363, - 266, 268, 256, 0, 369, 0, 0, 364, 367, 0, - 368, + 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, + 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, 337, 0, 0, + 243, 234, 0, 319, 309, 200, 306, 279, 0, 331, + 0, 0, 359, 435, 438, 0, 0, 0, 0, 0, + 0, 333, 338, 335, 334, 0, 258, 265, 263, 255, + 262, 244, 254, 342, 356, 357, 358, 349, 0, 348, + 320, 198, 0, 417, 0, 0, 360, 0, 0, 0, + 0, 0, 0, 0, 0, 344, 0, 0, 0, 0, + 339, 336, 0, 259, 266, 264, 268, 256, 261, 245, + 253, 350, 346, 363, 321, 199, 0, 0, 0, 0, + 0, 0, 0, 0, 340, 361, 267, 269, 257, 351, + 347, 364, 0, 370, 0, 0, 365, 368, 0, 369, }; short tao_yydgoto[] = { 1, - 419, 115, 116, 117, 118, 119, 22, 23, 410, 24, - 288, 355, 123, 124, 357, 317, 583, 606, 607, 241, - 302, 97, 483, 233, 447, 493, 560, 576, 289, 381, - 522, 535, 25, 26, 511, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 448, 561, 588, 165, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 553, 271, 290, 291, 292, 257, 137, 27, 28, - 29, 30, 92, 272, 2, 32, 144, 273, 145, 274, - 146, 275, 147, 276, 148, 37, 149, 38, 150, 39, - 151, 40, 152, 41, 153, 42, 154, 66, 68, 226, - 380, 490, 43, 44, 94, 284, 238, 387, 69, 196, - 45, 46, 47, 48, 49, 95, 285, 239, 388, 182, - 296, 453, 86, 375, 376, 370, 378, 420, 441, 440, - 360, 361, 362, 363, 364, 278, 365, 279, 366, 350, - 458, 190, 237, 67, 225, 379, 489, 175, 70, 50, - 227, 51, 52, 491, 564, 71, 143, 332, 249, 416, - 475, 417, 334, 477, 521, 476, 72, 207, 331, 473, - 520, 562, 544, 577, 563, 578, 575, 597, 572, 574, - 573, 595, 596, 73, 228, 450, 383, 494, 451, 495, - 532, 244, 405, 201, 303, 140, 246, 406, 141, 247, - 407, 382, 492, 531, 426, 503, 74, 229, 384, 496, - 431, 529, 509, 541, 571, 439, 429, 510, 480, 506, - 481, 507, 526, 547, 524, 546, 539, 554, 540, 555, - 570, 593, 568, 592, 508, 538, 594, 604, 610, 53, - 54, 55, 220, 187, 259, 260, 261, 262, 263, 264, - 339, 342, 56, 157, 189, 455, 221, 280, 281, 282, - 57, 58, 59, 60, 61, 62, 159, 63, 64, 65, + 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, 554, 249, 419, 487, + 570, 592, 255, 332, 545, 560, 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, + 556, 593, 573, 594, 591, 621, 588, 590, 589, 619, + 620, 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, 559, 598, 411, 527, 514, 537, 551, 538, 552, + 565, 586, 585, 617, 557, 579, 558, 580, 597, 623, + 595, 622, 566, 603, 624, 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, 561, 339, 271, 237, 359, + 360, 361, 448, 362, 449, 504, 539, 505, 540, 57, + 58, 59, 60, 61, 62, 158, 63, 64, 65, }; short tao_yysindex[] = { 0, - 0, 828, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -187, -220, -218, -130, 0, -187, -187, -187, -206, - -206, 0, 0, 0, 0, 0, 88, 620, -110, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 807, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -216, -194, -159, -123, 0, -216, -216, 0, -217, + -217, 0, 0, 0, 0, 0, 0, 0, 92, 602, + -172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 64, 85, 0, 0, 0, 0, - 0, -119, 0, 0, -119, 188, 811, 6, -187, 662, - -187, -187, -187, -187, 0, 0, 0, 88, -187, 0, - 88, -119, -187, -119, 0, -187, 212, 0, 220, 0, - -68, 0, -61, 160, 170, 0, 0, -157, 0, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -141, 0, 0, -141, 115, 768, -43, -216, 621, + -216, -216, -216, -216, 0, 0, 0, 92, -216, 0, + 92, -141, -216, -141, 0, -216, 0, 0, -216, 0, + -81, 0, -55, 97, 149, 161, 164, 0, 0, -125, + 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 37, 0, -19, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 88, -110, 0, 246, - 255, 0, 194, 262, 266, 274, 280, 293, 298, 303, - 313, 329, 337, 347, 0, 0, 0, 88, 284, 285, - 0, 0, 0, -19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8, 0, -29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 92, -172, + 0, 255, 260, 0, 201, 272, 277, 280, 295, 300, + 302, 333, 340, 343, 345, 348, 92, 241, 291, 0, + 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 286, 0, 0, 0, -206, 109, -206, 109, -187, - 0, 0, 0, 0, 0, -206, 0, 0, 150, 0, - 358, 0, 0, 109, 0, 0, 387, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 264, - 485, 109, 0, 0, -187, 296, -187, 307, 308, 0, - -19, -206, 0, -19, 114, 0, -187, 0, 0, -19, - 0, 0, 0, 55, 0, 55, 55, 0, 0, 0, - -206, -206, -132, -206, 123, 0, 148, 381, 0, 384, - 385, 386, 388, 389, 0, 0, 0, -187, -187, 0, - 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 390, 395, 0, 520, 450, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -206, 0, 913, - 886, 402, 773, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 23, 23, 23, 55, -19, 0, 336, 367, - 424, -76, 257, 248, 0, 0, 0, 0, 0, 0, - 369, 0, 0, 590, -193, -193, 0, -19, -187, -193, - 0, -132, 0, 0, 0, 0, 0, 0, 0, 405, - 426, 426, 0, 0, 0, 0, 0, -19, 0, 409, - 411, 415, 418, 421, 425, 427, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 428, 417, 0, - 439, 394, 232, 0, 913, -124, 365, 393, 0, 0, - 0, 0, 0, 464, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 444, 452, 458, 250, 0, 0, - -19, 0, 0, 0, 0, 396, 0, 0, 0, 0, - 0, 0, 0, 0, -187, 792, 0, 0, 233, 233, - 267, 0, 0, 0, 0, 0, 0, 0, 269, 590, - 590, 0, 0, 828, 0, 0, 0, 0, 0, 0, - 0, 0, 398, -206, 0, 0, 0, -206, 0, 367, - 424, -76, 257, 257, 248, 248, 0, 0, 0, 0, - 0, 0, 486, 0, 0, 469, -187, 0, 0, 488, - 241, 0, 0, 0, 0, 0, 0, 0, 55, 406, - -187, 55, 394, 407, 489, 410, 0, -19, -19, 0, - 0, 0, -187, 0, 0, 496, 0, 499, 500, 426, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 420, - 482, 0, 0, 792, 0, 498, 0, 0, 0, 0, - 453, 232, 0, 0, 501, 0, 0, -206, 506, 47, - 233, 0, 0, 48, 0, -187, 241, 513, 0, 0, - 0, 0, 0, 515, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -187, 0, 0, 0, 792, 0, 514, - 268, 503, 55, 505, 662, 60, 440, 48, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -187, 47, 524, 509, -187, 512, 0, 0, 0, - 0, 0, 0, 245, 0, 531, 530, 0, 0, 253, - 0, + 304, 0, 0, 0, 371, 0, -216, 0, 0, 0, + 0, 0, 0, 0, 0, -217, 0, 0, 172, 0, + 376, 0, 0, 0, 0, 0, 405, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, + 0, 0, -216, 324, -216, 327, 330, 0, 0, 0, + 396, 0, -216, 0, 0, 0, 0, -29, 0, 0, + 0, -18, 148, -18, -18, 0, 0, -217, 0, 545, + 510, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -217, 148, 0, 0, 0, 926, 860, 137, + 887, 414, 698, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 25, 25, 25, -18, -29, 0, 337, 369, + 428, -85, 251, 293, 0, 0, 0, 0, 0, 0, + 0, 787, 0, 0, 578, 0, 0, 0, 0, 0, + 0, 717, 183, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 412, 408, + 0, 430, 381, 219, 0, 926, -29, 0, -217, 148, + 352, 353, -217, -217, -185, -217, 167, 0, 355, 0, + 0, 0, 0, 0, 0, -216, -216, 0, 356, 0, + 0, 0, 0, 0, 0, 0, 0, 441, -18, -18, + -18, -18, -18, -18, -18, -18, -18, -18, 421, 422, + 424, 227, 0, 0, -29, 0, 0, 0, 0, 365, + 0, 0, 0, 0, 433, 0, 0, 0, 0, 0, + -29, 0, 0, 436, 437, 459, 465, 467, 468, 470, + 273, 578, 578, 0, 0, 807, 0, 0, 0, 0, + 0, 0, 0, 0, 406, -29, 0, 0, 0, -193, + -193, 0, -29, -216, -193, 0, -185, 473, 0, 474, + 475, 477, 478, 480, 0, 0, 0, 481, 482, -217, + 0, 369, 428, -85, 251, 251, 293, 293, 0, 0, + 0, 0, 0, 0, 503, 0, 0, 486, -216, 0, + 289, 744, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -18, 423, -216, -18, 381, 425, 505, 426, + 0, 232, 0, 0, 0, 0, -216, 0, 0, 0, + 0, 0, 0, 507, 507, 0, 0, -29, 0, 0, + 0, 0, 0, 507, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 431, 496, + 516, -216, 0, 464, 219, -217, 517, 0, 267, 267, + 0, 0, 0, 0, 0, 0, 0, 0, -29, 0, + 521, -14, 0, 0, 0, 87, 526, 82, 267, 527, + 262, 0, 0, 0, 0, 533, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 536, 0, + 0, 0, -217, 0, 744, 290, 0, 523, -18, 525, + 621, -25, 460, 87, 744, 0, 546, 296, -216, -29, + 0, 0, -217, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -216, 550, 534, -216, + 535, -216, 82, 553, 0, 0, 0, 0, 0, 0, + 0, 0, 274, 0, 559, 557, 0, 0, 281, 0, }; short tao_yyrindex[] = { 0, - 0, 577, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 603, 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, 31, 59, + 552, 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, 78, 62, 526, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 24, 0, 0, 24, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 46, 0, 0, + 68, 62, 0, 24, 0, 0, 64, 36, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 21, 0, 0, 21, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 106, 0, 0, - 121, 84, 0, 21, 0, 0, -22, 33, -262, 0, - 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, + 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -76, 0, + 0, 189, 191, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -76, 0, 0, 0, + 0, 0, 374, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, -67, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 509, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -82, 0, 0, 113, - 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -82, 0, 0, - 0, 0, 0, 344, 0, 0, 0, 0, 0, 0, + -175, 0, 0, 0, 0, 0, 0, -20, 0, 0, + 0, 0, 509, 0, 0, 0, 0, 0, 0, 671, + 671, 0, 0, 0, 0, 0, 0, 0, -13, 0, + 0, 0, 0, 509, 0, 0, 0, 388, 417, -86, + 455, -4, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 38, 0, 208, 119, + 502, 317, 130, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 0, 0, 0, 0, 0, 463, 0, 288, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, - 0, 0, 0, 463, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 324, - 706, 463, 0, 0, 0, 0, 0, 0, 0, 0, - -75, 0, 0, -245, 0, 0, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 577, 0, 0, 0, 484, -65, 0, 0, 318, + 0, 0, 0, 0, 0, 0, -121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 706, 706, 0, 0, 0, 0, 0, - 0, 0, 168, 0, 0, 0, 0, 0, 0, 231, - 392, -7, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 35, 0, 370, 343, - 715, 141, 112, 45, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 354, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 377, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 596, 0, 0, 598, 0, 0, 0, 0, 0, + 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 383, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 518, 0, 0, 0, 0, + 0, 0, 0, 350, 0, -163, 0, 0, 0, 0, + 0, 0, 384, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 576, 0, 0, 0, 419, 517, 0, 0, 0, 0, + 0, 607, 540, 429, 135, 168, 71, 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 600, 0, 0, - 601, 0, 0, 0, 0, 0, 325, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -5, 584, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 519, 0, 0, 0, 0, 0, 0, - 0, 350, 0, 0, 0, 0, 0, 0, 0, 414, - 757, 664, 152, 179, 68, 74, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 43, 0, 519, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 199, 0, 522, 0, 0, 525, -9, 0, + 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 583, 583, + 0, 0, 28, 0, 0, 0, 0, 0, -97, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 9, 587, + 524, 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, 609, 0, 8, 0, 0, - 0, 0, 0, 0, 592, 0, 0, 0, 0, 0, - -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 645, 0, 537, 0, 0, 608, 604, 0, 548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 611, - 607, 0, 0, 0, 0, 687, 0, 542, 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, 627, 0, 0, 0, - 0, + 0, 0, 0, 0, 0, 631, 0, 0, 0, 0, }; short tao_yygindex[] = { 0, - -25, 366, 0, 0, 0, -55, -24, -26, 0, -20, - 0, 0, 0, -53, -373, -2, 0, 0, 0, -212, - 0, 183, -392, 44, 0, 0, 0, 0, 193, 0, - 0, 0, 0, 659, 0, -292, 0, 279, 283, 278, - -30, -10, -181, 46, 0, -217, 200, 118, 0, 0, - -45, -44, -42, 628, 629, 0, 0, 0, -250, -40, - 0, 0, 0, -444, -11, 0, 0, 206, 379, 380, - -18, -15, -12, 7, 320, 0, 0, 9, 0, 13, - 0, 14, 0, 15, 0, 0, 0, 0, 0, 0, + -21, 402, 0, 0, 0, -60, -22, -28, 0, -19, + 0, 0, 0, -57, -399, -17, 240, 0, 0, 0, + 0, 0, 0, -229, 0, 305, -401, -130, 0, 0, + 0, 0, 222, 0, 0, 0, 0, 678, 0, 0, + 0, -266, 0, 325, 323, 328, -39, 34, 4, 104, + 0, -120, 211, 103, 0, 0, -38, -33, -24, 634, + 636, 0, 0, 0, -274, -23, 0, 0, 0, -357, + -11, 0, 0, 176, 0, 403, 410, -15, -7, -12, + 10, 373, 0, 0, 12, 0, 14, 0, 15, 0, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -79, 0, 0, 0, 0, 0, 0, 0, + 0, 691, 0, 472, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 20, 0, 27, 0, 0, 0, 0, + 0, 0, 0, 438, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 462, 375, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -142, 0, 0, 0, 0, - 0, 0, 0, 0, 686, 0, 470, 0, 0, 0, - 0, 0, 0, 0, 0, -167, 0, -41, 0, 0, - 0, 0, 0, 0, 0, 483, 0, 0, 0, 0, + 0, 0, 117, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 461, 328, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 135, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 182, 0, + 0, 0, 0, 0, -460, 0, 0, 0, 0, 0, + 127, 0, 0, 0, 0, 0, 0, 106, 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, -319, 0, 0, 0, - 0, 169, 0, 0, 0, 0, 0, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 375, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 653, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 650, 0, 0, 0, }; -#define TAO_YYTABLESIZE 1231 +#define TAO_YYTABLESIZE 1244 short tao_yytable[] = { 77, - 76, 121, 114, 120, 87, 88, 89, 122, 31, 138, - 33, 162, 139, 163, 34, 35, 36, 91, 93, 297, - 359, 166, 167, 394, 168, 125, 171, 101, 329, 330, - 101, 100, 430, 98, 100, 329, 374, 484, 399, 6, - 46, 6, 361, 121, 174, 120, 514, 377, 340, 122, - 75, 138, 479, 277, 139, 398, 173, 399, 176, 177, - 178, 179, 316, 75, 164, 207, 181, 125, 207, 75, - 184, 147, 147, 185, 398, 147, 147, 147, 65, 147, - 202, 147, 136, 207, 16, 136, 207, 136, 79, 136, - 420, 415, 147, 147, 316, 300, 147, 313, 203, 314, - 378, 565, 136, 136, 197, 137, 136, 198, 137, 101, - 137, 138, 137, 100, 138, 98, 138, 377, 138, 65, - 69, 90, 418, 416, 75, 137, 137, 147, 147, 137, - 392, 138, 138, 377, 192, 138, 108, 136, 136, 204, - 337, 65, 68, 65, 173, 96, 392, 598, 556, 133, - 536, 602, 133, 385, 204, 420, 291, 204, 147, 173, - 137, 137, 173, 269, 109, 142, 138, 138, 136, 133, - 133, 291, 16, 133, 291, 359, 83, 236, 131, 110, - 315, 131, 113, 231, 65, 234, 155, 418, 454, 134, - 530, 137, 134, 240, 580, 90, 512, 138, 131, 131, - 46, 392, 131, 192, 133, 133, 65, 156, 200, 134, - 134, 200, 286, 134, 293, 354, 135, 356, 46, 135, - 467, 468, 469, 296, 299, 377, 200, 222, 46, 240, - 199, 200, 235, 131, 131, 133, 135, 135, 296, 300, - 135, 296, 300, 46, 134, 134, 161, 245, 335, 336, - 338, 340, 398, 399, 191, 351, 352, 300, 298, 192, - 180, 193, 172, 183, 131, 283, 192, 158, 358, 186, - 158, 135, 135, 359, 515, 134, 361, 188, 378, 75, - 585, 207, 194, 331, 404, 412, 413, 101, 414, 402, - 415, 100, 195, 98, 403, 386, 342, 342, 342, 400, - 125, 401, 135, 557, 409, 205, 101, 121, 192, 120, - 100, 75, 98, 122, 206, 138, 208, 359, 139, 204, - 209, 65, 421, 422, 210, 548, 423, 424, 411, 558, - 559, 125, 211, 420, 420, 550, 551, 552, 212, 338, - 222, 558, 559, 304, 305, 306, 307, 308, 309, 310, - 90, 213, 204, 311, 312, 37, 214, 173, 391, 392, - 393, 215, 65, 147, 147, 418, 418, 463, 464, 291, - 354, 216, 356, 136, 136, 304, 305, 306, 307, 308, - 309, 310, 90, 127, 65, 311, 312, 217, 256, 465, - 466, 78, 81, 82, 84, 218, 137, 137, 487, 488, - 127, 127, 138, 138, 127, 219, 223, 224, 230, 232, - 126, 242, 478, 121, 121, 120, 120, 243, 287, 122, - 122, 138, 138, 358, 139, 139, 248, 126, 126, 294, - 295, 126, 343, 298, 341, 127, 296, 125, 125, 344, - 133, 133, 345, 346, 347, 389, 348, 349, 367, 226, - 31, 498, 33, 368, 128, 499, 34, 35, 36, 395, - 396, 397, 126, 427, 293, 428, 127, 432, 354, 433, - 356, 128, 128, 434, 314, 128, 435, 443, 293, 436, - 134, 134, 445, 437, 446, 438, 442, 323, 449, 456, - 77, 523, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 459, 470, 128, 135, 135, 323, - 323, 197, 354, 471, 356, 310, 55, 457, 323, 472, - 474, 358, 497, 485, 482, 486, 500, 501, 504, 505, - 513, 517, 518, 293, 519, 240, 525, 128, 527, 528, - 534, 537, 533, 59, 545, 542, 549, 250, 121, 587, - 120, 77, 579, 567, 122, 569, 138, 581, 323, 139, - 582, 584, 586, 600, 590, 358, 601, 605, 251, 252, - 603, 608, 125, 609, 374, 611, 1, 253, 254, 293, - 229, 229, 255, 293, 270, 67, 229, 229, 229, 229, - 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, - 124, 229, 229, 229, 229, 229, 229, 67, 310, 270, - 388, 229, 229, 229, 229, 229, 229, 229, 229, 229, - 229, 229, 229, 229, 229, 75, 229, 229, 229, 229, - 408, 99, 100, 354, 190, 103, 104, 105, 106, 401, - 204, 250, 361, 31, 369, 10, 276, 400, 323, 333, - 196, 344, 229, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 323, 323, 365, 251, 366, 390, 502, - 323, 323, 80, 460, 462, 323, 310, 229, 461, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 516, 589, 169, 170, 90, 323, 323, 444, - 85, 132, 258, 310, 132, 265, 323, 4, 301, 333, - 7, 452, 591, 543, 599, 566, 425, 160, 0, 323, - 0, 132, 132, 8, 9, 132, 10, 0, 0, 0, - 11, 0, 0, 250, 0, 266, 267, 0, 0, 0, - 265, 0, 4, 12, 0, 7, 323, 371, 372, 373, - 0, 0, 0, 0, 0, 129, 132, 132, 8, 9, - 0, 10, 0, 0, 0, 11, 20, 21, 250, 0, - 266, 267, 129, 129, 0, 265, 129, 4, 12, 0, - 7, 0, 268, 0, 0, 0, 0, 132, 0, 0, - 0, 0, 269, 8, 9, 0, 10, 130, 0, 0, - 11, 20, 21, 250, 0, 266, 267, 129, 129, 0, - 0, 0, 0, 12, 130, 130, 0, 0, 130, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 20, 21, 129, 0, - 0, 0, 0, 0, 0, 418, 75, 0, 0, 130, - 130, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 8, 9, 0, 10, 110, 111, 112, - 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, - 130, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 8, 9, 0, 10, 110, 111, 112, + 76, 123, 91, 93, 87, 88, 161, 122, 116, 162, + 124, 33, 127, 35, 140, 36, 37, 38, 306, 368, + 102, 286, 141, 102, 283, 416, 284, 201, 165, 564, + 201, 330, 101, 166, 332, 101, 99, 402, 378, 75, + 75, 123, 167, 170, 528, 201, 46, 122, 173, 163, + 124, 202, 127, 533, 140, 385, 172, 384, 175, 176, + 177, 178, 141, 75, 286, 6, 180, 362, 341, 203, + 183, 75, 513, 184, 148, 148, 186, 299, 148, 148, + 148, 66, 148, 301, 148, 137, 301, 432, 137, 109, + 137, 270, 137, 449, 444, 148, 148, 447, 445, 148, + 6, 301, 102, 144, 110, 137, 137, 285, 138, 137, + 90, 138, 299, 138, 101, 138, 66, 70, 99, 66, + 69, 380, 375, 300, 301, 420, 111, 518, 138, 138, + 148, 148, 138, 338, 189, 405, 197, 419, 555, 198, + 137, 137, 90, 16, 420, 139, 66, 79, 139, 98, + 139, 405, 139, 46, 268, 223, 419, 581, 449, 128, + 115, 148, 447, 138, 138, 139, 139, 134, 46, 139, + 134, 137, 135, 160, 232, 135, 128, 128, 238, 16, + 128, 66, 336, 83, 66, 601, 380, 134, 134, 205, + 46, 134, 135, 135, 138, 612, 135, 402, 311, 174, + 139, 139, 199, 200, 205, 136, 405, 205, 136, 427, + 252, 128, 259, 171, 174, 416, 516, 174, 208, 191, + 267, 208, 134, 134, 46, 136, 136, 135, 135, 136, + 238, 139, 292, 385, 297, 384, 208, 157, 75, 208, + 157, 188, 128, 372, 373, 337, 189, 292, 127, 297, + 292, 397, 297, 134, 399, 127, 568, 569, 135, 625, + 136, 136, 628, 386, 630, 127, 127, 190, 387, 127, + 328, 192, 189, 383, 563, 201, 123, 388, 389, 332, + 102, 75, 122, 193, 385, 124, 194, 127, 328, 140, + 358, 136, 101, 374, 401, 375, 99, 141, 189, 102, + 127, 362, 274, 275, 276, 277, 278, 279, 280, 90, + 402, 101, 281, 282, 205, 99, 343, 343, 343, 206, + 402, 426, 605, 208, 66, 430, 431, 433, 435, 378, + 209, 301, 455, 456, 376, 210, 449, 449, 211, 377, + 447, 447, 567, 445, 446, 274, 275, 276, 277, 278, + 279, 280, 90, 212, 132, 281, 282, 132, 213, 66, + 214, 227, 66, 221, 380, 519, 148, 148, 568, 569, + 575, 576, 577, 618, 132, 132, 137, 137, 132, 459, + 460, 461, 179, 123, 123, 182, 365, 366, 367, 122, + 122, 215, 124, 124, 127, 127, 140, 140, 216, 138, + 138, 217, 205, 218, 141, 141, 219, 457, 458, 132, + 132, 397, 174, 222, 399, 78, 81, 493, 494, 433, + 308, 495, 496, 82, 84, 33, 228, 35, 229, 36, + 37, 38, 508, 240, 208, 241, 139, 139, 481, 482, + 132, 343, 344, 204, 246, 292, 253, 297, 248, 260, + 345, 346, 261, 265, 401, 347, 259, 363, 134, 134, + 369, 220, 370, 135, 135, 371, 133, 403, 415, 133, + 414, 418, 259, 417, 315, 421, 428, 429, 436, 439, + 447, 451, 462, 463, 525, 464, 133, 133, 197, 466, + 133, 470, 230, 230, 473, 474, 136, 136, 230, 230, + 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, + 230, 230, 37, 230, 230, 230, 230, 475, 549, 77, + 546, 133, 133, 476, 397, 477, 478, 399, 479, 480, + 491, 498, 499, 500, 397, 501, 502, 399, 503, 506, + 507, 55, 130, 509, 510, 512, 526, 517, 522, 521, + 523, 524, 133, 541, 542, 543, 547, 550, 553, 130, + 130, 562, 123, 130, 230, 600, 574, 401, 122, 607, + 582, 124, 587, 127, 583, 140, 596, 401, 563, 424, + 131, 604, 606, 141, 610, 238, 77, 616, 614, 613, + 626, 627, 632, 629, 130, 130, 634, 131, 131, 637, + 638, 131, 1, 640, 259, 230, 230, 259, 59, 259, + 271, 230, 230, 230, 230, 230, 230, 230, 230, 230, + 230, 230, 230, 230, 230, 130, 230, 230, 230, 230, + 125, 68, 131, 131, 325, 191, 205, 68, 251, 355, + 401, 362, 31, 277, 324, 197, 422, 129, 345, 324, + 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, + 324, 252, 366, 131, 129, 129, 324, 324, 129, 311, + 421, 367, 311, 324, 364, 324, 497, 230, 324, 324, + 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, + 511, 80, 453, 452, 609, 324, 324, 520, 454, 129, + 168, 311, 169, 416, 324, 85, 269, 348, 304, 424, + 611, 324, 602, 548, 159, 324, 324, 324, 324, 324, + 324, 324, 324, 324, 324, 324, 324, 324, 631, 0, + 129, 0, 0, 324, 324, 0, 0, 0, 0, 311, + 324, 0, 324, 0, 324, 324, 324, 324, 324, 324, + 324, 324, 324, 324, 324, 324, 324, 0, 0, 0, + 0, 0, 324, 324, 0, 307, 0, 4, 311, 0, + 7, 324, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 324, 8, 9, 0, 10, 0, 0, 0, + 11, 0, 0, 308, 0, 309, 310, 0, 0, 0, + 307, 0, 4, 12, 0, 7, 0, 322, 323, 324, + 0, 324, 0, 0, 0, 0, 0, 0, 8, 9, + 0, 10, 0, 0, 0, 11, 20, 21, 308, 0, + 309, 310, 0, 392, 75, 0, 0, 0, 12, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 8, 9, 0, 10, 112, 113, 114, 75, 0, + 0, 20, 21, 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, 260, 0, 115, 0, 90, 260, 260, 260, 260, + 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, + 0, 260, 260, 260, 260, 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, 75, 311, 0, 0, 324, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 0, 260, 75, 0, 112, 113, 114, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 0, 0, 0, 0, 0, 113, 114, 0, 324, 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, 0, - 0, 0, 0, 0, 0, 0, 0, 90, 75, 0, - 0, 113, 0, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 8, 9, 0, 10, 110, - 111, 112, 0, 259, 0, 0, 0, 90, 259, 259, - 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, - 259, 259, 323, 259, 259, 259, 259, 323, 323, 323, - 323, 323, 323, 323, 323, 323, 323, 323, 323, 0, - 0, 0, 0, 0, 323, 323, 0, 0, 0, 90, - 310, 0, 0, 323, 75, 0, 0, 0, 0, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 0, 0, 0, 259, 0, 111, 112, 0, 0, - 0, 0, 0, 0, 0, 353, 0, 0, 0, 75, - 0, 0, 0, 323, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 0, 0, 75, 0, - 110, 111, 112, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 90, 0, 75, 0, 0, - 111, 112, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 0, 3, 0, 4, 5, 6, 7, 111, - 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 90, 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, 0, 18, 0, 0, 19, 90, 0, - 0, 265, 0, 4, 20, 21, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, - 9, 0, 10, 0, 0, 0, 11, 0, 265, 250, - 4, 266, 267, 7, 0, 0, 0, 0, 0, 12, - 0, 0, 0, 371, 372, 373, 8, 9, 0, 10, - 0, 0, 0, 11, 0, 0, 250, 0, 266, 267, - 0, 0, 20, 21, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, - 21, + 0, 0, 20, 21, }; short tao_yycheck[] = { 12, - 12, 28, 28, 28, 17, 18, 19, 28, 2, 28, - 2, 67, 28, 67, 2, 2, 2, 20, 21, 232, - 271, 67, 67, 316, 67, 28, 67, 41, 246, 247, - 44, 41, 352, 41, 44, 41, 59, 430, 301, 260, - 123, 260, 59, 70, 70, 70, 491, 123, 41, 70, - 257, 70, 426, 221, 70, 301, 69, 320, 71, 72, - 73, 74, 40, 257, 67, 41, 79, 70, 44, 257, - 83, 37, 38, 86, 320, 41, 42, 43, 58, 45, - 44, 47, 38, 59, 303, 41, 62, 43, 307, 45, - 58, 59, 58, 59, 40, 238, 62, 43, 62, 45, - 123, 546, 58, 59, 262, 38, 62, 265, 41, 123, - 43, 38, 45, 123, 41, 123, 43, 285, 45, 58, - 59, 328, 58, 59, 257, 58, 59, 93, 94, 62, - 257, 58, 59, 301, 328, 62, 59, 93, 94, 44, - 273, 58, 59, 123, 44, 58, 273, 592, 541, 38, - 524, 596, 41, 296, 59, 123, 44, 62, 124, 59, - 93, 94, 62, 59, 59, 276, 93, 94, 124, 58, - 59, 59, 303, 62, 62, 426, 307, 190, 38, 59, - 126, 41, 302, 186, 123, 188, 123, 123, 313, 38, - 510, 124, 41, 196, 568, 328, 489, 124, 58, 59, - 123, 328, 62, 328, 93, 94, 123, 123, 41, 58, - 59, 44, 225, 62, 227, 271, 38, 271, 301, 41, - 402, 403, 404, 44, 237, 301, 59, 123, 123, 232, - 262, 263, 189, 93, 94, 124, 58, 59, 59, 41, - 62, 62, 44, 123, 93, 94, 59, 204, 251, 252, - 253, 254, 329, 330, 323, 268, 269, 59, 91, 328, - 78, 323, 257, 81, 124, 222, 328, 62, 271, 58, - 65, 93, 94, 524, 492, 124, 293, 58, 301, 257, - 573, 257, 123, 289, 37, 331, 331, 301, 331, 42, - 331, 301, 123, 301, 47, 298, 289, 290, 291, 43, - 303, 45, 124, 256, 331, 60, 320, 334, 328, 334, - 320, 257, 320, 334, 60, 334, 123, 568, 334, 137, - 59, 301, 335, 336, 59, 538, 339, 340, 331, 282, - 283, 334, 59, 301, 302, 289, 290, 291, 59, 342, - 158, 282, 283, 321, 322, 323, 324, 325, 326, 327, - 328, 59, 257, 331, 332, 125, 59, 257, 313, 314, - 315, 59, 301, 329, 330, 301, 302, 398, 399, 257, - 426, 59, 426, 329, 330, 321, 322, 323, 324, 325, - 326, 327, 328, 41, 301, 331, 332, 59, 125, 400, - 401, 13, 14, 14, 15, 59, 329, 330, 440, 441, - 58, 59, 329, 330, 62, 59, 123, 123, 123, 301, - 41, 262, 425, 440, 441, 440, 441, 60, 123, 440, - 441, 440, 441, 426, 440, 441, 40, 58, 59, 123, - 123, 62, 285, 320, 312, 93, 257, 440, 441, 59, - 329, 330, 59, 59, 59, 44, 59, 59, 59, 125, - 444, 454, 444, 59, 41, 458, 444, 444, 444, 124, - 94, 38, 93, 59, 477, 40, 124, 59, 524, 59, - 524, 58, 59, 59, 125, 62, 59, 61, 491, 59, - 329, 330, 44, 59, 91, 59, 59, 257, 257, 125, - 503, 503, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 41, 62, 93, 329, 330, 279, - 280, 262, 568, 62, 568, 285, 125, 125, 288, 62, - 125, 524, 125, 257, 292, 257, 41, 59, 41, 289, - 125, 125, 44, 546, 125, 538, 41, 124, 40, 40, - 59, 44, 123, 125, 44, 93, 41, 284, 575, 575, - 575, 564, 564, 41, 575, 41, 575, 44, 328, 575, - 293, 59, 58, 40, 125, 568, 58, 323, 305, 306, - 59, 41, 575, 44, 125, 323, 0, 314, 315, 592, - 256, 257, 319, 596, 59, 123, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 257, 277, 278, 279, 280, 256, 257, 320, 285, 125, - 257, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 257, 277, 278, 279, 280, - 262, 263, 264, 257, 59, 267, 268, 269, 270, 123, - 41, 41, 59, 125, 125, 277, 125, 123, 257, 41, - 59, 41, 328, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 59, 125, 41, 303, 477, - 279, 280, 14, 395, 397, 257, 285, 328, 396, 288, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 493, 576, 67, 67, 328, 279, 280, 380, - 15, 38, 220, 285, 41, 256, 288, 258, 239, 249, - 261, 384, 578, 532, 593, 547, 342, 65, -1, 328, - -1, 58, 59, 274, 275, 62, 277, -1, -1, -1, + 12, 30, 20, 21, 17, 18, 67, 30, 30, 67, + 30, 2, 30, 2, 30, 2, 2, 2, 248, 286, + 41, 40, 30, 44, 43, 123, 45, 41, 67, 44, + 44, 41, 41, 67, 44, 44, 41, 312, 125, 257, + 257, 70, 67, 67, 505, 59, 123, 70, 70, 67, + 70, 44, 70, 514, 70, 123, 69, 123, 71, 72, + 73, 74, 70, 257, 40, 260, 79, 59, 41, 62, + 83, 257, 472, 86, 37, 38, 89, 91, 41, 42, + 43, 58, 45, 41, 47, 38, 44, 273, 41, 59, + 43, 59, 45, 58, 59, 58, 59, 58, 59, 62, + 260, 59, 123, 276, 59, 58, 59, 126, 38, 62, + 328, 41, 243, 43, 123, 45, 58, 59, 123, 58, + 59, 58, 59, 244, 245, 301, 59, 485, 58, 59, + 93, 94, 62, 264, 328, 257, 262, 301, 540, 265, + 93, 94, 328, 303, 320, 38, 123, 307, 41, 58, + 43, 273, 45, 123, 234, 123, 320, 559, 123, 41, + 302, 124, 123, 93, 94, 58, 59, 38, 123, 62, + 41, 124, 38, 59, 187, 41, 58, 59, 196, 303, + 62, 123, 262, 307, 123, 585, 123, 58, 59, 44, + 123, 62, 58, 59, 124, 595, 62, 472, 285, 44, + 93, 94, 262, 263, 59, 38, 328, 62, 41, 340, + 223, 93, 225, 257, 59, 313, 483, 62, 41, 123, + 233, 44, 93, 94, 301, 58, 59, 93, 94, 62, + 248, 124, 44, 301, 44, 301, 59, 62, 257, 62, + 65, 323, 124, 329, 330, 263, 328, 59, 41, 59, + 62, 312, 62, 124, 312, 273, 282, 283, 124, 617, + 93, 94, 620, 302, 622, 58, 59, 323, 302, 62, + 251, 123, 328, 302, 289, 289, 305, 302, 302, 289, + 301, 257, 305, 123, 302, 305, 123, 305, 269, 305, + 271, 124, 301, 43, 312, 45, 301, 305, 328, 320, + 93, 293, 321, 322, 323, 324, 325, 326, 327, 328, + 585, 320, 331, 332, 60, 320, 289, 290, 291, 60, + 595, 339, 589, 123, 301, 343, 344, 345, 346, 37, + 59, 289, 372, 373, 42, 59, 301, 302, 59, 47, + 301, 302, 256, 356, 357, 321, 322, 323, 324, 325, + 326, 327, 328, 59, 38, 331, 332, 41, 59, 301, + 59, 125, 301, 123, 301, 486, 329, 330, 282, 283, + 289, 290, 291, 603, 58, 59, 329, 330, 62, 376, + 377, 378, 78, 412, 413, 81, 283, 284, 285, 412, + 413, 59, 412, 413, 412, 413, 412, 413, 59, 329, + 330, 59, 257, 59, 412, 413, 59, 374, 375, 93, + 94, 472, 257, 123, 472, 13, 14, 430, 431, 437, + 284, 434, 435, 14, 15, 416, 123, 416, 58, 416, + 416, 416, 450, 262, 257, 60, 329, 330, 412, 413, + 124, 305, 306, 139, 40, 257, 123, 257, 301, 123, + 314, 315, 123, 58, 472, 319, 469, 44, 329, 330, + 124, 157, 94, 329, 330, 38, 38, 285, 61, 41, + 59, 91, 485, 44, 125, 257, 125, 125, 312, 125, + 125, 41, 62, 62, 497, 62, 58, 59, 262, 125, + 62, 59, 256, 257, 59, 59, 329, 330, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 125, 277, 278, 279, 280, 59, 536, 532, + 532, 93, 94, 59, 585, 59, 59, 585, 59, 257, + 125, 59, 59, 59, 595, 59, 59, 595, 59, 59, + 59, 125, 41, 41, 59, 257, 40, 125, 44, 125, + 125, 320, 124, 123, 59, 40, 93, 41, 292, 58, + 59, 41, 591, 62, 328, 583, 41, 585, 591, 591, + 44, 591, 40, 591, 313, 591, 41, 595, 289, 125, + 41, 59, 58, 591, 125, 603, 599, 599, 293, 44, + 41, 58, 40, 59, 93, 94, 323, 58, 59, 41, + 44, 62, 0, 323, 617, 256, 257, 620, 125, 622, + 59, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 124, 277, 278, 279, 280, + 257, 123, 93, 94, 125, 59, 41, 320, 41, 257, + 257, 59, 125, 125, 257, 59, 123, 41, 41, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 125, 59, 124, 58, 59, 279, 280, 62, 125, + 123, 41, 285, 257, 273, 288, 437, 328, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 469, 14, 370, 369, 592, 279, 280, 487, 371, 93, + 67, 285, 67, 331, 288, 15, 235, 270, 247, 335, + 594, 257, 586, 535, 65, 328, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 623, -1, + 124, -1, -1, 279, 280, -1, -1, -1, -1, 285, + 257, -1, 288, -1, 328, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, -1, -1, -1, + -1, -1, 279, 280, -1, 256, -1, 258, 285, -1, + 261, 288, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 328, 274, 275, -1, 277, -1, -1, -1, 281, -1, -1, 284, -1, 286, 287, -1, -1, -1, - 256, -1, 258, 294, -1, 261, 328, 298, 299, 300, - -1, -1, -1, -1, -1, 41, 93, 94, 274, 275, + 256, -1, 258, 294, -1, 261, -1, 298, 299, 300, + -1, 328, -1, -1, -1, -1, -1, -1, 274, 275, -1, 277, -1, -1, -1, 281, 317, 318, 284, -1, - 286, 287, 58, 59, -1, 256, 62, 258, 294, -1, - 261, -1, 298, -1, -1, -1, -1, 124, -1, -1, - -1, -1, 308, 274, 275, -1, 277, 41, -1, -1, - 281, 317, 318, 284, -1, 286, 287, 93, 94, -1, - -1, -1, -1, 294, 58, 59, -1, -1, 62, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 317, 318, 124, -1, - -1, -1, -1, -1, -1, 256, 257, -1, -1, 93, - 94, 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, 257, -1, -1, -1, - 124, 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, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 328, 257, -1, - -1, 302, -1, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, -1, 277, 278, - 279, 280, -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, -1, - -1, -1, -1, -1, 279, 280, -1, -1, -1, 328, - 285, -1, -1, 288, 257, -1, -1, -1, -1, 262, + 286, 287, -1, 256, 257, -1, -1, -1, 294, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, -1, -1, -1, 328, -1, 279, 280, -1, -1, - -1, -1, -1, -1, -1, 288, -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, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 328, -1, 257, -1, -1, + 273, 274, 275, -1, 277, 278, 279, 280, 257, -1, + -1, 317, 318, 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, -1, 256, -1, 258, 259, 260, 261, 279, - 280, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 328, 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, -1, 307, -1, -1, 310, 328, -1, - -1, 256, -1, 258, 317, 318, 261, -1, -1, -1, - -1, -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, -1, -1, -1, + 270, 271, 272, 273, 274, 275, -1, 277, 278, 279, + 280, 257, -1, 302, -1, 328, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + -1, 277, 278, 279, 280, -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, 257, 285, -1, -1, 288, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, -1, 328, 257, -1, 278, 279, 280, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + -1, -1, -1, -1, -1, 279, 280, -1, 328, -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, 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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 317, - 318, + -1, -1, 317, 318, }; #define TAO_YYFINAL 1 #ifndef TAO_YYDEBUG @@ -842,9 +867,10 @@ const char *tao_yyrule[] = { "$$26 :", "$$27 :", "value_abs_decl : IDL_ABSTRACT value_header $$25 '{' $$26 exports $$27 '}'", -"value_header : value_decl opt_truncatable inheritance_spec supports_spec", "$$28 :", -"value_decl : IDL_VALUETYPE $$28 id", +"value_header : value_decl opt_truncatable inheritance_spec $$28 supports_spec", +"$$29 :", +"value_decl : IDL_VALUETYPE $$29 id", "opt_truncatable : IDL_TRUNCATABLE", "opt_truncatable :", "supports_spec : IDL_SUPPORTS at_least_one_scoped_name", @@ -857,46 +883,46 @@ const char *tao_yyrule[] = { "value_element : state_member", "value_element : export", "value_element : init_decl ';'", -"$$29 :", -"state_member : IDL_PUBLIC $$29 member_i", "$$30 :", -"state_member : IDL_PRIVATE $$30 member_i", +"state_member : IDL_PUBLIC $$30 member_i", +"$$31 :", +"state_member : IDL_PRIVATE $$31 member_i", "exports : exports export", "exports :", -"$$31 :", -"export : type_dcl $$31 ';'", "$$32 :", -"export : typeid_dcl $$32 ';'", +"export : type_dcl $$32 ';'", "$$33 :", -"export : typeprefix_dcl $$33 ';'", +"export : typeid_dcl $$33 ';'", "$$34 :", -"export : const_dcl $$34 ';'", +"export : typeprefix_dcl $$34 ';'", "$$35 :", -"export : exception $$35 ';'", +"export : const_dcl $$35 ';'", "$$36 :", -"export : attribute $$36 ';'", +"export : exception $$36 ';'", "$$37 :", -"export : operation $$37 ';'", +"export : attribute $$37 ';'", "$$38 :", -"export : error $$38 ';'", -"at_least_one_scoped_name : scoped_name scoped_names", +"export : operation $$38 ';'", "$$39 :", -"scoped_names : scoped_names ',' $$39 scoped_name", +"export : error $$39 ';'", +"at_least_one_scoped_name : scoped_name scoped_names", +"$$40 :", +"scoped_names : scoped_names ',' $$40 scoped_name", "scoped_names :", "scoped_name : id", -"$$40 :", -"scoped_name : IDL_SCOPE_DELIMITOR $$40 id", "$$41 :", -"scoped_name : scoped_name IDL_SCOPE_DELIMITOR $$41 id", +"scoped_name : IDL_SCOPE_DELIMITOR $$41 id", +"$$42 :", +"scoped_name : scoped_name IDL_SCOPE_DELIMITOR $$42 id", "id : IDENTIFIER", "interface_forward : interface_decl", "interface_forward : IDL_LOCAL interface_decl", "interface_forward : IDL_ABSTRACT interface_decl", -"$$42 :", "$$43 :", "$$44 :", "$$45 :", -"const_dcl : IDL_CONST $$42 const_type $$43 id $$44 '=' $$45 expression", +"$$46 :", +"const_dcl : IDL_CONST $$43 const_type $$44 id $$45 '=' $$46 expression", "const_type : integer_type", "const_type : char_type", "const_type : octet_type", @@ -941,15 +967,15 @@ const char *tao_yyrule[] = { "literal : IDL_TRUETOK", "literal : IDL_FALSETOK", "positive_int_expr : const_expr", -"$$46 :", -"type_dcl : IDL_TYPEDEF $$46 type_declarator", +"$$47 :", +"type_dcl : IDL_TYPEDEF $$47 type_declarator", "type_dcl : struct_type", "type_dcl : union_type", "type_dcl : enum_type", "type_dcl : IDL_NATIVE simple_declarator", "type_dcl : constructed_forward_type_spec", -"$$47 :", -"type_declarator : type_spec $$47 at_least_one_declarator", +"$$48 :", +"type_declarator : type_spec $$48 at_least_one_declarator", "type_spec : simple_type_spec", "type_spec : constructed_type_spec", "simple_type_spec : base_type_spec", @@ -972,14 +998,14 @@ const char *tao_yyrule[] = { "constructed_forward_type_spec : struct_forward_type", "constructed_forward_type_spec : union_forward_type", "at_least_one_declarator : declarator declarators", -"$$48 :", -"declarators : declarators ',' $$48 declarator", +"$$49 :", +"declarators : declarators ',' $$49 declarator", "declarators :", "declarator : simple_declarator", "declarator : complex_declarator", "at_least_one_simple_declarator : simple_declarator simple_declarators", -"$$49 :", -"simple_declarators : simple_declarators ',' $$49 simple_declarator", +"$$50 :", +"simple_declarators : simple_declarators ',' $$50 simple_declarator", "simple_declarators :", "simple_declarator : id", "complex_declarator : array_declarator", @@ -1001,31 +1027,31 @@ const char *tao_yyrule[] = { "boolean_type : IDL_BOOLEAN", "any_type : IDL_ANY", "object_type : IDL_OBJECT", -"$$50 :", -"struct_decl : IDL_STRUCT $$50 id", "$$51 :", +"struct_decl : IDL_STRUCT $$51 id", "$$52 :", "$$53 :", -"struct_type : struct_decl $$51 '{' $$52 at_least_one_member $$53 '}'", +"$$54 :", +"struct_type : struct_decl $$52 '{' $$53 at_least_one_member $$54 '}'", "at_least_one_member : member members", "members : members member", "members :", -"$$54 :", -"member : $$54 member_i", "$$55 :", +"member : $$55 member_i", "$$56 :", -"member_i : type_spec $$55 at_least_one_declarator $$56 ';'", "$$57 :", -"member_i : error $$57 ';'", +"member_i : type_spec $$56 at_least_one_declarator $$57 ';'", "$$58 :", -"union_decl : IDL_UNION $$58 id", +"member_i : error $$58 ';'", "$$59 :", +"union_decl : IDL_UNION $$59 id", "$$60 :", "$$61 :", "$$62 :", "$$63 :", "$$64 :", -"union_type : union_decl IDL_SWITCH $$59 '(' $$60 switch_type_spec $$61 ')' $$62 '{' $$63 at_least_one_case_branch $$64 '}'", +"$$65 :", +"union_type : union_decl IDL_SWITCH $$60 '(' $$61 switch_type_spec $$62 ')' $$63 '{' $$64 at_least_one_case_branch $$65 '}'", "switch_type_spec : integer_type", "switch_type_spec : char_type", "switch_type_spec : octet_type", @@ -1035,103 +1061,103 @@ const char *tao_yyrule[] = { "at_least_one_case_branch : case_branch case_branches", "case_branches : case_branches case_branch", "case_branches :", -"$$65 :", "$$66 :", -"case_branch : at_least_one_case_label $$65 element_spec $$66 ';'", "$$67 :", -"case_branch : error $$67 ';'", +"case_branch : at_least_one_case_label $$66 element_spec $$67 ';'", +"$$68 :", +"case_branch : error $$68 ';'", "at_least_one_case_label : case_label case_labels", "case_labels : case_labels case_label", "case_labels :", -"$$68 :", -"case_label : IDL_DEFAULT $$68 ':'", "$$69 :", +"case_label : IDL_DEFAULT $$69 ':'", "$$70 :", -"case_label : IDL_CASE $$69 const_expr $$70 ':'", "$$71 :", -"element_spec : type_spec $$71 declarator", +"case_label : IDL_CASE $$70 const_expr $$71 ':'", +"$$72 :", +"element_spec : type_spec $$72 declarator", "struct_forward_type : struct_decl", "union_forward_type : union_decl", -"$$72 :", "$$73 :", "$$74 :", "$$75 :", -"enum_type : IDL_ENUM $$72 id $$73 '{' $$74 at_least_one_enumerator $$75 '}'", -"at_least_one_enumerator : enumerator enumerators", "$$76 :", -"enumerators : enumerators ',' $$76 enumerator", +"enum_type : IDL_ENUM $$73 id $$74 '{' $$75 at_least_one_enumerator $$76 '}'", +"at_least_one_enumerator : enumerator enumerators", +"$$77 :", +"enumerators : enumerators ',' $$77 enumerator", "enumerators :", "enumerator : IDENTIFIER", -"$$77 :", "$$78 :", -"sequence_type_spec : seq_head ',' $$77 positive_int_expr $$78 '>'", -"sequence_type_spec : seq_head '>'", "$$79 :", +"sequence_type_spec : seq_head ',' $$78 positive_int_expr $$79 '>'", +"sequence_type_spec : seq_head '>'", "$$80 :", -"seq_head : IDL_SEQUENCE $$79 '<' $$80 simple_type_spec", "$$81 :", +"seq_head : IDL_SEQUENCE $$80 '<' $$81 simple_type_spec", "$$82 :", -"string_type_spec : string_head '<' $$81 positive_int_expr $$82 '>'", +"$$83 :", +"string_type_spec : string_head '<' $$82 positive_int_expr $$83 '>'", "string_type_spec : string_head", "string_head : IDL_STRING", -"$$83 :", "$$84 :", -"wstring_type_spec : wstring_head '<' $$83 positive_int_expr $$84 '>'", +"$$85 :", +"wstring_type_spec : wstring_head '<' $$84 positive_int_expr $$85 '>'", "wstring_type_spec : wstring_head", "wstring_head : IDL_WSTRING", -"$$85 :", -"array_declarator : id $$85 at_least_one_array_dim", +"$$86 :", +"array_declarator : id $$86 at_least_one_array_dim", "at_least_one_array_dim : array_dim array_dims", "array_dims : array_dims array_dim", "array_dims :", -"$$86 :", "$$87 :", -"array_dim : '[' $$86 positive_int_expr $$87 ']'", "$$88 :", +"array_dim : '[' $$87 positive_int_expr $$88 ']'", "$$89 :", -"attribute : opt_readonly IDL_ATTRIBUTE $$88 param_type_spec $$89 at_least_one_simple_declarator", +"$$90 :", +"attribute : opt_readonly IDL_ATTRIBUTE $$89 param_type_spec $$90 at_least_one_simple_declarator", "opt_readonly : IDL_READONLY", "opt_readonly :", -"$$90 :", "$$91 :", "$$92 :", "$$93 :", -"exception : IDL_EXCEPTION $$90 id $$91 '{' $$92 members $$93 '}'", "$$94 :", +"exception : IDL_EXCEPTION $$91 id $$92 '{' $$93 members $$94 '}'", "$$95 :", "$$96 :", "$$97 :", -"operation : opt_op_attribute op_type_spec $$94 IDENTIFIER $$95 parameter_list $$96 opt_raises $$97 opt_context", +"$$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", -"$$98 :", "$$99 :", -"init_decl : IDL_FACTORY $$98 IDENTIFIER $$99 init_parameter_list", "$$100 :", -"init_parameter_list : '(' $$100 ')'", +"init_decl : IDL_FACTORY $$99 IDENTIFIER $$100 init_parameter_list", "$$101 :", -"init_parameter_list : '(' $$101 at_least_one_in_parameter ')'", -"at_least_one_in_parameter : in_parameter in_parameters", +"init_parameter_list : '(' $$101 ')'", "$$102 :", -"in_parameters : in_parameters ',' $$102 in_parameter", -"in_parameters :", +"init_parameter_list : '(' $$102 at_least_one_in_parameter ')'", +"at_least_one_in_parameter : in_parameters in_parameter", "$$103 :", +"in_parameters : in_parameters ',' $$103 in_parameter", +"in_parameters :", "$$104 :", -"in_parameter : IDL_IN $$103 param_type_spec $$104 declarator", "$$105 :", -"parameter_list : '(' $$105 ')'", +"in_parameter : IDL_IN $$104 param_type_spec $$105 declarator", "$$106 :", -"parameter_list : '(' $$106 at_least_one_parameter ')'", -"at_least_one_parameter : parameter parameters", +"parameter_list : '(' $$106 ')'", "$$107 :", -"parameters : parameters ',' $$107 parameter", -"parameters :", +"parameter_list : '(' $$107 at_least_one_parameter ')'", +"at_least_one_parameter : parameter parameters", "$$108 :", +"parameters : parameters ',' $$108 parameter", +"parameters :", "$$109 :", -"parameter : direction $$108 param_type_spec $$109 declarator", +"$$110 :", +"parameter : direction $$109 param_type_spec $$110 declarator", "param_type_spec : base_type_spec", "param_type_spec : string_type_spec", "param_type_spec : wstring_type_spec", @@ -1139,35 +1165,47 @@ const char *tao_yyrule[] = { "direction : IDL_IN", "direction : IDL_OUT", "direction : IDL_INOUT", -"$$110 :", "$$111 :", -"opt_raises : IDL_RAISES $$110 '(' $$111 at_least_one_scoped_name ')'", -"opt_raises :", "$$112 :", +"opt_raises : IDL_RAISES $$111 '(' $$112 at_least_one_scoped_name ')'", +"opt_raises :", "$$113 :", -"opt_context : IDL_CONTEXT $$112 '(' $$113 at_least_one_string_literal ')'", +"$$114 :", +"opt_context : IDL_CONTEXT $$113 '(' $$114 at_least_one_string_literal ')'", "opt_context :", "at_least_one_string_literal : IDL_STRING_LITERAL string_literals", -"$$114 :", -"string_literals : string_literals ',' $$114 IDL_STRING_LITERAL", +"$$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", -"component_decl : component_header '{' component_exports '}'", -"component_header : IDL_COMPONENT id component_inheritance_spec supports_spec", -"component_inheritance_spec : ':' scoped_name", +"$$116 :", +"$$117 :", +"$$118 :", +"component_decl : component_header $$116 '{' $$117 component_exports $$118 '}'", +"$$119 :", +"$$120 :", +"component_header : IDL_COMPONENT id $$119 component_inheritance_spec $$120 supports_spec", +"$$121 :", +"component_inheritance_spec : ':' $$121 scoped_name", "component_inheritance_spec :", "component_exports : component_exports component_export", "component_exports :", -"component_export : provides_decl ';'", -"component_export : uses_decl ';'", -"component_export : emits_decl ';'", -"component_export : publishes_decl ';'", -"component_export : consumes_decl ';'", -"component_export : attribute ';'", +"$$122 :", +"component_export : provides_decl $$122 ';'", +"$$123 :", +"component_export : uses_decl $$123 ';'", +"$$124 :", +"component_export : emits_decl $$124 ';'", +"$$125 :", +"component_export : publishes_decl $$125 ';'", +"$$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", @@ -1177,20 +1215,36 @@ const char *tao_yyrule[] = { "emits_decl : IDL_EMITS scoped_name id", "publishes_decl : IDL_PUBLISHES scoped_name id", "consumes_decl : IDL_CONSUMES scoped_name id", -"home_decl : home_header home_body", -"home_header : IDL_HOME id home_inheritance_spec supports_spec IDL_MANAGES scoped_name primary_key_spec", -"home_inheritance_spec : ':' scoped_name", +"$$128 :", +"home_decl : home_header $$128 home_body", +"$$129 :", +"$$130 :", +"$$131 :", +"$$132 :", +"$$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", +"$$135 :", +"home_inheritance_spec : ':' $$135 scoped_name", "home_inheritance_spec :", "primary_key_spec : IDL_PRIMARYKEY scoped_name", "primary_key_spec :", -"home_body : '{' home_exports '}'", +"$$136 :", +"$$137 :", +"home_body : '{' $$136 home_exports $$137 '}'", "home_exports : home_exports home_export", "home_exports :", "home_export : export", -"home_export : factory_decl ';'", -"home_export : finder_decl ';'", -"factory_decl : IDL_FACTORY id init_parameter_list opt_raises", -"finder_decl : IDL_FINDER id init_parameter_list opt_raises", +"$$138 :", +"home_export : factory_decl $$138 ';'", +"$$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", "event : event_decl", "event : event_abs_decl", "event : event_forward_decl", @@ -1640,7 +1694,7 @@ break; case 18: { /* | value_def*/ - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeDeclSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeDeclSeen); } break; case 19: @@ -1652,7 +1706,7 @@ break; case 20: { /* | component*/ - idl_global->set_parse_state (IDL_GlobalData::PS_ComponentSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentDeclSeen); } break; case 21: @@ -1676,7 +1730,7 @@ break; case 24: { /* | event*/ - idl_global->set_parse_state (IDL_GlobalData::PS_EventSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_EventDeclSeen); } break; case 25: @@ -1758,7 +1812,7 @@ case 35: AST_Interface *i = 0; /* - * Make a new interface node and add it to its enclosing scope + * Make a new interface node and add it to its enclosing scope. */ if (s != 0 && tao_yyvsp[0].ihval != 0) { @@ -1778,17 +1832,17 @@ case 35: * Add the interface to its definition scope. */ (void) s->fe_add_interface (i); + + /* This FE_InterfaceHeader class isn't destroyed with the AST.*/ + tao_yyvsp[0].ihval->name ()->destroy (); + delete tao_yyvsp[0].ihval; + tao_yyvsp[0].ihval = 0; } /* * Push it on the scope stack. */ idl_global->scopes ().push (i); - - /* This FE_InterfaceHeader class isn't destroyed with the AST.*/ - tao_yyvsp[0].ihval->name ()->destroy (); - delete tao_yyvsp[0].ihval; - tao_yyvsp[0].ihval = 0; } break; case 36: @@ -1874,13 +1928,23 @@ break; case 43: { /* | IDL_ABSTRACT interface_decl inheritance_spec*/ - 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 abstract") - ACE_TEXT (" interfaces yet\n"))); + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + + /* + * Create an AST representation of the information in the header + * part of an interface - this representation contains a computed + * list of all interfaces which this interface inherits from, + * recursively + */ + UTL_ScopedName n (tao_yyvsp[-1].idval, + 0); + ACE_NEW_RETURN (tao_yyval.ihval, + FE_InterfaceHeader (&n, + tao_yyvsp[0].nlval, + I_FALSE, + I_TRUE, + I_TRUE), + 1); } break; case 44: @@ -1939,10 +2003,10 @@ case 53: i = AST_Interface::narrow_from_decl (v); AST_Interface::fwd_redefinition_helper (i, s); - v = AST_ValueType::narrow_from_decl (i); /* * Add the valuetype to its definition scope */ + v = AST_ValueType::narrow_from_decl (i); (void) s->fe_add_valuetype (v); } @@ -1955,22 +2019,22 @@ break; case 54: { /* '{'*/ - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceSqSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeSqSeen); } break; case 55: { /* value_elements*/ - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceBodySeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeBodySeen); } break; case 56: { /* '}'*/ - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceQsSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); /* - * Done with this interface - pop it off the scopes stack + * Done with this value type - pop it off the scopes stack */ UTL_Scope* s = idl_global->scopes ().top (); AST_Interface* m = AST_Interface::narrow_from_scope (s); @@ -2004,10 +2068,10 @@ case 57: i = AST_Interface::narrow_from_decl (v); AST_Interface::fwd_redefinition_helper (i, s); - v = AST_ValueType::narrow_from_decl (i); /* * Add the valuetype to its definition scope */ + v = AST_ValueType::narrow_from_decl (i); (void) s->fe_add_valuetype (v); } @@ -2020,19 +2084,19 @@ break; case 58: { /* '{'*/ - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceSqSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeSqSeen); } break; case 59: { /* exports*/ - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceBodySeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeBodySeen); } break; case 60: { /* '}'*/ - idl_global->set_parse_state (IDL_GlobalData::PS_InterfaceQsSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeQsSeen); /* * Done with this interface - pop it off the scopes stack. @@ -2045,34 +2109,42 @@ case 60: break; case 61: { -/* value_header : value_decl opt_truncatable inheritance_spec supports_spec*/ +/* value_header : value_decl opt_truncatable inheritance_spec */ + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + } +break; +case 62: +{ +/* supports_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); + UTL_ScopedName *sn = 0; ACE_NEW_RETURN (sn, - UTL_ScopedName (tao_yyvsp[-3].idval, + UTL_ScopedName (tao_yyvsp[-4].idval, 0), 1); ACE_NEW_RETURN (tao_yyval.vhval, - FE_obv_header (sn, - tao_yyvsp[-1].nlval, - tao_yyvsp[0].nlval, - tao_yyvsp[-2].bval), + FE_OBVHeader (sn, + tao_yyvsp[-2].nlval, + tao_yyvsp[0].nlval, + tao_yyvsp[-3].bval), 1); } break; -case 62: +case 63: { /* value_decl : IDL_VALUETYPE*/ - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeSeen); } break; -case 63: +case 64: { /* id*/ - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeIDSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeIDSeen); tao_yyval.idval = tao_yyvsp[0].idval; } break; -case 64: +case 65: { /* opt_truncatable : IDL_TRUNCATABLE*/ ACE_DEBUG ((LM_DEBUG, @@ -2082,35 +2154,35 @@ case 64: ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("truncatable modifier not supported ") ACE_TEXT ("and is ignored\n"))); - tao_yyval.bval = I_TRUE; + tao_yyval.bval = I_FALSE; } break; -case 65: +case 66: { /* | /* EMPTY * /*/ tao_yyval.bval = I_FALSE; } break; -case 66: +case 67: { /* supports_spec : IDL_SUPPORTS at_least_one_scoped_name*/ tao_yyval.nlval = tao_yyvsp[0].nlval; } break; -case 67: +case 68: { /* | /* EMPTY * /*/ tao_yyval.nlval = 0; } break; -case 68: +case 69: { /* value_forward_decl : IDL_ABSTRACT value_decl*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); UTL_ScopedName n (tao_yyvsp[0].idval, 0); AST_ValueTypeFwd *f = 0; - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeForwardSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeForwardSeen); /* * Create a node representing a forward declaration of an @@ -2119,19 +2191,19 @@ case 68: if (s != 0) { f = idl_global->gen ()->create_valuetype_fwd (&n, - I_TRUE); + I_TRUE); (void) s->fe_add_valuetype_fwd (f); } } break; -case 69: +case 70: { /* | value_decl*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); UTL_ScopedName n (tao_yyvsp[0].idval, 0); AST_ValueTypeFwd *f = 0; - idl_global->set_parse_state (IDL_GlobalData::PS_ValuetypeForwardSeen); + idl_global->set_parse_state (IDL_GlobalData::PS_ValueTypeForwardSeen); /* * Create a node representing a forward declaration of an @@ -2145,7 +2217,7 @@ case 69: } } break; -case 70: +case 71: { /* value_box_decl : value_decl type_spec*/ ACE_DEBUG ((LM_DEBUG, @@ -2157,118 +2229,118 @@ case 70: ACE_TEXT (" boxes yet\n"))); } break; -case 76: +case 77: { /* state_member : IDL_PUBLIC*/ /* is $0 to member_i */ tao_yyval.vival = AST_Field::vis_PUBLIC; } break; -case 78: +case 79: { /* IDL_PRIVATE*/ /* is $0 to member_i */ tao_yyval.vival = AST_Field::vis_PRIVATE; } break; -case 82: +case 83: { /* export : type_dcl*/ idl_global->set_parse_state (IDL_GlobalData::PS_TypeDeclSeen); } break; -case 83: +case 84: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 84: +case 85: { /* | typeid_dcl*/ idl_global->set_parse_state (IDL_GlobalData::PS_TypeIdDeclSeen); } break; -case 85: +case 86: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 86: +case 87: { /* | typeprefix_dcl*/ idl_global->set_parse_state (IDL_GlobalData::PS_TypePrefixDeclSeen); } break; -case 87: +case 88: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 88: +case 89: { /* | const_dcl*/ idl_global->set_parse_state (IDL_GlobalData::PS_ConstDeclSeen); } break; -case 89: +case 90: { /* ';'*/ idl_global->set_parse_state(IDL_GlobalData::PS_NoState); } break; -case 90: +case 91: { /* | exception*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptDeclSeen); } break; -case 91: +case 92: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 92: +case 93: { /* | attribute*/ idl_global->set_parse_state (IDL_GlobalData::PS_AttrDeclSeen); } break; -case 93: +case 94: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 94: +case 95: { /* | operation*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpDeclSeen); } break; -case 95: +case 96: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } break; -case 96: +case 97: { /* | error*/ idl_global->err()->syntax_error (idl_global->parse_state()); } break; -case 97: +case 98: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); tao_yyerrok; } break; -case 98: +case 99: { /* at_least_one_scoped_name : scoped_name scoped_names*/ ACE_NEW_RETURN (tao_yyval.nlval, @@ -2277,13 +2349,13 @@ case 98: 1); } break; -case 99: +case 100: { /* scoped_names : scoped_names ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_SNListCommaSeen); } break; -case 100: +case 101: { /* scoped_name*/ idl_global->set_parse_state (IDL_GlobalData::PS_ScopedNameSeen); @@ -2307,13 +2379,13 @@ case 100: } } break; -case 101: +case 102: { /* | /* EMPTY * /*/ tao_yyval.nlval = 0; } break; -case 102: +case 103: { /* scoped_name : id*/ idl_global->set_parse_state (IDL_GlobalData::PS_SN_IDSeen); @@ -2324,13 +2396,13 @@ case 102: 1); } break; -case 103: +case 104: { /* | IDL_SCOPE_DELIMITOR*/ idl_global->set_parse_state (IDL_GlobalData::PS_ScopeDelimSeen); } break; -case 104: +case 105: { /* id*/ idl_global->set_parse_state (IDL_GlobalData::PS_SN_IDSeen); @@ -2350,13 +2422,13 @@ case 104: 1); } break; -case 105: +case 106: { /* | scoped_name IDL_SCOPE_DELIMITOR*/ idl_global->set_parse_state (IDL_GlobalData::PS_ScopeDelimSeen); } break; -case 106: +case 107: { /* id*/ idl_global->set_parse_state (IDL_GlobalData::PS_SN_IDSeen); @@ -2370,7 +2442,7 @@ case 106: tao_yyval.idlist = tao_yyvsp[-3].idlist; } break; -case 107: +case 108: { /* id: IDENTIFIER*/ ACE_NEW_RETURN (tao_yyval.idval, @@ -2379,7 +2451,7 @@ case 107: ACE_OS::free (tao_yyvsp[0].strval); } break; -case 108: +case 109: { /* interface_forward : interface_decl*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -2401,7 +2473,7 @@ case 108: } } break; -case 109: +case 110: { /* | IDL_LOCAL interface_decl*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -2425,7 +2497,7 @@ case 109: } } break; -case 110: +case 111: { /* | IDL_ABSTRACT interface_decl*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -2449,31 +2521,31 @@ case 110: } } break; -case 111: +case 112: { /* const_dcl : IDL_CONST*/ idl_global->set_parse_state (IDL_GlobalData::PS_ConstSeen); } break; -case 112: +case 113: { /* const_type*/ idl_global->set_parse_state (IDL_GlobalData::PS_ConstTypeSeen); } break; -case 113: +case 114: { /* id*/ idl_global->set_parse_state (IDL_GlobalData::PS_ConstIDSeen); } break; -case 114: +case 115: { /* '='*/ idl_global->set_parse_state (IDL_GlobalData::PS_ConstAssignSeen); } break; -case 115: +case 116: { /* expression*/ UTL_ScopedName n (tao_yyvsp[-4].idval, @@ -2514,7 +2586,7 @@ case 115: } } break; -case 122: +case 123: { /* const_type*/ /* : integer_type*/ @@ -2527,13 +2599,13 @@ case 122: tao_yyval.etval = AST_Expression::EV_string; } break; -case 123: +case 124: { /* | wstring_type_spec*/ tao_yyval.etval = AST_Expression::EV_wstring; } break; -case 124: +case 125: { /* | scoped_name*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -2601,7 +2673,7 @@ case 124: } } break; -case 128: +case 129: { /* or_expr : xor_expr*/ /* | or_expr '|' xor_expr*/ @@ -2613,7 +2685,7 @@ case 128: ); } break; -case 130: +case 131: { /* xor_expr : and_expr*/ /* | xor_expr '^' and_expr*/ @@ -2625,7 +2697,7 @@ case 130: ); } break; -case 132: +case 133: { /* and_expr : shift_expr | and_expr '&' shift_expr*/ tao_yyval.exval = @@ -2636,7 +2708,7 @@ case 132: ); } break; -case 134: +case 135: { /* shift_expr : add_expr | shift_expr IDL_LEFT_SHIFT add_expr*/ tao_yyval.exval = @@ -2647,7 +2719,7 @@ case 134: ); } break; -case 135: +case 136: { /* | shift_expr IDL_RIGHT_SHIFT add_expr*/ tao_yyval.exval = @@ -2658,7 +2730,7 @@ case 135: ); } break; -case 137: +case 138: { /* add_expr : mult_expr | add_expr '+' mult_expr*/ tao_yyval.exval = @@ -2669,7 +2741,7 @@ case 137: ); } break; -case 138: +case 139: { /* | add_expr '-' mult_expr*/ tao_yyval.exval = @@ -2680,7 +2752,7 @@ case 138: ); } break; -case 140: +case 141: { /* mult_expr : unary_expr | mult_expr '*' unary_expr*/ tao_yyval.exval = @@ -2691,7 +2763,7 @@ case 140: ); } break; -case 141: +case 142: { /* | mult_expr '/' unary_expr*/ tao_yyval.exval = @@ -2702,7 +2774,7 @@ case 141: ); } break; -case 142: +case 143: { /* | mult_expr '%' unary_expr*/ tao_yyval.exval = @@ -2713,7 +2785,7 @@ case 142: ); } break; -case 144: +case 145: { /* unary_expr : primary_expr | '+' primary_expr*/ tao_yyval.exval = @@ -2724,7 +2796,7 @@ case 144: ); } break; -case 145: +case 146: { /* | '-' primary_expr*/ tao_yyval.exval = @@ -2735,7 +2807,7 @@ case 145: ); } break; -case 146: +case 147: { /* | '~' primary_expr*/ tao_yyval.exval = @@ -2746,7 +2818,7 @@ case 146: ); } break; -case 147: +case 148: { /* primary_expr : scoped_name*/ /* @@ -2756,7 +2828,7 @@ case 147: */ UTL_Scope *s = idl_global->scopes ().top_non_null (); AST_Decl *d = s->lookup_by_name (tao_yyvsp[0].idlist, - 1); + I_TRUE); /* * If the scoped name is an IDL constant, it may be used in an @@ -2777,71 +2849,71 @@ case 147: } } break; -case 149: +case 150: { /* | literal*/ /* | '(' const_expr ')'*/ tao_yyval.exval = tao_yyvsp[-1].exval; } break; -case 150: +case 151: { /* literal : IDL_INTEGER_LITERAL*/ tao_yyval.exval = idl_global->gen ()->create_expr (tao_yyvsp[0].ival); } break; -case 151: +case 152: { /* | IDL_UINTEGER_LITERAL*/ tao_yyval.exval = idl_global->gen ()->create_expr (tao_yyvsp[0].uival); } break; -case 152: +case 153: { /* | IDL_STRING_LITERAL*/ tao_yyval.exval = idl_global->gen ()->create_expr (tao_yyvsp[0].sval); } break; -case 153: +case 154: { /* | IDL_WSTRING_LITERAL*/ tao_yyval.exval = idl_global->gen ()->create_expr (tao_yyvsp[0].wsval); } break; -case 154: +case 155: { /* | IDL_CHARACTER_LITERAL*/ tao_yyval.exval = idl_global->gen ()->create_expr (tao_yyvsp[0].cval); } break; -case 155: +case 156: { /* | IDL_WCHAR_LITERAL*/ ACE_OutputCDR::from_wchar wc (tao_yyvsp[0].wcval); tao_yyval.exval = idl_global->gen ()->create_expr (wc); } break; -case 156: +case 157: { /* | IDL_FLOATING_PT_LITERAL*/ tao_yyval.exval = idl_global->gen ()->create_expr (tao_yyvsp[0].dval); } break; -case 157: +case 158: { /* | IDL_TRUETOK*/ tao_yyval.exval = idl_global->gen ()->create_expr ((idl_bool) I_TRUE, AST_Expression::EV_bool); } break; -case 158: +case 159: { /* | IDL_FALSETOK*/ tao_yyval.exval = idl_global->gen ()->create_expr ((idl_bool) I_FALSE, AST_Expression::EV_bool); } break; -case 159: +case 160: { /* positive_int_expr : const_expr*/ int good_expression = 1; @@ -2910,37 +2982,37 @@ case 159: } } break; -case 160: +case 161: { /* type_dcl : IDL_TYPEDEF*/ idl_global->set_parse_state (IDL_GlobalData::PS_TypedefSeen); } break; -case 161: +case 162: { /* type_declarator */ tao_yyval.ival = 0; } break; -case 162: +case 163: { /* | struct_type */ tao_yyval.ival = 0; } break; -case 163: +case 164: { /* | union_type */ tao_yyval.ival = 0; } break; -case 164: +case 165: { /* | enum_type */ tao_yyval.ival = 0; } break; -case 165: +case 166: { /* | IDL_NATIVE simple_declarator*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -2964,19 +3036,19 @@ case 165: } } break; -case 166: +case 167: { /* | constructed_forward_type_spec*/ tao_yyval.ival = 0; } break; -case 167: +case 168: { /* type_declarator : type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_TypeSpecSeen); } break; -case 168: +case 169: { /* at_least_one_declarator*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3022,7 +3094,7 @@ case 168: } } break; -case 171: +case 172: { /* simple_type_spec : base_type_spec*/ tao_yyval.dcval = @@ -3031,7 +3103,7 @@ case 171: ); } break; -case 173: +case 174: { /* | template_type_spec*/ /* | scoped_name*/ @@ -3052,7 +3124,7 @@ case 173: tao_yyval.dcval = d; } break; -case 190: +case 191: { /* at_least_one_declarator : declarator declarators*/ ACE_NEW_RETURN (tao_yyval.dlval, @@ -3061,13 +3133,13 @@ case 190: 1); } break; -case 191: +case 192: { /* declarators : declarators ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_DeclsCommaSeen); } break; -case 192: +case 193: { /* declarator*/ idl_global->set_parse_state (IDL_GlobalData::PS_DeclsDeclSeen); @@ -3091,13 +3163,13 @@ case 192: } } break; -case 193: +case 194: { /* | /* EMPTY * /*/ tao_yyval.dlval = 0; } break; -case 196: +case 197: { /* at_least_one_simple_declarator : simple_declarator simple_declarators*/ ACE_NEW_RETURN (tao_yyval.dlval, @@ -3106,13 +3178,13 @@ case 196: 1); } break; -case 197: +case 198: { /* simple_declarators : simple_declarators ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_DeclsCommaSeen); } break; -case 198: +case 199: { /* simple_declarator*/ idl_global->set_parse_state (IDL_GlobalData::PS_DeclsDeclSeen); @@ -3136,13 +3208,13 @@ case 198: } } break; -case 199: +case 200: { /* | /* EMPTY * /*/ tao_yyval.dlval = 0; } break; -case 200: +case 201: { /* simple_declarator : id*/ UTL_ScopedName *sn = 0; @@ -3157,7 +3229,7 @@ case 200: 1); } break; -case 201: +case 202: { /* complex_declarator : array_declarator*/ UTL_ScopedName *sn = 0; @@ -3174,61 +3246,61 @@ case 201: 1); } break; -case 204: +case 205: { /* signed_int : IDL_LONG*/ tao_yyval.etval = AST_Expression::EV_long; } break; -case 205: +case 206: { /* | IDL_LONG IDL_LONG*/ tao_yyval.etval = AST_Expression::EV_longlong; } break; -case 206: +case 207: { /* | IDL_SHORT*/ tao_yyval.etval = AST_Expression::EV_short; } break; -case 207: +case 208: { /* unsigned_int : IDL_UNSIGNED IDL_LONG*/ tao_yyval.etval = AST_Expression::EV_ulong; } break; -case 208: +case 209: { /* | IDL_UNSIGNED IDL_LONG IDL_LONG*/ tao_yyval.etval = AST_Expression::EV_ulonglong; } break; -case 209: +case 210: { /* | IDL_UNSIGNED IDL_SHORT*/ tao_yyval.etval = AST_Expression::EV_ushort; } break; -case 210: +case 211: { /* floating_pt_type : IDL_DOUBLE*/ tao_yyval.etval = AST_Expression::EV_double; } break; -case 211: +case 212: { /* | IDL_FLOAT*/ tao_yyval.etval = AST_Expression::EV_float; } break; -case 212: +case 213: { /* | IDL_LONG IDL_DOUBLE*/ tao_yyval.etval = AST_Expression::EV_longdouble; } break; -case 213: +case 214: { /* fixed_type : IDL_FIXED*/ ACE_DEBUG ((LM_DEBUG, @@ -3240,56 +3312,56 @@ case 213: ACE_TEXT (" fixed types yet\n"))); } break; -case 214: +case 215: { /* char_type : IDL_CHAR*/ tao_yyval.etval = AST_Expression::EV_char; } break; -case 215: +case 216: { /* | IDL_WCHAR*/ tao_yyval.etval = AST_Expression::EV_wchar; } break; -case 216: +case 217: { /* octet_type : IDL_OCTET*/ tao_yyval.etval = AST_Expression::EV_octet; } break; -case 217: +case 218: { /* boolean_type : IDL_BOOLEAN*/ tao_yyval.etval = AST_Expression::EV_bool; } break; -case 218: +case 219: { /* any_type : IDL_ANY*/ tao_yyval.etval = AST_Expression::EV_any; } break; -case 219: +case 220: { /* object_type : IDL_OBJECT*/ tao_yyval.etval = AST_Expression::EV_object; } break; -case 220: +case 221: { /* struct_decl : IDL_STRUCT*/ idl_global->set_parse_state (IDL_GlobalData::PS_StructSeen); } break; -case 221: +case 222: { /* id*/ idl_global->set_parse_state (IDL_GlobalData::PS_StructIDSeen); tao_yyval.idval = tao_yyvsp[0].idval; } break; -case 222: +case 223: { /* struct_type : struct_header*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3318,19 +3390,19 @@ case 222: idl_global->scopes ().push (d); } break; -case 223: +case 224: { /* '{'*/ idl_global->set_parse_state (IDL_GlobalData::PS_StructSqSeen); } break; -case 224: +case 225: { /* at_least_one_member*/ idl_global->set_parse_state (IDL_GlobalData::PS_StructBodySeen); } break; -case 225: +case 226: { /* '}'*/ idl_global->set_parse_state (IDL_GlobalData::PS_StructQsSeen); @@ -3344,26 +3416,26 @@ case 225: idl_global->scopes ().pop (); } break; -case 229: +case 230: { /* member :*/ /* is $0 to member_i */ tao_yyval.vival = AST_Field::vis_NA; } break; -case 231: +case 232: { /* member_i : type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_MemberTypeSeen); } break; -case 232: +case 233: { /* at_least_one_declarator*/ idl_global->set_parse_state (IDL_GlobalData::PS_MemberDeclsSeen); } break; -case 233: +case 234: { /* ';'*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3418,51 +3490,51 @@ case 233: } } break; -case 234: +case 235: { /* | error*/ idl_global->err()->syntax_error (idl_global->parse_state ()); } break; -case 235: +case 236: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); tao_yyerrok; } break; -case 236: +case 237: { /* union_decl : IDL_UNION*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionSeen); } break; -case 237: +case 238: { /* id*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionIDSeen); tao_yyval.idval = tao_yyvsp[0].idval; } break; -case 238: +case 239: { /* union_type : union_decl IDL_SWITCH*/ idl_global->set_parse_state (IDL_GlobalData::PS_SwitchSeen); } break; -case 239: +case 240: { /* '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_SwitchOpenParSeen); } break; -case 240: +case 241: { /* switch_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_SwitchTypeSeen); } break; -case 241: +case 242: { /* ')'*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3502,19 +3574,19 @@ case 241: idl_global->scopes ().push (u); } break; -case 242: +case 243: { /* '{'*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionSqSeen); } break; -case 243: +case 244: { /* at_least_one_case_branch*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionBodySeen); } break; -case 244: +case 245: { /* '}'*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionQsSeen); @@ -3532,7 +3604,7 @@ case 244: } } break; -case 245: +case 246: { /* switch_type_spec : integer_type*/ tao_yyval.dcval = @@ -3541,7 +3613,7 @@ case 245: ); } break; -case 246: +case 247: { /* | char_type*/ /* wchars are not allowed. */ @@ -3556,7 +3628,7 @@ case 246: ); } break; -case 247: +case 248: { /* | octet_type*/ /* octets are not allowed. */ @@ -3567,7 +3639,7 @@ case 247: ); } break; -case 248: +case 249: { /* | boolean_type*/ tao_yyval.dcval = @@ -3576,7 +3648,7 @@ case 248: ); } break; -case 250: +case 251: { /* | enum_type*/ /* | scoped_name*/ @@ -3672,19 +3744,19 @@ case 250: } } break; -case 254: +case 255: { /* case_branch : at_least_one_case_label*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionLabelSeen); } break; -case 255: +case 256: { /* element_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionElemSeen); } break; -case 256: +case 257: { /* ';'*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3710,20 +3782,20 @@ case 256: } } break; -case 257: +case 258: { /* | error*/ idl_global->err()->syntax_error (idl_global->parse_state()); } break; -case 258: +case 259: { /* ';'*/ idl_global->set_parse_state (IDL_GlobalData::PS_NoState); tao_yyerrok; } break; -case 259: +case 260: { /* at_least_one_case_label : case_label case_labels*/ ACE_NEW_RETURN (tao_yyval.llval, @@ -3732,7 +3804,7 @@ case 259: 1); } break; -case 260: +case 261: { /* case_labels : case_labels case_label*/ if (tao_yyvsp[-1].llval == 0) @@ -3754,19 +3826,19 @@ case 260: } } break; -case 261: +case 262: { /* | /* EMPTY * /*/ tao_yyval.llval = 0; } break; -case 262: +case 263: { /* case_label : IDL_DEFAULT*/ idl_global->set_parse_state (IDL_GlobalData::PS_DefaultSeen); } break; -case 263: +case 264: { /* ':'*/ idl_global->set_parse_state (IDL_GlobalData::PS_LabelColonSeen); @@ -3777,18 +3849,18 @@ case 263: ); } break; -case 264: +case 265: { /* | IDL_CASE*/ idl_global->set_parse_state (IDL_GlobalData::PS_CaseSeen); } break; -case 265: +case 266: { idl_global->set_parse_state (IDL_GlobalData::PS_LabelExprSeen); } break; -case 266: +case 267: { /* const_expr*/ idl_global->set_parse_state (IDL_GlobalData::PS_LabelColonSeen); @@ -3799,13 +3871,13 @@ case 266: ); } break; -case 267: +case 268: { /* element_spec : type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionElemTypeSeen); } break; -case 268: +case 269: { /* declarator*/ idl_global->set_parse_state (IDL_GlobalData::PS_UnionElemDeclSeen); @@ -3845,7 +3917,7 @@ case 268: } } break; -case 269: +case 270: { /* struct_forward_type : struct_decl*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3863,7 +3935,7 @@ case 269: } } break; -case 270: +case 271: { /* union_forward_type : union_decl*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3881,13 +3953,13 @@ case 270: } } break; -case 271: +case 272: { /* enum_type : IDL_ENUM*/ idl_global->set_parse_state (IDL_GlobalData::PS_EnumSeen); } break; -case 272: +case 273: { /* id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3917,19 +3989,19 @@ case 272: idl_global->scopes ().push (e); } break; -case 273: +case 274: { /* '{'*/ idl_global->set_parse_state (IDL_GlobalData::PS_EnumSqSeen); } break; -case 274: +case 275: { /* at_least_one_enumerator*/ idl_global->set_parse_state (IDL_GlobalData::PS_EnumBodySeen); } break; -case 275: +case 276: { /* '}'*/ idl_global->set_parse_state (IDL_GlobalData::PS_EnumQsSeen); @@ -3950,13 +4022,13 @@ case 275: } } break; -case 277: +case 278: { /* enumerators : enumerators ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_EnumCommaSeen); } break; -case 280: +case 281: { /* enumerator : IDENTIFIER*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -3987,19 +4059,19 @@ case 280: } } break; -case 281: +case 282: { /* sequence_type_spec : seq_head ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_SequenceCommaSeen); } break; -case 282: +case 283: { /* positive_int_expr*/ idl_global->set_parse_state (IDL_GlobalData::PS_SequenceExprSeen); } break; -case 283: +case 284: { /* '>'*/ idl_global->set_parse_state (IDL_GlobalData::PS_SequenceQsSeen); @@ -4053,7 +4125,7 @@ case 283: } } break; -case 284: +case 285: { /* | seq_head '>'*/ idl_global->set_parse_state (IDL_GlobalData::PS_SequenceQsSeen); @@ -4101,7 +4173,7 @@ case 284: } } break; -case 285: +case 286: { /* seq_head : IDL_SEQUENCE*/ idl_global->set_parse_state (IDL_GlobalData::PS_SequenceSeen); @@ -4112,32 +4184,32 @@ case 285: idl_global->scopes ().push (0); } break; -case 286: +case 287: { /* '<'*/ idl_global->set_parse_state (IDL_GlobalData::PS_SequenceSqSeen); } break; -case 287: +case 288: { /* simple_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_SequenceTypeSeen); tao_yyval.dcval = tao_yyvsp[0].dcval; } break; -case 288: +case 289: { /* string_type_spec : string_head '<'*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringSqSeen); } break; -case 289: +case 290: { /* positive_int_expr*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringExprSeen); } break; -case 290: +case 291: { /* '>'*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringQsSeen); @@ -4166,7 +4238,7 @@ case 290: } } break; -case 291: +case 292: { /* | string_head*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringCompleted); @@ -4187,25 +4259,25 @@ case 291: ); } break; -case 292: +case 293: { /* string_head : IDL_STRING*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringSeen); } break; -case 293: +case 294: { /* wstring_type_spec : wstring_head '<'*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringSqSeen); } break; -case 294: +case 295: { /* positive_int_expr*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringExprSeen); } break; -case 295: +case 296: { /* '>'*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringQsSeen); @@ -4232,7 +4304,7 @@ case 295: } } break; -case 296: +case 297: { /* | wstring_head*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringCompleted); @@ -4252,19 +4324,19 @@ case 296: ); } break; -case 297: +case 298: { /* wstring_head : IDL_WSTRING*/ idl_global->set_parse_state (IDL_GlobalData::PS_StringSeen); } break; -case 298: +case 299: { /* array_declarator : id*/ idl_global->set_parse_state (IDL_GlobalData::PS_ArrayIDSeen); } break; -case 299: +case 300: { /* at_least_one_array_dim*/ idl_global->set_parse_state (IDL_GlobalData::PS_ArrayCompleted); @@ -4287,7 +4359,7 @@ case 299: } } break; -case 300: +case 301: { /* at_least_one_array_dim : array_dim array_dims*/ ACE_NEW_RETURN (tao_yyval.elval, @@ -4296,7 +4368,7 @@ case 300: 1); } break; -case 301: +case 302: { /* array_dims : array_dims array_dim*/ if (tao_yyvsp[-1].elval == 0) @@ -4318,25 +4390,25 @@ case 301: } } break; -case 302: +case 303: { /* | /* EMPTY * /*/ tao_yyval.elval = 0; } break; -case 303: +case 304: { /* array_dim : '['*/ idl_global->set_parse_state (IDL_GlobalData::PS_DimSqSeen); } break; -case 304: +case 305: { /* positive_int_expr*/ idl_global->set_parse_state (IDL_GlobalData::PS_DimExprSeen); } break; -case 305: +case 306: { /* ']'*/ idl_global->set_parse_state (IDL_GlobalData::PS_DimQsSeen); @@ -4358,19 +4430,19 @@ case 305: } } break; -case 306: +case 307: { /* attribute : opt_readonly IDL_ATTRIBUTE*/ idl_global->set_parse_state (IDL_GlobalData::PS_AttrSeen); } break; -case 307: +case 308: { /* param_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_AttrTypeSeen); } break; -case 308: +case 309: { /* at_least_one_simple_declarator*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4420,26 +4492,26 @@ case 308: } } break; -case 309: +case 310: { /* opt_readonly : IDL_READONLY*/ idl_global->set_parse_state (IDL_GlobalData::PS_AttrROSeen); tao_yyval.bval = I_TRUE; } break; -case 310: +case 311: { /* | /* EMPTY * /*/ tao_yyval.bval = I_FALSE; } break; -case 311: +case 312: { /* exception : IDL_EXCEPTION*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptSeen); } break; -case 312: +case 313: { /* id*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4466,19 +4538,19 @@ case 312: idl_global->scopes ().push (e); } break; -case 313: +case 314: { /* '{'*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptSqSeen); } break; -case 314: +case 315: { /* members*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptBodySeen); } break; -case 315: +case 316: { /* '}'*/ idl_global->set_parse_state (IDL_GlobalData::PS_ExceptQsSeen); @@ -4488,18 +4560,19 @@ case 315: idl_global->scopes ().pop (); } break; -case 316: +case 317: { /* operation : opt_op_attribute op_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpTypeSeen); } break; -case 317: +case 318: { /* IDENTIFIER*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); Identifier id (tao_yyvsp[0].strval); - UTL_ScopedName n (&id, 0); + UTL_ScopedName n (&id, + 0); AST_Operation *o = 0; idl_global->set_parse_state (IDL_GlobalData::PS_OpIDSeen); @@ -4541,19 +4614,19 @@ case 317: idl_global->scopes ().push (o); } break; -case 318: +case 319: { /* parameter_list*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParsCompleted); } break; -case 319: +case 320: { /* opt_raises*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); } break; -case 320: +case 321: { /* opt_context*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4584,27 +4657,27 @@ case 320: idl_global->scopes ().pop (); } break; -case 321: +case 322: { /* opt_op_attribute : IDL_ONEWAY*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpAttrSeen); tao_yyval.ofval = AST_Operation::OP_oneway; } break; -case 322: +case 323: { /* | IDL_IDEMPOTENT*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpAttrSeen); tao_yyval.ofval = AST_Operation::OP_idempotent; } break; -case 323: +case 324: { /* | /* EMPTY * /*/ tao_yyval.ofval = AST_Operation::OP_noflags; } break; -case 325: +case 326: { /* op_type_spec : param_type_spec | IDL_VOID*/ tao_yyval.dcval = @@ -4613,14 +4686,14 @@ case 325: ); } break; -case 326: +case 327: { /* init_decl : IDL_FACTORY */ /*@@ PS_FactorySeen?*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpTypeSeen); } break; -case 327: +case 328: { /* IDENTIFIER */ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4658,7 +4731,7 @@ case 327: idl_global->scopes ().push (factory); } break; -case 328: +case 329: { /* init_parameter_list*/ /* TODO: replace parameter_list with rule that accepts only IN args */ @@ -4667,49 +4740,49 @@ case 328: idl_global->scopes ().pop (); } break; -case 329: +case 330: { /* init_parameter_list : '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpSqSeen); } break; -case 330: +case 331: { /* ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpQsSeen); } break; -case 331: +case 332: { /* | '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpSqSeen); } break; -case 332: +case 333: { /* at_least_one_in_parameter ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpQsSeen); } break; -case 334: +case 335: { /* in_parameters : in_parameters ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParCommaSeen); } break; -case 337: +case 338: { /* in_parameter : IDL_IN*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParDirSeen); } break; -case 338: +case 339: { /* param_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParTypeSeen); } break; -case 339: +case 340: { /* declarator*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4739,49 +4812,49 @@ case 339: } } break; -case 340: +case 341: { /* parameter_list : '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpSqSeen); } break; -case 341: +case 342: { /* ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpQsSeen); } break; -case 342: +case 343: { /* | '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpSqSeen); } break; -case 343: +case 344: { /* at_least_one_parameter ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpQsSeen); } break; -case 345: +case 346: { /* parameters : parameters ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParCommaSeen); } break; -case 348: +case 349: { /* parameter : direction*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParDirSeen); } break; -case 349: +case 350: { /* param_type_spec*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpParTypeSeen); } break; -case 350: +case 351: { /* declarator*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -4825,7 +4898,7 @@ case 350: } } break; -case 351: +case 352: { /* param_type_spec : base_type_spec*/ tao_yyval.dcval = @@ -4834,7 +4907,7 @@ case 351: ); } break; -case 354: +case 355: { /* | string_type_spec*/ /* | wstring_type_spec*/ @@ -4871,75 +4944,75 @@ case 354: tao_yyval.dcval = d; } break; -case 355: +case 356: { /* direction : IDL_IN*/ tao_yyval.dival = AST_Argument::dir_IN; } break; -case 356: +case 357: { /* | IDL_OUT*/ tao_yyval.dival = AST_Argument::dir_OUT; } break; -case 357: +case 358: { /* | IDL_INOUT*/ tao_yyval.dival = AST_Argument::dir_INOUT; } break; -case 358: +case 359: { /* opt_raises : IDL_RAISES*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseSeen); } break; -case 359: +case 360: { /* '('*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseSqSeen); } break; -case 360: +case 361: { /* at_least_one_scoped_name ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseQsSeen); tao_yyval.nlval = tao_yyvsp[-1].nlval; } break; -case 361: +case 362: { tao_yyval.nlval = 0; /* | /* EMPTY * /*/ } break; -case 362: +case 363: { /* opt_context : IDL_CONTEXT*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpContextSeen); } break; -case 363: +case 364: { idl_global->set_parse_state (IDL_GlobalData::PS_OpContextSqSeen); /* '('*/ } break; -case 364: +case 365: { /* at_least_one_string_literal ')'*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpContextQsSeen); tao_yyval.slval = tao_yyvsp[-1].slval; } break; -case 365: +case 366: { /* | /* EMPTY * /*/ tao_yyval.slval = 0; } break; -case 366: +case 367: { /* at_least_one_string_literal : IDL_STRING_LITERAL string_literals*/ ACE_NEW_RETURN (tao_yyval.slval, @@ -4948,13 +5021,13 @@ case 366: 1); } break; -case 367: +case 368: { /* string_literals : string_literals ','*/ idl_global->set_parse_state (IDL_GlobalData::PS_OpContextCommaSeen); } break; -case 368: +case 369: { /* IDL_STRING_LITERAL*/ if (tao_yyvsp[-3].slval == 0) @@ -4976,13 +5049,13 @@ case 368: } } break; -case 369: +case 370: { /* | /* EMPTY * /*/ tao_yyval.slval = 0; } break; -case 370: +case 371: { /* typeid_dcl : IDL_TYPEID scoped_name IDL_STRING_LITERAL*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5001,7 +5074,7 @@ case 370: } } break; -case 371: +case 372: { /* typeprefix_dcl : IDL_TYPEPREFIX scoped_name IDL_STRING_LITERAL*/ UTL_Scope *s = idl_global->scopes ().top_non_null (); @@ -5020,6 +5093,661 @@ case 371: } } break; +case 375: +{ +/* component_forward_decl : IDL_COMPONENT id*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n (tao_yyvsp[0].idval, + 0); + AST_ComponentFwd *f = 0; + idl_global->set_parse_state ( + IDL_GlobalData::PS_ComponentForwardSeen + ); + + /* + * Create a node representing a forward declaration of a + * component. Store it in the enclosing scope. + */ + if (s != 0) + { + f = idl_global->gen ()->create_component_fwd (&n); + (void) s->fe_add_component_fwd (f); + } + } +break; +case 376: +{ +/* component_decl : component_header */ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Component *c = 0; + + /* + * Make a new component node and add it to the enclosing scope. + */ + if (s != 0 && tao_yyvsp[0].chval != 0) + { + c = + idl_global->gen ()->create_component ( + tao_yyvsp[0].chval->name (), + tao_yyvsp[0].chval->base_component (), + tao_yyvsp[0].chval->supports (), + tao_yyvsp[0].chval->n_supports (), + tao_yyvsp[0].chval->supports_flat (), + tao_yyvsp[0].chval->n_supports_flat () + ); + AST_Interface *i = AST_Interface::narrow_from_decl (c); + AST_Interface::fwd_redefinition_helper (i, + s); + /* + * Add the component to its definition scope. + */ + c = AST_Component::narrow_from_decl (i); + (void) s->fe_add_component (c); + + /* This FE_ComponentHeader class isn't destroyed with the AST.*/ + tao_yyvsp[0].chval->name ()->destroy (); + delete tao_yyvsp[0].chval; + tao_yyvsp[0].chval = 0; + } + + /* + * Push it on the scope stack. + */ + idl_global->scopes ().push (c); + } +break; +case 377: +{ +/* '{'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentSqSeen); + } +break; +case 378: +{ +/* component_exports*/ + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentBodySeen); + } +break; +case 379: +{ +/* '}'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentQsSeen); + + /* + * Done with this component - pop it off the scopes stack. + */ + UTL_Scope* s = idl_global->scopes ().top (); + AST_Interface* m = AST_Interface::narrow_from_scope (s); + m->inherited_name_clash (); + idl_global->scopes ().pop (); + } +break; +case 380: +{ +/* id*/ + idl_global->set_parse_state (IDL_GlobalData::PS_ComponentIDSeen); + } +break; +case 381: +{ +/* component_inheritance_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + } +break; +case 382: +{ +/* supports_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); + + /* + * Create an AST representation of the information in the header + * part of a component. + */ + UTL_ScopedName n (tao_yyvsp[-4].idval, + 0); + ACE_NEW_RETURN (tao_yyval.chval, + FE_ComponentHeader (&n, + tao_yyvsp[-2].idlist, + tao_yyvsp[0].nlval, + I_FALSE), + 1); + } +break; +case 383: +{ +/* component_inheritance_spec : ':'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_InheritColonSeen); + } +break; +case 384: +{ +/* scoped_name*/ + tao_yyval.idlist = tao_yyvsp[0].idlist; + } +break; +case 385: +{ +/* | /* EMPTY * /*/ + tao_yyval.idlist = 0; + } +break; +case 388: +{ +/* component_export : provides_decl*/ + idl_global->set_parse_state (IDL_GlobalData::PS_ProvidesDeclSeen); + } +break; +case 389: +{ +/* ';'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } +break; +case 390: +{ +/* | uses_decl*/ + idl_global->set_parse_state (IDL_GlobalData::PS_UsesDeclSeen); + } +break; +case 391: +{ +/* ';'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } +break; +case 392: +{ +/* | emits_decl*/ + idl_global->set_parse_state (IDL_GlobalData::PS_EmitsDeclSeen); + } +break; +case 393: +{ +/* ';'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } +break; +case 394: +{ +/* | publishes_decl*/ + idl_global->set_parse_state (IDL_GlobalData::PS_PublishesDeclSeen); + } +break; +case 395: +{ +/* ';'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } +break; +case 396: +{ +/* | consumes_decl*/ + idl_global->set_parse_state (IDL_GlobalData::PS_ConsumesDeclSeen); + } +break; +case 397: +{ +/* ';'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } +break; +case 398: +{ +/* | attribute*/ + idl_global->set_parse_state (IDL_GlobalData::PS_AttrDeclSeen); + } +break; +case 399: +{ +/* ';'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } +break; +case 400: +{ +/* provides_decl : IDL_PROVIDES 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_Component::port_description pd; + pd.id = tao_yyvsp[0].idval; + pd.impl = tao_yyvsp[-1].idlist; + c->provides ().enqueue_tail (pd); + } + } +break; +case 401: +{ +/* interface_type : scoped_name*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Decl *d = s->lookup_by_name (tao_yyvsp[0].idlist, + I_TRUE); + + if (d == 0) + { + idl_global->err ()->lookup_error (tao_yyvsp[0].idlist); + } + else if (d->node_type () != AST_Decl::NT_interface) + { + idl_global->err ()->interface_expected (d); + } + + tao_yyval.idlist = tao_yyvsp[0].idlist; + } +break; +case 402: +{ +/* | IDL_OBJECT*/ + Identifier *corba_id = 0; + ACE_NEW_RETURN (corba_id, + Identifier ("Object"), + 1); + UTL_IdList *conc_name = 0; + ACE_NEW_RETURN (conc_name, + UTL_IdList (corba_id, + 0), + 1); + ACE_NEW_RETURN (corba_id, + Identifier ("CORBA"), + 1); + UTL_IdList *corba_name = 0; + ACE_NEW_RETURN (corba_name, + UTL_IdList (corba_id, + conc_name), + 1); + tao_yyval.idlist = corba_name; + } +break; +case 403: +{ +/* 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_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); + } + } +break; +case 404: +{ +/* opt_multiple : IDL_MULTIPLE*/ + tao_yyval.bval = I_TRUE; + } +break; +case 405: +{ +/* | /* EMPTY * /*/ + tao_yyval.bval = I_FALSE; + } +break; +case 406: +{ +/* emits_decl : IDL_EMITS scoped_name id*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + 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_valuetype) + { + idl_global->err ()->valuetype_expected (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 = tao_yyvsp[-1].idlist; + c->emits ().enqueue_tail (pd); + } + } +break; +case 407: +{ +/* publishes_decl : IDL_PUBLISHES scoped_name id*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + 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_valuetype) + { + idl_global->err ()->valuetype_expected (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 = tao_yyvsp[-1].idlist; + c->publishes ().enqueue_tail (pd); + } + } +break; +case 408: +{ +/* consumes_decl : IDL_CONSUMES scoped_name id*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + 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_valuetype) + { + idl_global->err ()->valuetype_expected (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 = tao_yyvsp[-1].idlist; + c->consumes ().enqueue_tail (pd); + } + } +break; +case 409: +{ +/* home_decl : home_header */ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Home *h = 0; + + /* + * Make a new home node and add it to the enclosing scope. + */ + if (s != 0 && tao_yyvsp[0].hhval != 0) + { + h = + idl_global->gen ()->create_home ( + tao_yyvsp[0].hhval->name (), + tao_yyvsp[0].hhval->base_home (), + tao_yyvsp[0].hhval->managed_component (), + tao_yyvsp[0].hhval->primary_key (), + tao_yyvsp[0].hhval->supports (), + tao_yyvsp[0].hhval->n_supports (), + tao_yyvsp[0].hhval->supports_flat (), + tao_yyvsp[0].hhval->n_supports_flat () + ); + /* + * Add the home to its definition scope. + */ + (void) s->fe_add_home (h); + + /* This FE_HomeHeader class isn't destroyed with the AST.*/ + tao_yyvsp[0].hhval->name ()->destroy (); + delete tao_yyvsp[0].hhval; + tao_yyvsp[0].hhval = 0; + } + + /* + * Push it on the scope stack. + */ + idl_global->scopes ().push (h); + } +break; +case 411: +{ +/* home_header : IDL_HOME*/ + idl_global->set_parse_state (IDL_GlobalData::PS_HomeSeen); + } +break; +case 412: +{ +/* id*/ + idl_global->set_parse_state (IDL_GlobalData::PS_HomeIDSeen); + } +break; +case 413: +{ +/* home_inheritance_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_InheritSpecSeen); + } +break; +case 414: +{ +/* supports_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_SupportSpecSeen); + } +break; +case 415: +{ +/* IDL_MANAGES*/ + idl_global->set_parse_state (IDL_GlobalData::PS_ManagesSeen); + } +break; +case 416: +{ +/* scoped_name*/ + idl_global->set_parse_state (IDL_GlobalData::PS_ManagesIDSeen); + } +break; +case 417: +{ +/* primary_key_spec*/ + idl_global->set_parse_state (IDL_GlobalData::PS_PrimaryKeySpecSeen); + + /* + * Create an AST representation of the information in the header + * part of a component home. + */ + UTL_ScopedName n (tao_yyvsp[-10].idval, + 0); + ACE_NEW_RETURN (tao_yyval.hhval, + FE_HomeHeader (&n, + tao_yyvsp[-8].idlist, + tao_yyvsp[-6].nlval, + tao_yyvsp[-2].idlist, + tao_yyvsp[0].idlist), + 1); + } +break; +case 418: +{ +/* home_inheritance_spec ':' */ + idl_global->set_parse_state (IDL_GlobalData::PS_InheritColonSeen); + } +break; +case 419: +{ +/* scoped_name*/ + tao_yyval.idlist = tao_yyvsp[0].idlist; + } +break; +case 420: +{ +/* | /* EMPTY * /*/ + tao_yyval.idlist = 0; + } +break; +case 421: +{ +/* primary_key_spec : IDL_PRIMARYKEY scoped_name*/ + tao_yyval.idlist = tao_yyvsp[0].idlist; + } +break; +case 422: +{ +/* | /* EMPTY * /*/ + tao_yyval.idlist = 0; + } +break; +case 423: +{ +/* home_body : '{'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_HomeSqSeen); + } +break; +case 424: +{ +/* home_exports*/ + idl_global->set_parse_state (IDL_GlobalData::PS_HomeBodySeen); + } +break; +case 425: +{ +/* '}'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_HomeQsSeen); + } +break; +case 429: +{ +/* home_export : factory_decl*/ + idl_global->set_parse_state (IDL_GlobalData::PS_FactoryDeclSeen); + } +break; +case 430: +{ +/* | ';'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } +break; +case 431: +{ +/* | finder_decl*/ + idl_global->set_parse_state (IDL_GlobalData::PS_FinderDeclSeen); + } +break; +case 432: +{ +/* | ';'*/ + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } +break; +case 433: +{ +/* factory_decl : IDL_FACTORY id*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n (tao_yyvsp[0].idval, + 0); + AST_Operation *o = 0; + idl_global->set_parse_state (IDL_GlobalData::PS_OpIDSeen); + + /* + * Create a node representing a factory operation + * and add it to the enclosing scope. + */ + 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, + AST_Operation::OP_noflags, + &n, + I_TRUE, + I_FALSE + ); + (void) s->fe_add_operation (o); + home->factories ().enqueue_tail (o); + } + + ACE_OS::free (tao_yyvsp[0].idval); + tao_yyvsp[0].idval = 0; + + /* + * Push the operation scope onto the scopes stack. + */ + idl_global->scopes ().push (o); + } +break; +case 434: +{ +/* init_parameter_list*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpParsCompleted); + } +break; +case 435: +{ +/* opt_raises*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); + + /* + * Done with this operation. Pop its scope from the scopes stack. + */ + idl_global->scopes ().pop (); + } +break; +case 436: +{ +/* finder_decl : IDL_FINDER id*/ + UTL_Scope *s = idl_global->scopes ().top_non_null (); + UTL_ScopedName n (tao_yyvsp[0].idval, + 0); + AST_Operation *o = 0; + idl_global->set_parse_state (IDL_GlobalData::PS_OpIDSeen); + + /* + * Create a node representing a finder operation + * and add it to the enclosing scope. + */ + 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, + AST_Operation::OP_noflags, + &n, + I_TRUE, + I_FALSE + ); + (void) s->fe_add_operation (o); + home->finders ().enqueue_tail (o); + } + + ACE_OS::free (tao_yyvsp[0].idval); + tao_yyvsp[0].idval = 0; + + /* + * Push the operation scope onto the scopes stack. + */ + idl_global->scopes ().push (o); + } +break; +case 437: +{ +/* init_parameter_list*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpParsCompleted); + } +break; +case 438: +{ +/* opt_raises*/ + idl_global->set_parse_state (IDL_GlobalData::PS_OpRaiseCompleted); + + /* + * Done with this operation. Pop its scope from the scopes stack. + */ + idl_global->scopes ().pop (); + } +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 392ae2e6dc6..c79ca35e9a6 100644 --- a/TAO/TAO_IDL/fe/y.tab.h +++ b/TAO/TAO_IDL/fe/y.tab.h @@ -83,7 +83,8 @@ typedef union { UTL_LabelList *llval; /* Label list */ UTL_DeclList *dlval; /* Declaration list */ FE_InterfaceHeader *ihval; /* Interface header */ - FE_obv_header *vhval; /* Valuetype header */ + FE_OBVHeader *vhval; /* Valuetype header */ + FE_ComponentHeader *chval; /* Component header */ AST_Expression *exval; /* Expression value */ AST_UnionLabel *ulval; /* Union label */ AST_Field *ffval; /* Field value */ diff --git a/TAO/TAO_IDL/include/ast_component.h b/TAO/TAO_IDL/include/ast_component.h index de6fd16bb0c..5e5c801a675 100644 --- a/TAO/TAO_IDL/include/ast_component.h +++ b/TAO/TAO_IDL/include/ast_component.h @@ -21,13 +21,24 @@ public: virtual ~AST_Component (void); + // This also calls the base class version. + virtual void redefine (AST_Interface *from); + // Utility data structure for a 'uses' declaration. struct uses_description { - AST_Interface *receptacle; + Identifier *id; + UTL_ScopedName *impl; idl_bool is_multiple; }; + // Utility data structure for all other port declarations. + struct port_description + { + Identifier *id; + UTL_ScopedName *impl; + }; + // Accessors. AST_Component *base_component (void) const; @@ -36,20 +47,15 @@ public: long n_supports (void) const; - ACE_Unbounded_Queue<AST_Interface *> &provides (void); - void provides (AST_Interface *d); + ACE_Unbounded_Queue<port_description> &provides (void); - ACE_Unbounded_Queue<uses_description *> &uses (void); - void uses (uses_description *d); + ACE_Unbounded_Queue<uses_description> &uses (void); - ACE_Unbounded_Queue<AST_ValueType *> &emits (void); - void emits (AST_ValueType *d); + ACE_Unbounded_Queue<port_description> &emits (void); - ACE_Unbounded_Queue<AST_ValueType *> &publishes (void); - void publishes (AST_ValueType *d); + ACE_Unbounded_Queue<port_description> &publishes (void); - ACE_Unbounded_Queue<AST_ValueType *> &consumes (void); - void consumes (AST_ValueType *d); + ACE_Unbounded_Queue<port_description> &consumes (void); // Cleanup function. virtual void destroy (void); @@ -67,11 +73,11 @@ public: private: AST_Component *pd_base_component; - ACE_Unbounded_Queue<AST_Interface *> pd_provides; - ACE_Unbounded_Queue<uses_description *> pd_uses; - ACE_Unbounded_Queue<AST_ValueType *> pd_emits; - ACE_Unbounded_Queue<AST_ValueType *> pd_publishes; - ACE_Unbounded_Queue<AST_ValueType *> pd_consumes; + ACE_Unbounded_Queue<port_description> pd_provides; + ACE_Unbounded_Queue<uses_description> pd_uses; + ACE_Unbounded_Queue<port_description> pd_emits; + ACE_Unbounded_Queue<port_description> pd_publishes; + ACE_Unbounded_Queue<port_description> pd_consumes; }; #endif // _AST_COMPONENT_AST_COMPONENT_HH diff --git a/TAO/TAO_IDL/include/ast_constant.h b/TAO/TAO_IDL/include/ast_constant.h index 011cd0ab5af..c94aae1ff6a 100644 --- a/TAO/TAO_IDL/include/ast_constant.h +++ b/TAO/TAO_IDL/include/ast_constant.h @@ -105,6 +105,15 @@ public: idl_bool ifr_added (void); void ifr_added (idl_bool val); + const char *exprtype_to_string (void); + // Returns the appropriate type. + + static const char *exprtype_to_string (AST_Expression::ExprType et); + // For use with ORBs without the CORBA namespace. + + UTL_ScopedName *enum_full_name (void); + // If our type is enum, we have to generate the scoped name. + // Narrowing DEF_NARROW_METHODS1(AST_Constant, AST_Decl); DEF_NARROW_FROM_DECL(AST_Constant); diff --git a/TAO/TAO_IDL/include/ast_decl.h b/TAO/TAO_IDL/include/ast_decl.h index d44d0d936c2..5173758aa3c 100644 --- a/TAO/TAO_IDL/include/ast_decl.h +++ b/TAO/TAO_IDL/include/ast_decl.h @@ -197,6 +197,7 @@ public: void set_name (UTL_ScopedName *n); Identifier *local_name (void); + void local_name (Identifier *id); Identifier *compute_local_name (const char *prefix, const char *sufix); @@ -205,6 +206,9 @@ public: virtual const char *full_name (void); // Return the stringified full name. + const char *flat_name (void); + // Return the flattened full scoped name. + const char *repoID (void); void repoID (char *value); // Accessors for the repository ID. @@ -268,6 +272,41 @@ public: // Return TRUE if "this" is a child of "s". idl_bool is_child (AST_Decl *s); + idl_bool is_nested (void); + // Determines if we are inside of a nested scope or not. + + // Boolean methods to test if code was already generated. + idl_bool cli_hdr_gen (void); + idl_bool cli_stub_gen (void); + idl_bool cli_inline_gen (void); + idl_bool srv_hdr_gen (void); + idl_bool impl_hdr_gen (void); + idl_bool srv_skel_gen (void); + idl_bool impl_skel_gen (void); + idl_bool srv_inline_gen (void); + idl_bool cli_hdr_any_op_gen (void); + idl_bool cli_stub_any_op_gen (void); + idl_bool cli_hdr_cdr_op_gen (void); + idl_bool cli_stub_cdr_op_gen (void); + idl_bool cli_inline_cdr_op_gen (void); + idl_bool cli_inline_cdr_decl_gen (void); + + // Set the flag indicating that code generation is done. + void cli_hdr_gen (idl_bool); + void cli_stub_gen (idl_bool); + void cli_inline_gen (idl_bool); + void srv_hdr_gen (idl_bool); + void impl_hdr_gen (idl_bool); + void srv_skel_gen (idl_bool); + void impl_skel_gen (idl_bool); + void srv_inline_gen (idl_bool); + void cli_hdr_any_op_gen (idl_bool); + void cli_stub_any_op_gen (idl_bool); + void cli_hdr_cdr_op_gen (idl_bool); + void cli_stub_cdr_op_gen (idl_bool); + void cli_inline_cdr_op_gen (idl_bool); + void cli_inline_cdr_decl_gen (idl_bool); + protected: // These are not private because they're used by // be_predefined_type' constructor. @@ -281,6 +320,9 @@ protected: void compute_full_name (void); // Computes the stringified scoped name. + void compute_flat_name (void); + // Compute the flattened fully scoped name. + private: // Data @@ -328,6 +370,25 @@ private: idl_bool typeid_set_; // Has our repo id been set by a typeId declaration? + // Variables that indicate if the code generation for that node is already + // been done. This way we avoid regenerating same code. + idl_bool cli_hdr_gen_; + idl_bool cli_stub_gen_; + idl_bool cli_inline_gen_; + idl_bool srv_hdr_gen_; + idl_bool impl_hdr_gen_; + idl_bool srv_skel_gen_; + idl_bool impl_skel_gen_; + idl_bool srv_inline_gen_; + idl_bool cli_hdr_any_op_gen_; + idl_bool cli_stub_any_op_gen_; + idl_bool cli_hdr_cdr_op_gen_; + idl_bool cli_stub_cdr_op_gen_; + idl_bool cli_inline_cdr_op_gen_; + idl_bool cli_inline_cdr_decl_gen_; + + char *flat_name_; + // Flattened fully scoped name. // Operations void compute_full_name (UTL_ScopedName *n); diff --git a/TAO/TAO_IDL/include/ast_generator.h b/TAO/TAO_IDL/include/ast_generator.h index 5d90e19706b..c8ed5e484ca 100644 --- a/TAO/TAO_IDL/include/ast_generator.h +++ b/TAO/TAO_IDL/include/ast_generator.h @@ -161,7 +161,11 @@ public: UTL_ScopedName *n, AST_Home *base_home, AST_Component *managed_component, - AST_ValueType *primary_key + AST_ValueType *primary_key, + AST_Interface **supports, + long n_supports, + AST_Interface **supports_flat, + long n_supports_flat ); // Create a node representing an exception. diff --git a/TAO/TAO_IDL/include/ast_home.h b/TAO/TAO_IDL/include/ast_home.h index 712783903bc..1b731f7c2e1 100644 --- a/TAO/TAO_IDL/include/ast_home.h +++ b/TAO/TAO_IDL/include/ast_home.h @@ -19,7 +19,11 @@ public: AST_Home (UTL_ScopedName *n, AST_Home *base_home, AST_Component *managed_component, - AST_ValueType *primary_key); + AST_ValueType *primary_key, + AST_Interface **supports, + long n_supports, + AST_Interface **supports_flat, + long n_supports_flat); virtual ~AST_Home (void); @@ -32,10 +36,8 @@ public: AST_ValueType *primary_key (void) const; ACE_Unbounded_Queue<AST_Operation *> &factories (void); - void factories (AST_Operation *d); ACE_Unbounded_Queue<AST_Operation *> &finders (void); - void finders (AST_Operation *d); // Cleanup function. virtual void destroy (void); diff --git a/TAO/TAO_IDL/include/ast_interface.h b/TAO/TAO_IDL/include/ast_interface.h index 38f49479eba..9985f38b5cf 100644 --- a/TAO/TAO_IDL/include/ast_interface.h +++ b/TAO/TAO_IDL/include/ast_interface.h @@ -90,7 +90,7 @@ public: virtual ~AST_Interface (void); - // This serves for both interfaces and value types. + // This serves for both interfaces, value types and components. static void fwd_redefinition_helper (AST_Interface *&i, UTL_Scope *s); @@ -156,11 +156,11 @@ protected: virtual AST_Exception *fe_add_exception (AST_Exception *e); - virtual AST_Attribute *fe_add_attribute(AST_Attribute *a); + virtual AST_Attribute *fe_add_attribute (AST_Attribute *a); virtual AST_Field *fe_add_field (AST_Field *o); - virtual AST_Operation *fe_add_operation(AST_Operation *o); + virtual AST_Operation *fe_add_operation (AST_Operation *o); virtual AST_Union *fe_add_union (AST_Union *u); @@ -177,6 +177,11 @@ protected: virtual AST_Typedef *fe_add_typedef (AST_Typedef *t); virtual AST_Native *fe_add_native (AST_Native *n); + + // Lookup based on the local name, override of UTL_Scope definition. + // This version checks for redefinitions of attributes or operations. + AST_Decl *lookup_for_add (AST_Decl *d, + idl_bool treat_as_ref); }; #endif // _AST_INTERFACE_AST_INTERFACE_HH diff --git a/TAO/TAO_IDL/include/ast_operation.h b/TAO/TAO_IDL/include/ast_operation.h index 94b7bc3f91f..1e14ee1071e 100644 --- a/TAO/TAO_IDL/include/ast_operation.h +++ b/TAO/TAO_IDL/include/ast_operation.h @@ -108,6 +108,9 @@ public: // Public operations. + int void_return_type (void); + /// Returns 1 if the operation has a void return type. + /// Return the number of arguments virtual int argument_count (void); @@ -139,6 +142,9 @@ 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. + // Cleanup function. virtual void destroy (void); diff --git a/TAO/TAO_IDL/include/ast_type.h b/TAO/TAO_IDL/include/ast_type.h index 4d39064dcf5..28c4b9c20d4 100644 --- a/TAO/TAO_IDL/include/ast_type.h +++ b/TAO/TAO_IDL/include/ast_type.h @@ -124,6 +124,11 @@ public: idl_bool ifr_fwd_added (void); void ifr_fwd_added (idl_bool val); + const char *nested_type_name (AST_Decl *d, + const char *suffix = 0, + const char *prefix = 0); + // Type name of a node used when generating declarations. + // Narrowing. DEF_NARROW_METHODS1(AST_Type, AST_Decl); DEF_NARROW_FROM_DECL(AST_Type); @@ -138,6 +143,13 @@ protected: virtual int compute_size_type (void); // Determine our size type and set it if it is unknown. + const char *nested_name (const char *local_name, + const char *full_name, + AST_Decl *use_scope, + const char *suffix, + const char *prefix); + // Type name of a node used when generating declarations. + // Has the full definition been added to the Interface Repository? // Used for types which can have members and can be forward declared. idl_bool ifr_added_; @@ -151,6 +163,9 @@ protected: idl_bool has_constructor_; // Attribute that helps a union determine whether a member // should be included by value or by reference. + + char *nested_type_name_; + // For the corresponding method. }; #endif // _AST_TYPE_AST_TYPE_HH diff --git a/TAO/TAO_IDL/include/fe_interface_header.h b/TAO/TAO_IDL/include/fe_interface_header.h index 550aa92f952..d5f61ebb910 100644 --- a/TAO/TAO_IDL/include/fe_interface_header.h +++ b/TAO/TAO_IDL/include/fe_interface_header.h @@ -67,20 +67,24 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #ifndef _FE_INTERFACE_HEADER_FE_INTERFACE_HH #define _FE_INTERFACE_HEADER_FE_INTERFACE_HH -#include "TAO_IDL_FE_Export.h" #include "utl_scoped_name.h" class UTL_NameList; class AST_Interface; class AST_ValueType; +class AST_Component; +class AST_Home; +// FE_interfade_header // Internal class for FE to describe interface headers // // FE_obv_header -// Internal class for FE to describe valuetype headers +// Internal class for FE to describe valuetype headers. // +// FE_component_header +// Internal class for FE to describe component headers. -class TAO_IDL_FE_Export FE_InterfaceHeader +class FE_InterfaceHeader { public: FE_InterfaceHeader (UTL_ScopedName *n, @@ -91,7 +95,7 @@ public: virtual ~FE_InterfaceHeader (void); - // Data Accessors + // Data Accessors. UTL_ScopedName *name (void) const; AST_Interface **inherits (void) const; long n_inherits (void) const; @@ -104,7 +108,7 @@ public: idl_bool is_abstract (void) const; // See if we are an abstract interface. - // Data + // Data. protected: UTL_ScopedName *pd_interface_name; @@ -119,13 +123,13 @@ protected: idl_bool pd_is_local; idl_bool pd_is_abstract; - // Operations + // Operations. // Compile the flattened unique list of interfaces which this // interface inherits from. protected: - void compile_inheritance (UTL_NameList *ifaces, - idl_bool for_valuetype); + virtual void compile_inheritance (UTL_NameList *ifaces, + idl_bool for_valuetype); void compile_one_inheritance (AST_Interface *i); @@ -135,24 +139,24 @@ protected: }; -class FE_obv_header : public FE_InterfaceHeader +class FE_OBVHeader : public FE_InterfaceHeader { public: - FE_obv_header (UTL_ScopedName *n, - UTL_NameList *inherits, - UTL_NameList *supports, - idl_bool truncatable); - virtual ~FE_obv_header (void); + FE_OBVHeader (UTL_ScopedName *n, + UTL_NameList *inherits, + UTL_NameList *supports, + idl_bool truncatable); + virtual ~FE_OBVHeader (void); - // Data Accessors + // Data Accessors. AST_Interface **supports (void) const; long n_supports (void) const; AST_ValueType *inherits_concrete (void) const; AST_Interface *supports_concrete (void) const; idl_bool truncatable (void) const; -private: +protected: // Supported interfaces. AST_Interface **pd_supports; long pd_n_supports; @@ -163,9 +167,68 @@ private: // Currently ignored. idl_bool pd_truncatable; -private: +protected: void compile_supports (UTL_NameList *supports); idl_bool check_concrete_supported_inheritance (AST_Interface *d); }; +// 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 +{ +public: + + FE_ComponentHeader (UTL_ScopedName *n, + UTL_ScopedName *base_component, + UTL_NameList *supports, + idl_bool compile_now); + virtual ~FE_ComponentHeader (void); + + // Data Accessors. + AST_Component *base_component (void) const; + AST_Interface **supports (void) const; + long n_supports (void) const; + AST_Interface **supports_flat (void) const; + long n_supports_flat (void) const; + +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 +// store the 'managed_component' member of the derived class. +// 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 +{ +public: + + FE_HomeHeader (UTL_ScopedName *n, + UTL_ScopedName *base_home, + UTL_NameList *supports, + UTL_ScopedName *managed_component, + UTL_ScopedName *primary_key); + virtual ~FE_HomeHeader (void); + + // Data Accessors. + AST_Home *base_home (void) const; + AST_Component *managed_component (void) const; + AST_ValueType *primary_key (void) const; + +protected: + AST_Home *pd_base_home; + AST_ValueType *pd_primary_key; + +protected: + virtual void compile_inheritance (UTL_NameList *supports, + idl_bool for_valuetype); +}; + #endif // _FE_INTERFACE_HEADER_FE_INTERFACE_HH diff --git a/TAO/TAO_IDL/include/idl_defines.h b/TAO/TAO_IDL/include/idl_defines.h index 17b2bc4d71e..6f86e74d154 100644 --- a/TAO/TAO_IDL/include/idl_defines.h +++ b/TAO/TAO_IDL/include/idl_defines.h @@ -84,4 +84,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #define IDL_CF_INFORMATIVE (long)(1 << 4) #define IDL_CF_NOWARNINGS (long)(1 << 5) +#define NAMEBUFSIZE 1024 +// Maximum length of static buffers used to store names. + #endif // _IDL_DEFINES_IDL_DEFINES_HH diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index d2e9272a0ec..9f9a2710f21 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -102,25 +102,53 @@ public: , PS_ExceptDeclSeen // Seen complete exception declaration , PS_InterfaceDeclSeen // Seen complete interface declaration , PS_ModuleDeclSeen // Seen complete module declaration - , PS_ValuetypeDeclSeen // Seen complete valuetype declaration + , PS_ValueTypeDeclSeen // Seen complete valuetype declaration + , PS_ComponentDeclSeen // Seen complete component declaration + , PS_HomeDeclSeen // Seen complete home declaration + , PS_EventDeclSeen // Seen complete eventtype declartion , PS_AttrDeclSeen // Seen complete attribute declaration , PS_OpDeclSeen // Seen complete operation declaration + , PS_ProvidesDeclSeen // Seen complete privides declaration + , PS_UsesDeclSeen // Seen complete uses declaration + , PS_EmitsDeclSeen // Seen complete emits declaration + , PS_PublishesDeclSeen // Seen complete publishes declaration + , PS_FactoryDeclSeen // Seen complete factory declaration + , PS_FinderDeclSeen // Seen complete finder declaration + , PS_ConsumesDeclSeen // Seen complete subscribes declaration , PS_ModuleSeen // Seen a MODULE keyword , PS_ModuleIDSeen // Seen the module ID , PS_ModuleSqSeen // '{' seen for module , PS_ModuleQsSeen // '}' seen for module , PS_ModuleBodySeen // Seen complete module body + , PS_InheritColonSeen // Seen ':' in inheritance list + , PS_InheritSpecSeen // Seen a complete inheritance spec + , PS_SupportSpecSeen // Seen a complete supports spec + , PS_ManagesSeen // Seen a MANAGES keyword + , PS_ManagesIDSeen // Seen the scoped name referred to by MANAGES + , PS_PrimaryKeySpecSeen // Seen a complete primary key spec , PS_InterfaceSeen // Seen an INTERFACE keyword , PS_InterfaceIDSeen // Seen the interface ID - , PS_InheritSpecSeen // Seen a complete inheritance spec , PS_InterfaceForwardSeen // Forward interface decl seen - , PS_ValuetypeForwardSeen // Forward valuetype decl seen , PS_InterfaceSqSeen // '{' seen for interface , PS_InterfaceQsSeen // '}' seen for interface , PS_InterfaceBodySeen // Seen an interface body - , PS_InheritColonSeen // Seen ':' in inheritance list - , PS_ValuetypeSeen // Seen a VALUETYPE keyword - , PS_ValuetypeIDSeen // Seen the valuetype ID + , PS_ValueTypeSeen // Seen a VALUETYPE keyword + , PS_ValueTypeForwardSeen // Forward valuetype decl seen + , PS_ValueTypeIDSeen // Seen the valuetype ID + , PS_ValueTypeSqSeen // '{' seen for value type + , PS_ValueTypeQsSeen // '}' seen for value type + , PS_ValueTypeBodySeen // Seen a value type body + , PS_ComponentSeen // Seen a component declaration + , PS_ComponentIDSeen // Seen the component ID + , PS_ComponentForwardSeen // Seen a forward declaration of a component + , PS_ComponentSqSeen // '{' seen for component + , PS_ComponentQsSeen // '}' seen for component + , PS_ComponentBodySeen // Seen a component body + , PS_HomeSeen // Seen a home declaration + , PS_HomeIDSeen // Seen the home ID + , PS_HomeSqSeen // '{' seen for home + , PS_HomeQsSeen // '}' seen for home + , PS_HomeBodySeen // Seen a home body , PS_SNListCommaSeen // Seen ',' in list of scoped names , PS_ScopedNameSeen // Seen a complete scoped name , PS_SN_IDSeen // Seen an identifier as part of a scoped name @@ -217,9 +245,6 @@ public: , PS_DeclsDeclSeen // Seen complete decl in decls list , PS_NativeSeen // Seen a native declaration , PS_PragmaPrefixSyntax // Could not parse the #pragma prefix - , PS_EventSeen // Seen an event declaration - , PS_ComponentSeen // Seen a component declaration - , PS_HomeDeclSeen // Seen a home declaration }; // Constructor @@ -374,6 +399,12 @@ public: virtual idl_bool case_diff_error (void); // are we strict about case-only differences or not? + virtual void nest_orb (idl_bool); + // Set on or off whether we are using the NEST ORB. + + virtual idl_bool nest_orb (void); + // are we beIng used with the NEST ORB? + virtual void destroy (void); // Cleanup function. @@ -459,6 +490,9 @@ private: // Do we report an error for indentifiers in the same scope that differ // only by case? or just a warning? + idl_bool nest_orb_; + // Is this front end being used for the NEST ORB? + ACE_CString idl_flags_; // Concatenation of all the command line options. diff --git a/TAO/TAO_IDL/include/utl_err.h b/TAO/TAO_IDL/include/utl_err.h index 2d294c676d2..85537fe8fc4 100644 --- a/TAO/TAO_IDL/include/utl_err.h +++ b/TAO/TAO_IDL/include/utl_err.h @@ -111,6 +111,8 @@ public: EIDL_INHERIT_FWD_ERROR, // Cannot inherit from fwd decl interface EIDL_SUPPORTS_FWD_ERROR, // Cannot support a fwd decl interface EIDL_CONSTANT_EXPECTED, // We got something else.. + EIDL_INTERFACE_EXPECTED, // We got something else.. + EIDL_VALUETYPE_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 @@ -235,6 +237,16 @@ public: void constant_expected (UTL_ScopedName *n, AST_Decl *d); + // Report a situation where an interface was expected but we got + // something else instead. This most likely is a case in a supports + // or inheritance list. + void interface_expected (AST_Decl *d); + + // Report a situation where an 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 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 b6acdea3da1..a40cc055387 100644 --- a/TAO/TAO_IDL/include/utl_scope.h +++ b/TAO/TAO_IDL/include/utl_scope.h @@ -154,6 +154,12 @@ public: virtual AST_ValueTypeFwd *add_valuetype_fwd (AST_ValueTypeFwd *i); + virtual AST_Component *add_component (AST_Component *i); + + virtual AST_ComponentFwd *add_component_fwd (AST_ComponentFwd *i); + + virtual AST_Home *add_home (AST_Home *i); + virtual AST_Constant *add_constant (AST_Constant *c); virtual AST_Exception *add_exception (AST_Exception *e); @@ -349,6 +355,12 @@ private: virtual AST_ValueTypeFwd *fe_add_valuetype_fwd (AST_ValueTypeFwd *i); + virtual AST_Component *fe_add_component (AST_Component *i); + + virtual AST_ComponentFwd *fe_add_component_fwd (AST_ComponentFwd *i); + + virtual AST_Home *fe_add_home (AST_Home *i); + virtual AST_Constant *fe_add_constant (AST_Constant *i); virtual AST_Exception *fe_add_exception (AST_Exception *e); diff --git a/TAO/TAO_IDL/tao_idl.cpp b/TAO/TAO_IDL/tao_idl.cpp index a7875e313e2..75f30225c44 100644 --- a/TAO/TAO_IDL/tao_idl.cpp +++ b/TAO/TAO_IDL/tao_idl.cpp @@ -195,9 +195,8 @@ DRV_init (void) ** ** LOGIC: ** -** 1. Initialize the CFE, stage 1. This builds the scope stack ** 2. Initialize the BE. This builds an instance of the generator -** 3. Initialize the CFE, stage 2. This builds the global scope +** 3. Initialize the FE. This builds the global scope ** and populates it with the predefined types ** 4. Invoke FE_yyparse ** 5. Check for errors from FE_yyparse. If any, exit now diff --git a/TAO/TAO_IDL/util/utl_err.cpp b/TAO/TAO_IDL/util/utl_err.cpp index c5e50103d8e..49f92726a2b 100644 --- a/TAO/TAO_IDL/util/utl_err.cpp +++ b/TAO/TAO_IDL/util/utl_err.cpp @@ -150,6 +150,10 @@ error_string (UTL_Error::ErrorCode c) 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_EVAL_ERROR: return "expression evaluation error: "; case UTL_Error::EIDL_NAME_CASE_ERROR: @@ -251,18 +255,29 @@ exprtype_to_string (AST_Expression::ExprType t) static const char * parse_state_to_error_message (IDL_GlobalData::ParseState ps) { - switch (ps) { + switch (ps) + { case IDL_GlobalData::PS_NoState: return "Statement cannot be parsed"; case IDL_GlobalData::PS_TypeDeclSeen: return "Malformed typedef declaration"; + case IDL_GlobalData::PS_TypeIdDeclSeen: + return "Malformed type id declaration"; + case IDL_GlobalData::PS_TypePrefixDeclSeen: + return "Malformed type prefix declaration"; case IDL_GlobalData::PS_ConstDeclSeen: return "Malformed const declaration"; case IDL_GlobalData::PS_ExceptDeclSeen: return "Malformed exception declaration"; case IDL_GlobalData::PS_InterfaceDeclSeen: return "Malformed interface declaration"; - case IDL_GlobalData::PS_ValuetypeDeclSeen: + case IDL_GlobalData::PS_ValueTypeDeclSeen: + return "Malformed value type declaration"; + case IDL_GlobalData::PS_ComponentDeclSeen: + return "Malformed value type declaration"; + case IDL_GlobalData::PS_HomeDeclSeen: + return "Malformed home declaration"; + case IDL_GlobalData::PS_EventDeclSeen: return "Malformed value type declaration"; case IDL_GlobalData::PS_ModuleDeclSeen: return "Malformed module declaration"; @@ -270,6 +285,20 @@ parse_state_to_error_message (IDL_GlobalData::ParseState ps) return "Malformed attribute declaration"; case IDL_GlobalData::PS_OpDeclSeen: return "Malformed operation declaration"; + case IDL_GlobalData::PS_ProvidesDeclSeen: + return "Malformed provides declaration"; + case IDL_GlobalData::PS_UsesDeclSeen: + return "Malformed uses declaration"; + case IDL_GlobalData::PS_EmitsDeclSeen: + return "Malformed emits declaration"; + case IDL_GlobalData::PS_PublishesDeclSeen: + return "Malformed publishes declaration"; + case IDL_GlobalData::PS_ConsumesDeclSeen: + return "Malformed consumes declaration"; + case IDL_GlobalData::PS_FactoryDeclSeen: + return "Malformed factory declaration"; + case IDL_GlobalData::PS_FinderDeclSeen: + return "Malformed finder declaration"; case IDL_GlobalData::PS_ModuleSeen: return "Missing module identifier following MODULE keyword"; case IDL_GlobalData::PS_ModuleIDSeen: @@ -280,32 +309,68 @@ parse_state_to_error_message (IDL_GlobalData::ParseState ps) return "Illegal syntax following module '}' closer"; case IDL_GlobalData::PS_ModuleBodySeen: return "Illegal syntax following module body statement(s)"; - case IDL_GlobalData::PS_InterfaceSeen: - return "Missing interface identifier following INTERFACE keyword"; - case IDL_GlobalData::PS_ValuetypeSeen: - return "Missing interface identifier following VALUETYPE keyword"; - case IDL_GlobalData::PS_InterfaceIDSeen: - return "Illegal syntax following interface identifier"; - case IDL_GlobalData::PS_ValuetypeIDSeen: - return "Illegal syntax following value type identifier"; + case IDL_GlobalData::PS_InheritColonSeen: + return "Illegal syntax following ':' starting inheritance list"; case IDL_GlobalData::PS_InheritSpecSeen: return "Missing '{' or illegal syntax following inheritance spec"; + case IDL_GlobalData::PS_SupportSpecSeen: + return "Missing '{' or illegal syntax following support spec"; + case IDL_GlobalData::PS_ManagesSeen: + return "Missing component identifier following MANAGES keyword"; + case IDL_GlobalData::PS_ManagesIDSeen: + return "Illegal syntax following managed component identifier"; + case IDL_GlobalData::PS_PrimaryKeySpecSeen: + return "Illegal syntax following primary key spec"; + case IDL_GlobalData::PS_InterfaceSeen: + return "Missing interface identifier following INTERFACE keyword"; case IDL_GlobalData::PS_InterfaceForwardSeen: return "Missing ';' following forward interface declaration"; - case IDL_GlobalData::PS_ValuetypeForwardSeen: - return "Missing ';' following forward value type declaration"; - case IDL_GlobalData::PS_StructForwardSeen: - return "Missing ';' following forward struct declaration"; - case IDL_GlobalData::PS_UnionForwardSeen: - return "Missing ';' following forward union declaration"; + case IDL_GlobalData::PS_InterfaceIDSeen: + return "Missing '{' or illegal syntax following interface identifier"; case IDL_GlobalData::PS_InterfaceSqSeen: return "Illegal syntax following interface '{' opener"; case IDL_GlobalData::PS_InterfaceQsSeen: return "Illegal syntax following interface '}' closer"; case IDL_GlobalData::PS_InterfaceBodySeen: return "Illegal syntax following interface body statement(s)"; - case IDL_GlobalData::PS_InheritColonSeen: - return "Illegal syntax following ':' starting inheritance list"; + case IDL_GlobalData::PS_ValueTypeSeen: + return "Missing interface identifier following VALUETYPE keyword"; + case IDL_GlobalData::PS_ValueTypeForwardSeen: + return "Missing ';' following forward value type declaration"; + case IDL_GlobalData::PS_ValueTypeIDSeen: + return "Missing '{' or illegal syntax following value type identifier"; + case IDL_GlobalData::PS_ValueTypeSqSeen: + return "Illegal syntax following value type '{' opener"; + case IDL_GlobalData::PS_ValueTypeQsSeen: + 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_ComponentSeen: + return "Missing component identifier following COMPONENT keyword"; + case IDL_GlobalData::PS_ComponentForwardSeen: + return "Missing ';' following forward component declaration"; + case IDL_GlobalData::PS_ComponentIDSeen: + return "Missing '{' or illegal syntax following component identifier"; + case IDL_GlobalData::PS_ComponentSqSeen: + return "Illegal syntax following component '{' opener"; + case IDL_GlobalData::PS_ComponentQsSeen: + return "Illegal syntax following component '}' closer"; + case IDL_GlobalData::PS_ComponentBodySeen: + return "Illegal syntax following component body statement(s)"; + case IDL_GlobalData::PS_HomeSeen: + return "Missing component identifier following HOME keyword"; + case IDL_GlobalData::PS_HomeIDSeen: + return "Missing '{' or illegal syntax following home identifier"; + case IDL_GlobalData::PS_HomeSqSeen: + return "Illegal syntax following home '{' opener"; + case IDL_GlobalData::PS_HomeQsSeen: + return "Illegal syntax following home '}' closer"; + case IDL_GlobalData::PS_HomeBodySeen: + return "Illegal syntax following home body statement(s)"; + case IDL_GlobalData::PS_StructForwardSeen: + return "Missing ';' following forward struct declaration"; + case IDL_GlobalData::PS_UnionForwardSeen: + return "Missing ';' following forward union declaration"; case IDL_GlobalData::PS_SNListCommaSeen: return "Found illegal scoped name in scoped name list"; case IDL_GlobalData::PS_ScopedNameSeen: @@ -855,7 +920,7 @@ UTL_Error::constant_expected (UTL_ScopedName *n, idl_error_header (EIDL_CONSTANT_EXPECTED, d->line (), d->file_name ()); - n->dump (*ACE_DEFAULT_LOG_STREAM);; + n->dump (*ACE_DEFAULT_LOG_STREAM); ACE_ERROR ((LM_ERROR, " bound to ")); d->dump (*ACE_DEFAULT_LOG_STREAM); @@ -864,6 +929,36 @@ UTL_Error::constant_expected (UTL_ScopedName *n, idl_global->set_err_count (idl_global->err_count () + 1); } +// Report a situation where an interface was expected but we got +// something else instead. This most likely is a case in a supports +// or inheritance list. +void +UTL_Error::interface_expected (AST_Decl *d) +{ + idl_error_header (EIDL_INTERFACE_EXPECTED, + d->line (), + d->file_name ()); + 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 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 +UTL_Error::valuetype_expected (AST_Decl *d) +{ + idl_error_header (EIDL_VALUETYPE_EXPECTED, + d->line (), + d->file_name ()); + 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 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_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index ae8ea732cfc..2f8e26abad4 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -115,6 +115,7 @@ IDL_GlobalData::IDL_GlobalData (void) obv_support_ (I_FALSE), component_support_ (I_FALSE), case_diff_error_ (I_TRUE), + nest_orb_ (I_FALSE), idl_flags_ (""), last_seen_index_ (1) { @@ -470,19 +471,9 @@ IDL_GlobalData::store_include_file_name (UTL_String *n) unsigned long i; long seen = this->seen_include_file_before (n); - // Check if we need to store it at all or whether we've seen it already + // Check if we need to store it at all or whether we've seen it already. if (seen) { - if (seen != this->last_seen_index_) - { - // If it's not the same as the current filename, then we have - // just finished with some other included file, and its - // (possible empty) prefix must be popped. - char *trash = 0; - idl_global->pragma_prefixes ().pop (trash); - delete [] trash; - } - this->last_seen_index_ = seen; return; } @@ -497,16 +488,22 @@ IDL_GlobalData::store_include_file_name (UTL_String *n) if (this->pd_n_alloced_file_names == 0) { this->pd_n_alloced_file_names = INCREMENT; - this->pd_include_file_names = new UTL_String *[this->pd_n_alloced_file_names]; + ACE_NEW (this->pd_include_file_names, + UTL_String *[this->pd_n_alloced_file_names]); } else { o_include_file_names = this->pd_include_file_names; o_n_alloced_file_names = this->pd_n_alloced_file_names; this->pd_n_alloced_file_names += INCREMENT; - this->pd_include_file_names = new UTL_String *[this->pd_n_alloced_file_names]; - for (i = 0; i < o_n_alloced_file_names; i++) - this->pd_include_file_names[i] = o_include_file_names[i]; + ACE_NEW (this->pd_include_file_names, + UTL_String *[this->pd_n_alloced_file_names]); + + for (i = 0; i < o_n_alloced_file_names; ++i) + { + this->pd_include_file_names[i] = o_include_file_names[i]; + } + delete [] o_include_file_names; } } @@ -829,6 +826,18 @@ IDL_GlobalData::case_diff_error (void) } void +IDL_GlobalData::nest_orb (idl_bool val) +{ + this->nest_orb_ = val; +} + +idl_bool +IDL_GlobalData::nest_orb (void) +{ + return this->nest_orb_; +} + +void IDL_GlobalData::destroy (void) { if (this->pd_filename != 0) @@ -1009,3 +1018,4 @@ IDL_GlobalData::string_to_scoped_name (char *s) return retval; } + diff --git a/TAO/TAO_IDL/util/utl_list.cpp b/TAO/TAO_IDL/util/utl_list.cpp index dc9cebf2029..3fc44127e25 100644 --- a/TAO/TAO_IDL/util/utl_list.cpp +++ b/TAO/TAO_IDL/util/utl_list.cpp @@ -72,7 +72,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // will cease to operate correctly if you use either multiple or // public virtual inheritance. -#include "utl_list.h" +#include "utl_list.h" +#include "ace/OS.h" ACE_RCSID (util, utl_list, diff --git a/TAO/TAO_IDL/util/utl_scope.cpp b/TAO/TAO_IDL/util/utl_scope.cpp index 48d0a746726..5efb08ef8cb 100644 --- a/TAO/TAO_IDL/util/utl_scope.cpp +++ b/TAO/TAO_IDL/util/utl_scope.cpp @@ -71,6 +71,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "utl_string.h" #include "ast_valuetype.h" #include "ast_valuetype_fwd.h" +#include "ast_component.h" +#include "ast_component_fwd.h" +#include "ast_home.h" #include "ast_typedef.h" #include "ast_type.h" #include "ast_root.h" @@ -351,8 +354,8 @@ UTL_Scope::lookup_for_add (AST_Decl *d, return 0; } - return lookup_by_name_local (id, - 0); + return this->lookup_by_name_local (id, + 0); } int @@ -501,6 +504,42 @@ UTL_Scope::add_valuetype_fwd (AST_ValueTypeFwd *i) return i; } +AST_Component * +UTL_Scope::add_component (AST_Component *i) +{ + if (i == 0) + { + return 0; + } + + i->set_added (I_TRUE); + return i; +} + +AST_ComponentFwd * +UTL_Scope::add_component_fwd (AST_ComponentFwd *i) +{ + if (i == 0) + { + return 0; + } + + i->set_added (I_TRUE); + return i; +} + +AST_Home * +UTL_Scope::add_home (AST_Home *i) +{ + if (i == 0) + { + return 0; + } + + i->set_added (I_TRUE); + return i; +} + AST_Exception * UTL_Scope::add_exception (AST_Exception *e) { @@ -848,6 +887,24 @@ UTL_Scope::fe_add_valuetype_fwd (AST_ValueTypeFwd *) return 0; } +AST_Component * +UTL_Scope::fe_add_component (AST_Component *) +{ + return 0; +} + +AST_ComponentFwd * +UTL_Scope::fe_add_component_fwd (AST_ComponentFwd *) +{ + return 0; +} + +AST_Home * +UTL_Scope::fe_add_home (AST_Home *) +{ + return 0; +} + AST_Exception * UTL_Scope::fe_add_exception (AST_Exception *) { |