diff options
author | boris <boris@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-12-22 21:35:37 +0000 |
---|---|---|
committer | boris <boris@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-12-22 21:35:37 +0000 |
commit | afcc2f66607ce6ce760a0cc7a82a57706899b925 (patch) | |
tree | dd32e8a267255cc692b1bac58f2a0a76e4d7bbb1 | |
parent | 3c9f2b8a237b67f274ca8d6f329a37f403693a8e (diff) | |
download | ATCD-afcc2f66607ce6ce760a0cc7a82a57706899b925.tar.gz |
Impl
52 files changed, 0 insertions, 4264 deletions
diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp deleted file mode 100644 index 27d8caf2f17..00000000000 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/CIDL/SemanticAction/Impl/Composition.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/CIDL/SemanticAction/Impl/Composition.hpp" - -namespace CCF -{ - namespace CIDL - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.hpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.hpp deleted file mode 100644 index 0bde34b0740..00000000000 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.hpp +++ /dev/null @@ -1,94 +0,0 @@ -// file : CCF/CIDL/SemanticAction/Impl/Composition.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_CIDL_SEMANTIC_ACTION_IMPL_COMPOSITION_HPP -#define CCF_CIDL_SEMANTIC_ACTION_IMPL_COMPOSITION_HPP - -#include "CCF/CIDL/SyntaxTree/Composition.hpp" -#include "CCF/CIDL/SemanticAction/Composition.hpp" -#include "CCF/CIDL/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace CIDL - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Composition : - public virtual SemanticAction::Composition, - public virtual ScopeBase<SyntaxTree::CompositionPtr> - { - public: - virtual - ~Composition () throw () {} - - Composition (bool trace, SyntaxTree::ScopePtr& scope) - : ScopeBase<SyntaxTree::CompositionPtr> (scope), - trace_ (trace) - { - } - - virtual void - begin (SimpleIdentifierPtr const& id, Category::Value c) - { - if (trace_) cerr << "composition " << c << " " << id << endl; - - SyntaxTree::SimpleName name (id->lexeme ()); - - SyntaxTree::Composition::Category::Value category = - SyntaxTree::Composition::Category::SESSION; - - if (c == Category::ENTITY) - { - category = SyntaxTree::Composition::Category::ENTITY; - } - else if (c == Category::PROCESS) - { - category = SyntaxTree::Composition::Category::PROCESS; - } - else if (c == Category::SERVICE) - { - category = SyntaxTree::Composition::Category::SERVICE; - } - - SyntaxTree::CompositionPtr cp ( - new SyntaxTree::Composition (name, category, scope_)); - - scope_->insert (cp); - push (cp); - } - - virtual void - open_scope () - { - scope_ = top (); - } - - virtual void - close_scope () - { - scope_ = scope_->scope (); - } - - virtual void - end () - { - pop (); - if (trace_) cerr << "end" << endl; - } - - private: - bool trace_; - }; - } - } - } -} - -#endif // CCF_CIDL_SEMANTIC_ACTION_IMPL_COMPOSITION_HPP diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Elements.hpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Elements.hpp deleted file mode 100644 index 8379bc63337..00000000000 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Elements.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// file : CCF/CIDL/SemanticAction/Impl/Elements.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_CIDL_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP -#define CCF_CIDL_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP - -#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace CIDL - { - namespace SemanticAction - { - namespace Impl - { - using IDL3::SemanticAction::Impl::ScopeBase; - } - } - } -} - -#endif // CCF_CIDL_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Factory.cpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Factory.cpp deleted file mode 100644 index 4987a9d61dd..00000000000 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Factory.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/CIDL/SemanticAction/Impl/Factory.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/CIDL/SemanticAction/Impl/Factory.hpp" - -namespace CCF -{ - namespace CIDL - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Factory.hpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Factory.hpp deleted file mode 100644 index 857fd4e275c..00000000000 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Factory.hpp +++ /dev/null @@ -1,65 +0,0 @@ -// file : CCF/CIDL/SemanticAction/Impl/Factory.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_CIDL_SEMANTIC_ACTION_IMPL_FACTORY_HPP -#define CCF_CIDL_SEMANTIC_ACTION_IMPL_FACTORY_HPP - -#include "CCF/CIDL/SemanticAction/Factory.hpp" -#include "CCF/IDL3/SemanticAction/Impl/Factory.hpp" - -#include "CCF/CIDL/SemanticAction/Impl/Composition.hpp" -#include "CCF/CIDL/SemanticAction/Impl/HomeExecutor.hpp" - -namespace CCF -{ - namespace CIDL - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Factory : public virtual CIDL::SemanticAction::Factory, - public virtual IDL3::SemanticAction::Impl::Factory - { - public: - virtual - ~Factory () throw () {} - - Factory (CompilerElements::Context& context, - Diagnostic::Stream& dout, - SyntaxTree::TranslationRegionPtr const& r) - : IDL2::SemanticAction::Impl::Factory (context, dout, r), - IDL3::SemanticAction::Impl::Factory (context, dout, r), - trace_ (context.get ("cidl::semantic-action::trace", false)), - composition_ (trace_, scope_), - home_executor_ (trace_, scope_) - { - } - public: - virtual SemanticAction::Composition& - composition () - { - return composition_; - } - - virtual SemanticAction::HomeExecutor& - home_executor () - { - return home_executor_; - } - - private: - bool trace_; - Composition composition_; - HomeExecutor home_executor_; - }; - } - } - } -} - -#endif // CCF_CIDL_SEMANTIC_ACTION_IMPL_FACTORY_HPP diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/HomeExecutor.cpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/HomeExecutor.cpp deleted file mode 100644 index a14734c0b30..00000000000 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/HomeExecutor.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/CIDL/SemanticAction/Impl/HomeExecutor.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/CIDL/SemanticAction/Impl/HomeExecutor.hpp" - -namespace CCF -{ - namespace CIDL - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/HomeExecutor.hpp b/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/HomeExecutor.hpp deleted file mode 100644 index 445f9c34b5b..00000000000 --- a/TAO/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/HomeExecutor.hpp +++ /dev/null @@ -1,162 +0,0 @@ -// file : CCF/CIDL/SemanticAction/Impl/HomeExecutor.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_CIDL_SEMANTIC_ACTION_IMPL_HOME_EXECUTOR_HPP -#define CCF_CIDL_SEMANTIC_ACTION_IMPL_HOME_EXECUTOR_HPP - -#include "CCF/CIDL/SyntaxTree/HomeExecutor.hpp" -#include "CCF/CIDL/SemanticAction/HomeExecutor.hpp" -#include "CCF/CIDL/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace CIDL - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class HomeExecutor : - public virtual SemanticAction::HomeExecutor, - public virtual ScopeBase<SyntaxTree::HomeExecutorPtr> - { - public: - virtual - ~HomeExecutor () throw () {} - - HomeExecutor (bool trace, SyntaxTree::ScopePtr& scope) - : ScopeBase<SyntaxTree::HomeExecutorPtr> (scope), - trace_ (trace), - name_ ("::"), //@@ this is dirty - implements_ ("::"), - manages_ ("::") - - { - } - - virtual void - begin (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "home executor " << id << endl; - name_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - virtual void - open_scope () - { - // Note: nothing is expected to go to home executor scope - // so watch for grammar changes. - } - - virtual void - implements (IdentifierPtr const& id) - { - if (trace_) cerr << "implements " << id << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct ImplementsPredicate : public DeclarationTable::ResolvePredicate - { - struct IncompatibleType : - public DeclarationTable::ResolutionFailure - { - IncompatibleType (std::string const& t) : type (t) {} - std::string type; - }; - - virtual bool - test (DeclarationPtr const& d) const - throw (IncompatibleType) - { - if (!d->is_a<HomeDef> ()) - { - throw IncompatibleType (d->declaration_class ()); - } - - return d->dynamic_type<HomeDef> ()->defined (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - implements_ = sn; - } - catch (ImplementsPredicate::IncompatibleType const& e) - { - cerr << "error: invalid implements specification" << endl; - - cerr << "specifying " << e.type << " \'" << name - << "\' in home executor implements clause is illegal" - << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid implements specification" << endl; - cerr << "no home with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid implements specification" << endl; - cerr << "no defined home with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - cerr << "implementing forward-declared home is illegal" - << endl; - } - - } - - virtual void - manages (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "manages " << id << endl; - manages_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - virtual void - close_scope () - { - // Note: nothing is expected to go to home executor scope - // so watch for grammar changes. - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - - using namespace SyntaxTree; - - HomeExecutorPtr he (new SyntaxTree::HomeExecutor ( - name_, - scope_, - implements_, - manages_)); - scope_->insert (he); - } - private: - bool trace_; - SyntaxTree::SimpleName name_; - SyntaxTree::ScopedName implements_; - SyntaxTree::SimpleName manages_; - }; - } - } - } -} - -#endif // CCF_CIDL_SEMANTIC_ACTION_IMPL_HOME_EXECUTOR_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.cpp deleted file mode 100644 index d629baa3ca7..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Attribute.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Attribute.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.hpp deleted file mode 100644 index a619c80146c..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.hpp +++ /dev/null @@ -1,108 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Attribute.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_ATTRIBUTE_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_ATTRIBUTE_HPP - -#include "CCF/IDL2/SemanticAction/Attribute.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Attribute : public virtual SemanticAction::Attribute - { - public: - virtual - ~Attribute () throw () {} - - Attribute (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current), - type_ ("::") //@@ this is dirty - { - } - - public: - virtual void - type (IdentifierPtr const& id) - { - if (trace_) cerr << "attribute " << id; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<TypeDecl> (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - type_ = sn; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid attribute declaration" << endl; - cerr << "no type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid attribute declaration" << endl; - cerr << "declaration with name \'" << name - << "\' visible from scope \'" << scope_->name () - << "\' is not a type declaration" << endl; - cerr << "using non-type as an attribute type is illegal" - << endl; - } - - } - - virtual void - name (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << " " << id << endl; - - using namespace SyntaxTree; - SimpleName name (id->lexeme ()); - - AttributeDeclPtr a ( - new SyntaxTree::AttributeDecl (name, type_, scope_)); - - scope_->insert (a); - - type_ = ScopedName ("::"); - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::ScopedName type_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_ATTRIBUTE_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.cpp deleted file mode 100644 index 3c7cdc9ba32..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Elements.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp deleted file mode 100644 index 63866d7639a..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp +++ /dev/null @@ -1,92 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Elements.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP - -#include <stack> - -#include "CCF/IDL2/SemanticAction/Elements.hpp" - -//@@tmp -#include <iostream> -using std::cerr; -using std::endl; - -/* - Design notes: - - (1) I am using stack-based approach to handle cases like this: - - struct A - { - struct B - { - struct C - { - ... - } c; - - } b; - }; - - Even though you can't write the same let's say for interface - I am still using stack approach for consistency and possible - meta-coding. - -*/ - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - - // - // - // - template <typename NodeTypePtr> - class ScopeBase : public virtual SemanticAction::Scope - { - protected: - virtual - ~ScopeBase () throw () {} - - ScopeBase (SyntaxTree::ScopePtr& scope) - : scope_ (scope) - { - } - - protected: - void - push (NodeTypePtr const& t) - { - stack_.push (t); - } - - void - pop () - { - stack_.pop (); - } - - NodeTypePtr& - top () - { - return stack_.top (); - } - - protected: - SyntaxTree::ScopePtr& scope_; - std::stack<NodeTypePtr> stack_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp deleted file mode 100644 index f6ecbd8276c..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Factory.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Factory.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp deleted file mode 100644 index 4eb54841b39..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp +++ /dev/null @@ -1,148 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Factory.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_FACTORY_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_FACTORY_HPP - -#include "CCF/IDL2/SemanticAction/Factory.hpp" - -#include "CCF/IDL2/SemanticAction/Impl/Attribute.hpp" -#include "CCF/IDL2/SemanticAction/Impl/Include.hpp" -#include "CCF/IDL2/SemanticAction/Impl/Interface.hpp" -#include "CCF/IDL2/SemanticAction/Impl/Member.hpp" -#include "CCF/IDL2/SemanticAction/Impl/Module.hpp" -#include "CCF/IDL2/SemanticAction/Impl/Operation.hpp" -#include "CCF/IDL2/SemanticAction/Impl/Struct.hpp" -#include "CCF/IDL2/SemanticAction/Impl/Typedef.hpp" -#include "CCF/IDL2/SemanticAction/Impl/TypeId.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Factory : public virtual IDL2::SemanticAction::Factory - { - public: - virtual - ~Factory () throw () {} - - - Factory (CompilerElements::Context& context, - Diagnostic::Stream& dout, - SyntaxTree::TranslationRegionPtr const& r) - : trace_ (context.get ("idl2::semantic-action::trace", false)), - - scope_ (r->scope ()), - - attribute_ (trace_, scope_), - include_ (trace_), - interface_ (trace_, scope_), - member_ (trace_, scope_), - module_ (trace_, scope_), - operation_ (trace_, scope_), - struct__ (trace_, scope_), - system_include_ (trace_), - typedef__ (trace_, scope_), - type_id_ (trace_, scope_), - type_prefix_ (trace_, scope_) - { - } - - virtual SemanticAction::Attribute& - attribute () - { - return attribute_; - } - - virtual SemanticAction::Include& - include () - { - return include_; - } - - virtual SemanticAction::Interface& - interface () - { - return interface_; - } - - virtual SemanticAction::Member& - member () - { - return member_; - } - - virtual SemanticAction::Module& - module () - { - return module_; - } - - virtual SemanticAction::Operation& - operation () - { - return operation_; - } - - virtual SemanticAction::Struct& - struct_ () - { - return struct__; - } - - virtual SemanticAction::SystemInclude& - system_include () - { - return system_include_; - } - - virtual SemanticAction::Typedef& - typedef_ () - { - return typedef__; - } - - virtual SemanticAction::TypeId& - type_id () - { - return type_id_; - } - - virtual SemanticAction::TypePrefix& - type_prefix () - { - return type_prefix_; - } - - protected: - bool trace_; - - SyntaxTree::ScopePtr scope_; - SyntaxTree::TranslationRegionPtr region_; - - Attribute attribute_; - Include include_; - Interface interface_; - Member member_; - Module module_; - Operation operation_; - Struct struct__; - SystemInclude system_include_; - Typedef typedef__; - TypeId type_id_; - TypePrefix type_prefix_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_FACTORY_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.cpp deleted file mode 100644 index 531990a6631..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Include.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Include.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.hpp deleted file mode 100644 index 4e855f3c2a1..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.hpp +++ /dev/null @@ -1,82 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Include.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_INCLUDE_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_INCLUDE_HPP - -#include <stack> - -#include "CCF/IDL2/SyntaxTree/Translation.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // This is left unimplemented for now. Later code from - // IDL3 should be copied here. - // - // - class Include : public virtual SemanticAction::Include - { - public: - virtual - ~Include () throw () {} - - Include (bool trace) - : trace_ (trace) - { - } - - virtual void - begin (StringLiteralPtr const& sl) - { - if (trace_) cerr << "include " << sl << endl; - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - } - - public: - bool trace_; - }; - - class SystemInclude : public virtual SemanticAction::SystemInclude - { - public: - virtual - ~SystemInclude () throw () {} - - SystemInclude (bool trace) - : trace_ (trace) - { - } - - virtual void - begin (StringLiteralPtr const& sl) - { - if (trace_) cerr << "include <" << sl->lexeme () << ">" << endl; - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - } - - public: - bool trace_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_INCLUDE_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp deleted file mode 100644 index f712dd8228d..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Interface.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Interface.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.hpp deleted file mode 100644 index d199a39ddb9..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.hpp +++ /dev/null @@ -1,294 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Interface.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_INTERFACE_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_INTERFACE_HPP - -#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp" - -#include "CCF/IDL2/SemanticAction/Interface.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Interface : public virtual SemanticAction::Interface, - public virtual ScopeBase<SyntaxTree::InterfaceDeclPtr> - { - public: - virtual - ~Interface () throw () {} - - Interface (bool trace, - SyntaxTree::ScopePtr& scope) - : ScopeBase<SyntaxTree::InterfaceDeclPtr> (scope), - trace_ (trace), - name_ ("::") //@@ this is dirty - { - } - - virtual void - begin_abstract (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "abstract interface " << id << endl; - - qualifier_ = Qualifier::ABSTRACT; - name_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - - virtual void - begin_local (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "local interface " << id << endl; - - qualifier_ = Qualifier::LOCAL; - name_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - virtual void - begin_unconstrained (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "unconstrained interface " << id << endl; - - qualifier_ = Qualifier::UNCONSTRAINED; - name_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - virtual void - inherits (IdentifierPtr const& id) - { - using namespace SyntaxTree; - - if (trace_) cerr << " inherits: " << id << endl; - - Name name (id->lexeme ()); - - struct InheritancePredicate : public DeclarationTable::ResolvePredicate - { - InheritancePredicate (Qualifier::Value q) : q_ (q) {} - - struct IncompatibleType : - public DeclarationTable::ResolutionFailure - { - IncompatibleType (std::string const& t) : type (t) {} - std::string type; - }; - - virtual bool - test (DeclarationPtr const& d) const throw (IncompatibleType) - { - bool passed = false; - - switch (q_) - { - case Qualifier::UNCONSTRAINED: - { - if (d->is_a<AbstractInterfaceDecl> () || - d->is_a<UnconstrainedInterfaceDecl> ()) passed = true; - - break; - } - case Qualifier::LOCAL: - { - if (d->is_a<LocalInterfaceDecl> () || - d->is_a<AbstractInterfaceDecl> () || - d->is_a<UnconstrainedInterfaceDecl> ()) passed = true; - - break; - } - case Qualifier::ABSTRACT: - { - if (d->is_a<AbstractInterfaceDecl> ()) passed = true; - - break; - } - } - - if (!passed) throw IncompatibleType (d->declaration_class ()); - - //@@ could instead check for XXDef - // - return d->dynamic_type<InterfaceDecl> ()->defined (); - } - - private: - Qualifier::Value q_; - } p (qualifier_); - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - if (inherits_.insert (sn).second == false) - { - cerr << "error: invalid inheritance specification" << endl; - cerr << "directly inheriting from interface \'" - << sn << "\' more than once is illegal" << endl; - } - } - catch (InheritancePredicate::IncompatibleType const& e) - { - cerr << "error: invalid inheritance specification" << endl; - - cerr << "inheritance of "; - - switch (qualifier_) - { - case Qualifier::UNCONSTRAINED: - { - cerr << "unconstrained "; - break; - } - case Qualifier::LOCAL: - { - cerr << "local "; - break; - } - case Qualifier::ABSTRACT: - { - cerr << "abstract "; - break; - } - } - - cerr << "interface \'" << name_ <<"\' from " - << e.type << " \'" << name << "\' is illegal" << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid inheritance specification" << endl; - cerr << "no interface with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid inheritance specification" << endl; - cerr << "no defined interface with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - cerr << "inheritance from forward-declared interface is illegal" - << endl; - } - } - - virtual void - open_scope () - { - if (trace_) cerr << "scope open" << endl; - - using namespace SyntaxTree; - - InterfaceDefPtr def; - - switch (qualifier_) - { - case Qualifier::UNCONSTRAINED: - { - def = new UnconstrainedInterfaceDef (name_, scope_, inherits_); - break; - } - case Qualifier::LOCAL: - { - def = new LocalInterfaceDef (name_, scope_, inherits_); - break; - } - case Qualifier::ABSTRACT: - { - def = new AbstractInterfaceDef (name_, scope_, inherits_); - break; - } - } - - scope_->insert (def); - push (def); - scope_ = def; - - name_ = SimpleName ("::"); //indicate that we are done - inherits_.clear (); - } - - virtual void - close_scope () - { - scope_ = scope_->scope (); - if (trace_) cerr << "scope close" << endl; - } - - virtual void - end () - { - using namespace SyntaxTree; - - if (trace_) cerr << "end" << endl; - - if (name_ != SimpleName ("::")) - { - InterfaceDeclPtr decl; - - switch (qualifier_) - { - case Qualifier::UNCONSTRAINED: - { - decl = new UnconstrainedInterfaceForwardDecl (name_, scope_); - break; - } - case Qualifier::LOCAL: - { - decl = new LocalInterfaceForwardDecl (name_, scope_); - break; - } - case Qualifier::ABSTRACT: - { - decl = new AbstractInterfaceForwardDecl (name_, scope_); - break; - } - } - - scope_->insert (decl); - - name_ = SimpleName ("::"); //indicate that we are done - } - else - { - pop (); - } - } - private: - - struct Qualifier - { - enum Value - { - ABSTRACT, - LOCAL, - UNCONSTRAINED - }; - }; - - bool trace_; - - Qualifier::Value qualifier_; - SyntaxTree::SimpleName name_; - SyntaxTree::ScopedNameSet inherits_; - }; - - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_INTERFACE_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.cpp deleted file mode 100644 index 088bf03bd3f..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Member.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Member.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.hpp deleted file mode 100644 index 15e1b5ac6fa..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.hpp +++ /dev/null @@ -1,122 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Member.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_MEMBER_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_MEMBER_HPP - -#include "CCF/IDL2/SyntaxTree/Member.hpp" -#include "CCF/IDL2/SemanticAction/Member.hpp" - -using namespace std; - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Member : public virtual SemanticAction::Member - { - public: - virtual - ~Member () throw () {} - - Member (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current), - type_ ("::") //@@ this is dirty - { - } - - virtual void - begin (IdentifierPtr const& id) - { - if (trace_) cerr << "member " << id << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - //@@ loosing information (completeness) - // - - return d->is_a<TypeDecl> () && - d->dynamic_type<TypeDecl> ()->complete (); - } - } p; - - try - { - type_ = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid member declaration" << endl; - cerr << "no type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid member declaration" << endl; - cerr << "no complete type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - } - - - virtual void - declarator (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << " " << id << endl; - - using namespace SyntaxTree; - - if (type_ != ScopedName ("::")) - { - MemberDeclPtr member_ ( - new MemberDecl (SimpleName (id->lexeme ()), - type_, - scope_)); - - scope_->insert (member_); - } - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - - // Indicate that we are done. - // - type_ = SyntaxTree::ScopedName ("::"); - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::ScopedName type_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_MEMBER_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp deleted file mode 100644 index a7f12f2593f..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Module.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Module.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.hpp deleted file mode 100644 index a71df8dcb8a..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.hpp +++ /dev/null @@ -1,82 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Module.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_MODULE_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_MODULE_HPP - -#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp" - -#include "CCF/IDL2/SemanticAction/Module.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Module : public virtual SemanticAction::Module, - public virtual ScopeBase<SyntaxTree::ModulePtr> - { - public: - virtual - ~Module () throw () {} - - - Module (bool trace, - SyntaxTree::ScopePtr& scope) - : ScopeBase<SyntaxTree::ModulePtr> (scope), - trace_ (trace) - { - } - - virtual void - begin (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "module " << id << endl; - - using namespace SyntaxTree; - - SimpleName name (id->lexeme ()); - - ModulePtr m (new SyntaxTree::Module (name, scope_)); - - scope_->insert (m); - push (m); - } - - virtual void - open_scope () - { - if (trace_) cerr << "scope open" << endl; - scope_ = top (); - } - - virtual void - close_scope () - { - scope_ = scope_->scope (); - if (trace_) cerr << "scope close" << endl; - } - - virtual void - end () - { - pop (); - if (trace_) cerr << "end" << endl; - } - - private: - bool trace_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_MODULE_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp deleted file mode 100644 index caadb5220a9..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Operation.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Operation.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp deleted file mode 100644 index 44f8d32d168..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp +++ /dev/null @@ -1,165 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Operation.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_OPERATION_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_OPERATION_HPP - -#include "CCF/IDL2/SemanticAction/Operation.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Operation : public virtual SemanticAction::Operation - { - public: - - virtual - ~Operation () throw () {} - - Operation (bool trace, - SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current) - { - } - - SyntaxTree::ScopedName - lookup_type (SyntaxTree::Name const& name) - { - using namespace SyntaxTree; - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<TypeDecl> (); - } - } p; - - try - { - return scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid operation declaration" << endl; - cerr << "no type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - throw; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid operation declaration" << endl; - cerr << "declaration with name \'" << name - << "\' visible from scope \'" << scope_->name () - << "\' is not a type declaration" << endl; - cerr << "using non-type as operation parameter type " - << " or return type is illegal" - << endl; - throw; - } - } - - - virtual void - begin (IdentifierPtr const& type_id, - SimpleIdentifierPtr const& name_id) - { - if (trace_) - cerr << "operation " << type_id << " " << name_id << endl; - - using namespace SyntaxTree; - - try - { - ScopedName type_name = lookup_type (Name (type_id->lexeme ())); - - operation_ = OperationDeclPtr ( - new OperationDecl (SimpleName (name_id->lexeme ()), - type_name, - scope_)); - } - catch (...) - { - } - } - - - virtual void - parameter (Direction::Value direction, - IdentifierPtr const& type_id, - SimpleIdentifierPtr const& name_id) - { - if (trace_) - cerr << "parameter " << direction << " " << type_id - << " " << name_id << endl; - - using namespace SyntaxTree; - - if (operation_ == 0) return; - - try - { - ScopedName type_name = lookup_type (Name (type_id->lexeme ())); - - OperationParameter::Direction::Value d = - OperationParameter::Direction::INOUT; - - if (direction == Direction::IN) - { - d = OperationParameter::Direction::IN; - } - else if (direction == Direction::OUT) - { - d = OperationParameter::Direction::OUT; - } - - OperationParameterPtr p ( - new OperationParameter (d, - type_name, - SimpleName (name_id->lexeme ()), - scope_->table ())); - operation_->insert (p); - } - catch (...) - { - } - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - if (operation_ != 0) - { - scope_->insert (operation_); - operation_ = SyntaxTree::OperationDeclPtr (); - } - } - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::OperationDeclPtr operation_; - }; - - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_OPERATION_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.cpp deleted file mode 100644 index 0506ab5e363..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Struct.cpp -// author : Jeff Parsons <j.parsons@vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Struct.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.hpp deleted file mode 100644 index f744ca12886..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.hpp +++ /dev/null @@ -1,99 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Struct.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_STRUCT_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_STRUCT_HPP - -#include "CCF/IDL2/SyntaxTree/Struct.hpp" -#include "CCF/IDL2/SemanticAction/Struct.hpp" -#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Struct : public virtual SemanticAction::Struct, - public virtual ScopeBase<SyntaxTree::StructDeclPtr> - { - public: - virtual - ~Struct () throw () {} - - - Struct (bool trace, - SyntaxTree::ScopePtr& scope) - : ScopeBase<SyntaxTree::StructDeclPtr> (scope), - trace_ (trace), - name_ ("::") //@@ dirty - { - } - - virtual void - begin (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "struct " << id << endl; - name_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - virtual void - open_scope () - { - if (trace_) cerr << "scope open" << endl; - - using namespace SyntaxTree; - - StructDefPtr s (new StructDef (name_, scope_)); - - scope_->insert (s); - push (s); - scope_ = s; - - name_ = SimpleName ("::"); //indicate that we are done - } - - virtual void - close_scope () - { - scope_ = scope_->scope (); - if (trace_) cerr << "scope close" << endl; - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - - using namespace SyntaxTree; - - if (name_ != SimpleName ("::")) - { - scope_->insert ( - StructForwardDeclPtr( - new SyntaxTree::StructForwardDecl (name_, scope_))); - - name_ = SimpleName ("::"); //indicate that we are done - } - else - { - pop (); - } - } - - private: - bool trace_; - SyntaxTree::SimpleName name_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_STRUCT_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.cpp deleted file mode 100644 index 1c14fd4de10..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/TypeId.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/TypeId.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.hpp deleted file mode 100644 index 40b2510af46..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.hpp +++ /dev/null @@ -1,199 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/TypeId.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_TYPE_ID_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_TYPE_ID_HPP - -#include "CCF/IDL2/SyntaxTree/TypeId.hpp" - -// These inclusions are needed to ensure that typeprefix is applied to a -// suitable declaration. - -#include "CCF/IDL2/SyntaxTree/Module.hpp" -#include "CCF/IDL2/SyntaxTree/Interface.hpp" -#include "CCF/IDL2/SyntaxTree/ValueType.hpp" - - -#include "CCF/IDL2/SemanticAction/TypeId.hpp" - -#include <sstream> - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class TypeId : public virtual SemanticAction::TypeId - { - public: - virtual - ~TypeId () throw () {} - - TypeId (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current) - { - } - - virtual void - begin (IdentifierPtr const& d, StringLiteralPtr const& id) - { - if (trace_) cerr << "typeid " << d << " " << id << endl; - - using namespace SyntaxTree; - - Name dn (d->lexeme ()); - - try - { - ScopedName dsn = scope_->table ().resolve ( - dn, - scope_->name (), - scope_->peek_order ()); - - Order order = scope_->create_order (); - - std::ostringstream ostr; - ostr << order; - - SimpleName name (ostr.str ()); - - TypeIdPtr ti ( - new SyntaxTree::TypeId ( - name, - order, - scope_, - dsn, - SyntaxTree::StringLiteral (id->lexeme ()))); - - scope_->insert (ti); - - if (trace_) cerr << "assigned declaration name " << ti->name () - << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid typeid declaration" << endl; - cerr << "no declaration with name \'" - << dn << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - }; - - - // - // - // - class TypePrefix : public virtual SemanticAction::TypePrefix - { - public: - virtual - ~TypePrefix () throw () {} - - TypePrefix (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current) - { - } - - virtual void - begin (IdentifierPtr const& d, StringLiteralPtr const& prefix) - { - if (trace_) cerr << "typeprefix " << d << " " << prefix << endl; - - using namespace SyntaxTree; - - Name dn (d->lexeme ()); - - try - { - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - //@@ MSVC bug - requires fully qualified name in parameter. - return - d->is_a<CCF::IDL2::SyntaxTree::Module> () - || d->is_a<CCF::IDL2::SyntaxTree::FileScope> () - || d->is_a<CCF::IDL2::SyntaxTree::InterfaceDecl> () - || d->is_a<CCF::IDL2::SyntaxTree::ValueTypeDecl> (); - } - } p; - - ScopedName dsn = scope_->table ().resolve ( - dn, - scope_->name (), - scope_->peek_order (), - p); - - Order order = scope_->create_order (); - - std::ostringstream ostr; - ostr << order; - - SimpleName name (ostr.str ()); - - TypePrefixPtr tp ( - new SyntaxTree::TypePrefix ( - name, - order, - scope_, - dsn, - SyntaxTree::StringLiteral (prefix->lexeme ()))); - - scope_->insert (tp); - - if (trace_) cerr << "assigned declaration name " << tp->name () - << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid typeprefix declaration" << endl; - cerr << "no declaration with name \'" - << dn << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid typeprefix declaration" << endl; - cerr << "no suitable declaration with name \'" - << dn << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_TYPE_ID_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.cpp deleted file mode 100644 index 6298527032f..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Typedef.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL2/SemanticAction/Impl/Typedef.hpp" - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.hpp deleted file mode 100644 index 88fd55f10fa..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// file : CCF/IDL2/SemanticAction/Impl/Typedef.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_TYPEDEF_HPP -#define CCF_IDL2_SEMANTIC_ACTION_IMPL_TYPEDEF_HPP - -#include "CCF/IDL2/SyntaxTree/Typedef.hpp" -#include "CCF/IDL2/SyntaxTree/Sequence.hpp" -#include "CCF/IDL2/SemanticAction/Typedef.hpp" - -#include <sstream> - -using namespace std; - -namespace CCF -{ - namespace IDL2 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Typedef : public virtual SemanticAction::Typedef - { - public: - virtual - ~Typedef () throw () {} - - Typedef (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current), - type_ ("::") //@@ this is dirty - { - } - - virtual void - begin (IdentifierPtr const& id) - { - if (trace_) cerr << "typedef " << id << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<TypeDecl> (); - } - } p; - - try - { - type_ = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid typedef declaration" << endl; - cerr << "no type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid typedef declaration" << endl; - cerr << "no type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - } - - virtual void - begin_seq (IdentifierPtr const& id) - { - if (trace_) cerr << "typedef sequence<" << id << ">" << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - //@@ can use the same predicate with begin () - // - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<TypeDecl> (); - } - } p; - - try - { - ScopedName type (scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p)); - - Order order = scope_->create_order (); - - std::ostringstream ostr; - ostr << order; - - SimpleName name (ostr.str ()); - - UnboundedSequenceDeclPtr seq ( - new UnboundedSequenceDecl (name, order, scope_, type)); - - scope_->insert (seq); - - type_ = seq->name (); - - if (trace_) cerr << "assigned anonymous sequence name " - << type_ << endl; - - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid sequence declaration" << endl; - cerr << "no type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid sequence declaration" << endl; - cerr << "no type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - } - - virtual void - declarator (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << " " << id << endl; - - using namespace SyntaxTree; - - if (type_ != ScopedName ("::")) - { - TypedefDeclPtr typedef_ ( - new TypedefDecl (SimpleName (id->lexeme ()), - type_, - scope_)); - - - scope_->insert (typedef_); - } - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - - // Indicate that we are done. - // - type_ = SyntaxTree::ScopedName ("::"); - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::ScopedName type_; - }; - } - } - } -} - -#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_TYPEDEF_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp deleted file mode 100644 index b0f9d8283c9..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Component.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Component.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.hpp deleted file mode 100644 index 79245be6148..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.hpp +++ /dev/null @@ -1,258 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Component.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_COMPONENT_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_COMPONENT_HPP - -#include "CCF/IDL3/SemanticAction/Component.hpp" - -#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Component : - public virtual SemanticAction::Component, - public virtual ScopeBase<SyntaxTree::ComponentDeclPtr> - { - public: - virtual - ~Component () throw () {} - - - Component (bool trace, SyntaxTree::ScopePtr& scope) - : ScopeBase<SyntaxTree::ComponentDeclPtr> (scope), - trace_ (trace), - name_ ("::"), //@@ this is dirty - inherits_ ("::") - { - } - - virtual void - begin (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "component " << id << endl; - - name_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - virtual void - inherits (IdentifierPtr const& id) - { - if (trace_) cerr << "inherits " << id << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct InheritancePredicate : public DeclarationTable::ResolvePredicate - { - struct IncompatibleType : - public DeclarationTable::ResolutionFailure - { - IncompatibleType (std::string const& t) : type (t) {} - std::string type; - }; - - virtual bool - test (DeclarationPtr const& d) const - throw (IncompatibleType) - { - if (!d->is_a<ComponentDecl> ()) - { - throw IncompatibleType (d->declaration_class ()); - } - - return d->dynamic_type<ComponentDecl> ()->defined (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - inherits_ = sn; - } - catch (InheritancePredicate::IncompatibleType const& e) - { - cerr << "error: invalid inheritance specification" << endl; - - cerr << "inheritance of "; - cerr << "component \'" << name_ <<"\' from " - << e.type << " \'" << name << "\' is illegal" << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid inheritance specification" << endl; - cerr << "no component with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid inheritance specification" << endl; - cerr << "no defined component with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - cerr << "inheritance from forward-declared component is illegal" - << endl; - } - } - - - virtual void - supports (IdentifierPtr const& id) - { - if (trace_) cerr << "supports " << id << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct SupportsPredicate : - public DeclarationTable::ResolvePredicate - { - struct IncompatibleType : - public DeclarationTable::ResolutionFailure - { - IncompatibleType (std::string const& t) : type (t) {} - std::string type; - }; - - virtual bool - test (DeclarationPtr const& d) const - throw (IncompatibleType) - { - // Spec doesn't say anything about which interfaces - // component can support. - - if (!d->is_a<UnconstrainedInterfaceDecl> ()) - { - throw IncompatibleType (d->declaration_class ()); - } - - return d->dynamic_type<InterfaceDecl> ()->defined (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - if (supports_.insert (sn).second == false) - { - cerr << "error: invalid support specification" << endl; - cerr << "directly supporting interface \'" - << sn << "\' more than once is illegal" << endl; - } - } - catch (SupportsPredicate::IncompatibleType const& e) - { - cerr << "error: invalid support specification" << endl; - - cerr << "specifying " << e.type << " \'" << name - << "\' in component\'s support clause is illegal" - << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid support specification" << endl; - cerr << "no interface with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid support specification" << endl; - cerr << "no defined interface with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - cerr << "supporting forward-declared interface is illegal" - << endl; - } - } - - virtual void - open_scope () - { - using namespace SyntaxTree; - - ComponentDefPtr def; - - if (inherits_ == ScopedName ("::")) - { - def = ComponentDefPtr (new ComponentDef ( - name_, - scope_, - supports_)); - } - else - { - def = ComponentDefPtr (new ComponentDef ( - name_, - scope_, - inherits_, - supports_)); - } - - scope_->insert (def); - push (def); - scope_ = def; - - name_ = SimpleName ("::"); //indicate that we are done - inherits_ = ScopedName ("::"); - supports_.clear (); - } - - virtual void - close_scope () - { - scope_ = scope_->scope (); - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - - using namespace SyntaxTree; - - if (name_ != SimpleName ("::")) - { - ComponentDeclPtr decl (new ComponentForwardDecl (name_, scope_)); - scope_->insert (decl); - } - else - { - pop (); - } - } - private: - bool trace_; - SyntaxTree::SimpleName name_; - SyntaxTree::ScopedName inherits_; - SyntaxTree::ScopedNameSet supports_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_COMPONENT_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.cpp deleted file mode 100644 index 50fa3cdb279..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Consumes.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Consumes.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.hpp deleted file mode 100644 index 2e8bbf156ac..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Consumes.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_CONSUMES_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_CONSUMES_HPP - -#include "CCF/IDL3/SemanticAction/Consumes.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Consumes : public virtual SemanticAction::Consumes - { - public: - virtual - ~Consumes () throw () {} - - Consumes (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current), - type_ ("::") //@@ this is dirty - { - } - - virtual void - type (IdentifierPtr const& id) - { - if (trace_) cerr << "consumes " << id; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<EventTypeDef> (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - type_ = sn; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid consumes declaration" << endl; - cerr << "no event type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid consumes declaration" << endl; - cerr << "declaration with name \'" << name - << "\' visible from scope \'" << scope_->name () - << "\' is not a defined event type" << endl; - cerr << "using non-<defined event type> in consumes " - << "declaration is illegal" << endl; - } - } - - virtual void - name (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << " " << id << endl; - - using namespace SyntaxTree; - - SimpleName name (id->lexeme ()); - - DeclarationPtr d ( - new SyntaxTree::ConsumesDecl (name, type_, scope_)); - - scope_->insert (d); - - type_ = ScopedName ("::"); - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::ScopedName type_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_CONSUMES_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Elements.hpp deleted file mode 100644 index 75782eb7a1a..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Elements.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Elements.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP - -#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - using IDL2::SemanticAction::Impl::ScopeBase; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.cpp deleted file mode 100644 index 1466024e95a..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Emits.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Emits.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.hpp deleted file mode 100644 index 80f611e00ed..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Emits.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_EMITS_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_EMITS_HPP - -#include "CCF/IDL3/SemanticAction/Emits.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Emits : public virtual SemanticAction::Emits - { - public: - virtual - ~Emits () throw () {} - - Emits (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current), - type_ ("::") //@@ this is dirty - { - } - - virtual void - type (IdentifierPtr const& id) - { - if (trace_) cerr << "emits " << id; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<EventTypeDef> (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - type_ = sn; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid emits declaration" << endl; - cerr << "no event type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid emits declaration" << endl; - cerr << "declaration with name \'" << name - << "\' visible from scope \'" << scope_->name () - << "\' is not a defined event type" << endl; - cerr << "using non-<defined event type> in emits " - << "declaration is illegal" << endl; - } - } - - virtual void - name (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << " " << id << endl; - - using namespace SyntaxTree; - - SimpleName name (id->lexeme ()); - - DeclarationPtr d ( - new SyntaxTree::EmitsDecl (name, type_, scope_)); - - scope_->insert (d); - - type_ = ScopedName ("::"); - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::ScopedName type_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_EMITS_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.cpp deleted file mode 100644 index 7c875a786d2..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/EventType.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/EventType.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.hpp deleted file mode 100644 index 49c006fe1f1..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.hpp +++ /dev/null @@ -1,92 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/EventType.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_EVENT_TYPE_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_EVENT_TYPE_HPP - -#include "CCF/IDL3/SemanticAction/EventType.hpp" - -#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class EventType : public virtual SemanticAction::EventType, - public virtual ScopeBase<SyntaxTree::EventTypeDeclPtr> - { - public: - virtual - ~EventType () throw () {} - - EventType (bool trace, SyntaxTree::ScopePtr& scope) - : ScopeBase<SyntaxTree::EventTypeDeclPtr> (scope), - trace_ (trace), - name_ ("::") //@@ this is dirty - { - } - - public: - - virtual void - begin (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "eventtype " << id << endl; - name_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - virtual void - inherits (IdentifierPtr const& id) - { - if (trace_) cerr << "inherits " << id << endl; - } - - virtual void - open_scope () - { - using namespace SyntaxTree; - - ConcreteEventTypeDefPtr et( new ConcreteEventTypeDef ( - name_, - scope_, - inherits_)); - scope_->insert (et); - push (et); - scope_ = et; - - name_ = SimpleName ("::"); //indicate that we are done - inherits_.clear (); - } - - virtual void - close_scope () - { - scope_ = scope_->scope (); - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - pop (); - } - - private: - bool trace_; - SyntaxTree::SimpleName name_; - SyntaxTree::ScopedNameSet inherits_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_EVENT_TYPE_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp deleted file mode 100644 index ce2ad6b40b9..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Factory.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Factory.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp deleted file mode 100644 index f5231f51afc..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp +++ /dev/null @@ -1,149 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Factory.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_FACTORY_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_FACTORY_HPP - -#include "CCF/IDL3/SemanticAction/Factory.hpp" - -#include "CCF/IDL2/SemanticAction/Impl/Factory.hpp" - -#include "CCF/IDL3/SemanticAction/Impl/Include.hpp" -#include "CCF/IDL3/SemanticAction/Impl/Component.hpp" -#include "CCF/IDL3/SemanticAction/Impl/Provides.hpp" -#include "CCF/IDL3/SemanticAction/Impl/Uses.hpp" -#include "CCF/IDL3/SemanticAction/Impl/Publishes.hpp" -#include "CCF/IDL3/SemanticAction/Impl/Emits.hpp" -#include "CCF/IDL3/SemanticAction/Impl/Consumes.hpp" -#include "CCF/IDL3/SemanticAction/Impl/EventType.hpp" -#include "CCF/IDL3/SemanticAction/Impl/Home.hpp" -#include "CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - class Factory : public virtual IDL3::SemanticAction::Factory, - public virtual IDL2::SemanticAction::Impl::Factory - { - public: - virtual - ~Factory () throw () {} - - Factory (CompilerElements::Context& context, - Diagnostic::Stream& dout, - SyntaxTree::TranslationRegionPtr const& r) - : IDL2::SemanticAction::Impl::Factory (context, dout, r), - trace_ (context.get ("idl3::semantic-action::trace", false)), - - component_ (trace_, scope_), - consumes_ (trace_, scope_), - emits_ (trace_, scope_), - event_type_ (trace_, scope_), - home_ (trace_, scope_), - home_factory_ (trace_, scope_), - include_ (trace_, context, dout, *this, r, scope_), - provides_ (trace_, scope_), - publishes_ (trace_, scope_), - system_include_ (trace_, context, dout, *this, r, scope_), - uses_ (trace_, scope_) - { - } - - public: - - virtual SemanticAction::Consumes& - consumes () - { - return consumes_; - } - - virtual SemanticAction::Component& - component () - { - return component_; - } - - virtual SemanticAction::Emits& - emits () - { - return emits_; - } - - - virtual SemanticAction::EventType& - event_type () - { - return event_type_; - } - - virtual SemanticAction::Home& - home () - { - return home_; - } - - virtual SemanticAction::HomeFactory& - home_factory () - { - return home_factory_; - } - - - virtual IDL2::SemanticAction::Include& - include () - { - return include_; - } - - virtual SemanticAction::Provides& - provides () - { - return provides_; - } - - virtual SemanticAction::Publishes& - publishes () - { - return publishes_; - } - - virtual IDL2::SemanticAction::SystemInclude& - system_include () - { - return system_include_; - } - - virtual SemanticAction::Uses& - uses () - { - return uses_; - } - - private: - - bool trace_; - - Component component_; - Consumes consumes_; - Emits emits_; - EventType event_type_; - Home home_; - HomeFactory home_factory_; - Include include_; - Provides provides_; - Publishes publishes_; - SystemInclude system_include_; - Uses uses_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_FACTORY_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp deleted file mode 100644 index d7fe0eb7e9d..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Home.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Home.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.hpp deleted file mode 100644 index ed8cb617e6c..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.hpp +++ /dev/null @@ -1,336 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Home.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_HOME_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_HOME_HPP - -#include "CCF/IDL3/SemanticAction/Home.hpp" - -#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Home : public virtual SemanticAction::Home, - public virtual ScopeBase<SyntaxTree::HomeDefPtr> - { - public: - virtual - ~Home () throw () {} - - Home (bool trace, SyntaxTree::ScopePtr& scope) - : ScopeBase<SyntaxTree::HomeDefPtr> (scope), - trace_ (trace), - name_ ("::"), //@@ this is dirty - inherits_ ("::"), - manages_ ("::") - - { - } - - virtual void - begin (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "home " << id << endl; - name_ = SyntaxTree::SimpleName (id->lexeme ()); - } - - - virtual void - inherits (IdentifierPtr const& id) - { - if (trace_) cerr << "inherits " << id << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct InheritancePredicate : public DeclarationTable::ResolvePredicate - { - struct IncompatibleType : - public DeclarationTable::ResolutionFailure - { - IncompatibleType (std::string const& t) : type (t) {} - std::string type; - }; - - virtual bool - test (DeclarationPtr const& d) const - throw (IncompatibleType) - { - if (!d->is_a<HomeDef> ()) - { - throw IncompatibleType (d->declaration_class ()); - } - - // This is not really necessary since home cannot be - // forward-declared (yet ;-). - return d->dynamic_type<HomeDef> ()->defined (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - inherits_ = sn; - } - catch (InheritancePredicate::IncompatibleType const& e) - { - cerr << "error: invalid inheritance specification" << endl; - - cerr << "inheritance of "; - cerr << "home \'" << name_ <<"\' from " - << e.type << " \'" << name << "\' is illegal" << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid inheritance specification" << endl; - cerr << "no home with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid inheritance specification" << endl; - cerr << "no defined home with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - cerr << "inheritance from forward-declared home is illegal" - << endl; - } - } - - - virtual void - supports (IdentifierPtr const& id) - { - if (trace_) cerr << "supports " << id << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct SupportsPredicate : - public DeclarationTable::ResolvePredicate - { - struct IncompatibleType : - public DeclarationTable::ResolutionFailure - { - IncompatibleType (std::string const& t) : type (t) {} - std::string type; - }; - - virtual bool - test (DeclarationPtr const& d) const - throw (IncompatibleType) - { - // Spec doesn't say anything about which interfaces - // component can support. - if (!d->is_a<UnconstrainedInterfaceDecl> ()) - { - throw IncompatibleType (d->declaration_class ()); - } - - return d->dynamic_type<InterfaceDecl> ()->defined (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - if (supports_.insert (sn).second == false) - { - cerr << "error: invalid support specification" << endl; - cerr << "directly supporting interface \'" - << sn << "\' more than once is illegal" << endl; - } - } - catch (SupportsPredicate::IncompatibleType const& e) - { - cerr << "error: invalid support specification" << endl; - - cerr << "specifying " << e.type << " \'" << name - << "\' in home\'s support clause is illegal" - << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid support specification" << endl; - cerr << "no interface with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid support specification" << endl; - cerr << "no defined interface with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - cerr << "supporting forward-declared interface is illegal" - << endl; - } - } - - - virtual void - manages (IdentifierPtr const& id) - { - if (trace_) cerr << "manages " << id << endl; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct ManagesPredicate : - public DeclarationTable::ResolvePredicate - { - struct IncompatibleType : - public DeclarationTable::ResolutionFailure - { - IncompatibleType (std::string const& t) : type (t) {} - std::string type; - }; - - virtual bool - test (DeclarationPtr const& d) const - throw (IncompatibleType) - { - if (!d->is_a<ComponentDecl> ()) - { - throw IncompatibleType (d->declaration_class ()); - } - - return d->dynamic_type<ComponentDecl>()->defined (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - manages_ = sn; - } - catch (ManagesPredicate::IncompatibleType const& e) - { - cerr << "error: invalid manages specification" << endl; - - cerr << "specifying " << e.type << " \'" << name - << "\' in home manages clause is illegal" << endl; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid manages specification" << endl; - cerr << "no component with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid manages specification" << endl; - cerr << "no defined component with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - cerr << "managing of forward-declared component is illegal" - << endl; - } - } - - virtual void - open_scope () - { - using namespace SyntaxTree; - - HomeDefPtr def (new HomeDef ( - name_, - scope_, - inherits_, - supports_, - manages_)); - - if (inherits_ == ScopedName ("::")) - { - def = HomeDefPtr (new HomeDef ( - name_, - scope_, - supports_, - manages_)); - } - else - { - def = HomeDefPtr (new HomeDef ( - name_, - scope_, - inherits_, - supports_, - manages_)); - } - - - scope_->insert (def); - push (def); - scope_ = def; - - name_ = SimpleName ("::"); //indicate that we are done - inherits_ = ScopedName ("::"); - supports_.clear (); - manages_ = ScopedName ("::"); - } - - virtual void - close_scope () - { - scope_ = scope_->scope (); - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - - using namespace SyntaxTree; - - if (name_ != SimpleName ("::")) - { - // this is not supported by spec yet - } - else - { - pop (); - } - } - private: - bool trace_; - SyntaxTree::SimpleName name_; - SyntaxTree::ScopedName inherits_; - SyntaxTree::ScopedNameSet supports_; - SyntaxTree::ScopedName manages_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_HOME_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.cpp deleted file mode 100644 index a2868a48fce..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/HomeFactory.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp deleted file mode 100644 index 403c3477283..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp +++ /dev/null @@ -1,127 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_HOME_FACTORY_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_HOME_FACTORY_HPP - -#include "CCF/IDL3/SemanticAction/HomeFactory.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class HomeFactory : public virtual SemanticAction::HomeFactory - { - public: - virtual - ~HomeFactory () throw () - { - } - - HomeFactory (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current) - { - } - - virtual void - begin (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << "home factory " << id << endl; - - using namespace SyntaxTree; - - HomeDefPtr home (scope_->dynamic_type<HomeDef> ()); - - if (home == 0) - { - //@@ internal compiler error - } - - ComponentDefPtr component (home->manages ()); - - home_factory_ = HomeFactoryDeclPtr ( - new HomeFactoryDecl (SimpleName (id->lexeme ()), - component->name (), - scope_)); - } - - virtual void - parameter (IdentifierPtr const& type_id, - SimpleIdentifierPtr const& name_id) - { - if (trace_) cerr << "parameter " << type_id << " " - << name_id << endl; - - using namespace IDL3::SyntaxTree; - - Name type_name (type_id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<TypeDecl> (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - type_name, - scope_->name (), - scope_->peek_order (), - p); - - HomeFactoryParameterPtr p ( - new HomeFactoryParameter (sn, - SimpleName (name_id->lexeme ()), - scope_->table ())); - - home_factory_->insert (p); - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid home factory declaration" << endl; - cerr << "no type with name \'" - << type_name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid home factory declaration" << endl; - cerr << "declaration with name \'" << type_name - << "\' visible from scope \'" << scope_->name () - << "\' is not a type declaration" << endl; - cerr << "using non-type as home factory parameter type is illegal" - << endl; - } - } - - virtual void - end () - { - if (trace_) cerr << "end" << endl; - scope_->insert (home_factory_); - home_factory_ = SyntaxTree::HomeFactoryDeclPtr (); - } - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::HomeFactoryDeclPtr home_factory_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_HOME_FACTORY_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.cpp deleted file mode 100644 index c205a3a6ada..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Include.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Include.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp deleted file mode 100644 index 0b9350358e8..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp +++ /dev/null @@ -1,361 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Include.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_INCLUDE_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_INCLUDE_HPP - -#include "CCF/IDL2/SemanticAction/Include.hpp" - -//@@ needed for include handling -#include "CCF/CompilerElements/TokenStream.hpp" -#include "CCF/CompilerElements/Preprocessor.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // Note: overriding IDL2 include to allow inclusion of IDL3 files - // - // - class IncludeImpl - { - protected: - virtual - ~IncludeImpl () throw () {} - - enum Type - { - system, - user - }; - - IncludeImpl (bool trace, - CompilerElements::Context& context, - Diagnostic::Stream& dout, - SemanticAction::Factory& action_factory, - SyntaxTree::TranslationRegionPtr const& region, - SyntaxTree::ScopePtr& scope, - Type type) - : trace_ (trace), - context_ (context), - dout_ (dout), - action_factory_ (action_factory), - scope_ (scope), - type_ (type) - { - stack_.push (region); - path_stack_.push ( - fs::normalize ( - fs::complete (context_.get<fs::path> ("file-path")))); - } - - virtual void - begin_impl (StringLiteralPtr const& sl) - { - std::string prefix; - - if (type_ == user) - { - prefix = std::string ("include") + " \"" + sl->lexeme () + "\""; - } - else - { - prefix = std::string ("include") + " <" + sl->lexeme () + ">"; - } - - if (trace_) cerr << prefix << endl; - - using namespace SyntaxTree; - - try - { - fs::ifstream ifs; - ifs.exceptions (ios_base::badbit | ios_base::failbit); - - fs::path include_path (sl->lexeme ()); - fs::path complete_path (include_path); - - if (trace_) cerr << prefix << ": staring resolution." << endl; - - if (complete_path.is_complete ()) - { - complete_path = fs::normalize (complete_path); - - if (handle_already_included (complete_path, sl)) return; - - ifs.open (complete_path, std::ios_base::in); - } - else - { - bool found (false); - - if (type_ == user) - { - fs::path rel_path (path_stack_.top ().branch_path ()); - - complete_path = fs::normalize (rel_path / include_path); - - if (trace_) cerr << prefix << ": considering " - << complete_path.string () << endl; - - if (fs::exists (complete_path)) - { - if (handle_already_included (complete_path, sl)) return; - ifs.open (complete_path, std::ios_base::in); - found = true; - } - } - - if (!found) - { - typedef - std::vector<fs::path> - SearchPaths; - - SearchPaths const& search_paths ( - context_.get<SearchPaths> ("include-search-paths")); - - for (SearchPaths::const_iterator - i (search_paths.begin ()), - e (search_paths.end ()); i != e && !found; ++i) - { - complete_path = *i / include_path; - - if (!complete_path.is_complete ()) - { - complete_path = complete (complete_path); - } - - complete_path = fs::normalize (complete_path); - - if (trace_) cerr << prefix << ": considering " - << complete_path.string () << endl; - - if (fs::exists (complete_path)) - { - if (handle_already_included (complete_path, sl)) return; - ifs.open (complete_path, std::ios_base::in); - found = true; - } - } - - if (!found) - { - cerr << sl << ": error: file not found." << endl; - return; - } - } - } - - if (trace_) cerr << prefix << ": resolved to " - << complete_path.string () << endl; - - //@@ for some reason ifs throws exception if I don't reset it - // to original state. It probably has something to do with - // call to get after eof. - // - ifs.exceptions (ios_base::iostate (0)); - - TranslationRegionPtr r (new UserIncludeTranslationRegion ( - include_path, - stack_.top ()->table (), - stack_.top ()->create_order ())); - - stack_.top ()->insert (r); - - stack_.push (r); - path_stack_.push (complete_path); - - context_.set ("file-path", stack_.top ()->file_path ()); - - if (trace_) cerr << "push file scope: old scope " - << scope_->order (); - - scope_ = stack_.top ()->scope (); - - if (trace_) cerr << "; new scope " << scope_->order () << endl; - - //@@ this code is highly experimental - InputStreamAdapter isa (ifs); - Preprocessor pp (isa); - IDL3::LexicalAnalyzer lexer (pp); - - TokenList token_stream; - - //@@ bad token comparison - for (TokenPtr token = lexer.next ();; token = lexer.next ()) - { - token_stream.push_back (token); - if (ReferenceCounting::strict_cast<EndOfStream> (token) != 0) - break; - } - - if (token_stream.size () > 1) - { - IDL3::Parser parser (context_, dout_, lexer, action_factory_); - - IDL2::Parsing::parse (token_stream.begin (), - token_stream.end (), - parser.start ()); - } - - if (trace_) cerr << "pop file scope: old scope " - << scope_->order (); - - path_stack_.pop (); - stack_.pop (); - - scope_ = stack_.top ()->scope (); - context_.set ("file-path", stack_.top ()->file_path ()); - - if (trace_) cerr << "; new scope " << scope_->order () << endl; - } - catch (fs::filesystem_error const&) - { - cerr << sl << ": error: unable to open in read mode" << endl; - } - catch (ios_base::failure const&) - { - cerr << sl << ": error: unable to open in read mode" << endl; - } - } - - virtual void - end_impl () - { - if (trace_) cerr << "end" << endl; - } - - private: - - bool - handle_already_included (fs::path const& path, - StringLiteralPtr const& sl) - { - if(!include_file_set_.insert (path).second) - { - cerr << "warning: skipping already included file " << sl - << endl; - return true; - } - return false; - } - - private: - bool trace_; - CompilerElements::Context& context_; - Diagnostic::Stream& dout_; - SemanticAction::Factory& action_factory_; - SyntaxTree::ScopePtr& scope_; - Type type_; - - std::stack<SyntaxTree::TranslationRegionPtr> stack_; - std::stack<fs::path> path_stack_; - - struct FilePathComparator - { - bool operator () (fs::path const& x, fs::path const& y) const - { - return x.string () < y.string (); - } - }; - - std::set<fs::path, FilePathComparator> include_file_set_; - }; - - - // - // - // - struct Include : virtual IDL2::SemanticAction::Include, IncludeImpl - { - virtual - ~Include () throw () - { - } - - Include (bool trace, - CompilerElements::Context& context, - Diagnostic::Stream& dout, - SemanticAction::Factory& action_factory, - SyntaxTree::TranslationRegionPtr const& region, - SyntaxTree::ScopePtr& scope) - : IncludeImpl (trace, - context, - dout, - action_factory, - region, - scope, - IncludeImpl::user) - { - } - - virtual void - begin (StringLiteralPtr const& sl) - { - begin_impl (sl); - } - - virtual void - end () - { - end_impl (); - } - }; - - // - // - // - struct SystemInclude : virtual IDL2::SemanticAction::SystemInclude, - IncludeImpl - { - virtual - ~SystemInclude () throw () - { - } - - SystemInclude (bool trace, - CompilerElements::Context& context, - Diagnostic::Stream& dout, - SemanticAction::Factory& action_factory, - SyntaxTree::TranslationRegionPtr const& region, - SyntaxTree::ScopePtr& scope) - : IncludeImpl (trace, - context, - dout, - action_factory, - region, - scope, - IncludeImpl::system) - { - } - - virtual void - begin (StringLiteralPtr const& sl) - { - //@@ This is a really dirty hack. Need to think of - // a mechanism to address this issue. - // - if (sl->lexeme () != "Components.idl") - { - begin_impl (sl); - } - } - - virtual void - end () - { - end_impl (); - } - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_INCLUDE_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp deleted file mode 100644 index 051532def28..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Provides.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Provides.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.hpp deleted file mode 100644 index bcc25a6f145..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Provides.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_PROVIDES_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_PROVIDES_HPP - -#include "CCF/IDL3/SemanticAction/Provides.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Provides : public virtual SemanticAction::Provides - { - public: - virtual - ~Provides () throw () {} - - Provides (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current), - type_ ("::") //@@ this is dirty - { - } - - virtual void - type (IdentifierPtr const& id) - { - if (trace_) cerr << "provides " << id; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<InterfaceDecl> (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - type_ = sn; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid provides declaration" << endl; - cerr << "no interface type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid provides declaration" << endl; - cerr << "declaration with name \'" << name - << "\' visible from scope \'" << scope_->name () - << "\' is not an interface type declaration" << endl; - cerr << "using non-<interface type> in provides " - << "declaration is illegal" << endl; - } - } - - virtual void - name (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << " " << id << endl; - - using namespace SyntaxTree; - - SimpleName name (id->lexeme ()); - - DeclarationPtr d ( - new SyntaxTree::ProvidesDecl (name, type_, scope_)); - - scope_->insert (d); - - type_ = ScopedName ("::"); - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::ScopedName type_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_PROVIDES_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.cpp deleted file mode 100644 index 57051f968ea..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Publishes.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Publishes.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.hpp deleted file mode 100644 index 158f20a5fb7..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Publishes.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_PUBLISHES_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_PUBLISHES_HPP - -#include "CCF/IDL3/SemanticAction/Publishes.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Publishes : public virtual SemanticAction::Publishes - { - public: - virtual - ~Publishes () throw () {} - - Publishes (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current), - type_ ("::") //@@ this is dirty - { - } - - virtual void - type (IdentifierPtr const& id) - { - if (trace_) cerr << "publishes " << id; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<EventTypeDef> (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - type_ = sn; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid publishes declaration" << endl; - cerr << "no event type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid publishes declaration" << endl; - cerr << "declaration with name \'" << name - << "\' visible from scope \'" << scope_->name () - << "\' is not a defined event type" << endl; - cerr << "using non-<defined event type> in publishes " - << "declaration is illegal" << endl; - } - } - - virtual void - name (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << " " << id << endl; - - using namespace SyntaxTree; - - SimpleName name (id->lexeme ()); - - DeclarationPtr d ( - new SyntaxTree::PublishesDecl (name, type_, scope_)); - - scope_->insert (d); - - type_ = ScopedName ("::"); - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::ScopedName type_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_PUBLISHES_HPP diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp deleted file mode 100644 index d4f523744a8..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Uses.cpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#include "CCF/IDL3/SemanticAction/Impl/Uses.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - } - } - } -} - diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.hpp deleted file mode 100644 index b2093734f92..00000000000 --- a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// file : CCF/IDL3/SemanticAction/Impl/Uses.hpp -// author : Boris Kolpackov <boris@dre.vanderbilt.edu> -// cvs-id : $Id$ - -#ifndef CCF_IDL3_SEMANTIC_ACTION_IMPL_USES_HPP -#define CCF_IDL3_SEMANTIC_ACTION_IMPL_USES_HPP - -#include "CCF/IDL3/SemanticAction/Uses.hpp" - -namespace CCF -{ - namespace IDL3 - { - namespace SemanticAction - { - namespace Impl - { - // - // - // - class Uses : public virtual SemanticAction::Uses - { - public: - virtual - ~Uses () throw () {} - - Uses (bool trace, SyntaxTree::ScopePtr& current) - : trace_ (trace), - scope_ (current), - type_ ("::") //@@ this is dirty - { - } - - virtual void - type (IdentifierPtr const& id) - { - if (trace_) cerr << "uses " << id; - - using namespace SyntaxTree; - - Name name (id->lexeme ()); - - struct Predicate : public DeclarationTable::ResolvePredicate - { - virtual bool - test (DeclarationPtr const& d) const throw () - { - return d->is_a<InterfaceDecl> (); - } - } p; - - try - { - ScopedName sn = scope_->table ().resolve ( - name, - scope_->name (), - scope_->peek_order (), - p); - - type_ = sn; - } - catch (DeclarationTable::NameNotFound const&) - { - cerr << "error: invalid uses declaration" << endl; - cerr << "no interface type with name \'" - << name << "\' visible from scope \'" - << scope_->name () << "\'" << endl; - } - catch (DeclarationTable::PredicateNotMet const&) - { - cerr << "error: invalid uses declaration" << endl; - cerr << "declaration with name \'" << name - << "\' visible from scope \'" << scope_->name () - << "\' is not an interface type declaration" << endl; - cerr << "using non-<interface type> in uses " - << "declaration is illegal" << endl; - } - } - - virtual void - name (SimpleIdentifierPtr const& id) - { - if (trace_) cerr << " " << id << endl; - - using namespace SyntaxTree; - - SimpleName name (id->lexeme ()); - - DeclarationPtr d ( - new SyntaxTree::UsesDecl (name, type_, scope_)); - - scope_->insert (d); - - type_ = ScopedName ("::"); - } - - private: - bool trace_; - SyntaxTree::ScopePtr& scope_; - SyntaxTree::ScopedName type_; - }; - } - } - } -} - -#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_USES_HPP |