From ec76cf334643695043625f1d3eae222101cbfcf5 Mon Sep 17 00:00:00 2001 From: parsons Date: Wed, 2 Dec 2009 21:22:18 +0000 Subject: ChangeLogTag: Wed Dec 2 21:21:24 UTC 2009 Jeff Parsons --- modules/TAO/ChangeLog | 63 +++++++++++++ modules/TAO/TAO_IDL/ast/ast_argument.cpp | 4 - modules/TAO/TAO_IDL/ast/ast_attribute.cpp | 4 - modules/TAO/TAO_IDL/ast/ast_consumes.cpp | 2 +- modules/TAO/TAO_IDL/ast/ast_emits.cpp | 2 +- modules/TAO/TAO_IDL/ast/ast_exception.cpp | 6 +- modules/TAO/TAO_IDL/ast/ast_expression.cpp | 5 +- modules/TAO/TAO_IDL/ast/ast_generator.cpp | 15 ++- modules/TAO/TAO_IDL/ast/ast_interface.cpp | 7 +- modules/TAO/TAO_IDL/ast/ast_module.cpp | 9 +- modules/TAO/TAO_IDL/ast/ast_param_holder.cpp | 19 +--- modules/TAO/TAO_IDL/ast/ast_publishes.cpp | 2 +- modules/TAO/TAO_IDL/ast/ast_structure.cpp | 6 +- modules/TAO/TAO_IDL/ast/ast_template_common.cpp | 1 + modules/TAO/TAO_IDL/ast/ast_template_module.cpp | 2 + modules/TAO/TAO_IDL/ast/ast_union.cpp | 5 +- modules/TAO/TAO_IDL/ast/ast_valuetype.cpp | 5 +- modules/TAO/TAO_IDL/be/be_consumes.cpp | 2 +- modules/TAO/TAO_IDL/be/be_decl.cpp | 4 + modules/TAO/TAO_IDL/be/be_emits.cpp | 2 +- modules/TAO/TAO_IDL/be/be_generator.cpp | 8 +- modules/TAO/TAO_IDL/be/be_param_holder.cpp | 12 ++- modules/TAO/TAO_IDL/be/be_publishes.cpp | 2 +- modules/TAO/TAO_IDL/be_include/be_consumes.h | 2 +- modules/TAO/TAO_IDL/be_include/be_emits.h | 2 +- modules/TAO/TAO_IDL/be_include/be_generator.h | 8 +- modules/TAO/TAO_IDL/be_include/be_param_holder.h | 7 +- modules/TAO/TAO_IDL/be_include/be_publishes.h | 2 +- modules/TAO/TAO_IDL/fe/fe_interface_header.cpp | 7 +- .../TAO_IDL/fe/fe_template_interface_header.cpp | 1 + modules/TAO/TAO_IDL/fe/fe_utils.cpp | 29 ++++++ modules/TAO/TAO_IDL/fe/idl.yy | 19 +++- modules/TAO/TAO_IDL/fe/y.tab.cpp | 19 +++- modules/TAO/TAO_IDL/include/ast_consumes.h | 2 +- modules/TAO/TAO_IDL/include/ast_emits.h | 2 +- modules/TAO/TAO_IDL/include/ast_generator.h | 8 +- modules/TAO/TAO_IDL/include/ast_operation.h | 1 + modules/TAO/TAO_IDL/include/ast_param_holder.h | 13 +-- modules/TAO/TAO_IDL/include/ast_publishes.h | 2 +- modules/TAO/TAO_IDL/include/fe_interface_header.h | 2 + modules/TAO/TAO_IDL/include/fe_utils.h | 5 +- modules/TAO/TAO_IDL/include/idl_global.h | 13 +++ modules/TAO/TAO_IDL/include/utl_scope.h | 17 +++- modules/TAO/TAO_IDL/util/utl_global.cpp | 12 +++ modules/TAO/TAO_IDL/util/utl_scope.cpp | 103 +++++++++++++++++---- 45 files changed, 336 insertions(+), 127 deletions(-) diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog index ad6527644a7..1db376d5c72 100644 --- a/modules/TAO/ChangeLog +++ b/modules/TAO/ChangeLog @@ -1,3 +1,66 @@ +Wed Dec 2 21:21:24 UTC 2009 Jeff Parsons + + * TAO_IDL/include/ast_generator.h: + * TAO_IDL/include/ast_param_holder.h: + * TAO_IDL/include/fe_utils.h: + * TAO_IDL/include/idl_global.h: + * TAO_IDL/include/fe_interface_header.h: + * TAO_IDL/include/utl_scope.h: + * TAO_IDL/include/ast_consumes.h: + * TAO_IDL/include/ast_publishes.h: + * TAO_IDL/include/ast_operation.h: + * TAO_IDL/include/ast_emits.h: + * TAO_IDL/be/be_param_holder.cpp: + * TAO_IDL/be/be_publishes.cpp: + * TAO_IDL/be/be_decl.cpp: + * TAO_IDL/be/be_consumes.cpp: + * TAO_IDL/be/be_emits.cpp: + * TAO_IDL/be/be_generator.cpp: + * TAO_IDL/ast/ast_consumes.cpp: + * TAO_IDL/ast/ast_publishes.cpp: + * TAO_IDL/ast/ast_expression.cpp: + * TAO_IDL/ast/ast_interface.cpp: + * TAO_IDL/ast/ast_template_module.cpp: + * TAO_IDL/ast/ast_emits.cpp: + * TAO_IDL/ast/ast_template_common.cpp: + * TAO_IDL/ast/ast_module.cpp: + * TAO_IDL/ast/ast_generator.cpp: + * TAO_IDL/ast/ast_union.cpp: + * TAO_IDL/ast/ast_param_holder.cpp: + * TAO_IDL/ast/ast_exception.cpp: + * TAO_IDL/ast/ast_structure.cpp: + * TAO_IDL/ast/ast_attribute.cpp: + * TAO_IDL/ast/ast_valuetype.cpp: + * TAO_IDL/ast/ast_argument.cpp: + * TAO_IDL/be_include/be_publishes.h: + * TAO_IDL/be_include/be_param_holder.h: + * TAO_IDL/be_include/be_emits.h: + * TAO_IDL/be_include/be_generator.h: + * TAO_IDL/be_include/be_consumes.h: + * TAO_IDL/fe/fe_utils.cpp: + * TAO_IDL/fe/y.tab.cpp: + * TAO_IDL/fe/fe_template_interface_header.cpp: + * TAO_IDL/fe/fe_interface_header.cpp: + * TAO_IDL/fe/idl.yy: + * TAO_IDL/util/utl_global.cpp: + * TAO_IDL/util/utl_scope.cpp: + + - Added code to UTL_Scope::lookup_by_name() that can + match an input to a template parameter, if any, of the + enclosing scope. + + - Changed constructor and IDL compiler factory function + signatures for publishes, emits and consumes nodes to + take AST_Type rather than AST_EventType, allowing a + template parameter placeholder to be accepted if that + particular IDL construct is parameterized. + + - Removed #include of ast_typedef.h from utl_scope.h and + added it to the necessary .cpp files. + + - Added check for duplicate names in a formal template + parameter list. + Tue Dec 1 18:00:15 UTC 2009 Jeff Parsons * TAO_IDL/fe/idl.yy: diff --git a/modules/TAO/TAO_IDL/ast/ast_argument.cpp b/modules/TAO/TAO_IDL/ast/ast_argument.cpp index 2f053e68d97..1b46a649838 100644 --- a/modules/TAO/TAO_IDL/ast/ast_argument.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_argument.cpp @@ -73,10 +73,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_argument.h" #include "ast_visitor.h" -ACE_RCSID (ast, - ast_argument, - "$Id$") - // Static functions. // Convert an enum Direction value to a char *. diff --git a/modules/TAO/TAO_IDL/ast/ast_attribute.cpp b/modules/TAO/TAO_IDL/ast/ast_attribute.cpp index 45cab3b2a3c..f11b57a26ca 100644 --- a/modules/TAO/TAO_IDL/ast/ast_attribute.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_attribute.cpp @@ -79,10 +79,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "utl_err.h" #include "global_extern.h" -ACE_RCSID (ast, - ast_attribute, - "$Id$") - // Constructor(s) and destructor. AST_Attribute::AST_Attribute (void) : COMMON_Base (), diff --git a/modules/TAO/TAO_IDL/ast/ast_consumes.cpp b/modules/TAO/TAO_IDL/ast/ast_consumes.cpp index 7c3b6162783..347a323cd81 100644 --- a/modules/TAO/TAO_IDL/ast/ast_consumes.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_consumes.cpp @@ -5,7 +5,7 @@ #include "ast_visitor.h" AST_Consumes::AST_Consumes (UTL_ScopedName *n, - AST_EventType *consumes_type) + AST_Type *consumes_type) : COMMON_Base (false, false), AST_Decl (AST_Decl::NT_consumes, diff --git a/modules/TAO/TAO_IDL/ast/ast_emits.cpp b/modules/TAO/TAO_IDL/ast/ast_emits.cpp index b9f2b1b040d..c0061fcc099 100644 --- a/modules/TAO/TAO_IDL/ast/ast_emits.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_emits.cpp @@ -5,7 +5,7 @@ #include "ast_visitor.h" AST_Emits::AST_Emits (UTL_ScopedName *n, - AST_EventType *emits_type) + AST_Type *emits_type) : COMMON_Base (), AST_Decl (AST_Decl::NT_emits, n), diff --git a/modules/TAO/TAO_IDL/ast/ast_exception.cpp b/modules/TAO/TAO_IDL/ast/ast_exception.cpp index c5e1edf3774..f322dc53962 100644 --- a/modules/TAO/TAO_IDL/ast/ast_exception.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_exception.cpp @@ -73,15 +73,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_union.h" #include "ast_enum.h" #include "ast_enum_val.h" +#include "ast_typedef.h" #include "ast_visitor.h" + #include "utl_err.h" #include "utl_identifier.h" #include "utl_indenter.h" -ACE_RCSID (ast, - ast_exception, - "$Id$") - AST_Exception::AST_Exception (void) : COMMON_Base (), AST_Decl (), diff --git a/modules/TAO/TAO_IDL/ast/ast_expression.cpp b/modules/TAO/TAO_IDL/ast/ast_expression.cpp index 8225cc6b0b5..b28fabfbd33 100644 --- a/modules/TAO/TAO_IDL/ast/ast_expression.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_expression.cpp @@ -68,12 +68,15 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_expression.h" #include "ast_constant.h" +#include "ast_typedef.h" #include "ast_visitor.h" -#include "global_extern.h" + #include "utl_err.h" #include "utl_scope.h" #include "utl_string.h" + #include "nr_extern.h" +#include "global_extern.h" // FUZZ: disable check_for_streams_include #include "ace/streams.h" diff --git a/modules/TAO/TAO_IDL/ast/ast_generator.cpp b/modules/TAO/TAO_IDL/ast/ast_generator.cpp index fbd3d43c816..caad32c22a6 100644 --- a/modules/TAO/TAO_IDL/ast/ast_generator.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_generator.cpp @@ -101,18 +101,17 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_sequence.h" #include "ast_string.h" #include "ast_structure_fwd.h" +#include "ast_typedef.h" #include "ast_native.h" #include "ast_factory.h" + #include "utl_identifier.h" + #include "nr_extern.h" #include "ace/OS_NS_wchar.h" #include "ast_generator.h" -ACE_RCSID (ast, - ast_generator, - "$Id$") - AST_PredefinedType * AST_Generator::create_predefined_type (AST_PredefinedType::PredefinedType t, UTL_ScopedName *n) @@ -973,7 +972,7 @@ AST_Generator::create_uses (UTL_ScopedName *n, AST_Publishes * AST_Generator::create_publishes (UTL_ScopedName *n, - AST_EventType *publishes_type) + AST_Type *publishes_type) { AST_Publishes *retval = 0; ACE_NEW_RETURN (retval, @@ -986,7 +985,7 @@ AST_Generator::create_publishes (UTL_ScopedName *n, AST_Emits * AST_Generator::create_emits (UTL_ScopedName *n, - AST_EventType *emits_type) + AST_Type *emits_type) { AST_Emits *retval = 0; ACE_NEW_RETURN (retval, @@ -998,7 +997,7 @@ AST_Generator::create_emits (UTL_ScopedName *n, } AST_Consumes * AST_Generator::create_consumes (UTL_ScopedName *n, - AST_EventType *consumes_type) + AST_Type *consumes_type) { AST_Consumes *retval = 0; ACE_NEW_RETURN (retval, @@ -1099,7 +1098,7 @@ AST_Generator::create_template_module_ref ( AST_Param_Holder * AST_Generator::create_param_holder ( - Identifier *parameter_name) + UTL_ScopedName *parameter_name) { AST_Param_Holder *retval = 0; ACE_NEW_RETURN (retval, diff --git a/modules/TAO/TAO_IDL/ast/ast_interface.cpp b/modules/TAO/TAO_IDL/ast/ast_interface.cpp index b22454da389..f3c9cfd7ff3 100644 --- a/modules/TAO/TAO_IDL/ast/ast_interface.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_interface.cpp @@ -85,22 +85,21 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_union.h" #include "ast_union_fwd.h" #include "ast_structure_fwd.h" +#include "ast_typedef.h" #include "ast_native.h" #include "ast_visitor.h" #include "ast_extern.h" + #include "utl_err.h" #include "utl_identifier.h" #include "utl_indenter.h" #include "utl_string.h" + #include "global_extern.h" #include "nr_extern.h" #include "ace/streams.h" -ACE_RCSID (ast, - ast_interface, - "$Id$") - AST_Interface::AST_Interface (void) : COMMON_Base (), AST_Decl (), diff --git a/modules/TAO/TAO_IDL/ast/ast_module.cpp b/modules/TAO/TAO_IDL/ast/ast_module.cpp index 3ed47fdaba7..e18512eaba6 100644 --- a/modules/TAO/TAO_IDL/ast/ast_module.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_module.cpp @@ -88,20 +88,19 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_structure_fwd.h" #include "ast_enum.h" #include "ast_enum_val.h" +#include "ast_typedef.h" #include "ast_native.h" #include "ast_generator.h" #include "ast_visitor.h" #include "ast_extern.h" + #include "utl_err.h" #include "utl_identifier.h" #include "utl_indenter.h" + #include "global_extern.h" #include "nr_extern.h" -ACE_RCSID (ast, - ast_module, - "$Id$") - AST_Module::AST_Module (void) : AST_Decl (), UTL_Scope (), @@ -1684,7 +1683,7 @@ AST_Module::fe_add_typedef (AST_Typedef *t) AST_Decl *d = 0; // Already defined and cannot be redefined? Or already used? - if ((d = this->lookup_for_add(t, false)) != 0) + if ((d = this->lookup_for_add (t, false)) != 0) { if (!can_be_redefined (d)) { diff --git a/modules/TAO/TAO_IDL/ast/ast_param_holder.cpp b/modules/TAO/TAO_IDL/ast/ast_param_holder.cpp index a21b32f300f..b6a33a744b2 100644 --- a/modules/TAO/TAO_IDL/ast/ast_param_holder.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_param_holder.cpp @@ -4,12 +4,13 @@ #include "utl_identifier.h" -AST_Param_Holder::AST_Param_Holder (Identifier *parameter_name) +AST_Param_Holder::AST_Param_Holder (UTL_ScopedName *parameter_name) : COMMON_Base (false, false), AST_Decl (AST_Decl::NT_param_holder, - 0), - param_name_ (parameter_name) + parameter_name), + AST_Type (AST_Decl::NT_param_holder, + parameter_name) { } @@ -17,20 +18,10 @@ AST_Param_Holder::~AST_Param_Holder (void) { } -Identifier const * -AST_Param_Holder::param_name (void) const -{ - return this->param_name_; -} - void AST_Param_Holder::destroy (void) { - this->param_name_->destroy (); - delete this->param_name_; - this->param_name_ = 0; - - this->AST_Decl::destroy (); + this->AST_Type::destroy (); } int diff --git a/modules/TAO/TAO_IDL/ast/ast_publishes.cpp b/modules/TAO/TAO_IDL/ast/ast_publishes.cpp index 6fb1f7add33..25f3aa3b911 100644 --- a/modules/TAO/TAO_IDL/ast/ast_publishes.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_publishes.cpp @@ -5,7 +5,7 @@ #include "ast_visitor.h" AST_Publishes::AST_Publishes (UTL_ScopedName *n, - AST_EventType *publishes_type) + AST_Type *publishes_type) : COMMON_Base (), AST_Decl (AST_Decl::NT_publishes, n), diff --git a/modules/TAO/TAO_IDL/ast/ast_structure.cpp b/modules/TAO/TAO_IDL/ast/ast_structure.cpp index 9b0a40426a8..42af00b2451 100644 --- a/modules/TAO/TAO_IDL/ast/ast_structure.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_structure.cpp @@ -73,15 +73,13 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_field.h" #include "ast_enum.h" #include "ast_enum_val.h" +#include "ast_typedef.h" #include "ast_visitor.h" + #include "utl_string.h" #include "utl_err.h" #include "utl_indenter.h" -ACE_RCSID (ast, - ast_structure, - "$Id$") - AST_Structure::AST_Structure (void) : COMMON_Base (), AST_Decl (), diff --git a/modules/TAO/TAO_IDL/ast/ast_template_common.cpp b/modules/TAO/TAO_IDL/ast/ast_template_common.cpp index bc436663f26..3a736e1cbcd 100644 --- a/modules/TAO/TAO_IDL/ast/ast_template_common.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_template_common.cpp @@ -3,6 +3,7 @@ #include "ast_template_common.h" #include "ast_field.h" #include "ast_constant.h" +#include "ast_typedef.h" #include "utl_identifier.h" #include "utl_namelist.h" diff --git a/modules/TAO/TAO_IDL/ast/ast_template_module.cpp b/modules/TAO/TAO_IDL/ast/ast_template_module.cpp index 906d0d20b8e..fd93240e7ee 100644 --- a/modules/TAO/TAO_IDL/ast/ast_template_module.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_template_module.cpp @@ -3,6 +3,8 @@ #include "ast_template_module.h" #include "ast_template_module_ref.h" #include "ast_constant.h" +#include "ast_enum.h" +#include "ast_typedef.h" #include "ast_visitor.h" #include "utl_err.h" diff --git a/modules/TAO/TAO_IDL/ast/ast_union.cpp b/modules/TAO/TAO_IDL/ast/ast_union.cpp index db82198f108..41a9867d99d 100644 --- a/modules/TAO/TAO_IDL/ast/ast_union.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_union.cpp @@ -80,6 +80,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_predefined_type.h" #include "ast_enum.h" #include "ast_enum_val.h" +#include "ast_typedef.h" #include "ast_visitor.h" #include "utl_err.h" #include "utl_identifier.h" @@ -89,10 +90,6 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // FUZZ: disable check_for_streams_include #include "ace/streams.h" -ACE_RCSID (ast, - ast_union, - "$Id$") - AST_Union::AST_Union (void) : COMMON_Base (), AST_Decl (), diff --git a/modules/TAO/TAO_IDL/ast/ast_valuetype.cpp b/modules/TAO/TAO_IDL/ast/ast_valuetype.cpp index f484275f936..76d98c17922 100644 --- a/modules/TAO/TAO_IDL/ast/ast_valuetype.cpp +++ b/modules/TAO/TAO_IDL/ast/ast_valuetype.cpp @@ -2,6 +2,7 @@ // $Id$ #include "ast_valuetype.h" +#include "ast_typedef.h" #include "ast_factory.h" #include "ast_visitor.h" #include "ast_extern.h" @@ -15,10 +16,6 @@ #include "ace/streams.h" -ACE_RCSID (ast, - ast_valuetype, - "$Id$") - AST_ValueType::AST_ValueType (void) : COMMON_Base (), AST_Decl (), diff --git a/modules/TAO/TAO_IDL/be/be_consumes.cpp b/modules/TAO/TAO_IDL/be/be_consumes.cpp index fb0635a2288..792a0675e45 100644 --- a/modules/TAO/TAO_IDL/be/be_consumes.cpp +++ b/modules/TAO/TAO_IDL/be/be_consumes.cpp @@ -5,7 +5,7 @@ #include "be_visitor.h" be_consumes::be_consumes (UTL_ScopedName *n, - AST_EventType *consumes_type) + AST_Type *consumes_type) : COMMON_Base (false, false), AST_Decl (AST_Decl::NT_consumes, diff --git a/modules/TAO/TAO_IDL/be/be_decl.cpp b/modules/TAO/TAO_IDL/be/be_decl.cpp index 5f77bf4d01e..0d835ab4587 100644 --- a/modules/TAO/TAO_IDL/be/be_decl.cpp +++ b/modules/TAO/TAO_IDL/be/be_decl.cpp @@ -37,9 +37,13 @@ #include "be_factory.h" #include "be_sequence.h" #include "be_visitor.h" + #include "ast_structure_fwd.h" +#include "ast_typedef.h" #include "ast_string.h" + #include "utl_identifier.h" + #include "global_extern.h" #include "ace/Log_Msg.h" #include "ace/String_Base.h" diff --git a/modules/TAO/TAO_IDL/be/be_emits.cpp b/modules/TAO/TAO_IDL/be/be_emits.cpp index 125481c0209..bad1fd05214 100644 --- a/modules/TAO/TAO_IDL/be/be_emits.cpp +++ b/modules/TAO/TAO_IDL/be/be_emits.cpp @@ -5,7 +5,7 @@ #include "be_visitor.h" be_emits::be_emits (UTL_ScopedName *n, - AST_EventType *emits_type) + AST_Type *emits_type) : COMMON_Base (false, false), AST_Decl (AST_Decl::NT_emits, diff --git a/modules/TAO/TAO_IDL/be/be_generator.cpp b/modules/TAO/TAO_IDL/be/be_generator.cpp index 6e9329d86f0..cae66a0381f 100644 --- a/modules/TAO/TAO_IDL/be/be_generator.cpp +++ b/modules/TAO/TAO_IDL/be/be_generator.cpp @@ -965,7 +965,7 @@ be_generator::create_uses (UTL_ScopedName *n, AST_Publishes * be_generator::create_publishes (UTL_ScopedName *n, - AST_EventType *publishes_type) + AST_Type *publishes_type) { be_publishes *retval = 0; ACE_NEW_RETURN (retval, @@ -978,7 +978,7 @@ be_generator::create_publishes (UTL_ScopedName *n, AST_Emits * be_generator::create_emits (UTL_ScopedName *n, - AST_EventType *emits_type) + AST_Type *emits_type) { be_emits *retval = 0; ACE_NEW_RETURN (retval, @@ -990,7 +990,7 @@ be_generator::create_emits (UTL_ScopedName *n, } AST_Consumes * be_generator::create_consumes (UTL_ScopedName *n, - AST_EventType *consumes_type) + AST_Type *consumes_type) { be_consumes *retval = 0; ACE_NEW_RETURN (retval, @@ -1091,7 +1091,7 @@ be_generator::create_template_module_ref ( AST_Param_Holder * be_generator::create_param_holder ( - Identifier *parameter_name) + UTL_ScopedName *parameter_name) { be_param_holder *retval = 0; ACE_NEW_RETURN (retval, diff --git a/modules/TAO/TAO_IDL/be/be_param_holder.cpp b/modules/TAO/TAO_IDL/be/be_param_holder.cpp index 004a5f2cd20..b6c064456c6 100644 --- a/modules/TAO/TAO_IDL/be/be_param_holder.cpp +++ b/modules/TAO/TAO_IDL/be/be_param_holder.cpp @@ -19,14 +19,18 @@ #include "be_param_holder.h" -be_param_holder::be_param_holder (Identifier *parameter_name) +be_param_holder::be_param_holder (UTL_ScopedName *parameter_name) : COMMON_Base (false, false), AST_Decl (AST_Decl::NT_param_holder, - 0), + parameter_name), + AST_Type (AST_Decl::NT_param_holder, + parameter_name), AST_Param_Holder (parameter_name), be_decl (AST_Decl::NT_param_holder, - 0) + parameter_name), + be_type (AST_Decl::NT_param_holder, + parameter_name) { } @@ -46,7 +50,7 @@ void be_param_holder::destroy (void) { this->AST_Param_Holder::destroy (); - this->be_decl::destroy (); + this->be_type::destroy (); } IMPL_NARROW_FROM_DECL (be_param_holder) diff --git a/modules/TAO/TAO_IDL/be/be_publishes.cpp b/modules/TAO/TAO_IDL/be/be_publishes.cpp index fe9b3acba46..7b748de9fa3 100644 --- a/modules/TAO/TAO_IDL/be/be_publishes.cpp +++ b/modules/TAO/TAO_IDL/be/be_publishes.cpp @@ -5,7 +5,7 @@ #include "be_visitor.h" be_publishes::be_publishes (UTL_ScopedName *n, - AST_EventType *publishes_type) + AST_Type *publishes_type) : COMMON_Base (false, false), AST_Decl (AST_Decl::NT_publishes, diff --git a/modules/TAO/TAO_IDL/be_include/be_consumes.h b/modules/TAO/TAO_IDL/be_include/be_consumes.h index d03f1bf61d9..9e09c3cdc64 100644 --- a/modules/TAO/TAO_IDL/be_include/be_consumes.h +++ b/modules/TAO/TAO_IDL/be_include/be_consumes.h @@ -16,7 +16,7 @@ class be_consumes : public virtual AST_Consumes, { public: be_consumes (UTL_ScopedName *n, - AST_EventType *consumes_type); + AST_Type *consumes_type); virtual ~be_consumes (void); diff --git a/modules/TAO/TAO_IDL/be_include/be_emits.h b/modules/TAO/TAO_IDL/be_include/be_emits.h index 370b5263954..b8aa5d2b66a 100644 --- a/modules/TAO/TAO_IDL/be_include/be_emits.h +++ b/modules/TAO/TAO_IDL/be_include/be_emits.h @@ -16,7 +16,7 @@ class be_emits : public virtual AST_Emits, { public: be_emits (UTL_ScopedName *n, - AST_EventType *emits_type); + AST_Type *emits_type); virtual ~be_emits (void); diff --git a/modules/TAO/TAO_IDL/be_include/be_generator.h b/modules/TAO/TAO_IDL/be_include/be_generator.h index 52b9a7181d8..49d876e0c8f 100644 --- a/modules/TAO/TAO_IDL/be_include/be_generator.h +++ b/modules/TAO/TAO_IDL/be_include/be_generator.h @@ -279,15 +279,15 @@ public: virtual AST_Publishes *create_publishes (UTL_ScopedName *n, - AST_EventType *publishes_type); + AST_Type *publishes_type); virtual AST_Emits *create_emits (UTL_ScopedName *n, - AST_EventType *emits_type); + AST_Type *emits_type); virtual AST_Consumes *create_consumes (UTL_ScopedName *n, - AST_EventType *consumes_type); + AST_Type *consumes_type); virtual AST_Extended_Port *create_extended_port ( UTL_ScopedName *n, @@ -322,7 +322,7 @@ public: virtual AST_Param_Holder *create_param_holder ( - Identifier *parameter_name); + UTL_ScopedName *parameter_name); }; #endif // _BE_GENERATOR_BE_GENERATOR_HH diff --git a/modules/TAO/TAO_IDL/be_include/be_param_holder.h b/modules/TAO/TAO_IDL/be_include/be_param_holder.h index b9a870dc7a8..498e502b890 100644 --- a/modules/TAO/TAO_IDL/be_include/be_param_holder.h +++ b/modules/TAO/TAO_IDL/be_include/be_param_holder.h @@ -21,14 +21,15 @@ #ifndef TAO_BE_PARAM_HOLDER_H #define TAO_BE_PARAM_HOLDER_H -#include "be_decl.h" +#include "be_type.h" + #include "ast_param_holder.h" class be_param_holder : public virtual AST_Param_Holder, - public virtual be_decl + public virtual be_type { public: - be_param_holder (Identifier *parameter_name); + be_param_holder (UTL_ScopedName *parameter_name); virtual ~be_param_holder (void); diff --git a/modules/TAO/TAO_IDL/be_include/be_publishes.h b/modules/TAO/TAO_IDL/be_include/be_publishes.h index b9ea0e185e6..42e0d82ebcf 100644 --- a/modules/TAO/TAO_IDL/be_include/be_publishes.h +++ b/modules/TAO/TAO_IDL/be_include/be_publishes.h @@ -16,7 +16,7 @@ class be_publishes : public virtual AST_Publishes, { public: be_publishes (UTL_ScopedName *n, - AST_EventType *publishes_type); + AST_Type *publishes_type); virtual ~be_publishes (void); diff --git a/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp b/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp index 26972d69daa..c28d64b8ce1 100644 --- a/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp +++ b/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp @@ -69,21 +69,20 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // node itself is created. #include "fe_interface_header.h" + #include "ast_interface_fwd.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" + #include "fe_extern.h" #include "global_extern.h" #include "nr_extern.h" -ACE_RCSID (fe, - fe_interface_header, - "$Id$") - #undef INCREMENT #define INCREMENT 512 diff --git a/modules/TAO/TAO_IDL/fe/fe_template_interface_header.cpp b/modules/TAO/TAO_IDL/fe/fe_template_interface_header.cpp index 3e7e17118d8..f46cfeb4687 100644 --- a/modules/TAO/TAO_IDL/fe/fe_template_interface_header.cpp +++ b/modules/TAO/TAO_IDL/fe/fe_template_interface_header.cpp @@ -3,6 +3,7 @@ #include "fe_template_interface_header.h" #include "fe_extern.h" #include "ast_template_interface.h" +#include "ast_typedef.h" #include "utl_err.h" #include "global_extern.h" diff --git a/modules/TAO/TAO_IDL/fe/fe_utils.cpp b/modules/TAO/TAO_IDL/fe/fe_utils.cpp index 53b42d331c4..8ebae19ffb4 100644 --- a/modules/TAO/TAO_IDL/fe/fe_utils.cpp +++ b/modules/TAO/TAO_IDL/fe/fe_utils.cpp @@ -13,6 +13,35 @@ FE_Utils::T_Param_Info::T_Param_Info (void) { } +bool +FE_Utils::duplicate_param_id (T_PARAMLIST_INFO *params) +{ + size_t cur_pos = 0UL; + size_t size = params->size (); + + for (FE_Utils::T_PARAMLIST_INFO::CONST_ITERATOR i (*params); + !i.done (); + i.advance (), ++cur_pos) + { + FE_Utils::T_Param_Info *this_one = 0; + FE_Utils::T_Param_Info *that_one = 0; + + i.next (this_one); + + for (size_t j = cur_pos + 1; j < size; ++j) + { + params->get (that_one, j); + + if (this_one->name_ == that_one->name_) + { + return true; + } + } + } + + return false; +} + FE_Utils::T_Ref_Info::T_Ref_Info (void) : name_ (0), params_ (0) diff --git a/modules/TAO/TAO_IDL/fe/idl.yy b/modules/TAO/TAO_IDL/fe/idl.yy index 4dbc8770904..f61f33cb268 100644 --- a/modules/TAO/TAO_IDL/fe/idl.yy +++ b/modules/TAO/TAO_IDL/fe/idl.yy @@ -81,6 +81,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_template_module.h" #include "ast_template_module_inst.h" #include "ast_template_module_ref.h" +#include "ast_typedef.h" #include "ast_valuebox.h" #include "ast_valuetype.h" #include "ast_valuetype_fwd.h" @@ -612,7 +613,7 @@ template_module // module and instantiated template module. In the last // case, a fully scoped name is allowed, but here we // allow only an identifier (a scoped name of length - // 1). If not satisfied, we output a parse error with + // 1). If not satisfied, we output a syntax error with // the appropriate message. if ($1->length () != 1) { @@ -622,6 +623,13 @@ template_module } at_least_one_formal_parameter { + if (FE_Utils::duplicate_param_id ($3)) + { + idl_global->err ()->duplicate_param_id ( + $1); + + return 1; + } } '>' { @@ -640,6 +648,10 @@ template_module * Push it on the stack */ idl_global->scopes ().push (tm); + + // Store these for reference as we parse the scope + // of the template module. + idl_global->current_params ($3); } '{' { @@ -657,6 +669,10 @@ template_module * Finished with this module - pop it from the scope stack. */ idl_global->scopes ().pop (); + + // Clear the pointer so scoped name lookup will know + // that we are no longer in a template module scope. + idl_global->current_params (0); } ; @@ -6140,6 +6156,7 @@ at_least_one_formal_parameter $2 = 0; idl_global->err ()->mismatch_seq_of_param (bad_id.c_str ()); + return 1; } $$ = $2; diff --git a/modules/TAO/TAO_IDL/fe/y.tab.cpp b/modules/TAO/TAO_IDL/fe/y.tab.cpp index c7d5cf2a0fb..dadbdfde114 100644 --- a/modules/TAO/TAO_IDL/fe/y.tab.cpp +++ b/modules/TAO/TAO_IDL/fe/y.tab.cpp @@ -251,6 +251,7 @@ #include "ast_template_module.h" #include "ast_template_module_inst.h" #include "ast_template_module_ref.h" +#include "ast_typedef.h" #include "ast_valuebox.h" #include "ast_valuetype.h" #include "ast_valuetype_fwd.h" @@ -2948,6 +2949,13 @@ tao_yyreduce: case 47: { + if (FE_Utils::duplicate_param_id ((tao_yyvsp[(3) - (3)].plval))) + { + idl_global->err ()->duplicate_param_id ( + (tao_yyvsp[(1) - (3)].idlist)); + + return 1; + } } break; @@ -2969,6 +2977,10 @@ tao_yyreduce: * Push it on the stack */ idl_global->scopes ().push (tm); + + // Store these for reference as we parse the scope + // of the template module. + idl_global->current_params ((tao_yyvsp[(3) - (5)].plval)); } break; @@ -2995,6 +3007,10 @@ tao_yyreduce: * Finished with this module - pop it from the scope stack. */ idl_global->scopes ().pop (); + + // Clear the pointer so scoped name lookup will know + // that we are no longer in a template module scope. + idl_global->current_params (0); } break; @@ -8994,8 +9010,9 @@ tao_yyreduce: (tao_yyvsp[(2) - (2)].plval) = 0; idl_global->err ()->mismatch_seq_of_param (bad_id.c_str ()); + return 1; } - + (tao_yyval.plval) = (tao_yyvsp[(2) - (2)].plval); } break; diff --git a/modules/TAO/TAO_IDL/include/ast_consumes.h b/modules/TAO/TAO_IDL/include/ast_consumes.h index 4b7c796ba59..962859cb70b 100644 --- a/modules/TAO/TAO_IDL/include/ast_consumes.h +++ b/modules/TAO/TAO_IDL/include/ast_consumes.h @@ -12,7 +12,7 @@ class TAO_IDL_FE_Export AST_Consumes : public virtual AST_Field { public: AST_Consumes (UTL_ScopedName *n, - AST_EventType *consumes_type); + AST_Type *consumes_type); virtual ~AST_Consumes (void); diff --git a/modules/TAO/TAO_IDL/include/ast_emits.h b/modules/TAO/TAO_IDL/include/ast_emits.h index 575dd00871e..6931e31f917 100644 --- a/modules/TAO/TAO_IDL/include/ast_emits.h +++ b/modules/TAO/TAO_IDL/include/ast_emits.h @@ -12,7 +12,7 @@ class TAO_IDL_FE_Export AST_Emits : public virtual AST_Field { public: AST_Emits (UTL_ScopedName *n, - AST_EventType *emits_type); + AST_Type *emits_type); virtual ~AST_Emits (void); diff --git a/modules/TAO/TAO_IDL/include/ast_generator.h b/modules/TAO/TAO_IDL/include/ast_generator.h index 2dc143e1ca4..ca75187fba1 100644 --- a/modules/TAO/TAO_IDL/include/ast_generator.h +++ b/modules/TAO/TAO_IDL/include/ast_generator.h @@ -368,15 +368,15 @@ public: virtual AST_Publishes *create_publishes (UTL_ScopedName *n, - AST_EventType *publishes_type); + AST_Type *publishes_type); virtual AST_Emits *create_emits (UTL_ScopedName *n, - AST_EventType *emits_type); + AST_Type *emits_type); virtual AST_Consumes *create_consumes (UTL_ScopedName *n, - AST_EventType *consumes_type); + AST_Type *consumes_type); virtual AST_Extended_Port *create_extended_port ( @@ -412,7 +412,7 @@ public: virtual AST_Param_Holder *create_param_holder ( - Identifier *parameter_name); + UTL_ScopedName *parameter_name); }; #endif // _AST_GENERATOR_AST_GENERATOR_HH diff --git a/modules/TAO/TAO_IDL/include/ast_operation.h b/modules/TAO/TAO_IDL/include/ast_operation.h index c6abef575e7..94149de8dfa 100644 --- a/modules/TAO/TAO_IDL/include/ast_operation.h +++ b/modules/TAO/TAO_IDL/include/ast_operation.h @@ -71,6 +71,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "utl_scope.h" class UTL_ExceptList; +class AST_Type; class TAO_IDL_FE_Export AST_Operation : public virtual AST_Decl, public virtual UTL_Scope diff --git a/modules/TAO/TAO_IDL/include/ast_param_holder.h b/modules/TAO/TAO_IDL/include/ast_param_holder.h index f30386f2646..81eaa744d49 100644 --- a/modules/TAO/TAO_IDL/include/ast_param_holder.h +++ b/modules/TAO/TAO_IDL/include/ast_param_holder.h @@ -4,20 +4,16 @@ #ifndef AST_PARAM_HOLDER_H #define AST_PARAM_HOLDER_H -#include "ast_decl.h" - -class Identifier; +#include "ast_type.h" class TAO_IDL_FE_Export AST_Param_Holder - : public virtual AST_Decl + : public virtual AST_Type { public: - AST_Param_Holder (Identifier *parameter_name); + AST_Param_Holder (UTL_ScopedName *parameter_name); virtual ~AST_Param_Holder (void); - Identifier const * param_name (void) const; - // Narrowing. DEF_NARROW_FROM_DECL (AST_Param_Holder); @@ -29,9 +25,6 @@ public: // Visiting. virtual int ast_accept (ast_visitor *visitor); - -private: - Identifier *param_name_; }; #endif // AST_PARAM_HOLDER_H \ No newline at end of file diff --git a/modules/TAO/TAO_IDL/include/ast_publishes.h b/modules/TAO/TAO_IDL/include/ast_publishes.h index c6cf26edecb..3890421c031 100644 --- a/modules/TAO/TAO_IDL/include/ast_publishes.h +++ b/modules/TAO/TAO_IDL/include/ast_publishes.h @@ -12,7 +12,7 @@ class TAO_IDL_FE_Export AST_Publishes : public virtual AST_Field { public: AST_Publishes (UTL_ScopedName *n, - AST_EventType *publishes_type); + AST_Type *publishes_type); virtual ~AST_Publishes (void); diff --git a/modules/TAO/TAO_IDL/include/fe_interface_header.h b/modules/TAO/TAO_IDL/include/fe_interface_header.h index d3d4fa06d12..8717782f9f0 100644 --- a/modules/TAO/TAO_IDL/include/fe_interface_header.h +++ b/modules/TAO/TAO_IDL/include/fe_interface_header.h @@ -69,6 +69,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "utl_scoped_name.h" +#include "ast_typedef.h" + class UTL_NameList; class AST_Interface; diff --git a/modules/TAO/TAO_IDL/include/fe_utils.h b/modules/TAO/TAO_IDL/include/fe_utils.h index 78b4c72bfa4..03be417dfe0 100644 --- a/modules/TAO/TAO_IDL/include/fe_utils.h +++ b/modules/TAO/TAO_IDL/include/fe_utils.h @@ -5,7 +5,7 @@ #include "ace/Unbounded_Queue.h" -#include "ast_enum.h" +#include "ast_decl.h" #include "ast_expression.h" class UTL_StrList; @@ -13,6 +13,7 @@ class UTL_IdList; typedef UTL_IdList UTL_ScopedName; class UTL_NameList; class AST_PortType; +class AST_Enum; struct TAO_IDL_FE_Export FE_Utils { @@ -27,6 +28,8 @@ struct TAO_IDL_FE_Export FE_Utils }; typedef ACE_Unbounded_Queue T_PARAMLIST_INFO; + + static bool duplicate_param_id (T_PARAMLIST_INFO *params); struct T_Ref_Info { diff --git a/modules/TAO/TAO_IDL/include/idl_global.h b/modules/TAO/TAO_IDL/include/idl_global.h index 845031a0842..6e678e0b3c3 100644 --- a/modules/TAO/TAO_IDL/include/idl_global.h +++ b/modules/TAO/TAO_IDL/include/idl_global.h @@ -651,6 +651,15 @@ public: const char *big_file_name (void) const; // Just get the const string. + + FE_Utils::T_PARAMLIST_INFO const *current_params (void) const; + void current_params (FE_Utils::T_PARAMLIST_INFO *params); + // Accessors for the member. If UTL_Scope::lookup_by_name() + // has a 0 result, it will check this param list (if it is not + // 0, meaning we are in the scope of a template module) for a + // match before returning, in case it is processing a + // referenced template parameter of the eclosing template + // module. UTL_String *utl_string_factory (const char *str); // Utility function to create UTL_String classes on the FE heap. @@ -797,6 +806,10 @@ private: const char *big_file_name_; // Used if the above flag is set. + + FE_Utils::T_PARAMLIST_INFO *current_params_; + // Stored if we are parsing the scope of a template module, + // 0 otherwise. }; diff --git a/modules/TAO/TAO_IDL/include/utl_scope.h b/modules/TAO/TAO_IDL/include/utl_scope.h index 4d94e9b0b0a..75ddb258c8d 100644 --- a/modules/TAO/TAO_IDL/include/utl_scope.h +++ b/modules/TAO/TAO_IDL/include/utl_scope.h @@ -81,10 +81,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. // the responsibility of those functions then to call the add() // function defined in the parent "AST_" class. -#include "ast_decl.h" -#include "ast_expression.h" -#include "ast_typedef.h" -#include "utl_scoped_name.h" +#include "fe_utils.h" // This is for AIX w/IBM C++. class Identifier; @@ -108,6 +105,7 @@ class AST_Exception; class AST_Attribute; class AST_Operation; class AST_Argument; +class AST_Param_Holder; class AST_Union; class AST_UnionFwd; class AST_UnionBranch; @@ -118,6 +116,7 @@ class AST_Enum; class AST_EnumVal; class AST_Sequence; class AST_String; +class AST_Typedef; class AST_Array; class AST_Native; class AST_Factory; @@ -338,7 +337,15 @@ protected: void check_for_predef_seq (AST_Decl *d); // Set the appropriate *_seen_ flag if we are seeing a spec-defined // sequence of a basic type. - + + AST_Param_Holder *match_param ( + UTL_ScopedName *e, + FE_Utils::T_PARAMLIST_INFO const *params); + // If the Identifier string (from the scoped name which has been + // already determined to be of length 1) matches a param, + // create and return a param holder AST node, otherwise + // return 0. + protected: // Data. diff --git a/modules/TAO/TAO_IDL/util/utl_global.cpp b/modules/TAO/TAO_IDL/util/utl_global.cpp index 498a35b16da..641b276bc9f 100644 --- a/modules/TAO/TAO_IDL/util/utl_global.cpp +++ b/modules/TAO/TAO_IDL/util/utl_global.cpp @@ -1789,6 +1789,18 @@ IDL_GlobalData::big_file_name (void) const return this->big_file_name_; } +FE_Utils::T_PARAMLIST_INFO const * +IDL_GlobalData::current_params (void) const +{ + return this->current_params_; +} + +void +IDL_GlobalData::current_params (FE_Utils::T_PARAMLIST_INFO *params) +{ + this->current_params_ = params; +} + UTL_String * IDL_GlobalData::utl_string_factory (const char *str) { diff --git a/modules/TAO/TAO_IDL/util/utl_scope.cpp b/modules/TAO/TAO_IDL/util/utl_scope.cpp index 0232794a1e4..3deeb6c9d4a 100644 --- a/modules/TAO/TAO_IDL/util/utl_scope.cpp +++ b/modules/TAO/TAO_IDL/util/utl_scope.cpp @@ -92,6 +92,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_attribute.h" #include "ast_operation.h" #include "ast_argument.h" +#include "ast_param_holder.h" #include "ast_union.h" #include "ast_union_fwd.h" #include "ast_union_branch.h" @@ -100,9 +101,12 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "ast_native.h" #include "ast_factory.h" #include "ast_visitor.h" +#include "ast_generator.h" + #include "nr_extern.h" #include "fe_extern.h" #include "global_extern.h" + #include "ace/OS_NS_strings.h" // FUZZ: disable check_for_streams_include @@ -572,6 +576,33 @@ UTL_Scope::check_for_predef_seq (AST_Decl *d) } } +AST_Param_Holder * +UTL_Scope::match_param ( + UTL_ScopedName *e, + FE_Utils::T_PARAMLIST_INFO const *params) +{ + const char *name = e->first_component ()->get_string (); + AST_Param_Holder *retval = 0; + + for (FE_Utils::T_PARAMLIST_INFO::CONST_ITERATOR i (*params); + !i.done (); + i.advance ()) + { + FE_Utils::T_Param_Info *param = 0; + i.next (param); + + if (param->name_ == name) + { + retval = + idl_global->gen ()->create_param_holder (e); + + break; + } + } + + return retval; +} + // Public operations. // Scope Management Protocol. @@ -1806,6 +1837,28 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e, { return 0; } + + // If this call returns a non-zero value, we are in the scope + // of a template module. + FE_Utils::T_PARAMLIST_INFO const *params = + idl_global->current_params (); + + if (e->length () == 1 && params != 0) + { + AST_Param_Holder *param_holder = + this->match_param (e, params); + + // Since we are inside the scope of a template module, any + // single-segment scoped name that matches a template + // parameter name has to be a reference to that parameter, + // so we return the created placeholder. If there's no + // match, 0 is returned, and we proceed with the regular + // lookup. + if (param_holder != 0) + { + return param_holder; + } + } // If name starts with "::" or "" start lookup in global scope. if (is_global_name (e->head ())) @@ -1908,57 +1961,71 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e, // Since we have actually seen a match in local scope (even though that // went nowhere) the full identifier is actually undefined as we are not // allowed to follow down the parent scope chain. (The above is still - // useful to identify possiable user scoping mistakes however for the + // useful to identify possible user scoping mistakes however for the // following diagnostic.) if (0 != d) { - ACE_ERROR (( LM_ERROR, - ACE_TEXT ("%C: \"%C\", line %d: Did you mean \"::%C\"\n") + ACE_ERROR (( + LM_ERROR, + ACE_TEXT ("%C: \"%C\", line %d: ") + ACE_TEXT ("Did you mean \"::%C\"\n") ACE_TEXT (" declared at "), idl_global->prog_name (), idl_global->filename ()->get_string (), idl_global->lineno (), - d->full_name () )); - const bool same_file= + d->full_name ())); + + const bool same_file = (0 == ACE_OS::strcmp ( idl_global->filename ()->get_string (), d->file_name ().c_str ()) ); + if (!same_file) { ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%C "), - d->file_name ().c_str () )); + ACE_TEXT ("%C "), + d->file_name ().c_str () )); } - ACE_ERROR ((LM_ERROR, + + ACE_ERROR (( + LM_ERROR, ACE_TEXT ("line %d but hidden by local \""), d->line () )); + if (ScopeAsDecl (this)->full_name ()[0]) { - ACE_ERROR ((LM_ERROR, ACE_TEXT ("::%C"), - ScopeAsDecl (this)->full_name () )); + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("::%C"), + ScopeAsDecl (this)->full_name () )); } + ACE_ERROR ((LM_ERROR, - ACE_TEXT ("::%C\""), - e->head ()->get_string () )); - const bool same_file_again= + ACE_TEXT ("::%C\""), + e->head ()->get_string () )); + + const bool same_file_again = (same_file && 0 == ACE_OS::strcmp ( idl_global->filename ()->get_string (), first_one_found->file_name ().c_str ()) ); + if (!same_file_again) { - ACE_ERROR ((LM_ERROR, + ACE_ERROR (( + LM_ERROR, ACE_TEXT ("\n") ACE_TEXT (" declared at %C "), - first_one_found->file_name ().c_str () )); + first_one_found->file_name ().c_str ())); } else { ACE_ERROR ((LM_ERROR, ACE_TEXT (" at ") )); } - ACE_ERROR ((LM_ERROR, ACE_TEXT ("line %d ?\n"), - first_one_found->line () )); + + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %d ?\n"), + first_one_found->line () )); } return 0; } @@ -2009,7 +2076,7 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e, } // We have found the root of the identifier in our local scope. - first_one_found= d; + first_one_found = d; // For the possible call to look_in_inherited() below. s = DeclAsScope (d); -- cgit v1.2.1