diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-11-30 16:59:02 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-11-30 16:59:02 +0000 |
commit | e4485f190e47bb805ec4588450c0fb8efc2ff44e (patch) | |
tree | f25e94d277e9adde73c9bd4d6e52f1407b15bbee | |
parent | 128b3cc1db8d8374465f9dcebb7fe79420b9c745 (diff) | |
download | ATCD-e4485f190e47bb805ec4588450c0fb8efc2ff44e.tar.gz |
ChangeLogTag: Mon Nov 30 16:56:21 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | modules/TAO/ChangeLog | 16 | ||||
-rw-r--r-- | modules/TAO/TAO_IDL/fe/idl.yy | 1 | ||||
-rw-r--r-- | modules/TAO/TAO_IDL/fe/y.tab.cpp | 47 | ||||
-rw-r--r-- | modules/TAO/TAO_IDL/include/idl_global.h | 4 | ||||
-rw-r--r-- | modules/TAO/TAO_IDL/util/utl_global.cpp | 22 |
5 files changed, 63 insertions, 27 deletions
diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog index 613be70e6fd..7ff070e17de 100644 --- a/modules/TAO/ChangeLog +++ b/modules/TAO/ChangeLog @@ -1,3 +1,19 @@ +Mon Nov 30 16:56:21 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/include/idl_global.h: + * TAO_IDL/util/utl_global.cpp: + + Removed check for illegal const type added in + + Fri Nov 27 23:13:05 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu> + + since it turned out to be unnecessary, the check is made elswhere. + + * TAO_IDL/fe/y.tab.cpp: + * TAO_IDL/fe/idl.yy: + + Added semantic action for single template arg. + Fri Nov 27 23:13:05 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/include/idl_global.h: diff --git a/modules/TAO/TAO_IDL/fe/idl.yy b/modules/TAO/TAO_IDL/fe/idl.yy index 0bbee695fa0..b57149d2f5f 100644 --- a/modules/TAO/TAO_IDL/fe/idl.yy +++ b/modules/TAO/TAO_IDL/fe/idl.yy @@ -1973,6 +1973,7 @@ primary_expr if (d == 0) { idl_global->err ()->lookup_error ($1); + return 1; } else if (d->node_type () == AST_Decl::NT_const) { diff --git a/modules/TAO/TAO_IDL/fe/y.tab.cpp b/modules/TAO/TAO_IDL/fe/y.tab.cpp index 7a2d583131e..6cb7fa2f700 100644 --- a/modules/TAO/TAO_IDL/fe/y.tab.cpp +++ b/modules/TAO/TAO_IDL/fe/y.tab.cpp @@ -4429,6 +4429,7 @@ tao_yyreduce: if (d == 0) { idl_global->err ()->lookup_error ((tao_yyvsp[(1) - (1)].idlist)); + return 1; } else if (d->node_type () == AST_Decl::NT_const) { @@ -9327,7 +9328,51 @@ tao_yyreduce: // a constant and look up the type to add to the template // arg list. AST_Expression *ex = (tao_yyvsp[(1) - (1)].exval); - (tao_yyval.dcval) = 0; + UTL_ScopedName *sn = ex->n (); + AST_Decl *d = 0; + UTL_Scope *s = idl_global->scopes ().top_non_null (); + + if (sn != 0) + { + d = s->lookup_by_name (sn, true); + + if (d == 0) + { + idl_global->err ()->lookup_error (sn); + return 1; + } + else + { + AST_Decl::NodeType nt = d->node_type (); + + if (nt == AST_Decl::NT_enum_val) + { + (tao_yyvsp[(1) - (1)].exval)->evaluate ( + AST_Expression::EK_const); + + (tao_yyval.dcval) = + idl_global->gen ()->create_constant ( + (tao_yyvsp[(1) - (1)].exval)->ev ()->et, + (tao_yyvsp[(1) - (1)].exval), + sn); + } + else + { + (tao_yyval.dcval) = d; + } + } + } + else + { + (tao_yyvsp[(1) - (1)].exval)->evaluate ( + AST_Expression::EK_const); + + (tao_yyval.dcval) = + idl_global->gen ()->create_constant ( + (tao_yyvsp[(1) - (1)].exval)->ev ()->et, + (tao_yyvsp[(1) - (1)].exval), + 0); + } } break; diff --git a/modules/TAO/TAO_IDL/include/idl_global.h b/modules/TAO/TAO_IDL/include/idl_global.h index 97bbc8b456c..491c767bd62 100644 --- a/modules/TAO/TAO_IDL/include/idl_global.h +++ b/modules/TAO/TAO_IDL/include/idl_global.h @@ -663,10 +663,6 @@ public: void original_local_name (Identifier *local_name); // Strips _cxx_ prefix for use in port names. - bool name_is_const_type (AST_Expression *ex); - // If the scoped name member is non-zero, make sure it's - // a legal const type. - private: bool check_one_seq_of_param (FE_Utils::T_PARAMLIST_INFO *list, ACE_CString ¶m_id, diff --git a/modules/TAO/TAO_IDL/util/utl_global.cpp b/modules/TAO/TAO_IDL/util/utl_global.cpp index 6121874ee00..498a35b16da 100644 --- a/modules/TAO/TAO_IDL/util/utl_global.cpp +++ b/modules/TAO/TAO_IDL/util/utl_global.cpp @@ -2066,28 +2066,6 @@ IDL_GlobalData::original_local_name (Identifier *local_name) } bool -IDL_GlobalData::name_is_const_type (AST_Expression *ex) -{ - UTL_ScopedName *sn = ex->n (); - - if (sn != 0) - { - AST_Decl *d = - this->pd_scopes.top_non_null ()->lookup_by_name (sn, true); - - AST_Decl::NodeType nt = d->node_type (); - - if (nt != AST_Decl::NT_const && nt != AST_Decl::NT_enum_val) - { - this->pd_err->constant_expected (sn, d); - return false; - } - } - - return true; -} - -bool IDL_GlobalData::check_one_seq_of_param (FE_Utils::T_PARAMLIST_INFO *list, ACE_CString ¶m_id, size_t index) |