diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-12-12 00:29:59 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-12-12 00:29:59 +0000 |
commit | 2a4255e4f891883322aa18f2a9346b6dbd26546d (patch) | |
tree | dc901e3045794c55c72848b20e0aaf0147b7d704 /TAO/TAO_IDL | |
parent | af4b5e407c33a809da99c7275479e0a1503e8d63 (diff) | |
download | ATCD-2a4255e4f891883322aa18f2a9346b6dbd26546d.tar.gz |
ChangeLogTag: Wed Dec 11 18:26:09 2002 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/fe/idl.ll | 11 | ||||
-rw-r--r-- | TAO/TAO_IDL/fe/lex.yy.cpp | 11 | ||||
-rw-r--r-- | TAO/TAO_IDL/include/idl_global.h | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/util/utl_global.cpp | 17 |
4 files changed, 22 insertions, 23 deletions
diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index f20f40f3b90..1f3daddcbca 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -440,6 +440,7 @@ idl_parse_line_and_file (char *buf) ACE_NEW (tmp, UTL_String (h)); idl_global->set_filename (tmp); + idl_global->update_prefix (tmp->get_string ()); } UTL_String *fname = idl_global->filename (); @@ -473,16 +474,6 @@ idl_parse_line_and_file (char *buf) // This call also manages the #pragma prefix. idl_global->store_include_file_name (nm); } - else if (is_main_filename - && idl_global->pragma_prefixes ().size () > 1 - && idl_global->scopes ().depth () == 1) - { - // If we're here, we have come to the end of an included file, so we - // pop its prefix. - char *trash = 0; - idl_global->pragma_prefixes ().pop (trash); - delete [] trash; - } } // Store a #pragma line into the list of pragmas diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index ffddd4238b8..5882bb19706 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -2631,6 +2631,7 @@ idl_parse_line_and_file (char *buf) ACE_NEW (tmp, UTL_String (h)); idl_global->set_filename (tmp); + idl_global->update_prefix (tmp->get_string ()); } UTL_String *fname = idl_global->filename (); @@ -2664,16 +2665,6 @@ idl_parse_line_and_file (char *buf) // This call also manages the #pragma prefix. idl_global->store_include_file_name (nm); } - else if (is_main_filename - && idl_global->pragma_prefixes ().size () > 1 - && idl_global->scopes ().depth () == 1) - { - // If we're here, we have come to the end of an included file, so we - // pop its prefix. - char *trash = 0; - idl_global->pragma_prefixes ().pop (trash); - delete [] trash; - } } // Store a #pragma line into the list of pragmas diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index 850ab48df34..6d6f3128eb0 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -429,6 +429,9 @@ public: ACE_Unbounded_Stack<char *> & pragma_prefixes (void); // Accessor for the pragma prefix container. + void update_prefix (char *filename); + // Do repo id prefix bookkeeping when the file changes. + UTL_ScopedName *string_to_scoped_name (char *s); // Parses a string with double colons. @@ -518,6 +521,9 @@ private: ACE_Unbounded_Stack<char *> pragma_prefixes_; // Container for all the #pragma prefix declarations. + ACE_Hash_Map_Manager<ACE_CString, ACE_CString, ACE_Null_Mutex> file_prefixes_; + // Remembers the prefixes associated with files, if any. + long last_seen_index_; // The index (not zero-based!) of the last seen included file. diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index f5dbbcb5be8..3cf140f859f 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -477,9 +477,6 @@ IDL_GlobalData::store_include_file_name (UTL_String *n) return; } - // If it's a new filename, we need to push an empty prefix. - idl_global->pragma_prefixes ().push (ACE::strnew ("")); - // OK, need to store. Make sure there's space for one more string if (this->pd_n_include_file_names == this->pd_n_alloced_file_names) { @@ -914,6 +911,20 @@ IDL_GlobalData::pragma_prefixes (void) return this->pragma_prefixes_; } +void +IDL_GlobalData::update_prefix (char *filename) +{ + ACE_CString tmp ("", 0, 0); + ACE_CString fn (filename, 0, 0); + int result = + this->file_prefixes_.trybind (fn, tmp); + char *trash = 0; + this->pragma_prefixes_.pop (trash); + delete [] trash; + this->pragma_prefixes_.push (tmp.rep ()); + this->pd_root->prefix ((char *) tmp.fast_rep ()); +} + UTL_ScopedName * IDL_GlobalData::string_to_scoped_name (char *s) { |