summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-11-25 20:21:15 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-11-25 20:21:15 +0000
commit4676054804f7af743243ebc5acf783a5464084ea (patch)
tree4d0a1e14eaa0589646564583efedb271b60aa5e6
parent0f01df9a0a9217de380e1058f0085ef3c758f114 (diff)
downloadATCD-4676054804f7af743243ebc5acf783a5464084ea.tar.gz
ChangeLogTag: Wed Nov 25 20:19:10 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--modules/TAO/ChangeLog10
-rw-r--r--modules/TAO/TAO_IDL/fe/idl.yy29
-rw-r--r--modules/TAO/TAO_IDL/fe/y.tab.cpp4
-rw-r--r--modules/TAO/TAO_IDL/include/utl_err.h7
-rw-r--r--modules/TAO/TAO_IDL/util/utl_err.cpp16
5 files changed, 54 insertions, 12 deletions
diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog
index 7e7ef92a7ea..c7d5d76cb56 100644
--- a/modules/TAO/ChangeLog
+++ b/modules/TAO/ChangeLog
@@ -1,3 +1,13 @@
+Wed Nov 25 20:19:10 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/include/utl_err.h:
+ * TAO_IDL/util/utl_err.cpp:
+ * TAO_IDL/fe/y.tab.cpp:
+ * TAO_IDL/fe/idl.yy:
+
+ Start of semantic actions for instantiated template modules,
+ and related error messages.
+
Wed Nov 25 18:52:19 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
* TAO_IDL/fe/idl.yy:
diff --git a/modules/TAO/TAO_IDL/fe/idl.yy b/modules/TAO/TAO_IDL/fe/idl.yy
index 469729158a5..8fa7334526f 100644
--- a/modules/TAO/TAO_IDL/fe/idl.yy
+++ b/modules/TAO/TAO_IDL/fe/idl.yy
@@ -605,7 +605,6 @@ template_module
: template_module_header
{
// template_module : template_module_header
-
// The module_header rule is common to template module, fixed
// module and instantiated template module. In the last
// case, a fully scoped name is allowed, but here we
@@ -690,12 +689,36 @@ template_module_ref
template_module_inst
: template_module_header
{
+// template_module_inst : template_module_header
+ UTL_Scope *s = idl_global->scopes ().top_non_null ();
+ UTL_ScopedName *sn = $1;
+ AST_Template_Module *ref = 0;
+ AST_Decl *d = s->lookup_by_name (sn, true);
+ bool so_far_so_good = true;
+
+ if (d == 0)
+ {
+ idl_global->err ()->lookup_error (sn);
+ so_far_so_good = false;
+ }
+ else
+ {
+ ref = AST_Template_Module::narrow_from_decl (d);
+
+ if (ref == 0)
+ {
+ idl_global->err ()->template_module_expected (d);
+ so_far_so_good = false;
+ }
+ }
}
at_least_one_actual_parameter '>'
{
+// at_least_one_actual_parameter '>'
}
id
{
+// id
}
;
@@ -1714,10 +1737,6 @@ const_type
AST_Decl *d =
s->lookup_by_name (sn, true);
- $1->destroy ();
- delete $1;
- $1 = 0;
-
if (s != 0 && d != 0)
{
/*
diff --git a/modules/TAO/TAO_IDL/fe/y.tab.cpp b/modules/TAO/TAO_IDL/fe/y.tab.cpp
index 406ebd709aa..265f3a83e8e 100644
--- a/modules/TAO/TAO_IDL/fe/y.tab.cpp
+++ b/modules/TAO/TAO_IDL/fe/y.tab.cpp
@@ -4164,10 +4164,6 @@ tao_yyreduce:
AST_Decl *d =
s->lookup_by_name (sn, true);
- (tao_yyvsp[(1) - (1)].idlist)->destroy ();
- delete (tao_yyvsp[(1) - (1)].idlist);
- (tao_yyvsp[(1) - (1)].idlist) = 0;
-
if (s != 0 && d != 0)
{
/*
diff --git a/modules/TAO/TAO_IDL/include/utl_err.h b/modules/TAO/TAO_IDL/include/utl_err.h
index c7f9df5d415..bad40b6111c 100644
--- a/modules/TAO/TAO_IDL/include/utl_err.h
+++ b/modules/TAO/TAO_IDL/include/utl_err.h
@@ -117,7 +117,7 @@ public:
EIDL_CONCRETE_VT_EXPECTED, // We got something else..
EIDL_ABSTRACT_EXPECTED, // We got something else..
EIDL_EVENTTYPE_EXPECTED, // We got something else..
- EIDL_TMPL_IFACE_EXPECTED, // We got something else..
+ EIDL_TMPL_MODULE_EXPECTED, // We got something else..
EIDL_PORTTYPE_EXPECTED, // We got something else..
EIDL_CONNECTOR_EXPECTED, // We got something else..
EIDL_TYPEDEF_EXPECTED, // We got something else..
@@ -272,6 +272,11 @@ public:
// or inheritance list.
void interface_expected (AST_Decl *d);
+ // Report a situation where a template module was expected but we got
+ // something else instead. This most likely is a case in a template
+ // module instantiation or alias.
+ void template_module_expected (AST_Decl *d);
+
// Report a situation where a value type was expected but we got
// something else instead. This most likely is a case in a primary
// key, emits, publishes or consumes declaration.
diff --git a/modules/TAO/TAO_IDL/util/utl_err.cpp b/modules/TAO/TAO_IDL/util/utl_err.cpp
index 1dc2dcf20c2..03d5999c4b2 100644
--- a/modules/TAO/TAO_IDL/util/utl_err.cpp
+++ b/modules/TAO/TAO_IDL/util/utl_err.cpp
@@ -165,8 +165,8 @@ error_string (UTL_Error::ErrorCode c)
return "abstract type expected: ";
case UTL_Error::EIDL_EVENTTYPE_EXPECTED:
return "event type expected: ";
- case UTL_Error::EIDL_TMPL_IFACE_EXPECTED:
- return "template interface expected: ";
+ case UTL_Error::EIDL_TMPL_MODULE_EXPECTED:
+ return "template module expected: ";
case UTL_Error::EIDL_PORTTYPE_EXPECTED:
return "porttype expected: ";
case UTL_Error::EIDL_CONNECTOR_EXPECTED:
@@ -1120,6 +1120,18 @@ UTL_Error::interface_expected (AST_Decl *d)
idl_global->set_err_count (idl_global->err_count () + 1);
}
+void
+UTL_Error::template_module_expected (AST_Decl *d)
+{
+ idl_error_header (EIDL_TMPL_MODULE_EXPECTED,
+ idl_global->lineno (),
+ idl_global->filename ()->get_string ());
+ 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.