diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-03-24 20:57:40 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-03-24 20:57:40 +0000 |
commit | b7725101b695df43087f487800647f60b038e00c (patch) | |
tree | 6f9b42f2ee6b5e8a81f6c9afe05a6fbfcd3bdce0 /TAO/TAO_IDL | |
parent | 445fcb5110569e5b88f234e1a3a6930b6addb15c (diff) | |
download | ATCD-TypeCode_Overhaul.tar.gz |
*** empty log message ***TypeCode_Overhaul
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp | 47 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp | 13 |
2 files changed, 54 insertions, 6 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp index 0b8ececd286..2c0d9152209 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp @@ -30,7 +30,19 @@ TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node) << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; - // Generate the TypeCode instantiation. + // generate typecode for the base type + this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED); + + if (!base || base->accept (this) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("(%N:%l) be_visitor_alias_typecode") + ACE_TEXT ("::visit_typedef) - ") + ACE_TEXT ("failed to generate base typecode\n")), + -1); + } + + // Generate the alias TypeCode instantiation. os << "static TAO::TypeCode::Alias<char const *," << be_nl << " TAO::Null_RefCount_Policy> const" @@ -38,8 +50,37 @@ TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node) << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl << "\"" << node->repoID () << "\"," << be_nl << "\"" << node->original_local_name () << "\"," << be_nl - << "&" << base->tc_name () << ");" << be_uidt_nl - << be_uidt_nl; + << "&"; + + if (base->is_nested () + && base->defined_in ()->scope_node_type () == AST_Decl::NT_module) + { + be_module * const module = + be_module::narrow_from_scope (base->defined_in ()); + + ACE_ASSERT (module); + + for (UTL_IdListActiveIterator i (module->name ()); + !i.is_done (); + i.next ()) + { + char * const module_name = i.item ()->get_string (); + + if (ACE_OS::strcmp (module_name, "") != 0) + { + os << "::"; + } + + os << module_name; + } + + os << "::_tao_tc_" << base->flat_name (); + } + else + os << "&" << base->tc_name (); + + os << ");" << be_uidt_nl + << be_uidt_nl; return this->gen_typecode_ptr (node); } diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp index fc891a668bd..c6e92a46c8c 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp @@ -259,6 +259,8 @@ be_visitor_typecode_defn::gen_nested_namespace_end (be_module *node) } } + *os << be_nl << be_nl; + return 0; } @@ -396,12 +398,13 @@ be_visitor_typecode_defn::gen_typecode_ptr (be_type * node) if (node->is_nested () && node->defined_in ()->scope_node_type () == AST_Decl::NT_module) { - be_module *module = be_module::narrow_from_scope (node->defined_in ()); + be_module * const module = + be_module::narrow_from_scope (node->defined_in ()); if (!module || (this->gen_nested_namespace_begin (module) == -1)) { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_typecode_defn::visit_type - " + "be_visitor_typecode_defn::gen_typecode_ptr - " "Error parsing nested name\n"), -1); } @@ -430,7 +433,7 @@ be_visitor_typecode_defn::gen_typecode_ptr (be_type * node) os << node->tc_name (); os << " =" << be_idt_nl - << "&_tc_TAO_tc_"; + << "&_tao_tc_"; // Flat name generation. os << node->flat_name (); @@ -688,6 +691,10 @@ be_visitor_typecode_defn::visit_string (be_string * node) << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + os << be_nl << be_nl + << "// WORK DAMN IT!" << be_nl + << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; + // Generate the TypeCode instantiation. os << "static TAO::TypeCode::String<TAO::Null_RefCount_Policy> const" |