From a47931a18b5b9edfba432baae002a9683edab921 Mon Sep 17 00:00:00 2001 From: boris Date: Tue, 6 Jan 2004 23:23:00 +0000 Subject: ChangeLogTag: Tue Jan 6 17:26:33 2004 Boris Kolpackov --- .../CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp | 1 + TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp | 54 +++++++--- TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp | 115 ++++++++++++++++++--- .../CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp | 7 +- TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp | 7 +- TAO/CIAO/ChangeLog | 23 +++-- 6 files changed, 170 insertions(+), 37 deletions(-) diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp index 1dd956a1fb5..4f26c633caa 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp @@ -187,6 +187,7 @@ namespace CCF i); ctx.tu ().new_edge (now (), i); + ctx.tu ().new_edge (now (), i); } catch (Resolve const&) { diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp index 5dab687f127..7563926cf8c 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.cpp @@ -198,6 +198,25 @@ namespace CCF static_type_info () { return nameable_; } + // Extends + // + // + namespace + { + TypeInfo + extends_init_ () + { + TypeInfo ti (typeid (Extends)); + ti.add_base (Access::PUBLIC, true, Edge::static_type_info ()); + return ti; + } + + TypeInfo extends_ (extends_init_ ()); + } + + TypeInfo const& Extends:: + static_type_info () { return extends_; } + // Scope // // @@ -217,26 +236,37 @@ namespace CCF NamesIteratorPair pair (find (first)); - if (name.simple ()) // last name + if (pair.first != pair.second) // Found something. { - for (NamesIterator n (pair.first); n != pair.second; ++n) + if (name.simple ()) // last name { - result.insert (&((**n).named ())); + for (NamesIterator n (pair.first); n != pair.second; ++n) + { + result.insert (&((**n).named ())); + } } - } - else - { - Name rest (name.begin () + 1, name.end ()); - - for (NamesIterator n (pair.first); n != pair.second; ++n) + else { - Nameable& node ((**n).named ()); - if (Scope* s = dynamic_cast (&node)) + Name rest (name.begin () + 1, name.end ()); + + for (NamesIterator n (pair.first); n != pair.second; ++n) { - s->lookup (rest, result); + Nameable& node ((**n).named ()); + if (Scope* s = dynamic_cast (&node)) + { + s->lookup (rest, result); + } } } } + else // Try scopes that we are an extension of. + { + for (ExtendsIterator i (extends_begin ()), e (extends_end ()); + i != e; ++i) + { + (**i).extendee ().lookup (name, result); + } + } } namespace diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp index 3a79b802d60..1a7d02f11a6 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Elements.hpp @@ -96,6 +96,20 @@ namespace CCF Node (); + // This is a bunch of experimantal sink functions that allow + // extensions in the form of one-way edges (see Executor stuff + // in CIDL for example). + // + void + add_edge_left (Edge& e) + { + } + + void + add_edge_right (Edge& e) + { + } + private: CompilerElements::Context context_; }; @@ -304,9 +318,56 @@ namespace CCF std::set Nameables; + class Scope; + + class Extends : public virtual Edge + { + public: + Scope& extender () const + { + return *extender_; + } + + Scope& extendee () const + { + return *extendee_; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph; + + Extends () + { + type_info (static_type_info ()); + } + + void + set_left_node (Scope& s) + { + extender_ = &s; + } + + void + set_right_node (Scope& s) + { + extendee_ = &s; + } + + private: + Scope* extender_; + Scope* extendee_; + }; + class Scope : public virtual Nameable { private: + typedef + std::vector + Extends_; + typedef std::vector Names_; @@ -316,6 +377,27 @@ namespace CCF NamesMap_; public: + // + // + typedef + Extends_::const_iterator + ExtendsIterator; + + ExtendsIterator + extends_begin () const + { + return extends_.begin (); + } + + ExtendsIterator + extends_end () const + { + return extends_.end (); + } + + + // + // typedef Names_::const_iterator NamesIterator; @@ -375,7 +457,23 @@ namespace CCF names_map_[e.name ()].push_back (&e); } + void + add_edge_left (Extends& e) + { + extends_.push_back (&e); + } + + void + add_edge_right (Extends& e) + { + extends_.push_back (&e); + } + + using Nameable::add_edge_right; + private: + Extends_ extends_; + Names_ names_; NamesMap_ names_map_; }; @@ -421,21 +519,8 @@ namespace CCF { } - //@@ this is a bunch of experimantal sink functions - // that allow extensions (see Executor stuff in CIDL - // for example). This code should eventually migrate - // to Node if it is found really useful. - // - - void - add_edge_left (Edge& e) - { - } - - void - add_edge_right (Edge& e) - { - } + using Node::add_edge_right; + using Node::add_edge_left; private: typedef diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp index e8beccd363e..316bd888cbd 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp @@ -75,9 +75,11 @@ namespace CCF { try { - ctx.tu ().new_edge ( - now (), + SemanticGraph::Component& c ( resolve (from, name, Flags::defined)); + + ctx.tu ().new_edge (now (), c); + ctx.tu ().new_edge (now (), c); } catch (Resolve const&) { @@ -123,6 +125,7 @@ namespace CCF i); ctx.tu ().new_edge (now (), i); + ctx.tu ().new_edge (now (), i); } catch (Resolve const&) { diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp index 48e11d33ee4..92f90ef0170 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp @@ -58,9 +58,11 @@ namespace CCF { try { - ctx.tu ().new_edge ( - now (), + SemanticGraph::Home& h ( resolve (from, name, Flags::defined)); + + ctx.tu ().new_edge (now (), h); + ctx.tu ().new_edge (now (), h); } catch (Resolve const&) { @@ -107,6 +109,7 @@ namespace CCF i); ctx.tu ().new_edge (now (), i); + ctx.tu ().new_edge (now (), i); } catch (Resolve const&) { diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index e0159fcdb45..b9b8f4c3eff 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,8 +1,19 @@ +Tue Jan 6 17:26:33 2004 Boris Kolpackov + + * CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp: + * CCF/CCF/IDL2/SemanticGraph/Elements.cpp: + * CCF/CCF/IDL2/SemanticGraph/Elements.hpp: + * CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp: + * CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp: + + Added support for lookup in inherited/supported + scopes. + Tue Jan 6 11:35:27 2004 Jeff Parsons * CIDLC/ServantHeaderGenerator.hpp: * CIDLC/ServantSourceGenerator.hpp: - + Added virtual destructors to classes ServantHeaderEmitter and ServantSourceEmitter to eliminate warnings on g++ 3.3. @@ -10,12 +21,12 @@ Tue Jan 6 11:23:29 2004 Jeff Parsons * examples/OEP/BasicSP/EC/client.cpp: * examples/OEP/BasicSP/EC/controller.cpp: - + Replaced occurrences of cerr with ACE_ERROR_RETURN. - + * examples/OEP/Display/GPS/GPS_exec.cpp: * examples/OEP/Display/GPS/GPS_tracing_exec.cpp: - + Added #include of ace/OS_NS_time.h. Tue Jan 6 10:16:51 2004 Balachandran Natarajan @@ -31,11 +42,11 @@ Mon Jan 5 21:38:53 2004 Boris Kolpackov Fixed uninitialized variable bug that resulted in generation of unused modules. - + * CCF/Example/CIDL/LocalExecutorMapping/test-0.idl: Added unused module to the test case. - + * CIDLC/cidlc.cpp: Cosmetic chnages. -- cgit v1.2.1