diff options
Diffstat (limited to 'modules/TAO/TAO_IDL/fe/idl.yy')
-rw-r--r-- | modules/TAO/TAO_IDL/fe/idl.yy | 136 |
1 files changed, 77 insertions, 59 deletions
diff --git a/modules/TAO/TAO_IDL/fe/idl.yy b/modules/TAO/TAO_IDL/fe/idl.yy index e973f2439a9..f5f79b8762b 100644 --- a/modules/TAO/TAO_IDL/fe/idl.yy +++ b/modules/TAO/TAO_IDL/fe/idl.yy @@ -6332,6 +6332,11 @@ extended_uses_decl ; extended_port_decl + : template_port_decl + | non_template_port_decl + ; + +template_port_decl : IDL_PORT template_inst IDENTIFIER { // extended_port_decl : IDL_PORT template_inst IDENTIFIER @@ -6390,7 +6395,68 @@ extended_port_decl delete $2; $2 = 0; } - | IDL_PORT scoped_name IDENTIFIER + | IDL_MIRRORPORT template_inst IDENTIFIER + { +// | IDL_MIRRORPORT template_inst IDENTIFIER + idl_global->set_parse_state (IDL_GlobalData::PS_MirrorPortDeclSeen); + UTL_Scope *s = idl_global->scopes ().top_non_null (); + AST_Decl *d = s->lookup_by_name ($2->name_, true); + AST_PortType *pt = 0; + AST_PortType::T_ARGLIST *args = 0; + bool so_far_so_good = true; + + if (d == 0) + { + idl_global->err ()->lookup_error ($2->name_); + so_far_so_good = false; + } + else + { + pt = AST_PortType::narrow_from_decl (d); + + if (pt == 0) + { + idl_global->err ()->error1 (UTL_Error::EIDL_PORTTYPE_EXPECTED, + d); + so_far_so_good = false; + } + else + { + args = + pt->match_arg_names ($2->args_); + + if (args == 0) + { + so_far_so_good = false; + } + } + } + + if (so_far_so_good) + { + Identifier id ($3); + ACE::strdelete ($3); + $3 = 0; + + UTL_ScopedName sn (&id, + 0); + + AST_Mirror_Port *mp = + idl_global->gen ()->create_mirror_port (&sn, + pt, + args); + + (void) s->fe_add_mirror_port (mp); + } + + $2->destroy (); + delete $2; + $2 = 0; + } + ; + +non_template_port_decl + : IDL_PORT scoped_name IDENTIFIER { // extended_port_decl : IDL_PORT scoped_name IDENTIFIER idl_global->set_parse_state (IDL_GlobalData::PS_ExtendedPortDeclSeen); @@ -6450,64 +6516,6 @@ extended_port_decl delete $2; $2 = 0; } - | IDL_MIRRORPORT template_inst IDENTIFIER - { -// | IDL_MIRRORPORT template_inst IDENTIFIER - idl_global->set_parse_state (IDL_GlobalData::PS_MirrorPortDeclSeen); - UTL_Scope *s = idl_global->scopes ().top_non_null (); - AST_Decl *d = s->lookup_by_name ($2->name_, true); - AST_PortType *pt = 0; - AST_PortType::T_ARGLIST *args = 0; - bool so_far_so_good = true; - - if (d == 0) - { - idl_global->err ()->lookup_error ($2->name_); - so_far_so_good = false; - } - else - { - pt = AST_PortType::narrow_from_decl (d); - - if (pt == 0) - { - idl_global->err ()->error1 (UTL_Error::EIDL_PORTTYPE_EXPECTED, - d); - so_far_so_good = false; - } - else - { - args = - pt->match_arg_names ($2->args_); - - if (args == 0) - { - so_far_so_good = false; - } - } - } - - if (so_far_so_good) - { - Identifier id ($3); - ACE::strdelete ($3); - $3 = 0; - - UTL_ScopedName sn (&id, - 0); - - AST_Mirror_Port *mp = - idl_global->gen ()->create_mirror_port (&sn, - pt, - args); - - (void) s->fe_add_mirror_port (mp); - } - - $2->destroy (); - delete $2; - $2 = 0; - } | IDL_MIRRORPORT scoped_name IDENTIFIER { // | IDL_MIRRORPORT scoped_name IDENTIFIER @@ -6633,6 +6641,16 @@ connector_export // ';' idl_global->set_parse_state (IDL_GlobalData::PS_NoState); } + | non_template_port_decl + { +// | template_extended_port_decl + idl_global->set_parse_state (IDL_GlobalData::PS_ExtendedPortDeclSeen); + } + ';' + { +// ';' + idl_global->set_parse_state (IDL_GlobalData::PS_NoState); + } | template_extended_port_decl { // | template_extended_port_decl |