summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-15 20:35:37 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-15 20:35:37 +0000
commit0a058b16d4c82e429f2ab43c1597574771687e7e (patch)
treefc4ea8cff295bee5f7172e6d1a7394e286b39983
parent344d858c5262717e7e18074008b00eb4196cb7c9 (diff)
downloadATCD-0a058b16d4c82e429f2ab43c1597574771687e7e.tar.gz
ChangeLogTag: Tue Dec 15 20:34:51 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--modules/TAO/ChangeLog26
-rw-r--r--modules/TAO/TAO_IDL/ast/ast_operation.cpp66
-rw-r--r--modules/TAO/TAO_IDL/be/be_field.cpp2
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp2
-rw-r--r--modules/TAO/TAO_IDL/fe/fe_component_header.cpp56
-rw-r--r--modules/TAO/TAO_IDL/fe/fe_home_header.cpp53
-rw-r--r--modules/TAO/TAO_IDL/fe/fe_interface_header.cpp165
-rw-r--r--modules/TAO/TAO_IDL/fe/fe_obv_header.cpp64
-rw-r--r--modules/TAO/TAO_IDL/fe/idl.yy218
-rw-r--r--modules/TAO/TAO_IDL/fe/y.tab.cpp221
-rw-r--r--modules/TAO/TAO_IDL/include/ast_interface.h10
-rw-r--r--modules/TAO/TAO_IDL/include/fe_component_header.h2
-rw-r--r--modules/TAO/TAO_IDL/include/fe_home_header.h4
-rw-r--r--modules/TAO/TAO_IDL/include/fe_interface_header.h15
-rw-r--r--modules/TAO/TAO_IDL/include/fe_obv_header.h12
-rw-r--r--modules/TAO/TAO_IDL/include/utl_exceptlist.h12
-rw-r--r--modules/TAO/TAO_IDL/util/utl_exceptlist.cpp10
-rw-r--r--modules/TAO/TAO_IDL/util/utl_scope.cpp14
18 files changed, 730 insertions, 222 deletions
diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog
index 1a0d4e9d39c..89bd022c31c 100644
--- a/modules/TAO/ChangeLog
+++ b/modules/TAO/ChangeLog
@@ -1,3 +1,29 @@
+Tue Dec 15 20:34:51 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/include/utl_exceptlist.h:
+ * TAO_IDL/include/fe_home_header.h:
+ * TAO_IDL/include/fe_interface_header.h:
+ * TAO_IDL/include/fe_obv_header.h:
+ * TAO_IDL/include/ast_interface.h:
+ * TAO_IDL/include/fe_component_header.h:
+ * TAO_IDL/be/be_visitor_home/home_ex_idl.cpp:
+ * TAO_IDL/be/be_field.cpp:
+ * TAO_IDL/ast/ast_operation.cpp:
+ * TAO_IDL/fe/fe_obv_header.cpp:
+ * TAO_IDL/fe/fe_home_header.cpp:
+ * TAO_IDL/fe/y.tab.cpp:
+ * TAO_IDL/fe/fe_interface_header.cpp:
+ * TAO_IDL/fe/fe_component_header.cpp:
+ * TAO_IDL/fe/idl.yy:
+ * TAO_IDL/util/utl_exceptlist.cpp:
+ * TAO_IDL/util/utl_scope.cpp:
+
+ - Added support for template parameters in an
+ operation throw spec.
+
+ - Began support for template parameters as
+ base interfaces/valuetypes and supported interfaces.
+
Mon Dec 14 20:26:51 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/include/ast_template_common.h:
diff --git a/modules/TAO/TAO_IDL/ast/ast_operation.cpp b/modules/TAO/TAO_IDL/ast/ast_operation.cpp
index ad558b03ed4..6e9215470ea 100644
--- a/modules/TAO/TAO_IDL/ast/ast_operation.cpp
+++ b/modules/TAO/TAO_IDL/ast/ast_operation.cpp
@@ -78,18 +78,18 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "ast_predefined_type.h"
#include "ast_argument.h"
#include "ast_exception.h"
+#include "ast_param_holder.h"
+#include "ast_typedef.h"
#include "ast_visitor.h"
+
#include "utl_err.h"
#include "utl_namelist.h"
#include "utl_exceptlist.h"
#include "utl_identifier.h"
#include "utl_string.h"
#include "utl_strlist.h"
-#include "global_extern.h"
-ACE_RCSID (ast,
- ast_operation,
- "$Id$")
+#include "global_extern.h"
AST_Operation::AST_Operation (void)
: COMMON_Base (),
@@ -335,7 +335,7 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t)
}
UTL_ScopedName *nl_n = 0;
- AST_Exception *fe = 0;
+ AST_Type *fe = 0;
AST_Decl *d = 0;
this->pd_exceptions = 0;
@@ -350,9 +350,57 @@ AST_Operation::fe_add_exceptions (UTL_NameList *t)
idl_global->err ()->lookup_error (nl_n);
return 0;
}
-
- bool oneway_op = (this->flags () == AST_Operation::OP_oneway);
- fe = AST_Exception::narrow_from_decl (d);
+
+ AST_Decl::NodeType nt = d->node_type ();
+
+ switch (nt)
+ {
+ case AST_Decl::NT_except:
+ break;
+ case AST_Decl::NT_param_holder:
+ {
+ AST_Param_Holder *ph =
+ AST_Param_Holder::narrow_from_decl (d);
+
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_except
+ && nt != AST_Decl::NT_type)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+ }
+
+ break;
+ }
+ case AST_Decl::NT_typedef:
+ {
+ AST_Typedef *td =
+ AST_Typedef::narrow_from_decl (d);
+
+ nt = td->primitive_base_type ()->node_type ();
+
+ if (nt != AST_Decl::NT_except)
+ {
+ idl_global->err ()->error1 (
+ UTL_Error::EIDL_ILLEGAL_RAISES,
+ this);
+ }
+
+ break;
+ }
+ default:
+ idl_global->err ()->error1 (
+ UTL_Error::EIDL_ILLEGAL_RAISES,
+ this);
+
+ break;
+ };
+
+ bool oneway_op =
+ (this->flags () == AST_Operation::OP_oneway);
+
+ fe = AST_Type::narrow_from_decl (d);
if (oneway_op && fe != 0)
{
@@ -476,7 +524,7 @@ void
AST_Operation::dump (ACE_OSTREAM_TYPE &o)
{
AST_Decl *d = 0;
- AST_Exception *e = 0;
+ AST_Type *e = 0;
UTL_String *s = 0;
if (this->pd_flags == OP_oneway)
diff --git a/modules/TAO/TAO_IDL/be/be_field.cpp b/modules/TAO/TAO_IDL/be/be_field.cpp
index 374227a89ee..a65cd7c6b7e 100644
--- a/modules/TAO/TAO_IDL/be/be_field.cpp
+++ b/modules/TAO/TAO_IDL/be/be_field.cpp
@@ -99,8 +99,8 @@ be_field::accept (be_visitor *visitor)
void
be_field::destroy (void)
{
+ // AST_Field::destroy() is called by another path.
this->be_decl::destroy ();
- this->AST_Field::destroy ();
}
IMPL_NARROW_FROM_DECL (be_field)
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp b/modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp
index e6ca171b1ab..be4a564bc69 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_home/home_ex_idl.cpp
@@ -374,7 +374,7 @@ be_visitor_home_ex_idl::gen_exception_list (
!ei.is_done ()
;)
{
- AST_Exception *ex = ei.item ();
+ AST_Type *ex = ei.item ();
ACE_CString ex_name =
IdentifierHelper::orig_sn (ex->name ());
diff --git a/modules/TAO/TAO_IDL/fe/fe_component_header.cpp b/modules/TAO/TAO_IDL/fe/fe_component_header.cpp
index 9c8c1b3ea31..d05f0a6247b 100644
--- a/modules/TAO/TAO_IDL/fe/fe_component_header.cpp
+++ b/modules/TAO/TAO_IDL/fe/fe_component_header.cpp
@@ -1,18 +1,18 @@
// $Id$
#include "fe_component_header.h"
+
#include "ast_component.h"
#include "ast_module.h"
+#include "ast_param_holder.h"
+
#include "utl_err.h"
#include "utl_namelist.h"
+
#include "fe_extern.h"
#include "global_extern.h"
#include "nr_extern.h"
-ACE_RCSID (fe,
- fe_component_header,
- "$Id$")
-
FE_ComponentHeader::FE_ComponentHeader (UTL_ScopedName *n,
UTL_ScopedName *base_component,
UTL_NameList *supports,
@@ -38,7 +38,7 @@ FE_ComponentHeader::base_component (void) const
return this->base_component_;
}
-AST_Interface **
+AST_Type **
FE_ComponentHeader::supports (void) const
{
return this->inherits_;
@@ -117,7 +117,8 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports)
AST_Decl *d = 0;
UTL_ScopedName *item = 0;;
- AST_Interface *i = 0;
+ AST_Interface *iface = 0;
+ AST_Type *t = 0;
long j = 0;
long k = 0;
@@ -141,8 +142,7 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports)
// Look it up.
UTL_Scope *s = idl_global->scopes ().top ();
- d = s->lookup_by_name (item,
- true);
+ d = s->lookup_by_name (item, true);
if (d == 0)
{
@@ -166,40 +166,60 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports)
throw Bailout ();
}
- // Not an appropriate interface?
+ // Remove typedefs, if any.
if (d->node_type () == AST_Decl::NT_typedef)
{
d = AST_Typedef::narrow_from_decl (d)->primitive_base_type ();
}
- i = AST_Interface::narrow_from_decl (d);
+ AST_Decl::NodeType nt = d->node_type ();
+ t = AST_Type::narrow_from_decl (d);
- // Not an interface?
- if (i == 0 || i->node_type () != AST_Decl::NT_interface)
+ if (nt == AST_Decl::NT_interface)
+ {
+ iface = AST_Interface::narrow_from_decl (d);
+ }
+ else if (nt == AST_Decl::NT_param_holder)
+ {
+ AST_Param_Holder *ph =
+ AST_Param_Holder::narrow_from_decl (d);
+
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_interface)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ continue;
+ }
+ }
+ else
{
idl_global->err ()->interface_expected (d);
continue;
}
// Undefined interface?
- if (!i->is_defined ())
+ if (iface != 0 && !iface->is_defined ())
{
idl_global->err ()->inheritance_fwd_error (this->interface_name_,
- i);
+ iface);
continue;
}
// Local interface? (illegal for components to support).
- if (i->is_local ())
+ if (iface->is_local ())
{
idl_global->err ()->unconstrained_interface_expected (this->name (),
- i->name ());
+ iface->name ());
continue;
}
// OK, see if we have to add this to the list of interfaces
// inherited from.
- this->compile_one_inheritance (i);
+ this->compile_one_inheritance (t);
}
// OK, install in interface header.
@@ -221,7 +241,7 @@ FE_ComponentHeader::compile_supports (UTL_NameList *supports)
if (this->iused_ > 0)
{
ACE_NEW (this->inherits_,
- AST_Interface *[this->iused_]);
+ AST_Type *[this->iused_]);
for (k = 0; k < this->iused_; ++k)
{
diff --git a/modules/TAO/TAO_IDL/fe/fe_home_header.cpp b/modules/TAO/TAO_IDL/fe/fe_home_header.cpp
index e7b26c32511..987dd395597 100644
--- a/modules/TAO/TAO_IDL/fe/fe_home_header.cpp
+++ b/modules/TAO/TAO_IDL/fe/fe_home_header.cpp
@@ -1,16 +1,16 @@
// $Id$
#include "fe_home_header.h"
+
#include "ast_home.h"
#include "ast_valuetype.h"
+#include "ast_param_holder.h"
+
#include "utl_err.h"
+
#include "fe_extern.h"
#include "global_extern.h"
-ACE_RCSID (fe,
- fe_home_header,
- "$Id$")
-
FE_HomeHeader::FE_HomeHeader (UTL_ScopedName *n,
UTL_ScopedName *base_home,
UTL_NameList *supports,
@@ -46,7 +46,7 @@ FE_HomeHeader::managed_component (void) const
return this->managed_component_;
}
-AST_ValueType *
+AST_Type *
FE_HomeHeader::primary_key (void) const
{
return this->primary_key_;
@@ -82,26 +82,26 @@ FE_HomeHeader::compile_inheritance (UTL_ScopedName *base_home)
if (this->base_home_ == 0)
{
- idl_global->err ()->inheritance_error (this->name (),
- d);
+ idl_global->err ()->inheritance_error (this->name (), d);
}
}
void
-FE_HomeHeader::compile_managed_component (UTL_ScopedName *managed_component)
+FE_HomeHeader::compile_managed_component (
+ UTL_ScopedName *mc_name)
{
- if (managed_component == 0)
+ if (mc_name == 0)
{
return;
}
UTL_Scope *s = idl_global->scopes ().top_non_null ();
- AST_Decl *d = s->lookup_by_name (managed_component,
+ AST_Decl *d = s->lookup_by_name (mc_name,
true);
if (d == 0)
{
- idl_global->err ()->lookup_error (managed_component);
+ idl_global->err ()->lookup_error (mc_name);
// This is probably the result of bad IDL.
// We will crash if we continue from here.
@@ -150,11 +150,38 @@ FE_HomeHeader::compile_primary_key (UTL_ScopedName *primary_key)
d = AST_Typedef::narrow_from_decl (d)->primitive_base_type ();
}
- this->primary_key_ = AST_ValueType::narrow_from_decl (d);
+ this->primary_key_ = AST_Type::narrow_from_decl (d);
- if (this->primary_key_ == 0 || nt != AST_Decl::NT_valuetype)
+ if (this->primary_key_ == 0)
{
idl_global->err ()->valuetype_expected (d);
}
+ else
+ {
+ switch (nt)
+ {
+ case AST_Decl::NT_valuetype:
+ break;
+ case AST_Decl::NT_param_holder:
+ {
+ AST_Param_Holder *ph =
+ AST_Param_Holder::narrow_from_decl (d);
+
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_except)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+ }
+
+ break;
+ }
+ default:
+ idl_global->err ()->valuetype_expected (d);
+ break;
+ };
+ }
}
diff --git a/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp b/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp
index 26972d69daa..2e9ff36f942 100644
--- a/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp
+++ b/modules/TAO/TAO_IDL/fe/fe_interface_header.cpp
@@ -69,21 +69,21 @@ 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 "ast_param_holder.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
@@ -138,6 +138,7 @@ FE_InterfaceHeader::FE_InterfaceHeader (UTL_ScopedName *n,
bool is_abstract,
bool compile_now)
: interface_name_ (n),
+ has_template_parent_ (false),
inherits_ (0),
n_inherits_ (0),
inherits_flat_ (0),
@@ -190,7 +191,7 @@ FE_InterfaceHeader::destroy (void)
// Add this interface to the list of inherited if not already there.
void
-FE_InterfaceHeader::compile_one_inheritance (AST_Interface *i)
+FE_InterfaceHeader::compile_one_inheritance (AST_Type *i)
{
// Check for badly formed interface.
if (i == 0)
@@ -206,27 +207,52 @@ FE_InterfaceHeader::compile_one_inheritance (AST_Interface *i)
// OK, add i to the list of inherited interfaces.
this->add_inheritance (i);
+
+ AST_Interface *iface =
+ AST_Interface::narrow_from_decl (i);
- // And add i to the flat list as well.
- if (!this->already_seen_flat (i))
+ if (iface == 0)
{
- this->add_inheritance_flat (i);
+ // If a template parameter as parent appears at any time,
+ // we bag the flat list until instantiation time.
+ this->has_template_parent_ = true;
+ this->destroy_flat_arrays ();
}
-
- // Add i's parents to the flat list.
- AST_Interface **parents = i->inherits_flat ();
- long num_parents = i->n_inherits_flat ();
-
- for (long j = 0; j < num_parents; ++j)
+ else if (! this->has_template_parent_)
{
- AST_Interface *tmp = parents[j];
-
- if (this->already_seen_flat (tmp))
+ // And add i to the flat list as well.
+ if (!this->already_seen_flat (iface))
{
- continue;
+ this->add_inheritance_flat (iface);
}
+
+ // Add i's parents to the flat list.
+ AST_Type **parents = iface->inherits_flat ();
+ long num_parents = iface->n_inherits_flat ();
- this->add_inheritance_flat (tmp);
+ for (long j = 0; j < num_parents; ++j)
+ {
+ AST_Interface *tmp =
+ AST_Interface::narrow_from_decl (parents[j]);
+
+ if (tmp == 0)
+ {
+ // If a template parameter as parent appears at any time,
+ // we bag the flat list until instantiation time.
+ this->has_template_parent_ = true;
+ this->destroy_flat_arrays ();
+ break;
+ }
+ else if (! this->has_template_parent_)
+ {
+ if (this->already_seen_flat (tmp))
+ {
+ continue;
+ }
+
+ this->add_inheritance_flat (tmp);
+ }
+ }
}
}
@@ -243,12 +269,13 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces,
AST_Decl *d = 0;
UTL_ScopedName *item = 0;;
AST_Interface *i = 0;
- int inh_err = 0;
// Compute expanded flattened non-repeating list of interfaces
// which this one inherits from.
- for (UTL_NamelistActiveIterator l (ifaces); !l.is_done (); l.next ())
+ for (UTL_NamelistActiveIterator l (ifaces);
+ !l.is_done ();
+ l.next ())
{
item = l.item ();
@@ -308,9 +335,11 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces,
// We will crash if we continue from here.
throw Bailout ();
}
+
+ AST_Decl::NodeType nt = d->node_type ();
// Not an appropriate interface?
- if (d->node_type () == AST_Decl::NT_typedef)
+ if (nt == AST_Decl::NT_typedef)
{
d = AST_Typedef::narrow_from_decl (d)->primitive_base_type ();
}
@@ -319,29 +348,51 @@ FE_InterfaceHeader::compile_inheritance (UTL_NameList *ifaces,
if (i != 0)
{
- inh_err = this->check_inherit (i,
- for_valuetype);
+ if (this->check_inherit (i, for_valuetype) == -1)
+ {
+ idl_global->err ()->interface_expected (d);
+ break;
+ }
+ else if (!for_valuetype
+ && this->is_abstract_
+ && !i->is_abstract ())
+ {
+ idl_global->err ()->abstract_inheritance_error (
+ this->name (),
+ i->name ());
+ break;
+ }
}
- else
+ else if (nt == AST_Decl::NT_param_holder)
{
- inh_err = -1;
+ AST_Param_Holder *ph =
+ AST_Param_Holder::narrow_from_decl (d);
+
+ nt = ph->info ()->type_;
+
+ bool ok_param =
+ nt == AST_Decl::NT_type
+ || (nt == AST_Decl::NT_interface && !for_valuetype)
+ || (nt == AST_Decl::NT_valuetype && for_valuetype);
+
+ if (!ok_param)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ break;
+ }
}
-
- if (inh_err == -1)
+ else
{
idl_global->err ()->interface_expected (d);
break;
}
- if (!for_valuetype && this->is_abstract_ && !i->is_abstract ())
- {
- idl_global->err ()->abstract_inheritance_error (this->name (),
- i->name ());
- }
-
// OK, see if we have to add this to the list of interfaces
// inherited from.
- this->compile_one_inheritance (i);
+ this->compile_one_inheritance (
+ AST_Type::narrow_from_decl (d));
}
// OK, install in interface header.
@@ -373,9 +424,9 @@ FE_InterfaceHeader::check_inherit (AST_Interface *i,
// Add an interface to an inheritance spec.
void
-FE_InterfaceHeader::add_inheritance (AST_Interface *i)
+FE_InterfaceHeader::add_inheritance (AST_Type *i)
{
- AST_Interface **oiseen;
+ AST_Type **oiseen;
// Make sure there's space for one more.
if (this->iallocated_ == this->iused_)
@@ -385,7 +436,7 @@ FE_InterfaceHeader::add_inheritance (AST_Interface *i)
this->iallocated_ = INCREMENT;
ACE_NEW (this->iseen_,
- AST_Interface *[this->iallocated_]);
+ AST_Type *[this->iallocated_]);
}
else
{
@@ -393,7 +444,7 @@ FE_InterfaceHeader::add_inheritance (AST_Interface *i)
this->iallocated_ += INCREMENT;
ACE_NEW (this->iseen_,
- AST_Interface *[this->iallocated_]);
+ AST_Type *[this->iallocated_]);
for (long k = 0; k < this->iused_; ++k)
{
@@ -447,11 +498,28 @@ FE_InterfaceHeader::add_inheritance_flat (AST_Interface *i)
// Have we already seen this interface?
bool
-FE_InterfaceHeader::already_seen (AST_Interface *ip)
+FE_InterfaceHeader::already_seen (AST_Type *ip)
{
+ AST_Param_Holder *ph =
+ AST_Param_Holder::narrow_from_decl (ip);
+
for (long i = 0; i < this->iused_; ++i)
{
- if (this->iseen_[i] == ip)
+ AST_Param_Holder *tmp =
+ AST_Param_Holder::narrow_from_decl (this->iseen_[i]);
+
+ if (ph != 0 && tmp != 0)
+ {
+ if (ph->info ()->name_ == tmp->info ()->name_)
+ {
+ idl_global->err ()->duplicate_param_id (ph->name ());
+ ph->destroy ();
+ delete ph;
+ ph = 0;
+ return true;
+ }
+ }
+ else if (this->iseen_[i] == ip)
{
return true;
}
@@ -499,7 +567,7 @@ FE_InterfaceHeader::install_in_header (void)
if (this->iused_ > 0)
{
ACE_NEW (this->inherits_,
- AST_Interface *[this->iused_]);
+ AST_Type *[this->iused_]);
for (k = 0; k < this->iused_; ++k)
{
@@ -518,7 +586,7 @@ FE_InterfaceHeader::name (void) const
return this->interface_name_;
}
-AST_Interface **
+AST_Type **
FE_InterfaceHeader::inherits (void) const
{
return this->inherits_;
@@ -542,3 +610,14 @@ FE_InterfaceHeader::n_inherits_flat (void) const
return this->n_inherits_flat_;
}
+void
+FE_InterfaceHeader::destroy_flat_arrays (void)
+{
+ delete [] this->inherits_flat_;
+ this->inherits_flat_ = 0;
+ delete [] this->iseen_flat_;
+ this->iseen_flat_ = 0;
+ this->n_inherits_flat_ = 0;
+ this->iallocated_flat_ = 0;
+ this->iused_flat_ = 0;
+} \ No newline at end of file
diff --git a/modules/TAO/TAO_IDL/fe/fe_obv_header.cpp b/modules/TAO/TAO_IDL/fe/fe_obv_header.cpp
index 59eeee777fc..2ecb2c6a2f5 100644
--- a/modules/TAO/TAO_IDL/fe/fe_obv_header.cpp
+++ b/modules/TAO/TAO_IDL/fe/fe_obv_header.cpp
@@ -1,17 +1,17 @@
// $Id$
#include "fe_obv_header.h"
+
#include "ast_valuetype.h"
#include "ast_module.h"
-#include "global_extern.h"
+#include "ast_param_holder.h"
+
#include "utl_err.h"
#include "utl_namelist.h"
+
#include "fe_extern.h"
#include "nr_extern.h"
-
-ACE_RCSID (fe,
- fe_obv_header,
- "$Id$")
+#include "global_extern.h"
// @@@ (JP) Here are the rules for interface inheritance and
// value type inheritance and supports, straight from Jonathan
@@ -87,7 +87,7 @@ FE_OBVHeader::~FE_OBVHeader (void)
{
}
-AST_Interface **
+AST_Type **
FE_OBVHeader::supports (void) const
{
return this->supports_;
@@ -99,13 +99,13 @@ FE_OBVHeader::n_supports (void) const
return this->n_supports_;
}
-AST_ValueType *
+AST_Type *
FE_OBVHeader::inherits_concrete (void) const
{
return this->inherits_concrete_;
}
-AST_Interface *
+AST_Type *
FE_OBVHeader::supports_concrete (void) const
{
return this->supports_concrete_;
@@ -132,8 +132,8 @@ FE_OBVHeader::compile_inheritance (UTL_NameList *vtypes,
if (this->n_inherits_ > 0)
{
- AST_Interface *iface = this->inherits_[0];
- AST_ValueType *vt = AST_ValueType::narrow_from_decl (iface);
+ AST_Type *t = this->inherits_[0];
+ AST_ValueType *vt = AST_ValueType::narrow_from_decl (t);
if (vt != 0
&& vt->is_abstract () == false)
@@ -149,17 +149,17 @@ FE_OBVHeader::compile_inheritance (UTL_NameList *vtypes,
for (long i = 1; i < this->n_inherits_; ++i)
{
- iface = this->inherits_[i];
+ t = this->inherits_[i];
- if (!iface->is_abstract ())
+ if (!t->is_abstract ())
{
- idl_global->err ()->abstract_expected (iface);
+ idl_global->err ()->abstract_expected (t);
}
if (! is_eventtype
- && iface->node_type () == AST_Decl::NT_eventtype)
+ && t->node_type () == AST_Decl::NT_eventtype)
{
- idl_global->err ()->valuetype_expected (iface);
+ idl_global->err ()->valuetype_expected (t);
}
}
}
@@ -177,12 +177,14 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports)
long length = supports->length ();
this->n_supports_ = length;
+
ACE_NEW (this->supports_,
- AST_Interface *[length]);
+ AST_Type *[length]);
AST_Decl *d = 0;
UTL_ScopedName *item = 0;;
AST_Interface *iface = 0;
+ AST_Type *t = 0;
int i = 0;
for (UTL_NamelistActiveIterator l (supports); !l.is_done (); l.next ())
@@ -202,8 +204,7 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports)
// Look it up.
UTL_Scope *s = idl_global->scopes ().top ();
- d = s->lookup_by_name (item,
- true);
+ d = s->lookup_by_name (item, true);
if (d == 0)
{
@@ -232,11 +233,30 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports)
{
d = AST_Typedef::narrow_from_decl (d)->primitive_base_type ();
}
+
+ AST_Decl::NodeType nt = d->node_type ();
+ t = AST_Type::narrow_from_decl (d);
- if (d->node_type () == AST_Decl::NT_interface)
+ if (nt == AST_Decl::NT_interface)
{
iface = AST_Interface::narrow_from_decl (d);
}
+ else if (nt == AST_Decl::NT_param_holder)
+ {
+ AST_Param_Holder *ph =
+ AST_Param_Holder::narrow_from_decl (d);
+
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_interface)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ continue;
+ }
+ }
else
{
idl_global->err ()->supports_error (this->interface_name_,
@@ -245,14 +265,14 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports)
}
// Forward declared interface?
- if (!iface->is_defined ())
+ if (iface != 0 && !iface->is_defined ())
{
idl_global->err ()->supports_fwd_error (this->interface_name_,
iface);
continue;
}
- if (!iface->is_abstract ())
+ if (iface != 0 && !iface->is_abstract ())
{
if (i == 0)
{
@@ -273,7 +293,7 @@ FE_OBVHeader::compile_supports (UTL_NameList *supports)
}
}
- this->supports_[i++] = iface;
+ this->supports_[i++] = t;
}
}
diff --git a/modules/TAO/TAO_IDL/fe/idl.yy b/modules/TAO/TAO_IDL/fe/idl.yy
index 85fe1770b96..54b2d87cab2 100644
--- a/modules/TAO/TAO_IDL/fe/idl.yy
+++ b/modules/TAO/TAO_IDL/fe/idl.yy
@@ -5153,6 +5153,8 @@ provides_decl : IDL_PROVIDES interface_type id
// provides_decl : IDL_PROVIDES interface_type id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
AST_Decl *d = s->lookup_by_name ($2,
true);
@@ -5161,20 +5163,49 @@ provides_decl : IDL_PROVIDES interface_type id
idl_global->err ()->lookup_error ($2);
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_interface)
+ else
{
- // Nothing else but CORBA::Object can have
- // this identifier.
- int comp_result =
- ACE_OS::strcmp (d->local_name ()->get_string (),
- "Object");
-
- // Simple provides port must use IDL interface
- // or CORBA::Object.
- if (comp_result != 0)
+ int compare = 0;
+ nt = d->node_type ();
+
+ switch (nt)
{
- idl_global->err ()->interface_expected (d);
- so_far_so_good = false;
+ case AST_Decl::NT_interface:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_interface)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ case AST_Decl::NT_pre_defined:
+ // Nothing else but CORBA::Object can have
+ // this identifier.
+ compare =
+ ACE_OS::strcmp (d->local_name ()->get_string (),
+ "Object");
+
+ // Simple provides port must use IDL interface
+ // or CORBA::Object.
+ if (compare != 0)
+ {
+ idl_global->err ()->interface_expected (d);
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->interface_expected (d);
+ so_far_so_good = false;
+ break;
}
}
@@ -5245,6 +5276,8 @@ uses_decl : uses_opt_multiple interface_type id
// uses_decl : uses_opt_multiple interface_type id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
AST_Decl *d = s->lookup_by_name ($2,
true);
@@ -5253,20 +5286,49 @@ uses_decl : uses_opt_multiple interface_type id
idl_global->err ()->lookup_error ($2);
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_interface)
+ else
{
- // Nothing else but CORBA::Object can have
- // this identifier.
- int comp_result =
- ACE_OS::strcmp (d->local_name ()->get_string (),
- "Object");
-
- // Simple provides port must use IDL interface
- // or CORBA::Object.
- if (comp_result != 0)
+ int compare = 0;
+ nt = d->node_type ();
+
+ switch (nt)
{
- idl_global->err ()->interface_expected (d);
- so_far_so_good = false;
+ case AST_Decl::NT_interface:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_interface)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ case AST_Decl::NT_pre_defined:
+ // Nothing else but CORBA::Object can have
+ // this identifier.
+ compare =
+ ACE_OS::strcmp (d->local_name ()->get_string (),
+ "Object");
+
+ // Simple provides port must use IDL interface
+ // or CORBA::Object.
+ if (compare != 0)
+ {
+ idl_global->err ()->interface_expected (d);
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->interface_expected (d);
+ so_far_so_good = false;
+ break;
}
}
@@ -5294,7 +5356,8 @@ uses_decl : uses_opt_multiple interface_type id
if (c != 0
&& u->is_multiple ()
&& !idl_global->using_ifr_backend ()
- && !idl_global->ignore_idl3 ())
+ && !idl_global->ignore_idl3 ()
+ && nt != AST_Decl::NT_param_holder)
{
// These datatypes must be created in the
// front end so they can be looked up
@@ -5349,16 +5412,39 @@ emits_decl : IDL_EMITS scoped_name id
idl_global->err ()->lookup_error ($2);
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_eventtype)
+ else
{
- idl_global->err ()->eventtype_expected (d);
- so_far_so_good = false;
+ nt = d->node_type ();
+
+ switch (nt)
+ {
+ case AST_Decl::NT_eventtype:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_eventtype)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->eventtype_expected (d);
+ so_far_so_good = false;
+ break;
+ }
}
if (so_far_so_good)
{
- AST_EventType *event_type =
- AST_EventType::narrow_from_decl (d);
+ AST_Type *event_type =
+ AST_Type::narrow_from_decl (d);
// Strip off _cxx_, if any, for port name.
idl_global->original_local_name ($3);
@@ -5388,6 +5474,9 @@ publishes_decl : IDL_PUBLISHES scoped_name id
// publishes_decl : IDL_PUBLISHES scoped_name id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
+
AST_Decl *d = s->lookup_by_name ($2,
true);
@@ -5396,16 +5485,39 @@ publishes_decl : IDL_PUBLISHES scoped_name id
idl_global->err ()->lookup_error ($2);
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_eventtype)
+ else
{
- idl_global->err ()->eventtype_expected (d);
- so_far_so_good = false;
+ nt = d->node_type ();
+
+ switch (nt)
+ {
+ case AST_Decl::NT_eventtype:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_eventtype)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->eventtype_expected (d);
+ so_far_so_good = false;
+ break;
+ }
}
if (so_far_so_good)
{
- AST_EventType *event_type =
- AST_EventType::narrow_from_decl (d);
+ AST_Type *event_type =
+ AST_Type::narrow_from_decl (d);
// Strip off _cxx_, if any, for port name.
idl_global->original_local_name ($3);
@@ -5435,6 +5547,9 @@ consumes_decl : IDL_CONSUMES scoped_name id
// consumes_decl : IDL_CONSUMES scoped_name id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
+
AST_Decl *d = s->lookup_by_name ($2,
true);
@@ -5443,16 +5558,39 @@ consumes_decl : IDL_CONSUMES scoped_name id
idl_global->err ()->lookup_error ($2);
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_eventtype)
+ else
{
- idl_global->err ()->eventtype_expected (d);
- so_far_so_good = false;
+ nt = d->node_type ();
+
+ switch (nt)
+ {
+ case AST_Decl::NT_eventtype:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_eventtype)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->eventtype_expected (d);
+ so_far_so_good = false;
+ break;
+ }
}
if (so_far_so_good)
{
- AST_EventType *event_type =
- AST_EventType::narrow_from_decl (d);
+ AST_Type *event_type =
+ AST_Type::narrow_from_decl (d);
// Strip off _cxx_, if any, for port name.
idl_global->original_local_name ($3);
diff --git a/modules/TAO/TAO_IDL/fe/y.tab.cpp b/modules/TAO/TAO_IDL/fe/y.tab.cpp
index 5cb6f63833c..32f608a0a84 100644
--- a/modules/TAO/TAO_IDL/fe/y.tab.cpp
+++ b/modules/TAO/TAO_IDL/fe/y.tab.cpp
@@ -7943,6 +7943,8 @@ tao_yyreduce:
// provides_decl : IDL_PROVIDES interface_type id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
AST_Decl *d = s->lookup_by_name ((tao_yyvsp[(2) - (3)].idlist),
true);
@@ -7951,20 +7953,49 @@ tao_yyreduce:
idl_global->err ()->lookup_error ((tao_yyvsp[(2) - (3)].idlist));
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_interface)
+ else
{
- // Nothing else but CORBA::Object can have
- // this identifier.
- int comp_result =
- ACE_OS::strcmp (d->local_name ()->get_string (),
- "Object");
-
- // Simple provides port must use IDL interface
- // or CORBA::Object.
- if (comp_result != 0)
+ int compare = 0;
+ nt = d->node_type ();
+
+ switch (nt)
{
- idl_global->err ()->interface_expected (d);
- so_far_so_good = false;
+ case AST_Decl::NT_interface:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_interface)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ case AST_Decl::NT_pre_defined:
+ // Nothing else but CORBA::Object can have
+ // this identifier.
+ compare =
+ ACE_OS::strcmp (d->local_name ()->get_string (),
+ "Object");
+
+ // Simple provides port must use IDL interface
+ // or CORBA::Object.
+ if (compare != 0)
+ {
+ idl_global->err ()->interface_expected (d);
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->interface_expected (d);
+ so_far_so_good = false;
+ break;
}
}
@@ -8039,6 +8070,8 @@ tao_yyreduce:
// uses_decl : uses_opt_multiple interface_type id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
AST_Decl *d = s->lookup_by_name ((tao_yyvsp[(2) - (3)].idlist),
true);
@@ -8047,20 +8080,49 @@ tao_yyreduce:
idl_global->err ()->lookup_error ((tao_yyvsp[(2) - (3)].idlist));
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_interface)
+ else
{
- // Nothing else but CORBA::Object can have
- // this identifier.
- int comp_result =
- ACE_OS::strcmp (d->local_name ()->get_string (),
- "Object");
-
- // Simple provides port must use IDL interface
- // or CORBA::Object.
- if (comp_result != 0)
+ int compare = 0;
+ nt = d->node_type ();
+
+ switch (nt)
{
- idl_global->err ()->interface_expected (d);
- so_far_so_good = false;
+ case AST_Decl::NT_interface:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_interface)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ case AST_Decl::NT_pre_defined:
+ // Nothing else but CORBA::Object can have
+ // this identifier.
+ compare =
+ ACE_OS::strcmp (d->local_name ()->get_string (),
+ "Object");
+
+ // Simple provides port must use IDL interface
+ // or CORBA::Object.
+ if (compare != 0)
+ {
+ idl_global->err ()->interface_expected (d);
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->interface_expected (d);
+ so_far_so_good = false;
+ break;
}
}
@@ -8088,7 +8150,8 @@ tao_yyreduce:
if (c != 0
&& u->is_multiple ()
&& !idl_global->using_ifr_backend ()
- && !idl_global->ignore_idl3 ())
+ && !idl_global->ignore_idl3 ()
+ && nt != AST_Decl::NT_param_holder)
{
// These datatypes must be created in the
// front end so they can be looked up
@@ -8139,6 +8202,9 @@ tao_yyreduce:
// emits_decl : IDL_EMITS scoped_name id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
+
AST_Decl *d = s->lookup_by_name ((tao_yyvsp[(2) - (3)].idlist),
true);
@@ -8147,16 +8213,39 @@ tao_yyreduce:
idl_global->err ()->lookup_error ((tao_yyvsp[(2) - (3)].idlist));
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_eventtype)
+ else
{
- idl_global->err ()->eventtype_expected (d);
- so_far_so_good = false;
+ nt = d->node_type ();
+
+ switch (nt)
+ {
+ case AST_Decl::NT_eventtype:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_eventtype)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->eventtype_expected (d);
+ so_far_so_good = false;
+ break;
+ }
}
if (so_far_so_good)
{
- AST_EventType *event_type =
- AST_EventType::narrow_from_decl (d);
+ AST_Type *event_type =
+ AST_Type::narrow_from_decl (d);
// Strip off _cxx_, if any, for port name.
idl_global->original_local_name ((tao_yyvsp[(3) - (3)].idval));
@@ -8187,6 +8276,9 @@ tao_yyreduce:
// publishes_decl : IDL_PUBLISHES scoped_name id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
+
AST_Decl *d = s->lookup_by_name ((tao_yyvsp[(2) - (3)].idlist),
true);
@@ -8195,16 +8287,39 @@ tao_yyreduce:
idl_global->err ()->lookup_error ((tao_yyvsp[(2) - (3)].idlist));
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_eventtype)
+ else
{
- idl_global->err ()->eventtype_expected (d);
- so_far_so_good = false;
+ nt = d->node_type ();
+
+ switch (nt)
+ {
+ case AST_Decl::NT_eventtype:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_eventtype)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->eventtype_expected (d);
+ so_far_so_good = false;
+ break;
+ }
}
if (so_far_so_good)
{
- AST_EventType *event_type =
- AST_EventType::narrow_from_decl (d);
+ AST_Type *event_type =
+ AST_Type::narrow_from_decl (d);
// Strip off _cxx_, if any, for port name.
idl_global->original_local_name ((tao_yyvsp[(3) - (3)].idval));
@@ -8235,6 +8350,9 @@ tao_yyreduce:
// consumes_decl : IDL_CONSUMES scoped_name id
UTL_Scope *s = idl_global->scopes ().top_non_null ();
bool so_far_so_good = true;
+ AST_Decl::NodeType nt = AST_Decl::NT_type;
+ AST_Param_Holder *ph = 0;
+
AST_Decl *d = s->lookup_by_name ((tao_yyvsp[(2) - (3)].idlist),
true);
@@ -8243,16 +8361,39 @@ tao_yyreduce:
idl_global->err ()->lookup_error ((tao_yyvsp[(2) - (3)].idlist));
so_far_so_good = false;
}
- else if (d->node_type () != AST_Decl::NT_eventtype)
+ else
{
- idl_global->err ()->eventtype_expected (d);
- so_far_so_good = false;
+ nt = d->node_type ();
+
+ switch (nt)
+ {
+ case AST_Decl::NT_eventtype:
+ break;
+ case AST_Decl::NT_param_holder:
+ ph = AST_Param_Holder::narrow_from_decl (d);
+ nt = ph->info ()->type_;
+
+ if (nt != AST_Decl::NT_type
+ && nt != AST_Decl::NT_eventtype)
+ {
+ idl_global->err ()->mismatched_template_param (
+ ph->info ()->name_.c_str ());
+
+ so_far_so_good = false;
+ }
+
+ break;
+ default:
+ idl_global->err ()->eventtype_expected (d);
+ so_far_so_good = false;
+ break;
+ }
}
if (so_far_so_good)
{
- AST_EventType *event_type =
- AST_EventType::narrow_from_decl (d);
+ AST_Type *event_type =
+ AST_Type::narrow_from_decl (d);
// Strip off _cxx_, if any, for port name.
idl_global->original_local_name ((tao_yyvsp[(3) - (3)].idval));
diff --git a/modules/TAO/TAO_IDL/include/ast_interface.h b/modules/TAO/TAO_IDL/include/ast_interface.h
index f04e0ade0a3..465a271ba84 100644
--- a/modules/TAO/TAO_IDL/include/ast_interface.h
+++ b/modules/TAO/TAO_IDL/include/ast_interface.h
@@ -81,9 +81,9 @@ public:
AST_Interface (void);
AST_Interface (UTL_ScopedName *n,
- AST_Interface **ih,
+ AST_Type **ih,
long nih,
- AST_Interface **ih_flat,
+ AST_Type **ih_flat,
long nih_flat,
bool local,
bool abstract);
@@ -97,7 +97,7 @@ public:
// Overridden for valuetypes, components, and eventtypes.
virtual void redefine (AST_Interface *from);
- AST_Interface **inherits (void) const;
+ AST_Type **inherits (void) const;
long n_inherits (void) const;
@@ -166,7 +166,7 @@ protected:
// Queue data structure needed for breadth-first traversal of
// inheritance tree.
- ACE_Unbounded_Queue<AST_Interface *> insert_queue;
+ ACE_Unbounded_Queue<AST_Type *> insert_queue;
// For a special case of a deeply nested inheritance graph and one specific
// way of inheritance in which a node that was already visited,
@@ -177,7 +177,7 @@ protected:
// parent turns out to be a child of the first .
// Queue of dequeued nodes to be searched for the above case.
- ACE_Unbounded_Queue<AST_Interface *> del_queue;
+ ACE_Unbounded_Queue<AST_Type *> del_queue;
// Are we the equivalent interface of a home?
bool home_equiv_;
diff --git a/modules/TAO/TAO_IDL/include/fe_component_header.h b/modules/TAO/TAO_IDL/include/fe_component_header.h
index 055193f9c8d..e17bcf4503f 100644
--- a/modules/TAO/TAO_IDL/include/fe_component_header.h
+++ b/modules/TAO/TAO_IDL/include/fe_component_header.h
@@ -26,7 +26,7 @@ public:
// Data Accessors.
AST_Component *base_component (void) const;
- AST_Interface **supports (void) const;
+ AST_Type **supports (void) const;
long n_supports (void) const;
AST_Interface **supports_flat (void) const;
long n_supports_flat (void) const;
diff --git a/modules/TAO/TAO_IDL/include/fe_home_header.h b/modules/TAO/TAO_IDL/include/fe_home_header.h
index a981e03029c..88a6c6c0b8c 100644
--- a/modules/TAO/TAO_IDL/include/fe_home_header.h
+++ b/modules/TAO/TAO_IDL/include/fe_home_header.h
@@ -29,12 +29,12 @@ public:
// Data Accessors.
AST_Home *base_home (void) const;
AST_Component *managed_component (void) const;
- AST_ValueType *primary_key (void) const;
+ AST_Type *primary_key (void) const;
protected:
AST_Home *base_home_;
AST_Component *managed_component_;
- AST_ValueType *primary_key_;
+ AST_Type *primary_key_;
protected:
void compile_inheritance (UTL_ScopedName *base_home);
diff --git a/modules/TAO/TAO_IDL/include/fe_interface_header.h b/modules/TAO/TAO_IDL/include/fe_interface_header.h
index 8717782f9f0..c56843d00ec 100644
--- a/modules/TAO/TAO_IDL/include/fe_interface_header.h
+++ b/modules/TAO/TAO_IDL/include/fe_interface_header.h
@@ -90,7 +90,7 @@ public:
// Data Accessors.
UTL_ScopedName *name (void) const;
- AST_Interface **inherits (void) const;
+ AST_Type **inherits (void) const;
long n_inherits (void) const;
AST_Interface **inherits_flat (void) const;
long n_inherits_flat (void) const;
@@ -112,25 +112,28 @@ protected:
void compile_inheritance (UTL_NameList *ifaces,
bool for_valuetype);
- void compile_one_inheritance (AST_Interface *i);
+ void compile_one_inheritance (AST_Type *i);
// Called from compile_inheritance().
int check_inherit (AST_Interface *i,
bool for_valuetype);
- void add_inheritance (AST_Interface *i);
+ void add_inheritance (AST_Type *i);
void add_inheritance_flat (AST_Interface *i);
- bool already_seen (AST_Interface *ip);
+ bool already_seen (AST_Type *ip);
bool already_seen_flat (AST_Interface *ip);
void install_in_header (void);
+
+ void destroy_flat_arrays (void);
// Data.
protected:
UTL_ScopedName *interface_name_;
+ bool has_template_parent_;
// Inherited interfaces.
- AST_Interface **inherits_;
+ AST_Type **inherits_;
long n_inherits_;
// Used for name clash checking.
@@ -140,7 +143,7 @@ protected:
bool is_local_;
bool is_abstract_;
- AST_Interface **iseen_;
+ AST_Type **iseen_;
AST_Interface **iseen_flat_;
long iallocated_;
long iused_;
diff --git a/modules/TAO/TAO_IDL/include/fe_obv_header.h b/modules/TAO/TAO_IDL/include/fe_obv_header.h
index 52a998de924..d2410a7eccd 100644
--- a/modules/TAO/TAO_IDL/include/fe_obv_header.h
+++ b/modules/TAO/TAO_IDL/include/fe_obv_header.h
@@ -23,10 +23,10 @@ public:
virtual ~FE_OBVHeader (void);
// Data Accessors.
- AST_Interface **supports (void) const;
+ AST_Type **supports (void) const;
long n_supports (void) const;
- AST_ValueType *inherits_concrete (void) const;
- AST_Interface *supports_concrete (void) const;
+ AST_Type *inherits_concrete (void) const;
+ AST_Type *supports_concrete (void) const;
bool truncatable (void) const;
virtual void destroy (void);
@@ -34,11 +34,11 @@ public:
protected:
// Supported interfaces.
- AST_Interface **supports_;
+ AST_Type **supports_;
long n_supports_;
- AST_ValueType *inherits_concrete_;
- AST_Interface *supports_concrete_;
+ AST_Type *inherits_concrete_;
+ AST_Type *supports_concrete_;
// Currently ignored.
bool truncatable_;
diff --git a/modules/TAO/TAO_IDL/include/utl_exceptlist.h b/modules/TAO/TAO_IDL/include/utl_exceptlist.h
index 5e36d5e2222..5598f08c8c9 100644
--- a/modules/TAO/TAO_IDL/include/utl_exceptlist.h
+++ b/modules/TAO/TAO_IDL/include/utl_exceptlist.h
@@ -69,7 +69,9 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "utl_list.h"
-class AST_Exception;
+// Member type is not AST_Exception, since it could also be a
+// param holder for a template parameter.
+class AST_Type;
// NOTE: This list class only works correctly because we use single public
// inheritance, as opposed to multiple inheritance or public virtual.
@@ -80,11 +82,11 @@ class AST_Exception;
class TAO_IDL_FE_Export UTL_ExceptList : public UTL_List
{
public:
- UTL_ExceptList (AST_Exception *s,
+ UTL_ExceptList (AST_Type *s,
UTL_ExceptList *cdr);
// Get list item.
- AST_Exception *head (void);
+ AST_Type *head (void);
// Cleanup.
virtual void destroy (void);
@@ -95,7 +97,7 @@ public:
private:
// Data.
- AST_Exception *pd_car_data;
+ AST_Type *pd_car_data;
};
// Active iterator for UTL_ExceptList.
@@ -106,7 +108,7 @@ public:
UTL_ExceptlistActiveIterator (UTL_ExceptList *s);
// Get current item
- AST_Exception *item (void);
+ AST_Type *item (void);
};
#endif // _UTL_EXCEPTLIST_UTL_EXCEPTLIST_HH
diff --git a/modules/TAO/TAO_IDL/util/utl_exceptlist.cpp b/modules/TAO/TAO_IDL/util/utl_exceptlist.cpp
index 49e0ce84b12..e0b04978be7 100644
--- a/modules/TAO/TAO_IDL/util/utl_exceptlist.cpp
+++ b/modules/TAO/TAO_IDL/util/utl_exceptlist.cpp
@@ -78,11 +78,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "ace/OS_Memory.h"
-ACE_RCSID (util,
- utl_exceptlist,
- "$Id$")
-
-UTL_ExceptList::UTL_ExceptList (AST_Exception *s,
+UTL_ExceptList::UTL_ExceptList (AST_Type *s,
UTL_ExceptList *cdr)
: UTL_List (cdr),
pd_car_data (s)
@@ -90,7 +86,7 @@ UTL_ExceptList::UTL_ExceptList (AST_Exception *s,
}
// Get list item.
-AST_Exception *
+AST_Type *
UTL_ExceptList::head (void)
{
return this->pd_car_data;
@@ -135,7 +131,7 @@ UTL_ExceptlistActiveIterator::UTL_ExceptlistActiveIterator (UTL_ExceptList *s)
}
// Get current item.
-AST_Exception *
+AST_Type *
UTL_ExceptlistActiveIterator::item (void)
{
if (source == 0)
diff --git a/modules/TAO/TAO_IDL/util/utl_scope.cpp b/modules/TAO/TAO_IDL/util/utl_scope.cpp
index c4d438facb2..9ee364a8b7f 100644
--- a/modules/TAO/TAO_IDL/util/utl_scope.cpp
+++ b/modules/TAO/TAO_IDL/util/utl_scope.cpp
@@ -78,6 +78,8 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "ast_component_fwd.h"
#include "ast_home.h"
#include "ast_porttype.h"
+#include "ast_template_module.h"
+#include "ast_template_module_ref.h"
#include "ast_typedef.h"
#include "ast_type.h"
#include "ast_root.h"
@@ -181,12 +183,20 @@ iter_lookup_by_name_local (AST_Decl *d,
d = td->base_type ();
}
-
+
if (d == 0)
{
return 0;
}
+ AST_Template_Module_Ref *tmr =
+ AST_Template_Module_Ref::narrow_from_decl (d);
+
+ if (tmr != 0)
+ {
+ d = tmr->ref ();
+ }
+
// Try to convert the AST_Decl to a UTL_Scope.
UTL_Scope *sc = DeclAsScope (d);
@@ -2077,8 +2087,6 @@ UTL_Scope::lookup_by_name (UTL_ScopedName *e,
// We have found the root of the identifier in our local scope.
first_one_found = d;
-
- // For the possible call to look_in_inherited() below.
s = DeclAsScope (d);
// OK, start of name is defined. Now loop doing local lookups