summaryrefslogtreecommitdiff
path: root/TAO/CIAO/CCF/CCF/IDL3/SemanticAction
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/CIAO/CCF/CCF/IDL3/SemanticAction')
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp41
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Consumes.hpp35
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Elements.hpp23
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Emits.hpp35
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp38
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Factory.hpp63
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp42
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/HomeFactory.hpp37
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp189
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.hpp55
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.cpp87
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.hpp43
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Elements.hpp29
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.cpp87
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.hpp43
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.cpp104
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.hpp55
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp41
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp133
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp212
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.hpp58
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.cpp148
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp50
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.cpp272
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp167
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Makefile.alt31
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp87
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.hpp43
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.cpp87
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.hpp43
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp87
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.hpp43
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Makefile.alt17
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Provides.hpp35
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Publishes.hpp35
-rw-r--r--TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Uses.hpp35
36 files changed, 2630 insertions, 0 deletions
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp
new file mode 100644
index 00000000000..7d0c8b0020a
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Component.hpp
@@ -0,0 +1,41 @@
+// file : CCF/IDL3/SemanticAction/Component.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_COMPONENT_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_COMPONENT_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class Component : public virtual Scope
+ {
+ public:
+ virtual void
+ begin_def (SimpleIdentifierPtr const& id) = 0;
+
+ virtual void
+ begin_fwd (SimpleIdentifierPtr const& id) = 0;
+
+ virtual void
+ inherits (IdentifierPtr const& id) = 0;
+
+ virtual void
+ supports (IdentifierPtr const& id) = 0;
+
+ virtual void
+ end () = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_COMPONENT_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Consumes.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Consumes.hpp
new file mode 100644
index 00000000000..b6a136ca49b
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Consumes.hpp
@@ -0,0 +1,35 @@
+// file : CCF/IDL3/SemanticAction/Consumes.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_CONSUMES_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_CONSUMES_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class Consumes
+ {
+ public:
+ virtual
+ ~Consumes () throw () {}
+
+ virtual void
+ type (IdentifierPtr const& id) = 0;
+
+ virtual void
+ name (SimpleIdentifierPtr const& id) = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_CONSUMES_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Elements.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Elements.hpp
new file mode 100644
index 00000000000..7637a0c473c
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Elements.hpp
@@ -0,0 +1,23 @@
+// file : CCF/IDL3/SemanticAction/Elements.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_ELEMENTS_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_ELEMENTS_HPP
+
+#include "CCF/IDL2/SemanticAction/Elements.hpp"
+
+#include "CCF/IDL3/Token.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ using IDL2::SemanticAction::Scope;
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_ELEMENTS_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Emits.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Emits.hpp
new file mode 100644
index 00000000000..10fade5ec04
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Emits.hpp
@@ -0,0 +1,35 @@
+// file : CCF/IDL3/SemanticAction/Emits.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_EMITS_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_EMITS_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class Emits
+ {
+ public:
+ virtual
+ ~Emits () throw () {}
+
+ virtual void
+ type (IdentifierPtr const& id) = 0;
+
+ virtual void
+ name (SimpleIdentifierPtr const& id) = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_EMITS_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp
new file mode 100644
index 00000000000..bf9ffc93a5c
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/EventType.hpp
@@ -0,0 +1,38 @@
+// file : CCF/IDL3/SemanticAction/EventType.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_EVENT_TYPE_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_EVENT_TYPE_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class EventType : public virtual Scope
+ {
+ public:
+ virtual void
+ begin_concrete_def (SimpleIdentifierPtr const& id) = 0;
+
+ virtual void
+ begin_concrete_fwd (SimpleIdentifierPtr const& id) = 0;
+
+ virtual void
+ inherits (IdentifierPtr const& id) = 0;
+
+ virtual void
+ end () = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_EVENT_TYPE_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Factory.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Factory.hpp
new file mode 100644
index 00000000000..34feee84ccf
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Factory.hpp
@@ -0,0 +1,63 @@
+// file : CCF/IDL3/SemanticAction/Factory.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_FACTORY_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_FACTORY_HPP
+
+#include "CCF/IDL2/SemanticAction/Factory.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ class Component;
+ class Provides;
+ class Uses;
+ class Publishes;
+ class Emits;
+ class Consumes;
+ class EventType;
+ class Home;
+ class HomeFactory;
+
+ //
+ //
+ //
+ class Factory : public virtual IDL2::SemanticAction::Factory
+ {
+ public:
+ virtual Component&
+ component () = 0;
+
+ virtual Provides&
+ provides () = 0;
+
+ virtual Uses&
+ uses () = 0;
+
+ virtual Publishes&
+ publishes () = 0;
+
+ virtual Emits&
+ emits () = 0;
+
+ virtual Consumes&
+ consumes () = 0;
+
+ virtual EventType&
+ event_type () = 0;
+
+ virtual Home&
+ home () = 0;
+
+ virtual HomeFactory&
+ home_factory () = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_FACTORY_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp
new file mode 100644
index 00000000000..782e84bb565
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Home.hpp
@@ -0,0 +1,42 @@
+// file : CCF/IDL3/SemanticAction/Home.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_HOME_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_HOME_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class Home : public virtual Scope
+ {
+ public:
+
+ virtual void
+ begin (SimpleIdentifierPtr const& id) = 0;
+
+ virtual void
+ inherits (IdentifierPtr const& id) = 0;
+
+ virtual void
+ supports (IdentifierPtr const& id) = 0;
+
+ virtual void
+ manages (IdentifierPtr const& id) = 0;
+
+ virtual void
+ end () = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_HOME_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/HomeFactory.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/HomeFactory.hpp
new file mode 100644
index 00000000000..2f64a4e3c6b
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/HomeFactory.hpp
@@ -0,0 +1,37 @@
+// file : CCF/IDL3/SemanticAction/HomeFactory.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_HOME_FACTORY_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_HOME_FACTORY_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class HomeFactory
+ {
+ public:
+
+ virtual void
+ name (SimpleIdentifierPtr const& id) = 0;
+
+ virtual void
+ parameter (IdentifierPtr const& type,
+ SimpleIdentifierPtr const& name) = 0;
+
+ virtual void
+ raises (IdentifierPtr const& id) = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_HOME_FACTORY_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp
new file mode 100644
index 00000000000..f812d55f316
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.cpp
@@ -0,0 +1,189 @@
+// file : CCF/IDL3/SemanticAction/Impl/Component.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticAction/Impl/Component.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ Component::
+ ~Component () throw ()
+ {
+ }
+
+ Component::
+ Component (Context& c)
+ : ScopeBase<SemanticGraph::Component> (c)
+ {
+ }
+
+ void Component::
+ begin_def (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "component def " << id << endl;
+
+ SimpleName name (id->lexeme ());
+
+ if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
+ {
+ now (dynamic_cast<SemanticGraph::Component&>(*s));
+ }
+ else
+ {
+ now (ctx.tu ().new_node<SemanticGraph::Component> ());
+ }
+
+ ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
+ }
+
+ void Component::
+ begin_fwd (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "component fwd " << id << endl;
+
+ SimpleName name (id->lexeme ());
+
+ if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
+ {
+ now (dynamic_cast<SemanticGraph::Component&>(*s));
+ }
+ else
+ {
+ now (ctx.tu ().new_node<SemanticGraph::Component> ());
+ }
+
+ ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
+ }
+
+ void Component::
+ inherits (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << " inherits " << id << endl;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ ctx.tu ().new_edge<Inherits> (
+ now (),
+ resolve<SemanticGraph::Component> (from, name, defined));
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid inheritance specification" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no component with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "incompatible type in inheritance specification" << endl;
+ }
+ catch (NotDefined const& e)
+ {
+ cerr << "attempt to inherit from forward-declared component "
+ << e.name () << endl;
+ cerr << "inheritance from forward-declared component is illegal"
+ << endl;
+ }
+ }
+
+ void Component::
+ supports (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << " supports " << id << endl;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ SemanticGraph::Interface& i (
+ resolve<SemanticGraph::Interface> (from, name, defined));
+
+ check_support (now ().supports_begin (),
+ now ().supports_end (),
+ i);
+
+ ctx.tu ().new_edge<Supports> (now (), i);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid supports specification" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no interface with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "incompatible type in supports specification" << endl;
+ }
+ catch (NotDefined const& e)
+ {
+ cerr << "attempt to support from forward-declared component "
+ << e.name () << endl;
+ cerr << "support of forward-declared interface is illegal"
+ << endl;
+ }
+ catch (AlreadySupported const& e)
+ {
+ cerr << "directly supporting interface \'" << e.name ()
+ << "\' more than once is illegal" << endl;
+ }
+ }
+
+ //@@ Implementation of *_scope is the same for all cases.
+ //
+ void Component::
+ open_scope ()
+ {
+ if (ctx.trace ()) cerr << "scope open" << endl;
+
+ push (ctx.scope ());
+ ctx.scope (now ());
+ }
+
+ void Component::
+ close_scope ()
+ {
+ ctx.scope (top ());
+ pop ();
+
+ if (ctx.trace ()) cerr << "scope close" << endl;
+ }
+
+ void Component::
+ end ()
+ {
+ if (ctx.trace ()) cerr << "end" << endl;
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.hpp
new file mode 100644
index 00000000000..238cda2cb2f
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Component.hpp
@@ -0,0 +1,55 @@
+// 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/SemanticGraph/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<SemanticGraph::Component>
+ {
+ public:
+ virtual
+ ~Component () throw ();
+
+ Component (Context& c);
+
+ virtual void
+ begin_def (SimpleIdentifierPtr const& id);
+
+ virtual void
+ begin_fwd (SimpleIdentifierPtr const& id);
+
+ virtual void
+ inherits (IdentifierPtr const& id);
+
+ virtual void
+ supports (IdentifierPtr const& id);
+
+ virtual void
+ open_scope ();
+
+ virtual void
+ close_scope ();
+
+ virtual void
+ end ();
+ };
+ }
+ }
+ }
+}
+
+#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
new file mode 100644
index 00000000000..c220a571c84
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.cpp
@@ -0,0 +1,87 @@
+// file : CCF/IDL3/SemanticAction/Impl/Consumes.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticGraph/Component.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Consumes.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ Consumes::
+ ~Consumes () throw ()
+ {
+ }
+
+ Consumes::
+ Consumes (Context& c)
+ : Base (c)
+ {
+ }
+
+ void Consumes::
+ type (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "consumes " << id;
+
+ type_ = 0;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ type_ = &resolve<EventType> (from, name);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid consumes declaration" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no eventtype with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "declaration with name \'" << name
+ << "\' visible from scope \'" << from
+ << "\' is not an eventtype declaration" << endl;
+ cerr << "using non-eventtype in consumes declaration is illegal"
+ << endl;
+ }
+ }
+
+ void Consumes::
+ name (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << " " << id << endl;
+
+ if (type_)
+ {
+ Consumer& c (ctx.tu ().new_node<Consumer> ());
+
+ ctx.tu ().new_edge<Belongs> (c, *type_);
+ ctx.tu ().new_edge<Defines> (ctx.scope (), c, id->lexeme ());
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.hpp
new file mode 100644
index 00000000000..c047dec2753
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Consumes.hpp
@@ -0,0 +1,43 @@
+// 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/SemanticGraph/EventType.hpp"
+#include "CCF/IDL3/SemanticAction/Consumes.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ class Consumes : public virtual SemanticAction::Consumes,
+ public Base
+ {
+ public:
+ virtual
+ ~Consumes () throw ();
+
+ Consumes (Context& c);
+
+ virtual void
+ type (IdentifierPtr const& id);
+
+ virtual void
+ name (SimpleIdentifierPtr const& id);
+
+ private:
+ SemanticGraph::EventType* 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
new file mode 100644
index 00000000000..9adec23d1c5
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Elements.hpp
@@ -0,0 +1,29 @@
+// 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::Context;
+ using IDL2::SemanticAction::Impl::Base;
+ using IDL2::SemanticAction::Impl::ScopeBase;
+
+ using IDL2::SemanticAction::Impl::lookup;
+
+ }
+ }
+ }
+}
+
+#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
new file mode 100644
index 00000000000..7f9711a113f
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.cpp
@@ -0,0 +1,87 @@
+// file : CCF/IDL3/SemanticAction/Impl/Emits.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticGraph/Component.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Emits.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ Emits::
+ ~Emits () throw ()
+ {
+ }
+
+ Emits::
+ Emits (Context& c)
+ : Base (c)
+ {
+ }
+
+ void Emits::
+ type (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "emits " << id;
+
+ type_ = 0;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ type_ = &resolve<EventType> (from, name);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid emits declaration" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no eventtype with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "declaration with name \'" << name
+ << "\' visible from scope \'" << from
+ << "\' is not an eventtype declaration" << endl;
+ cerr << "using non-eventtype in emits declaration is illegal"
+ << endl;
+ }
+ }
+
+ void Emits::
+ name (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << " " << id << endl;
+
+ if (type_)
+ {
+ Emitter& e (ctx.tu ().new_node<Emitter> ());
+
+ ctx.tu ().new_edge<Belongs> (e, *type_);
+ ctx.tu ().new_edge<Defines> (ctx.scope (), e, id->lexeme ());
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.hpp
new file mode 100644
index 00000000000..65580d6bc41
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Emits.hpp
@@ -0,0 +1,43 @@
+// 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/SemanticGraph/EventType.hpp"
+#include "CCF/IDL3/SemanticAction/Emits.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ class Emits : public virtual SemanticAction::Emits,
+ public Base
+ {
+ public:
+ virtual
+ ~Emits () throw ();
+
+ Emits (Context& c);
+
+ virtual void
+ type (IdentifierPtr const& id);
+
+ virtual void
+ name (SimpleIdentifierPtr const& id);
+
+ private:
+ SemanticGraph::EventType* 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
new file mode 100644
index 00000000000..faf36555923
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.cpp
@@ -0,0 +1,104 @@
+// file : CCF/IDL3/SemanticAction/Impl/EventType.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticAction/Impl/EventType.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ EventType::
+ ~EventType () throw ()
+ {
+ }
+
+ EventType::
+ EventType (Context& c)
+ : ScopeBase<SemanticGraph::EventType> (c)
+ {
+ }
+
+ void EventType::
+ begin_concrete_def (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "concrete eventtype def " << id << endl;
+
+ SimpleName name (id->lexeme ());
+
+ if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
+ {
+ now (dynamic_cast<ConcreteEventType&>(*s));
+ }
+ else
+ {
+ now (ctx.tu ().new_node<ConcreteEventType> ());
+ }
+
+ ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
+ }
+
+ void EventType::
+ begin_concrete_fwd (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "concrete eventtype fwd" << id << endl;
+
+ SimpleName name (id->lexeme ());
+
+ if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
+ {
+ now (dynamic_cast<ConcreteEventType&>(*s));
+ }
+ else
+ {
+ now (ctx.tu ().new_node<ConcreteEventType> ());
+ }
+
+ ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
+ }
+
+ void EventType::
+ inherits (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "inherits " << id << endl;
+ }
+
+ void EventType::
+ open_scope ()
+ {
+ if (ctx.trace ()) cerr << "scope open" << endl;
+
+ push (ctx.scope ());
+ ctx.scope (now ());
+ }
+
+ void EventType::
+ close_scope ()
+ {
+ ctx.scope (top ());
+ pop ();
+
+ if (ctx.trace ()) cerr << "scope close" << endl;
+ }
+
+ void EventType::
+ end ()
+ {
+ if (ctx.trace ()) cerr << "end" << endl;
+ }
+
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.hpp
new file mode 100644
index 00000000000..f3676561e54
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/EventType.hpp
@@ -0,0 +1,55 @@
+// 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/SemanticGraph/EventType.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<SemanticGraph::EventType>
+ {
+ public:
+ virtual
+ ~EventType () throw ();
+
+ EventType (Context& c);
+
+ virtual void
+ begin_concrete_def (SimpleIdentifierPtr const& id);
+
+ virtual void
+ begin_concrete_fwd (SimpleIdentifierPtr const& id);
+
+ virtual void
+ inherits (IdentifierPtr const& id);
+
+ virtual void
+ open_scope ();
+
+ virtual void
+ close_scope ();
+
+ virtual void
+ end ();
+ };
+ }
+ }
+ }
+}
+
+#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
new file mode 100644
index 00000000000..bc5a0f7b624
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.cpp
@@ -0,0 +1,41 @@
+// 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
+ {
+
+ Factory::
+ ~Factory () throw () {}
+
+ Factory::
+ Factory (CompilerElements::Context& context,
+ Diagnostic::Stream& dout,
+ SemanticGraph::TranslationUnit& tu)
+ : IDL2::SemanticAction::Impl::Factory (context, dout, tu),
+
+ component_ (ctx_),
+ consumes_ (ctx_),
+ emits_ (ctx_),
+ event_type_ (ctx_),
+ home_ (ctx_),
+ home_factory_ (ctx_),
+ include_ (ctx_, context, dout, *this),
+ provides_ (ctx_),
+ publishes_ (ctx_),
+ system_include_ (ctx_, context, dout, *this),
+ uses_ (ctx_)
+ {
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp
new file mode 100644
index 00000000000..7fd2cbcb871
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Factory.hpp
@@ -0,0 +1,133 @@
+// 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 ();
+
+ //@@ there is no more separate tracing options
+ //
+
+ Factory (CompilerElements::Context& context,
+ Diagnostic::Stream& dout,
+ SemanticGraph::TranslationUnit& tu);
+
+ 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:
+
+ 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
new file mode 100644
index 00000000000..f06be80b428
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.cpp
@@ -0,0 +1,212 @@
+// file : CCF/IDL3/SemanticAction/Impl/Home.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticGraph/Component.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Home.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ Home::
+ ~Home () throw ()
+ {
+ }
+
+ Home::
+ Home (Context& c)
+ : ScopeBase<SemanticGraph::Home> (c)
+ {
+ }
+
+ void Home::
+ begin (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "home " << id << endl;
+
+ SimpleName name (id->lexeme ());
+
+ if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
+ {
+ now (dynamic_cast<SemanticGraph::Home&>(*s));
+ }
+ else
+ {
+ now (ctx.tu ().new_node<SemanticGraph::Home> ());
+ }
+
+ ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
+ }
+
+
+ void Home::
+ inherits (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "inherits " << id << endl;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ ctx.tu ().new_edge<Inherits> (
+ now (),
+ resolve<SemanticGraph::Home> (from, name, defined));
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid inheritance specification" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no home with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "incompatible type in inheritance specification" << endl;
+ }
+ catch (NotDefined const& e)
+ {
+ cerr << "attempt to inherit from forward-declared home "
+ << e.name () << endl;
+ cerr << "inheritance from forward-declared home is illegal"
+ << endl;
+ }
+ }
+
+
+ void Home::
+ supports (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "supports " << id << endl;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ SemanticGraph::Interface& i (
+ resolve<SemanticGraph::Interface> (from, name, defined));
+
+ check_support (now ().supports_begin (),
+ now ().supports_end (),
+ i);
+
+ ctx.tu ().new_edge<Supports> (now (), i);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid supports specification" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no interface with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "incompatible type in supports specification" << endl;
+ }
+ catch (NotDefined const& e)
+ {
+ cerr << "attempt to support from forward-declared component "
+ << e.name () << endl;
+ cerr << "support of forward-declared interface is illegal"
+ << endl;
+ }
+ catch (AlreadySupported const& e)
+ {
+ cerr << "directly supporting interface \'" << e.name ()
+ << "\' more than once is illegal" << endl;
+ }
+ }
+
+
+ void Home::
+ manages (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "manages " << id << endl;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ ctx.tu ().new_edge<Manages> (
+ now (),
+ resolve<SemanticGraph::Component> (from, name, defined));
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid manages specification" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no component with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "incompatible type in manages specification" << endl;
+ }
+ catch (NotDefined const& e)
+ {
+ cerr << "attempt to manage forward-declared component "
+ << e.name () << endl;
+ cerr << "management of forward-declared component is illegal"
+ << endl;
+ }
+ }
+
+ void Home::
+ open_scope ()
+ {
+ if (ctx.trace ()) cerr << "scope open" << endl;
+
+ push (ctx.scope ());
+ ctx.scope (now ());
+ }
+
+ void Home::
+ close_scope ()
+ {
+ ctx.scope (top ());
+ pop ();
+
+ if (ctx.trace ()) cerr << "scope close" << endl;
+ }
+
+ void Home::
+ end ()
+ {
+ if (ctx.trace ()) cerr << "end" << endl;
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.hpp
new file mode 100644
index 00000000000..fae16eef5cb
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Home.hpp
@@ -0,0 +1,58 @@
+// 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/SemanticGraph/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<SemanticGraph::Home>
+ {
+ public:
+ virtual
+ ~Home () throw ();
+
+ Home (Context& c);
+
+ virtual void
+ begin (SimpleIdentifierPtr const& id);
+
+ virtual void
+ inherits (IdentifierPtr const& id);
+
+ virtual void
+ supports (IdentifierPtr const& id);
+
+ virtual void
+ manages (IdentifierPtr const& id);
+
+ virtual void
+ open_scope ();
+
+ virtual void
+ close_scope ();
+
+ virtual void
+ end ();
+ };
+ }
+ }
+ }
+}
+
+#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
new file mode 100644
index 00000000000..62311451c5e
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.cpp
@@ -0,0 +1,148 @@
+// file : CCF/IDL3/SemanticAction/Impl/HomeFactory.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticGraph/Home.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ HomeFactory::
+ ~HomeFactory () throw ()
+ {
+ }
+
+ HomeFactory::
+ HomeFactory (Context& c)
+ : Base (c)
+ {
+ }
+
+ void HomeFactory::
+ name (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << " " << id << endl;
+
+ hf_ = 0;
+
+ SemanticGraph::Home& h (
+ dynamic_cast<SemanticGraph::Home&>(ctx.scope ()));
+
+ SemanticGraph::Component& c (
+ dynamic_cast<SemanticGraph::Component&>(h.manages ().managee ()));
+
+ SimpleName name (id->lexeme ());
+
+ hf_ = &ctx.tu ().new_node<SemanticGraph::HomeFactory> ();
+
+ ctx.tu ().new_edge<Returns> (*hf_, c);
+ ctx.tu ().new_edge<Defines> (ctx.scope (), *hf_, name);
+ }
+
+
+ void HomeFactory::
+ parameter (IdentifierPtr const& type_id,
+ SimpleIdentifierPtr const& name_id)
+ {
+ if (ctx.trace ()) cerr << "parameter in " << " "
+ << type_id << " " << name_id << endl;
+
+ if (hf_ == 0) return;
+
+ Name name (type_id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ Type& t (resolve<Type> (from, name, complete));
+
+ Parameter& p (
+ ctx.tu ().new_node<InParameter> (name_id->lexeme ()));
+
+ ctx.tu ().new_edge<Belongs> (p, t);
+ ctx.tu ().new_edge<Receives> (*hf_, p);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid parameter declaration" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no type with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "declaration with name \'" << name
+ << "\' visible from scope \'" << from
+ << "\' is not a type declaration" << endl;
+ cerr << "using non-type as an factory parameter type is "
+ << "illegal" << endl;
+ }
+ catch (NotComplete const& e)
+ {
+ cerr << "type \'" << e.name () << "\' is not complete" << endl;
+ }
+ }
+
+ void HomeFactory::
+ raises (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "raises " << id << endl;
+
+ if (hf_ == 0) return;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ SemanticGraph::Exception& e (
+ resolve<SemanticGraph::Exception> (from, name));
+
+ ctx.tu ().new_edge<Raises> (*hf_, e);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid raises declaration" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no exception with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "declaration with name \'" << name
+ << "\' visible from scope \'" << from
+ << "\' is not an exception declaration" << endl;
+ cerr << "using non-exception type in raises declaration is "
+ << "illegal" << endl;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp
new file mode 100644
index 00000000000..75dc95cfda6
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/HomeFactory.hpp
@@ -0,0 +1,50 @@
+// 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/IDL2/SemanticGraph/Operation.hpp"
+#include "CCF/IDL3/SemanticAction/HomeFactory.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ //
+ //
+ //
+ class HomeFactory : public virtual SemanticAction::HomeFactory,
+ public Base
+ {
+ public:
+ virtual
+ ~HomeFactory () throw ();
+
+ HomeFactory (Context& c);
+
+ virtual void
+ name (SimpleIdentifierPtr const& id);
+
+ virtual void
+ parameter (IdentifierPtr const& type_id,
+ SimpleIdentifierPtr const& name_id);
+
+ virtual void
+ raises (IdentifierPtr const& id);
+
+ private:
+ SemanticGraph::HomeFactory* hf_;
+ };
+ }
+ }
+ }
+}
+
+#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
new file mode 100644
index 00000000000..7c1c98a2728
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.cpp
@@ -0,0 +1,272 @@
+// file : CCF/IDL3/SemanticAction/Impl/Include.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticAction/Impl/Include.hpp"
+
+#include "CCF/CompilerElements/TokenStream.hpp"
+#include "CCF/CompilerElements/Preprocessor.hpp"
+
+#include "CCF/IDL3/LexicalAnalyzer.hpp"
+#include "CCF/IDL3/Parser.hpp"
+
+#include <vector>
+#include <string>
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ // IncludeImpl
+ //
+ //
+ IncludeImpl::
+ ~IncludeImpl () throw ()
+ {
+ }
+
+ IncludeImpl::
+ IncludeImpl (Context& c,
+ CompilerElements::Context& context,
+ Diagnostic::Stream& dout,
+ SemanticAction::Factory& action_factory,
+ Type type)
+ : ctx (c),
+ context_ (context),
+ dout_ (dout),
+ action_factory_ (action_factory),
+ type_ (type)
+ {
+ abs_path_stack_.push (
+ fs::normalize (
+ fs::complete (context_.get<fs::path> ("file-path"))));
+ }
+
+ void IncludeImpl::
+ begin_impl (StringLiteralPtr const& sl)
+ {
+ std::string prefix;
+
+ if (type_ == user)
+ {
+ prefix = std::string ("include") + " \"" + sl->value () + "\"";
+ }
+ else
+ {
+ prefix = std::string ("include") + " <" + sl->value () + ">";
+ }
+
+ if (ctx.trace ()) cerr << prefix << endl;
+
+ try
+ {
+ fs::ifstream ifs;
+ ifs.exceptions (std::ios_base::badbit | std::ios_base::failbit);
+
+ fs::path include_path (sl->value ());
+ fs::path complete_path (include_path);
+
+ if (ctx.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 (abs_path_stack_.top ().branch_path ());
+
+ complete_path = fs::normalize (rel_path / include_path);
+
+ if (ctx.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 (ctx.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 (ctx.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 (std::ios_base::iostate (0));
+
+ TranslationRegion& r (ctx.tu() .new_node<TranslationRegion> ());
+
+ if (type_ == user)
+ {
+ ctx.tu ().new_edge<QuoteIncludes> (
+ ctx.region (), r, include_path);
+ }
+ else
+ {
+ ctx.tu ().new_edge<BracketIncludes> (
+ ctx.region (), r, include_path);
+ }
+
+ // Set new current region.
+ //
+ stack_.push (&ctx.region ());
+ ctx.region (r);
+
+ // Create Root scope for new region.
+ //
+ Root& root (ctx.tu ().new_node<Root> ());
+ ctx.tu ().new_edge<ContainsRoot> (r, root);
+ ctx.scope (root);
+
+ // Store previous relative path and current absolute.
+ //
+ rel_path_stack_.push (context_.get<fs::path> ("file-path"));
+ context_.set("file-path", include_path);
+
+ abs_path_stack_.push (complete_path);
+
+
+ // Parse the file.
+ //
+ //
+
+ //@@ 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 ());
+ }
+
+ // Restore paths
+ //
+ abs_path_stack_.pop ();
+
+ context_.set("file-path", rel_path_stack_.top ());
+ rel_path_stack_.pop ();
+
+
+ // Restore region.
+ //
+ ctx.region (*stack_.top ());
+ stack_.pop ();
+
+ // Create new Root scope.
+ //
+ {
+ Root& root (ctx.tu ().new_node<Root> ());
+ ctx.tu ().new_edge<ContainsRoot> (ctx.region (), root);
+ ctx.scope (root);
+ }
+ }
+ catch (fs::filesystem_error const&)
+ {
+ cerr << sl << ": error: unable to open in read mode" << endl;
+ }
+ catch (std::ios_base::failure const&)
+ {
+ cerr << sl << ": error: unable to open in read mode" << endl;
+ }
+ }
+
+ void IncludeImpl::
+ end_impl ()
+ {
+ if (ctx.trace ()) cerr << "end" << endl;
+ }
+
+ bool IncludeImpl::
+ 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;
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp
new file mode 100644
index 00000000000..0bc4a631986
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Include.hpp
@@ -0,0 +1,167 @@
+// 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 <stack>
+#include <set>
+
+#include "CCF/CompilerElements/Context.hpp"
+#include "CCF/CompilerElements/Diagnostic.hpp"
+
+#include "CCF/IDL2/SemanticGraph/Translation.hpp"
+#include "CCF/IDL3/SemanticGraph/Elements.hpp"
+
+#include "CCF/IDL2/SemanticAction/Include.hpp"
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp"
+
+#include "CCF/IDL3/SemanticAction/Factory.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 (Context& c,
+ CompilerElements::Context& context,
+ Diagnostic::Stream& dout,
+ SemanticAction::Factory& action_factory,
+ Type type);
+
+ virtual void
+ begin_impl (StringLiteralPtr const& sl);
+
+ virtual void
+ end_impl ();
+
+ private:
+ bool
+ handle_already_included (fs::path const& path,
+ StringLiteralPtr const& sl);
+ private:
+ Context& ctx;
+
+ CompilerElements::Context& context_;
+ Diagnostic::Stream& dout_;
+ SemanticAction::Factory& action_factory_;
+
+ Type type_;
+
+ std::stack<SemanticGraph::TranslationRegion*> stack_;
+ std::stack<fs::path> abs_path_stack_, rel_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 (Context& c,
+ CompilerElements::Context& context,
+ Diagnostic::Stream& dout,
+ SemanticAction::Factory& action_factory)
+ : IncludeImpl (c,
+ context,
+ dout,
+ action_factory,
+ 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 (Context& c,
+ CompilerElements::Context& context,
+ Diagnostic::Stream& dout,
+ SemanticAction::Factory& action_factory)
+ : IncludeImpl (c,
+ context,
+ dout,
+ action_factory,
+ 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->value () != "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/Makefile.alt b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Makefile.alt
new file mode 100644
index 00000000000..86e6bca9548
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Makefile.alt
@@ -0,0 +1,31 @@
+# file : CCF/IDL3/SemanticAction/Impl/Makefile.alt
+# author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+# cvs-id : $Id$
+
+root = ../../../..
+
+include $(root)/Bootstrap.rules
+
+$(call include, $(root)/Config.rules)
+
+$(call include, $(UTILITY_ROOT)/BuildRules/Object.pre.rules)
+
+# Factory.cpp
+
+cxx_translation_units := Component.cpp \
+ Consumes.cpp \
+ Elements.cpp \
+ Emits.cpp \
+ EventType.cpp \
+ Factory.cpp \
+ Home.cpp \
+ HomeFactory.cpp \
+ Include.cpp \
+ Provides.cpp \
+ Publishes.cpp \
+ Uses.cpp
+
+
+CXX_PREPROCESS_FLAGS += -I$(root) -I$(UTILITY_ROOT) -I$(BOOST_ROOT)
+
+$(call include, $(UTILITY_ROOT)/BuildRules/Object.post.rules)
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp
new file mode 100644
index 00000000000..f5b5b083d16
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.cpp
@@ -0,0 +1,87 @@
+// file : CCF/IDL3/SemanticAction/Impl/Provides.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticGraph/Component.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Provides.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ Provides::
+ ~Provides () throw ()
+ {
+ }
+
+ Provides::
+ Provides (Context& c)
+ : Base (c)
+ {
+ }
+
+ void Provides::
+ type (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "provides " << id;
+
+ type_ = 0;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ type_ = &resolve<SemanticGraph::Interface> (from, name);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid provides declaration" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no interface with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "declaration with name \'" << name
+ << "\' visible from scope \'" << from
+ << "\' is not an eventtype declaration" << endl;
+ cerr << "using non-interface type in provides declaration is "
+ << "illegal" << endl;
+ }
+ }
+
+ void Provides::
+ name (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << " " << id << endl;
+
+ if (type_)
+ {
+ Provider& p (ctx.tu ().new_node<Provider> ());
+
+ ctx.tu ().new_edge<Belongs> (p, *type_);
+ ctx.tu ().new_edge<Defines> (ctx.scope (), p, id->lexeme ());
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.hpp
new file mode 100644
index 00000000000..e818b049cc5
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Provides.hpp
@@ -0,0 +1,43 @@
+// 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/IDL2/SemanticGraph/Interface.hpp"
+#include "CCF/IDL3/SemanticAction/Provides.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ class Provides : public virtual SemanticAction::Provides,
+ public Base
+ {
+ public:
+ virtual
+ ~Provides () throw ();
+
+ Provides (Context& c);
+
+ virtual void
+ type (IdentifierPtr const& id);
+
+ virtual void
+ name (SimpleIdentifierPtr const& id);
+
+ private:
+ SemanticGraph::Interface* 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
new file mode 100644
index 00000000000..227836ea8ec
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.cpp
@@ -0,0 +1,87 @@
+// file : CCF/IDL3/SemanticAction/Impl/Publishes.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticGraph/Component.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Publishes.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ Publishes::
+ ~Publishes () throw ()
+ {
+ }
+
+ Publishes::
+ Publishes (Context& c)
+ : Base (c)
+ {
+ }
+
+ void Publishes::
+ type (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "publishes " << id;
+
+ type_ = 0;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ type_ = &resolve<EventType> (from, name);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid publishes declaration" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no eventtype with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "declaration with name \'" << name
+ << "\' visible from scope \'" << from
+ << "\' is not an eventtype declaration" << endl;
+ cerr << "using non-eventtype in publishes declaration is illegal"
+ << endl;
+ }
+ }
+
+ void Publishes::
+ name (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << " " << id << endl;
+
+ if (type_)
+ {
+ Publisher& p (ctx.tu ().new_node<Publisher> ());
+
+ ctx.tu ().new_edge<Belongs> (p, *type_);
+ ctx.tu ().new_edge<Defines> (ctx.scope (), p, id->lexeme ());
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.hpp
new file mode 100644
index 00000000000..bf19b938d54
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Publishes.hpp
@@ -0,0 +1,43 @@
+// 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/SemanticGraph/EventType.hpp"
+#include "CCF/IDL3/SemanticAction/Publishes.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ class Publishes : public virtual SemanticAction::Publishes,
+ public Base
+ {
+ public:
+ virtual
+ ~Publishes () throw ();
+
+ Publishes (Context& c);
+
+ virtual void
+ type (IdentifierPtr const& id);
+
+ virtual void
+ name (SimpleIdentifierPtr const& id);
+
+ private:
+ SemanticGraph::EventType* 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
new file mode 100644
index 00000000000..ee51de66c36
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.cpp
@@ -0,0 +1,87 @@
+// file : CCF/IDL3/SemanticAction/Impl/Uses.cpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "CCF/IDL3/SemanticGraph/Component.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Uses.hpp"
+
+#include <iostream>
+
+using std::cerr;
+using std::endl;
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ using namespace SemanticGraph;
+
+ Uses::
+ ~Uses () throw ()
+ {
+ }
+
+ Uses::
+ Uses (Context& c)
+ : Base (c)
+ {
+ }
+
+ void Uses::
+ type (IdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << "uses " << id;
+
+ type_ = 0;
+
+ Name name (id->lexeme ());
+ ScopedName from (ctx.scope ().scoped_name ());
+
+ try
+ {
+ try
+ {
+ type_ = &resolve<SemanticGraph::Interface> (from, name);
+ }
+ catch (Resolve const&)
+ {
+ cerr << "error: invalid uses declaration" << endl;
+ throw;
+ }
+ }
+ catch (NotFound const&)
+ {
+ cerr << "no interface with name \'" << name
+ << "\' visible from scope \'" << from << "\'" << endl;
+ }
+ catch (WrongType const& e)
+ {
+ cerr << "declaration with name \'" << name
+ << "\' visible from scope \'" << from
+ << "\' is not an eventtype declaration" << endl;
+ cerr << "using non-interface type in uses declaration is "
+ << "illegal" << endl;
+ }
+ }
+
+ void Uses::
+ name (SimpleIdentifierPtr const& id)
+ {
+ if (ctx.trace ()) cerr << " " << id << endl;
+
+ if (type_)
+ {
+ User& u (ctx.tu ().new_node<User> ());
+
+ ctx.tu ().new_edge<Belongs> (u, *type_);
+ ctx.tu ().new_edge<Defines> (ctx.scope (), u, id->lexeme ());
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.hpp
new file mode 100644
index 00000000000..54c2884767f
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Impl/Uses.hpp
@@ -0,0 +1,43 @@
+// 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/IDL2/SemanticGraph/Interface.hpp"
+#include "CCF/IDL3/SemanticAction/Uses.hpp"
+#include "CCF/IDL3/SemanticAction/Impl/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ namespace Impl
+ {
+ class Uses : public virtual SemanticAction::Uses,
+ public Base
+ {
+ public:
+ virtual
+ ~Uses () throw ();
+
+ Uses (Context& c);
+
+ virtual void
+ type (IdentifierPtr const& id);
+
+ virtual void
+ name (SimpleIdentifierPtr const& id);
+
+ private:
+ SemanticGraph::Interface* type_;
+ };
+ }
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_IMPL_USES_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Makefile.alt b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Makefile.alt
new file mode 100644
index 00000000000..0e79c8593b1
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Makefile.alt
@@ -0,0 +1,17 @@
+# file : CCF/IDL3/SemanticAction/Makefile.alt
+# author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+# cvs-id : $Id$
+
+root := ../../..
+
+include $(root)/Bootstrap.rules
+
+$(call include, $(root)/Config.rules)
+
+$(call include, $(UTILITY_ROOT)/BuildRules/Recursion.pre.rules)
+
+target_makefile_list :=
+target_directory_list := Impl
+default_makefile_name := Makefile.alt
+
+$(call include, $(UTILITY_ROOT)/BuildRules/Recursion.post.rules)
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Provides.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Provides.hpp
new file mode 100644
index 00000000000..e32fcdab84e
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Provides.hpp
@@ -0,0 +1,35 @@
+// file : CCF/IDL3/SemanticAction/Provides.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_PROVIDES_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_PROVIDES_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class Provides
+ {
+ public:
+ virtual
+ ~Provides () throw () {}
+
+ virtual void
+ type (IdentifierPtr const& id) = 0;
+
+ virtual void
+ name (SimpleIdentifierPtr const& id) = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_PROVIDES_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Publishes.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Publishes.hpp
new file mode 100644
index 00000000000..1ce9898ffe5
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Publishes.hpp
@@ -0,0 +1,35 @@
+// file : CCF/IDL3/SemanticAction/Publishes.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_PUBLISHES_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_PUBLISHES_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class Publishes
+ {
+ public:
+ virtual
+ ~Publishes () throw () {}
+
+ virtual void
+ type (IdentifierPtr const& id) = 0;
+
+ virtual void
+ name (SimpleIdentifierPtr const& id) = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_PUBLISHES_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Uses.hpp b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Uses.hpp
new file mode 100644
index 00000000000..867d6495c55
--- /dev/null
+++ b/TAO/CIAO/CCF/CCF/IDL3/SemanticAction/Uses.hpp
@@ -0,0 +1,35 @@
+// file : CCF/IDL3/SemanticAction/Uses.hpp
+// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
+// cvs-id : $Id$
+
+#ifndef CCF_IDL3_SEMANTIC_ACTION_USES_HPP
+#define CCF_IDL3_SEMANTIC_ACTION_USES_HPP
+
+#include "CCF/IDL3/SemanticAction/Elements.hpp"
+
+namespace CCF
+{
+ namespace IDL3
+ {
+ namespace SemanticAction
+ {
+ //
+ //
+ //
+ class Uses
+ {
+ public:
+ virtual
+ ~Uses () throw () {}
+
+ virtual void
+ type (IdentifierPtr const& id) = 0;
+
+ virtual void
+ name (SimpleIdentifierPtr const& id) = 0;
+ };
+ }
+ }
+}
+
+#endif // CCF_IDL3_SEMANTIC_ACTION_USES_HPP