diff options
author | boris <boris@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-12-23 22:27:01 +0000 |
---|---|---|
committer | boris <boris@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-12-23 22:27:01 +0000 |
commit | cf89c75d74ba99d47ec2f88586ae76342804b480 (patch) | |
tree | 1d96fc235dad8f852e19e38b21aab5b321522ec5 | |
parent | 4ba94c52bd80dbc6c286e9f9f6e487d15a86b861 (diff) | |
download | ATCD-cf89c75d74ba99d47ec2f88586ae76342804b480.tar.gz |
ChangeLogTag: Tue Dec 23 16:26:19 2003 Boris Kolpackov <boris@dre.vanderbilt.edu>
30 files changed, 567 insertions, 195 deletions
diff --git a/TAO/CIAO/CCF/CCF/IDL2/LexicalAnalyzer.cpp b/TAO/CIAO/CCF/CCF/IDL2/LexicalAnalyzer.cpp index e24593db8be..1e665664e05 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/LexicalAnalyzer.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/LexicalAnalyzer.cpp @@ -39,6 +39,7 @@ namespace CCF keyword_table_.insert ("interface" ); keyword_table_.insert ("local" ); keyword_table_.insert ("module" ); + keyword_table_.insert ("oneway" ); keyword_table_.insert ("out" ); keyword_table_.insert ("raises" ); keyword_table_.insert ("sequence" ); diff --git a/TAO/CIAO/CCF/CCF/IDL2/Parser.cpp b/TAO/CIAO/CCF/CCF/IDL2/Parser.cpp index ebd8d2ef937..e5ef98bf15a 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Parser.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Parser.cpp @@ -44,6 +44,7 @@ namespace CCF INTERFACE ("interface" ), LOCAL ("local" ), MODULE ("module" ), + ONEWAY ("oneway" ), OUT ("out" ), RAISES ("raises" ), SEQUENCE ("sequence" ), @@ -190,6 +191,12 @@ namespace CCF // Operation // // + act_operation_one_way ( + f.operation (), &SemanticAction::Operation::one_way), + + act_operation_two_way ( + f.operation (), &SemanticAction::Operation::two_way), + act_operation_type ( f.operation (), &SemanticAction::Operation::type), @@ -736,8 +743,22 @@ namespace CCF // // operation_decl = - identifier[act_operation_type] - >> simple_identifier[act_operation_name] + ( + ( + ONEWAY[act_operation_one_way] + >> identifier[act_operation_type] + ) + | + ( + identifier[act_operation_two_way][act_operation_type] + ) + ) + >> operation_decl_trailer + ; + + + operation_decl_trailer = + simple_identifier[act_operation_name] >> LPAREN >> operation_parameter_list >> RPAREN diff --git a/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp b/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp index 18795137696..65b30935a61 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Parser.hpp @@ -314,6 +314,7 @@ namespace CCF KeywordParser INTERFACE; KeywordParser LOCAL; KeywordParser MODULE; + KeywordParser ONEWAY; KeywordParser OUT; KeywordParser RAISES; KeywordParser SEQUENCE; @@ -416,6 +417,7 @@ namespace CCF Rule member_declarator_list; Rule operation_decl; + Rule operation_decl_trailer; Rule operation_parameter_list; Rule operation_parameter; Rule operation_raises_list; @@ -555,6 +557,8 @@ namespace CCF // Operation // // + NoArgAction<SemanticAction::Operation> + act_operation_one_way, act_operation_two_way; OneArgAction<IdentifierPtr, SemanticAction::Operation> act_operation_type; diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp index 46fa82504cf..33776e04ab1 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp @@ -171,7 +171,7 @@ namespace CCF class AlreadySupported_ {}; typedef ExceptionTemplate<AlreadySupported_> AlreadySupported; - + template<typename I> void check_inheritance (I begin, I end, SemanticGraph::Nameable& t) @@ -181,7 +181,7 @@ namespace CCF void check_support (I begin, I end, SemanticGraph::Nameable& t) throw (AlreadySupported); - + protected: Context& ctx; }; diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp index adc4c89184d..4598af8574e 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp @@ -2,6 +2,7 @@ // author : Boris Kolpackov <boris@dre.vanderbilt.edu> // cvs-id : $Id$ +#include "CCF/IDL2/SemanticGraph/Fundamental.hpp" #include "CCF/IDL2/SemanticAction/Impl/Operation.hpp" #include <iostream> @@ -31,6 +32,22 @@ namespace CCF } void Operation:: + one_way () + { + if (ctx.trace ()) cerr << "oneway "; + + op_ = &ctx.tu ().new_node<OneWayOperation> (); + } + + void Operation:: + two_way () + { + if (ctx.trace ()) cerr << "twoway "; + + op_ = &ctx.tu ().new_node<TwoWayOperation> (); + } + + void Operation:: type (IdentifierPtr const& id) { if (ctx.trace ()) cerr << "operation " << id; @@ -40,11 +57,20 @@ namespace CCF Name name (id->lexeme ()); ScopedName from (ctx.scope ().scoped_name ()); + struct NotVoid : Resolve {}; + try { try { - type_ = &resolve<Type> (from, name, complete); + Type& t (resolve<Type> (from, name, complete)); + + if (op_->one_way ()) + { + if (dynamic_cast<Void*> (&t) == 0) throw NotVoid (); + } + + type_ = &t; } catch (Resolve const&) { @@ -69,6 +95,11 @@ namespace CCF { cerr << "type \'" << e.name () << "\' is not complete" << endl; } + catch (NotVoid const&) + { + cerr << "oneway operation should have void as a return type" + << endl; + } } void Operation:: @@ -76,19 +107,12 @@ namespace CCF { if (ctx.trace ()) cerr << " " << id << endl; - op_ = 0; + SimpleName name (id->lexeme ()); + ctx.tu ().new_edge<Defines> (ctx.scope (), *op_, name); if (type_) { - SimpleName name (id->lexeme ()); - - SemanticGraph::Operation& o ( - ctx.tu ().new_node<SemanticGraph::Operation> ()); - - ctx.tu ().new_edge<Returns> (o, *type_); - ctx.tu ().new_edge<Defines> (ctx.scope (), o, name); - - op_ = &o; + ctx.tu ().new_edge<Returns> (*op_, *type_); } } @@ -101,15 +125,20 @@ namespace CCF if (ctx.trace ()) cerr << "parameter " << direction << " " << type_id << " " << name_id << endl; - if (op_ == 0) return; - Name name (type_id->lexeme ()); ScopedName from (ctx.scope ().scoped_name ()); + struct NotIn : Resolve {}; + try { try { + if (op_->one_way () && direction != Direction::in) + { + throw NotIn (); + } + Type& t (resolve<Type> (from, name, complete)); Parameter* p; @@ -159,6 +188,11 @@ namespace CCF { cerr << "type \'" << e.name () << "\' is not complete" << endl; } + catch (NotIn const&) + { + cerr << "parameter of oneway operation should have \'in\' " + << "direction" << endl; + } } @@ -167,15 +201,17 @@ namespace CCF { if (ctx.trace ()) cerr << "raises " << id << endl; - if (op_ == 0) return; - Name name (id->lexeme ()); ScopedName from (ctx.scope ().scoped_name ()); + struct OneWay : Resolve {}; + try { try { + if (op_->one_way ()) throw OneWay (); + SemanticGraph::Exception& e ( resolve<SemanticGraph::Exception> (from, name)); @@ -200,6 +236,10 @@ namespace CCF cerr << "using non-exception type in raises declaration is " << "illegal" << endl; } + catch (OneWay const&) + { + cerr << "oneway operation may not raise exceptions" << endl; + } } } } diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp index 2fae39df979..b1109f5a196 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp @@ -30,6 +30,12 @@ namespace CCF Operation (Context& c); virtual void + one_way (); + + virtual void + two_way (); + + virtual void type (IdentifierPtr const& id); virtual void diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Operation.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Operation.hpp index 221a7f762b5..b08cfb8160e 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Operation.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Operation.hpp @@ -22,6 +22,12 @@ namespace CCF { public: virtual void + one_way () = 0; + + virtual void + two_way () = 0; + + virtual void type (IdentifierPtr const& id) = 0; virtual void diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Interface.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Interface.hpp index e720473a788..ddd79dc7861 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Interface.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Interface.hpp @@ -6,6 +6,7 @@ #define CCF_IDL2_SEMANTIC_GRAPH_INTERFACE_HPP #include "CCF/IDL2/SemanticGraph/Elements.hpp" +#include "CCF/IDL2/SemanticGraph/Operation.hpp" namespace CCF { @@ -94,7 +95,7 @@ namespace CCF { return object (); } - + static Introspection::TypeInfo const& static_type_info (); diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp index 4be7d134b4e..878bc4076bd 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.cpp @@ -188,6 +188,46 @@ namespace CCF TypeInfo const& Operation:: static_type_info () { return operation_; } + + + // OneWayOperation + // + // + namespace + { + TypeInfo + one_way_operation_init_ () + { + TypeInfo ti (typeid (OneWayOperation)); + ti.add_base (Access::PUBLIC, true, Operation::static_type_info ()); + return ti; + } + + TypeInfo one_way_operation_ (one_way_operation_init_ ()); + } + + TypeInfo const& OneWayOperation:: + static_type_info () { return one_way_operation_; } + + + // TwoWayOperation + // + // + namespace + { + TypeInfo + two_way_operation_init_ () + { + TypeInfo ti (typeid (TwoWayOperation)); + ti.add_base (Access::PUBLIC, true, Operation::static_type_info ()); + return ti; + } + + TypeInfo two_way_operation_ (two_way_operation_init_ ()); + } + + TypeInfo const& TwoWayOperation:: + static_type_info () { return two_way_operation_; } } } } diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.hpp index aa801ea7a4e..a361d2bc47b 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/SemanticGraph/Operation.hpp @@ -322,6 +322,9 @@ namespace CCF return dynamic_cast<Returns&> (belongs ()); } + virtual bool + one_way () const = 0; + static Introspection::TypeInfo const& static_type_info (); @@ -355,6 +358,56 @@ namespace CCF Receives_ receives_; Raises_ raises_; }; + + + // + // + // + class OneWayOperation : public virtual Operation + { + public: + virtual bool + one_way () const + { + return true; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + OneWayOperation () + { + type_info (static_type_info ()); + } + }; + + + // + // + // + class TwoWayOperation : public virtual Operation + { + public: + virtual bool + one_way () const + { + return false; + } + + static Introspection::TypeInfo const& + static_type_info (); + + protected: + friend class Graph<Node, Edge>; + + TwoWayOperation () + { + type_info (static_type_info ()); + } + }; } } } diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.cpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.cpp index 09a793ded58..2fca9de465b 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.cpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.cpp @@ -10,119 +10,6 @@ namespace CCF { namespace Traversal { - // Operation - // - // - void Operation:: - traverse (Type& o) - { - pre (o); - returns (o); - name (o); - receives (o); - raises (o); - post (o); - } - - void Operation:: - pre (Type&) - { - } - - void Operation:: - returns (Type& o, EdgeDispatcherBase& d) - { - d.traverse (o.returns ()); - } - - void Operation:: - returns (Type& o) - { - returns (o, edge_traverser ()); - } - - void Operation:: - name (Type&) - { - } - - void Operation:: - receives (Type& o, EdgeDispatcherBase& d) - { - iterate_and_traverse (o.receives_begin (), o.receives_end (), d); - } - - void Operation:: - receives (Type& o) - { - receives_pre (o); - iterate_and_traverse (o.receives_begin (), - o.receives_end (), - edge_traverser (), - *this, - &Operation::comma, - o); - receives_post (o); - } - - void Operation:: - receives_pre (Type&) - { - } - - void Operation:: - receives_post (Type&) - { - } - - void Operation:: - raises (Type& o, EdgeDispatcherBase& d) - { - iterate_and_traverse (o.raises_begin (), o.raises_end (), d); - } - - void Operation:: - raises (Type& o) - { - Type::RaisesIterator b (o.raises_begin ()), e (o.raises_end ()); - - if (b != e) - { - raises_pre (o); - iterate_and_traverse ( - b, e, edge_traverser (), *this, &Operation::comma, o); - raises_post (o); - } - else - { - raises_none (o); - } - } - - void Operation:: - raises_pre (Type&) - { - } - - void Operation:: - raises_post (Type&) - { - } - - void Operation:: - raises_none (Type&) - { - } - - void Operation:: - post (Type&) - { - } - - void Operation:: - comma (Type&) - { - } } } } diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.hpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.hpp index 79bddb62b66..2cec83888c6 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.hpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.hpp @@ -95,56 +95,69 @@ namespace CCF // // // - struct Operation : Node<SemanticGraph::Operation> + template <typename T> + struct OperationTemplate : Node<T> { virtual void - traverse (Type&); + traverse (T&); virtual void - pre (Type&); + pre (T&); virtual void - returns (Type&, EdgeDispatcherBase&); + returns (T&, EdgeDispatcherBase&); virtual void - returns (Type&); + returns (T&); virtual void - name (Type&); + name (T&); virtual void - receives (Type&, EdgeDispatcherBase&); + receives (T&, EdgeDispatcherBase&); virtual void - receives (Type&); + receives (T&); virtual void - receives_pre (Type&); + receives_pre (T&); virtual void - receives_post (Type&); + receives_post (T&); virtual void - raises (Type&, EdgeDispatcherBase&); + raises (T&, EdgeDispatcherBase&); virtual void - raises (Type&); + raises (T&); virtual void - raises_pre (Type&); + raises_pre (T&); virtual void - raises_post (Type&); + raises_post (T&); virtual void - raises_none (Type&); + raises_none (T&); virtual void - post (Type&); + post (T&); virtual void - comma (Type&); + comma (T&); }; + + typedef + OperationTemplate<SemanticGraph::Operation> + Operation; + + typedef + OperationTemplate<SemanticGraph::OneWayOperation> + OneWayOperation; + + typedef + OperationTemplate<SemanticGraph::TwoWayOperation> + TwoWayOperation; } } } diff --git a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.tpp b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.tpp index fe41b777f1b..5d55e84a23f 100644 --- a/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.tpp +++ b/TAO/CIAO/CCF/CCF/IDL2/Traversal/Operation.tpp @@ -33,7 +33,7 @@ namespace CCF { d.traverse (p.belongs ()); } - + template<typename T> void ParameterTemplate<T>:: belongs (T& p) @@ -52,6 +52,137 @@ namespace CCF post (T&) { } + + + // OperationTemplate + // + // + template<typename T> + void OperationTemplate<T>:: + traverse (T& o) + { + pre (o); + returns (o); + name (o); + receives (o); + raises (o); + post (o); + } + + template<typename T> + void OperationTemplate<T>:: + pre (T&) + { + } + + template<typename T> + void OperationTemplate<T>:: + returns (T& o, EdgeDispatcherBase& d) + { + d.traverse (o.returns ()); + } + + template<typename T> + void OperationTemplate<T>:: + returns (T& o) + { + returns (o, edge_traverser ()); + } + + template<typename T> + void OperationTemplate<T>:: + name (T&) + { + } + + template<typename T> + void OperationTemplate<T>:: + receives (T& o, EdgeDispatcherBase& d) + { + iterate_and_traverse (o.receives_begin (), o.receives_end (), d); + } + + template<typename T> + void OperationTemplate<T>:: + receives (T& o) + { + receives_pre (o); + iterate_and_traverse (o.receives_begin (), + o.receives_end (), + edge_traverser (), + *this, + &OperationTemplate<T>::comma, + o); + receives_post (o); + } + + template<typename T> + void OperationTemplate<T>:: + receives_pre (T&) + { + } + + template<typename T> + void OperationTemplate<T>:: + receives_post (T&) + { + } + + template<typename T> + void OperationTemplate<T>:: + raises (T& o, EdgeDispatcherBase& d) + { + iterate_and_traverse (o.raises_begin (), o.raises_end (), d); + } + + template<typename T> + void OperationTemplate<T>:: + raises (T& o) + { + typename T::RaisesIterator b (o.raises_begin ()), e (o.raises_end ()); + + if (b != e) + { + raises_pre (o); + iterate_and_traverse ( + b, e, edge_traverser (), *this, &OperationTemplate<T>::comma, o); + raises_post (o); + } + else + { + raises_none (o); + } + } + + template<typename T> + void OperationTemplate<T>:: + raises_pre (T&) + { + } + + template<typename T> + void OperationTemplate<T>:: + raises_post (T&) + { + } + + template<typename T> + void OperationTemplate<T>:: + raises_none (T&) + { + } + + template<typename T> + void OperationTemplate<T>:: + post (T&) + { + } + + template<typename T> + void OperationTemplate<T>:: + comma (T&) + { + } } } } diff --git a/TAO/CIAO/CCF/CCF/IDL3/LexicalAnalyzer.cpp b/TAO/CIAO/CCF/CCF/IDL3/LexicalAnalyzer.cpp index 333c7560d04..cefb3617488 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/LexicalAnalyzer.cpp +++ b/TAO/CIAO/CCF/CCF/IDL3/LexicalAnalyzer.cpp @@ -7,7 +7,7 @@ namespace CCF { namespace IDL3 - { + { LexicalAnalyzer:: LexicalAnalyzer (TokenStream<char>& is) : IDL2::LexicalAnalyzer (is) @@ -19,6 +19,7 @@ namespace CCF keyword_table_.insert ("emits" ); keyword_table_.insert ("eventtype"); keyword_table_.insert ("home" ); + keyword_table_.insert ("finder" ); keyword_table_.insert ("manages" ); keyword_table_.insert ("provides" ); keyword_table_.insert ("publishes"); diff --git a/TAO/CIAO/CCF/CCF/IDL3/Makefile.archive b/TAO/CIAO/CCF/CCF/IDL3/Makefile.archive index 177bb50136f..f18078565aa 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/Makefile.archive +++ b/TAO/CIAO/CCF/CCF/IDL3/Makefile.archive @@ -24,6 +24,7 @@ translated_units += SemanticAction/Impl/Component.o \ SemanticAction/Impl/Factory.o \ SemanticAction/Impl/Home.o \ SemanticAction/Impl/HomeFactory.o \ + SemanticAction/Impl/HomeFinder.o \ SemanticAction/Impl/Include.o \ SemanticAction/Impl/Provides.o \ SemanticAction/Impl/Publishes.o \ diff --git a/TAO/CIAO/CCF/CCF/IDL3/Parser.cpp b/TAO/CIAO/CCF/CCF/IDL3/Parser.cpp index 663d7fc8bed..f9094177344 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/Parser.cpp +++ b/TAO/CIAO/CCF/CCF/IDL3/Parser.cpp @@ -25,11 +25,13 @@ namespace CCF EMITS ("emits" ), EVENTTYPE ("eventtype"), HOME ("home" ), + FINDER ("finder" ), MANAGES ("manages" ), PROVIDES ("provides" ), PUBLISHES ("publishes"), USES ("uses" ), + // Component // act_component_begin_def ( @@ -53,16 +55,19 @@ namespace CCF act_component_end ( f.component (), &SemanticAction::Component::end), + // Provides // act_provides_type (f.provides (), &SemanticAction::Provides::type), act_provides_name (f.provides (), &SemanticAction::Provides::name), + // Uses // act_uses_type (f.uses (), &SemanticAction::Uses::type), act_uses_name (f.uses (), &SemanticAction::Uses::name), + // Publishes // act_publishes_type ( @@ -71,16 +76,19 @@ namespace CCF act_publishes_name ( f.publishes (), &SemanticAction::Publishes::name), + // Emits // act_emits_type (f.emits (), &SemanticAction::Emits::type), act_emits_name (f.emits (), &SemanticAction::Emits::name), + // Consumes // act_consumes_type (f.consumes (), &SemanticAction::Consumes::type), act_consumes_name (f.consumes (), &SemanticAction::Consumes::name), + // EventType // act_event_type_begin_concrete_def ( @@ -101,6 +109,7 @@ namespace CCF act_event_type_end ( f.event_type (), &SemanticAction::EventType::end), + // Home // act_home_begin ( @@ -124,6 +133,7 @@ namespace CCF act_home_end ( f.home (), &SemanticAction::Home::end), + // HomeFactory // act_home_factory_name ( @@ -133,7 +143,19 @@ namespace CCF f.home_factory (), &SemanticAction::HomeFactory::parameter), act_home_factory_raises ( - f.home_factory (), &SemanticAction::HomeFactory::raises) + f.home_factory (), &SemanticAction::HomeFactory::raises), + + + // HomeFinder + // + act_home_finder_name ( + f.home_finder (), &SemanticAction::HomeFinder::name), + + act_home_finder_parameter ( + f.home_finder (), &SemanticAction::HomeFinder::parameter), + + act_home_finder_raises ( + f.home_finder (), &SemanticAction::HomeFinder::raises) { IDL2::Parser::extension = @@ -143,8 +165,8 @@ namespace CCF | extension ; + // component // - // Component // component_decl = @@ -211,8 +233,8 @@ namespace CCF ) ; + // ports // - // Component body elements // provides_decl = PROVIDES @@ -249,10 +271,10 @@ namespace CCF >> SEMI ; + + // eventtype // - // Eventtype // - eventtype_decl = EVENTTYPE >> ( @@ -297,7 +319,7 @@ namespace CCF ; // - // Home + // home // home_decl = home_header @@ -329,11 +351,12 @@ namespace CCF attribute_decl | operation_decl | home_factory_decl + | home_finder_decl ) ; + // home factory // - // Home factory // home_factory_decl = FACTORY @@ -361,6 +384,37 @@ namespace CCF identifier[act_home_factory_raises] >> *(COMMA >> identifier[act_home_factory_raises]) ; + + + // home finder + // + // + home_finder_decl = + FINDER + >> simple_identifier[act_home_finder_name] + >> LPAREN + >> home_finder_parameter_list + >> RPAREN + >> !(RAISES >> LPAREN >> home_finder_raises_list >> RPAREN) + >> SEMI + ; + + home_finder_parameter_list = + *( + home_finder_parameter + >> *(COMMA >> home_finder_parameter) + ) + ; + + home_finder_parameter = + IN + >> (identifier >> simple_identifier)[act_home_finder_parameter] + ; + + home_finder_raises_list = + identifier[act_home_finder_raises] + >> *(COMMA >> identifier[act_home_finder_raises]) + ; } } } diff --git a/TAO/CIAO/CCF/CCF/IDL3/Parser.hpp b/TAO/CIAO/CCF/CCF/IDL3/Parser.hpp index ce4b1b0a0fc..20bf58da5a8 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/Parser.hpp +++ b/TAO/CIAO/CCF/CCF/IDL3/Parser.hpp @@ -31,6 +31,7 @@ namespace CCF KeywordParser EMITS; KeywordParser EVENTTYPE; KeywordParser HOME; + KeywordParser FINDER; KeywordParser MANAGES; KeywordParser PROVIDES; KeywordParser PUBLISHES; @@ -76,6 +77,10 @@ namespace CCF Rule home_factory_parameter; Rule home_factory_raises_list; + Rule home_finder_decl; + Rule home_finder_parameter_list; + Rule home_finder_parameter; + Rule home_finder_raises_list; public: Parser (CompilerElements::Context& context, @@ -197,6 +202,19 @@ namespace CCF OneArgAction<IdentifierPtr, SemanticAction::HomeFactory> act_home_factory_raises; + // HomeFinder + // + OneArgAction<SimpleIdentifierPtr, SemanticAction::HomeFinder> + act_home_finder_name; + + TwoArgAction<IdentifierPtr, + SimpleIdentifierPtr, + SemanticAction::HomeFinder> + act_home_finder_parameter; + + OneArgAction<IdentifierPtr, SemanticAction::HomeFinder> + act_home_finder_raises; + }; } } diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction.hpp index f5ea0a1509c..021dbcc598e 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction.hpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction.hpp @@ -15,6 +15,7 @@ #include "CCF/IDL3/SemanticAction/EventType.hpp" #include "CCF/IDL3/SemanticAction/Home.hpp" #include "CCF/IDL3/SemanticAction/HomeFactory.hpp" +#include "CCF/IDL3/SemanticAction/HomeFinder.hpp" #include "CCF/IDL3/SemanticAction/Provides.hpp" #include "CCF/IDL3/SemanticAction/Publishes.hpp" #include "CCF/IDL3/SemanticAction/Uses.hpp" diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Factory.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Factory.hpp index 34feee84ccf..f319094e694 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Factory.hpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Factory.hpp @@ -22,6 +22,7 @@ namespace CCF class EventType; class Home; class HomeFactory; + class HomeFinder; // // @@ -55,6 +56,9 @@ namespace CCF virtual HomeFactory& home_factory () = 0; + + virtual HomeFinder& + home_finder () = 0; }; } } diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp index bc5a0f7b624..57c37360697 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp @@ -28,6 +28,7 @@ namespace CCF event_type_ (ctx_), home_ (ctx_), home_factory_ (ctx_), + home_finder_ (ctx_), include_ (ctx_, context, dout, *this), provides_ (ctx_), publishes_ (ctx_), diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp index 7fd2cbcb871..de3eed7d3fd 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp @@ -19,6 +19,7 @@ #include "CCF/IDL3/SemanticAction/Impl/EventType.hpp" #include "CCF/IDL3/SemanticAction/Impl/Home.hpp" #include "CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp" +#include "CCF/IDL3/SemanticAction/Impl/HomeFinder.hpp" namespace CCF { @@ -80,6 +81,11 @@ namespace CCF return home_factory_; } + virtual SemanticAction::HomeFinder& + home_finder () + { + return home_finder_; + } virtual IDL2::SemanticAction::Include& include () @@ -119,6 +125,7 @@ namespace CCF EventType event_type_; Home home_; HomeFactory home_factory_; + HomeFinder home_finder_; Include include_; Provides provides_; Publishes publishes_; diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Makefile.alt b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Makefile.alt index 86e6bca9548..4fed20d2057 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Makefile.alt +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Makefile.alt @@ -20,6 +20,7 @@ cxx_translation_units := Component.cpp \ Factory.cpp \ Home.cpp \ HomeFactory.cpp \ + HomeFinder.cpp \ Include.cpp \ Provides.cpp \ Publishes.cpp \ diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Home.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Home.cpp index e423cec35b5..deb3dacffa0 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Home.cpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Home.cpp @@ -12,7 +12,7 @@ namespace CCF { using Introspection::TypeInfo; using Introspection::Access; - + // Home // // @@ -43,7 +43,8 @@ namespace CCF home_factory_init_ () { TypeInfo ti (typeid (HomeFactory)); - ti.add_base (Access::PUBLIC, true, Operation::static_type_info ()); + ti.add_base ( + Access::PUBLIC, true, TwoWayOperation::static_type_info ()); return ti; } @@ -63,7 +64,8 @@ namespace CCF home_finder_init_ () { TypeInfo ti (typeid (HomeFinder)); - ti.add_base (Access::PUBLIC, true, Operation::static_type_info ()); + ti.add_base ( + Access::PUBLIC, true, TwoWayOperation::static_type_info ()); return ti; } diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Home.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Home.hpp index 27b98bcdbd1..0055970fb03 100644 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Home.hpp +++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticGraph/Home.hpp @@ -107,7 +107,7 @@ namespace CCF // // // - class HomeFactory : public virtual Operation + class HomeFactory : public virtual TwoWayOperation { public: static Introspection::TypeInfo const& @@ -126,7 +126,7 @@ namespace CCF // // // - class HomeFinder : public virtual Operation + class HomeFinder : public virtual TwoWayOperation { public: static Introspection::TypeInfo const& diff --git a/TAO/CIAO/CCF/Documentation/TODO b/TAO/CIAO/CCF/Documentation/TODO index f7ebf9f6deb..dc4432a0373 100644 --- a/TAO/CIAO/CCF/Documentation/TODO +++ b/TAO/CIAO/CCF/Documentation/TODO @@ -14,10 +14,6 @@ Legend: @@ Write proper build instructions. -@@ Seem to me some of the declaration_class implementations are redundant. - -@% Need to do something with this ctor initialization mess. - @@ Can I use C++ templates instead of m4 in BuiltIn stuff? @@ Typedef.hpp TypeId.hpp: naming inconsistency. @@ -26,13 +22,6 @@ Legend: @@ Need evolution of semantic action error handling/reporting. -@@+ Add Elements to IDL3 and CIDL for consistency. - -@@+ Should CIDL syntax tree files have 'using namespace IDL2::SyntaxTree;' - directives? - -@@++ Add traversal of inheritance list as done for scope. - @@+ It's a good idea to include ostream instead of iostream where I only use ostreams. @@ -43,32 +32,22 @@ Legend: like ;-). This item depends on (1). @@++ 'using namespace' cleanup. - -@@ TypeId::declaration returns ScopedName which is not very consistent - since scoped name in general case denotes a bunch of declarations. - Same for TypePrefix. -%% Perhaps add reference to declaration table to every SyntaxTree::Node - (and not just scopes). - @@ Replace all i++ with ++i. @@ It seems that SyntaxTree::Node origin in terms of file:line should be preserved for subsequent diagnostic implemented as separate paths (see repository id generator for example). - -@@ Rename TypeId/TypePrefix to TypeIdDecl/TypePrefixDecl @@++++ Diagnostic evolution @%++ XML indentation buffer -@%+++ Anonymous types and typedef's model (2) - @@+++ Introduction (injection) of names into scope @@++++ C Preprocessor integration (wave) + %% IDL feature: type id/prefix %% IDL feature: exception declaration @@ -77,6 +56,12 @@ Legend: %% IDL feature: struct +%% IDL feature: enum + +%% IDL feature: factories/finders (completion) (left: finder) + +%% IDL feature: oprations (completion) (left: oneway) + --- @% IDL feature: literals and constant expression (3) @@ -85,14 +70,8 @@ Legend: @% IDL feature: sequences; depends on 2,3 (left: bounded seq) -@% IDL feature: oprations (completion) (left: oneway) - @% IDL feature: attribute (completion) (left: exception spec) -@% IDL feature: factories/finders (completion) (left: finder) - -@@ IDL feature: enum - @@ IDL feature: valuetype (4) @% IDL feature: event (completion); do after (4) diff --git a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/ExecutorMappingGenerator.cpp b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/ExecutorMappingGenerator.cpp index 22ce61dd49d..e5d6c09c430 100644 --- a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/ExecutorMappingGenerator.cpp +++ b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/ExecutorMappingGenerator.cpp @@ -721,6 +721,7 @@ namespace struct ExplicitPortEmitter : Traversal::Attribute, Traversal::Operation, Traversal::HomeFactory, + Traversal::HomeFinder, Emitter { ExplicitPortEmitter (Context& c, ostream& os) @@ -846,6 +847,57 @@ namespace { os << ", "; } + + // HomeFinder. + // + + virtual void + returns (SemanticGraph::HomeFinder&) + { + os << "::Components::EnterpriseComponent "; + } + + virtual void + name (SemanticGraph::HomeFinder& hf) + { + os << " " << hf.name (); + } + + virtual void + receives_pre (SemanticGraph::HomeFinder&) + { + os << " ("; + } + + virtual void + receives_post (SemanticGraph::HomeFinder&) + { + os << ")"; + } + + virtual void + raises_pre (SemanticGraph::HomeFinder&) + { + os << " raises ("; + } + + virtual void + raises_post (SemanticGraph::HomeFinder&) + { + os << ")"; + } + + virtual void + post (SemanticGraph::HomeFinder&) + { + os << ";"; + } + + virtual void + comma (SemanticGraph::HomeFinder&) + { + os << ", "; + } }; struct ParameterEmitter : Traversal::Parameter, public Emitter diff --git a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2.idl b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2.idl index 2f964027f35..57b5d5de22c 100644 --- a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2.idl +++ b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2.idl @@ -59,5 +59,6 @@ module M2 inout S_Seq s_seq) raises (Ex1, Ex2); factory new (in long l, in OctetSeq s) raises (Ex2, Ex1); + finder find (in long l, in OctetSeq s) raises (Ex1, Ex2); }; }; diff --git a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2_exec.idl.orig b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2_exec.idl.orig index 8d487896b4d..8fcc3a95830 100644 --- a/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2_exec.idl.orig +++ b/TAO/CIAO/CCF/Example/CIDL/LocalExecutorMapping/test-2_exec.idl.orig @@ -55,6 +55,7 @@ module M2 attribute ::M2::S_Seq a_s_seq; void foo (in long l, inout boolean b, out long ol, in ::M::I i, out unsigned long long ull, inout ::M2::S_Seq s_seq) raises (::M2::Ex1, ::M2::Ex2); ::Components::EnterpriseComponent new (in long l, in ::M2::OctetSeq s) raises (::M2::Ex2, ::M2::Ex1); + ::Components::EnterpriseComponent find (in long l, in ::M2::OctetSeq s) raises (::M2::Ex1, ::M2::Ex2); }; local interface CCM_H2 : CCM_H2Explicit, CCM_H2Implicit { diff --git a/TAO/CIAO/CCF/Test/IDL2/SemanticGraph/HandBuilt/Builder.cpp b/TAO/CIAO/CCF/Test/IDL2/SemanticGraph/HandBuilt/Builder.cpp index 202a3e6fcd5..764ab3fbc6f 100644 --- a/TAO/CIAO/CCF/Test/IDL2/SemanticGraph/HandBuilt/Builder.cpp +++ b/TAO/CIAO/CCF/Test/IDL2/SemanticGraph/HandBuilt/Builder.cpp @@ -107,7 +107,7 @@ build () // 13: // - Operation& f (tu.new_node<Operation> ()); + TwoWayOperation& f (tu.new_node<TwoWayOperation> ()); tu.new_edge<Returns> (f, void_); Parameter& id (tu.new_node<InParameter> ("id")); diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog index caec38786ee..10b9faf60b0 100644 --- a/TAO/CIAO/ChangeLog +++ b/TAO/CIAO/ChangeLog @@ -1,10 +1,56 @@ +Tue Dec 23 16:26:19 2003 Boris Kolpackov <boris@dre.vanderbilt.edu> + + * CCF/CCF/IDL2/LexicalAnalyzer.cpp: + * CCF/CCF/IDL2/Parser.cpp: + * CCF/CCF/IDL2/Parser.hpp: + * CCF/CCF/IDL2/SemanticAction/Operation.hpp: + * CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp: + * CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp: + * CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp: + * CCF/CCF/IDL2/SemanticGraph/Interface.hpp: + * CCF/CCF/IDL2/SemanticGraph/Operation.cpp: + * CCF/CCF/IDL2/SemanticGraph/Operation.hpp: + * CCF/CCF/IDL2/Traversal/Operation.cpp: + * CCF/CCF/IDL2/Traversal/Operation.hpp: + * CCF/CCF/IDL2/Traversal/Operation.tpp: + * CCF/Test/IDL2/SemanticGraph/HandBuilt/Builder.cpp: + + Added support for oneway operations. + + * CCF/CCF/IDL3/LexicalAnalyzer.cpp: + * CCF/CCF/IDL3/Makefile.archive: + * CCF/CCF/IDL3/Parser.cpp: + * CCF/CCF/IDL3/Parser.hpp: + * CCF/CCF/IDL3/SemanticAction.hpp: + * CCF/CCF/IDL3/SemanticAction/Factory.hpp: + * CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp: + * CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp: + * CCF/CCF/IDL3/SemanticAction/Impl/Makefile.alt: + * CCF/CCF/IDL3/SemanticGraph/Home.cpp: + * CCF/CCF/IDL3/SemanticGraph/Home.hpp: + + Added support for home finders. + + * CCF/Example/CIDL/LocalExecutorMapping/ExecutorMappingGenerator.cpp: + + Added support for feature mentioned above. + + * CCF/Example/CIDL/LocalExecutorMapping/test-2.idl: + * CCF/Example/CIDL/LocalExecutorMapping/test-2_exec.idl.orig: + + Added coverage for features mentioned above. + + * CCF/Documentation/TODO: + + Reflected new achievements. + Tue Dec 23 12:03:27 2003 Boris Kolpackov <boris@dre.vanderbilt.edu> * CIDLC/CIDLC.vcproj: - + Updated VC7.1 projects. Also temporarily excluded from the build generators that are still to be ported. - + * CCF/Example/CIDL/LocalExecutorMapping/ExecutorMappingGenerator.cpp: * CIDLC/ExecutorMappingGenerator.cpp: |