diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-05-21 23:06:20 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-05-21 23:06:20 +0000 |
commit | 96db2bd339ca52d7af93621407c1607085a77fb0 (patch) | |
tree | 5610f80c6323be750ce05b6a9a0931efbb0905f7 /TAO/TAO_IDL/ast/ast_module.cpp | |
parent | ffed642fe355fe95f7f93ef6e1b33ff011eb75ce (diff) | |
download | ATCD-96db2bd339ca52d7af93621407c1607085a77fb0.tar.gz |
ChangeLogTag: Fri May 21 23:04:30 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>ChangeLog
Diffstat (limited to 'TAO/TAO_IDL/ast/ast_module.cpp')
-rw-r--r-- | TAO/TAO_IDL/ast/ast_module.cpp | 93 |
1 files changed, 75 insertions, 18 deletions
diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp index 7d95b729334..c3b569bf709 100644 --- a/TAO/TAO_IDL/ast/ast_module.cpp +++ b/TAO/TAO_IDL/ast/ast_module.cpp @@ -199,7 +199,7 @@ AST_Module::referenced (AST_Decl *e, } AST_Decl *d = - this->look_in_prev_mods (e->local_name (), true); + this->look_in_prev_mods_local (e->local_name (), true); if (0 == d) { @@ -213,29 +213,63 @@ AST_Module::referenced (AST_Decl *e, void AST_Module::add_to_previous (AST_Module *m) { - // This will eventually replace the individual declarations - // list below. this->prev_mods_.insert (m); - - for (ACE_Unbounded_Set<AST_Module *>::CONST_ITERATOR i ( - m->prev_mods ()); - !i.done (); - i.advance ()) +} + +AST_Decl * +AST_Module::look_in_prev_mods_local (Identifier *e, + bool ignore_fwd) +{ + AST_Module **m = 0; + AST_Decl *d = 0; + + // If there are more than two openings of this module, we want + // to get the last one - the one that will have the decls from + // all the previous openings added to previous_. + for (ACE_Unbounded_Set<AST_Module *>::CONST_ITERATOR iter ( + this->prev_mods_); + !iter.done (); + iter.advance ()) { - AST_Module **mm = 0; - i.next (mm); + iter.next (m); - this->prev_mods_.insert (*mm); + for (UTL_ScopeActiveIterator i (*m, UTL_Scope::IK_decls); + !i.is_done (); + i.next ()) + { + d = i.item (); + + if (ignore_fwd) + { + AST_Decl::NodeType nt = d->node_type (); + + if (nt == AST_Decl::NT_interface_fwd + || nt == AST_Decl::NT_eventtype_fwd + || nt == AST_Decl::NT_component_fwd + || nt == AST_Decl::NT_struct_fwd + || nt == AST_Decl::NT_union_fwd + || nt == AST_Decl::NT_valuetype_fwd) + { + continue; + } + } + + if (e->case_compare (d->local_name ())) + { + return d; + } + } } + + return 0; } AST_Decl * -AST_Module::look_in_prev_mods (Identifier *e, - bool ignore_fwd) +AST_Module::look_in_prev_mods (UTL_ScopedName *e, + bool full_def_only) { AST_Module **m = 0; AST_Decl *d = 0; - AST_Decl *retval = 0; // If there are more than two openings of this module, we want // to get the last one - the one that will have the decls from @@ -253,7 +287,7 @@ AST_Module::look_in_prev_mods (Identifier *e, { d = i.item (); - if (ignore_fwd) + if (full_def_only) { AST_Decl::NodeType nt = d->node_type (); @@ -268,14 +302,30 @@ AST_Module::look_in_prev_mods (Identifier *e, } } - if (e->case_compare (d->local_name ())) + if (e->head ()->case_compare (d->local_name ())) { - retval = d; + UTL_Scope *s = DeclAsScope (d); + UTL_ScopedName *sn = + static_cast<UTL_ScopedName *> (e->tail ()); + + if (sn == 0) + { + return d; + } + else if (s != 0) + { + d = s->lookup_by_name_r (sn, full_def_only); + + if (d != 0) + { + return d; + } + } } } } - return retval; + return 0; } ACE_Unbounded_Set<AST_Module *> & @@ -309,6 +359,13 @@ AST_Module::from_inst (AST_Template_Module_Inst *node) this->from_inst_ = node; } +AST_Decl * +AST_Module::special_lookup (UTL_ScopedName *e, + bool full_def_only) +{ + return this->look_in_prev_mods (e, full_def_only); +} + //================================================ AST_PredefinedType * |