summaryrefslogtreecommitdiff
path: root/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-05 17:14:45 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-03-05 17:14:45 +0000
commit58033491c6d0bac82315c1fdb1ec9b39be58093f (patch)
treec69c3aa67ec66758066e959bd0d533ea336ec236 /TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl
parent2efc882384a34f61311a24fc641d1b5fd5776356 (diff)
downloadATCD-TAO-1_5.tar.gz
This commit was manufactured by cvs2svn to create tag 'TAO-1_5'.TAO-1_5
Diffstat (limited to 'TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl')
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.cpp189
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.hpp55
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp112
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.hpp39
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.cpp133
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp304
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.tpp94
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp69
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.hpp41
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Exception.cpp69
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Exception.hpp42
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp86
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp194
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.cpp50
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.hpp41
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp247
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.hpp69
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.cpp106
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.hpp41
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp63
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.hpp42
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Native.cpp50
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Native.hpp34
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp338
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp80
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp243
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp57
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.cpp97
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.hpp45
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.cpp134
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.hpp58
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.cpp292
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.hpp61
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Union.cpp213
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Union.hpp57
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueType.cpp267
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueType.hpp65
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.cpp139
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.hpp42
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeMember.cpp138
-rw-r--r--TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeMember.hpp48
41 files changed, 0 insertions, 4544 deletions
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 dcffba1dc92..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.cpp
+++ /dev/null
@@ -1,189 +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"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Attribute::
- Attribute (Context& c)
- : Base (c)
- {
- }
-
- void Attribute::
- begin_ro ()
- {
- if (ctx.trace ()) cerr << "readonly attribute" << endl;
-
- readonly_ = true;
-
-
- }
-
- void Attribute::
- begin_rw ()
- {
- if (ctx.trace ()) cerr << "readwrite attribute" << endl;
-
- readonly_ = false;
- }
-
- void Attribute::
- type (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << id << endl;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- type_ = 0;
-
- try
- {
- try
- {
- type_ = &resolve<Type> (from, name, Flags::complete);
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid attribute declaration" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type as an attribute type is illegal" << endl;
- }
- catch (NotComplete const& e)
- {
- cerr << "type \'" << e.name () << "\' is not complete" << endl;
- }
- }
-
- void Attribute::
- name (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << id << endl;
-
- if (type_ != 0)
- {
- if (readonly_)
- a_ = &ctx.tu ().new_node<ReadAttribute> ();
- else
- a_ = &ctx.tu ().new_node<ReadWriteAttribute> ();
-
- ctx.tu ().new_edge<Belongs> (*a_, *type_);
- ctx.tu ().new_edge<Defines> (ctx.scope (), *a_, id->lexeme ());
- }
- }
-
- void Attribute::
- get_raises (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "get-raise " << id << endl;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- SemanticGraph::Exception& e (
- resolve<SemanticGraph::Exception> (from, name));
-
- ctx.tu ().new_edge<GetRaises> (
- dynamic_cast<ReadAttribute&> (*a_), 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&)
- {
- 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;
- }
- }
-
- void Attribute::
- set_raises (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "set-raise " << id << endl;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- SemanticGraph::Exception& e (
- resolve<SemanticGraph::Exception> (from, name));
-
- ctx.tu ().new_edge<SetRaises> (
- dynamic_cast<WriteAttribute&> (*a_), 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&)
- {
- 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;
- }
- }
-
- void Attribute::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
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 88bc8e5016a..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Attribute.hpp
+++ /dev/null
@@ -1,55 +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/SemanticGraph/Attribute.hpp"
-#include "CCF/IDL2/SemanticAction/Attribute.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Attribute : SemanticAction::Attribute, Base
- {
- Attribute (Context& c);
-
- virtual void
- begin_ro ();
-
- virtual void
- begin_rw ();
-
- virtual void
- type (IdentifierPtr const& id);
-
- virtual void
- name (SimpleIdentifierPtr const& id);
-
- virtual void
- get_raises (IdentifierPtr const& id);
-
- virtual void
- set_raises (IdentifierPtr const& id);
-
- virtual void
- end ();
-
- private:
- bool readonly_;
- SemanticGraph::Type* type_;
- SemanticGraph::Attribute* a_;
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_ATTRIBUTE_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp
deleted file mode 100644
index 6a55fa768c4..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Const.cpp
-// author : Boris Kolpackov <boris@kolpackov.net>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticAction/Impl/Const.hpp"
-
-#include "CCF/IDL2/SemanticGraph/Fundamental.hpp"
-#include "CCF/IDL2/SemanticGraph/IntExpression.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Const::
- Const (Context& c)
- : Base (c)
- {
- }
-
- void Const::
- begin (IdentifierPtr const& type_id,
- SimpleIdentifierPtr const& name_id)
- {
- if (ctx.trace ())
- cerr << "const " << type_id << " " << name_id << endl;
-
- const_ = 0;
-
- SimpleName name (name_id->lexeme ());
- Name type_name (type_id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- Type& t (resolve<Type> (from, type_name, Flags::complete));
-
- if (dynamic_cast<Octet*> (&t) ||
- dynamic_cast<Short*> (&t) ||
- dynamic_cast<UnsignedShort*> (&t) ||
- dynamic_cast<Long*> (&t) ||
- dynamic_cast<UnsignedLong*> (&t) ||
- dynamic_cast<LongLong*> (&t) ||
- dynamic_cast<UnsignedLongLong*> (&t))
- {
- // Integer constant.
- //
- const_ = &ctx.tu ().new_node<SemanticGraph::IntConst> ();
-
- ctx.tu ().new_edge<Belongs> (*const_, t);
- ctx.tu ().new_edge<Defines> (ctx.scope (), *const_, name);
- }
-
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid const declaration" << endl;
- throw;
- }
-
- //@@ I am not handling NotUnique here. For example if
- // I provide module name as type then the compiler
- // will ICE. Think about other places it may happen
- // (attribute, value memebr, typeded, others?).
- //
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type as a const type is illegal" << endl;
- }
- catch (NotComplete const& e)
- {
- cerr << "type \'" << e.name () << "\' is not complete" << endl;
- }
- }
-
- void Const::
- expr ()
- {
- //@@ Need to check if int_exp_stack is empty.
- //
- if (const_ && ctx.int_exp_size () > 0)
- {
- IntExpression& expr (ctx.int_exp_pop ());
-
- ctx.tu ().new_edge<Initializes> (expr, *const_);
- }
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.hpp
deleted file mode 100644
index 37ac3153d16..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Const.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Const.hpp
-// author : Boris Kolpackov <boris@kolpackov.net>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_CONST_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_CONST_HPP
-
-#include "CCF/IDL2/SemanticGraph/Elements.hpp"
-#include "CCF/IDL2/SemanticAction/Const.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Const : SemanticAction::Const, Base
- {
- Const (Context& c);
-
- virtual void
- begin (IdentifierPtr const& type,
- SimpleIdentifierPtr const& name);
-
- virtual void
- expr ();
-
- private:
- SemanticGraph::Const* const_;
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_CONST_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 0076b9d757c..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.cpp
+++ /dev/null
@@ -1,133 +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"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace
-{
- bool trace (false);
-}
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- // @@ Need pointer iterator adapter.
-
- using namespace SemanticGraph;
- using SemanticGraph::Scope;
-
- Nameables
- resolve (TranslationUnit& tu,
- ScopedName const& from,
- Name const& name) throw (NotFound)
- {
-
- if (trace) cerr << "resolve: starting resolution process for \'"
- << name << "\' from \'" << from << "\'" << endl;
-
- Nameables r;
-
- // Check if name is already scoped.
- //
- if (name.scoped ())
- {
- r = tu.lookup (ScopedName (name));
- }
- else
- {
- // Obtain all nodes corresponding to this scope name.
- //
-
- for (ScopedName next (from);;)
- {
- Nameables scopes (tu.lookup (next));
-
- // Lookup the name in each scope.
- //
- for (Nameables::const_iterator
- i (scopes.begin ()), end (scopes.end ());
- i != end; ++i)
- {
- if (Scope* s = dynamic_cast<Scope*> (*i))
- {
- s->lookup (name, r);
- }
- }
-
- if (r.begin () != r.end () || next.simple ())
- {
- // Found something -or- at the root scope.
- //
- break;
- }
-
- next = ScopedName (next.begin (), next.end () - 1);
- }
- }
-
- if (r.begin () == r.end ())
- {
- if (trace) cerr << "resolve: resolution process for \'"
- << name << "\' from \'" << from << "\' failed."
- << endl;
-
- throw NotFound ();
- }
- else
- {
- if (trace) cerr << "resolve: resolution process for \'"
- << name << "\' from \'" << from << "\' succeeded:"
- << endl;
-
- for (Nameables::const_iterator i (r.begin ()), end (r.end ());
- i != end; ++i)
- {
- if (trace) cerr << "\t\'" << (**i).scoped_name () << "\'"
- << endl;
- }
- }
-
- return r;
- }
-
-
- // Lookup *all* scopes for a simple name
- //
- //
- Nameable*
- lookup (SemanticGraph::TranslationUnit& tu,
- SemanticGraph::Scope& in,
- SemanticGraph::SimpleName const& name) throw (NotUnique)
- {
- Nameables r;
-
- Nameables scopes (tu.lookup (in.scoped_name ()));
-
- for (Nameables::const_iterator
- i (scopes.begin ()), end (scopes.end ());
- i != end; ++i)
- {
- dynamic_cast<Scope&> (**i).lookup (name, r);
- }
-
- if (r.size () > 1) throw NotUnique ();
-
- if (r.empty ()) return 0;
-
- return *(r.begin ());
- }
- }
- }
- }
-}
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 9b32c0931e1..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.hpp
+++ /dev/null
@@ -1,304 +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/SemanticGraph/Translation.hpp"
-#include "CCF/IDL2/SemanticGraph/IntExpression.hpp"
-
-#include "CCF/IDL2/SemanticAction/Elements.hpp"
-
-/*
- 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
- {
-
- //
- //
- //
- class Context
- {
- public:
- Context (bool trace,
- SemanticGraph::TranslationUnit& tu)
- : trace_ (trace),
- tu_ (tu)
- {
- }
-
- bool
- trace ()
- {
- return trace_;
- }
-
- SemanticGraph::TranslationUnit&
- tu () const
- {
- return tu_;
- }
-
- SemanticGraph::Scope&
- scope () const
- {
- return *scope_;
- }
-
- void
- scope (SemanticGraph::Scope& scope)
- {
- scope_ = &scope;
- }
-
- SemanticGraph::TranslationRegion&
- region () const
- {
- return *region_;
- }
-
- void
- region (SemanticGraph::TranslationRegion& r)
- {
- region_ = &r;
- }
-
- public:
- void
- int_exp_push (SemanticGraph::IntExpression& e)
- {
- int_exp_stack_.push (&e);
- }
-
- SemanticGraph::IntExpression&
- int_exp_pop ()
- {
- SemanticGraph::IntExpression& e (*int_exp_stack_.top ());
- int_exp_stack_.pop ();
- return e;
- }
-
- std::size_t
- int_exp_size ()
- {
- return int_exp_stack_.size ();
- }
-
- void
- int_exp_flush ()
- {
- while (int_exp_stack_.size ())
- int_exp_stack_.pop ();
- }
-
- private:
- bool trace_;
- SemanticGraph::TranslationUnit& tu_;
- SemanticGraph::TranslationRegion* region_;
- SemanticGraph::Scope* scope_;
-
- std::stack<SemanticGraph::IntExpression*> int_exp_stack_;
-
- private:
- Context (Context const&);
- void operator= (Context const&);
- };
-
-
- //
- //
- //
- class Base
- {
- protected:
- virtual
- ~Base ()
- {
- }
-
- Base (Context& c)
- : ctx (c)
- {
- }
-
- protected:
-
- class Resolve {};
-
- template <typename Id>
- struct ExceptionTemplate : Resolve
- {
- explicit
- ExceptionTemplate (SemanticGraph::ScopedName name)
- : name_ (name)
- {
- }
-
- SemanticGraph::ScopedName
- name () const
- {
- return name_;
- }
-
- private:
- SemanticGraph::ScopedName name_;
- };
-
-
- struct NotFound : Resolve {};
-
- class WrongType_ {};
- typedef ExceptionTemplate<WrongType_> WrongType;
-
- class NotUnique : Resolve {};
-
- class NotDefined_ {};
- typedef ExceptionTemplate<NotDefined_> NotDefined;
-
- class NotComplete_ {};
- typedef ExceptionTemplate<NotComplete_> NotComplete;
-
- struct Flags
- {
- enum Value
- {
- none = 0x00,
- complete = 0x01,
- defined = 0x02
- };
- };
-
- template <typename T>
- T&
- resolve (SemanticGraph::ScopedName const& from,
- SemanticGraph::Name const& name,
- Flags::Value flags = Flags::none)
- throw (NotFound, NotUnique, WrongType, NotDefined, NotComplete);
-
-
- class AlreadyInherited_ {};
- typedef ExceptionTemplate<AlreadyInherited_> AlreadyInherited;
-
- class AlreadySupported_ {};
- typedef ExceptionTemplate<AlreadySupported_> AlreadySupported;
-
- template<typename I>
- void
- check_inheritance (I begin, I end, SemanticGraph::Nameable& t)
- throw (AlreadyInherited);
-
- template<typename I>
- void
- check_support (I begin, I end, SemanticGraph::Nameable& t)
- throw (AlreadySupported);
-
- protected:
- Context& ctx;
- };
-
-
- //
- //
- //
- template <typename T>
- class ScopeBase : public Base
- {
- protected:
- ScopeBase (Context& c)
- : Base (c)
- {
- }
-
- protected:
- T&
- now () const
- {
- return *now_;
- }
-
- void
- now (T& t)
- {
- now_ = &t;
- }
-
- void
- push (SemanticGraph::Scope& t)
- {
- stack_.push (&t);
- }
-
- void
- pop ()
- {
- stack_.pop ();
- }
-
- SemanticGraph::Scope&
- top ()
- {
- return *stack_.top ();
- }
-
- private:
- T* now_;
- std::stack<SemanticGraph::Scope*> stack_;
- };
-
-
- //
- //
- //
- class NotFound {};
- class NotUnique {};
-
- SemanticGraph::Nameables
- resolve (SemanticGraph::TranslationUnit& tu,
- SemanticGraph::ScopedName const& from,
- SemanticGraph::Name const& name) throw (NotFound);
-
-
-
-
- SemanticGraph::Nameable*
- lookup (SemanticGraph::TranslationUnit& tu,
- SemanticGraph::Scope& in,
- SemanticGraph::SimpleName const& name) throw (NotUnique);
- }
- }
- }
-}
-
-#include "CCF/IDL2/SemanticAction/Impl/Elements.tpp"
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_ELEMENTS_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.tpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.tpp
deleted file mode 100644
index 13d4e8905d4..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Elements.tpp
+++ /dev/null
@@ -1,94 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Elements.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- template <typename T>
- T& Base::
- resolve (SemanticGraph::ScopedName const& from,
- SemanticGraph::Name const& name,
- Flags::Value flags)
- throw (NotFound, NotUnique, WrongType, NotDefined, NotComplete)
- {
- using namespace SemanticGraph;
-
- try
- {
- Nameables nodes (Impl::resolve (ctx.tu (), from, name));
-
-
- if (nodes.size () != 1) throw NotUnique ();
-
- Nameable& node (**(nodes.begin ()));
-
- try
- {
- T& t (dynamic_cast<T&> (node));
-
- if (flags & Flags::defined)
- {
- if (!t.defined ()) throw NotDefined (node.scoped_name ());
- }
-
- if (flags & Flags::complete)
- {
- SemanticGraph::Type& type (
- dynamic_cast<SemanticGraph::Type&> (t));
-
- if (!type.complete ())
- {
- throw NotComplete (node.scoped_name ());
- }
- }
-
- return t;
- }
- catch (std::bad_cast const&)
- {
- throw WrongType (node.scoped_name ());
- }
- }
- catch (Impl::NotFound const&)
- {
- throw NotFound ();
- }
- }
-
- template<typename I>
- void Base::
- check_inheritance (I begin, I end, SemanticGraph::Nameable& t)
- throw (AlreadyInherited)
- {
- for (;begin != end; ++begin)
- {
- if ((**begin).inheritee () == t)
- {
- throw AlreadyInherited (t.scoped_name ());
- }
- }
- }
-
- template<typename I>
- void Base::
- check_support (I begin, I end, SemanticGraph::Nameable& t)
- throw (AlreadySupported)
- {
- for (;begin != end; ++begin)
- {
- if ((**begin).supportee () == t)
- {
- throw AlreadySupported (t.scoped_name ());
- }
- }
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp
deleted file mode 100644
index a87d87470b2..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Enum.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticAction/Impl/Enum.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Enum::
- Enum (Context& c)
- : Base (c)
- {
- }
-
- void Enum::
- begin (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "enum " << id << endl;
-
- type_ = 0;
-
- SimpleName name (id->lexeme ());
-
- //@@ Need to check for redeclaration of the name.
- //
-
- type_ = &ctx.tu ().new_node<SemanticGraph::Enum> ();
- ctx.tu ().new_edge<Defines> (ctx.scope (), *type_, name);
- }
-
- void Enum::
- enumerator (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "enumerator " << id << endl;
-
- //@@ Need to check for redeclaration of the name.
- //
-
- SimpleName name (id->lexeme ());
-
- if (type_ != 0)
- {
- Enumerator& e (ctx.tu ().new_node<Enumerator> ());
- ctx.tu ().new_edge<Belongs> (e, *type_);
- }
- }
-
- void Enum::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.hpp
deleted file mode 100644
index df25fb0455f..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Enum.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Enum.hpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_ENUM_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_ENUM_HPP
-
-#include "CCF/IDL2/SemanticGraph/Enum.hpp"
-#include "CCF/IDL2/SemanticAction/Enum.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Enum : SemanticAction::Enum, Base
- {
- Enum (Context& c);
-
- virtual void
- begin (SimpleIdentifierPtr const& id);
-
- virtual void
- enumerator (SimpleIdentifierPtr const& id);
-
- virtual void
- end ();
-
- private:
- SemanticGraph::Enum* type_;
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_ENUM_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Exception.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Exception.cpp
deleted file mode 100644
index 5fb70498011..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Exception.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Exception.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticAction/Impl/Exception.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Exception::
- Exception (Context& c)
- : ScopeBase<SemanticGraph::Exception> (c)
- {
- }
-
- void Exception::
- begin (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "exception " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- //@@ Need to check for redeclaration of the name. Can not
- // do that because I don't have mechanism for throwing
- // exception from SA.
- //
- now (ctx.tu ().new_node<SemanticGraph::Exception> ());
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
- }
-
- void Exception::
- open_scope ()
- {
- if (ctx.trace ()) cerr << "scope open" << endl;
-
- push (ctx.scope ());
- ctx.scope (now ());
- }
-
- void Exception::
- close_scope ()
- {
- ctx.scope (top ());
- pop ();
-
- if (ctx.trace ()) cerr << "scope close" << endl;
- }
-
- void Exception::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Exception.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Exception.hpp
deleted file mode 100644
index 6ed44048b36..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Exception.hpp
+++ /dev/null
@@ -1,42 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Exception.hpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_EXCEPTION_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_EXCEPTION_HPP
-
-#include "CCF/IDL2/SemanticGraph/Exception.hpp"
-#include "CCF/IDL2/SemanticAction/Exception.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Exception : SemanticAction::Exception,
- ScopeBase<SemanticGraph::Exception>
- {
- Exception (Context& c);
-
- virtual void
- begin (SimpleIdentifierPtr const& id);
-
- virtual void
- open_scope ();
-
- virtual void
- close_scope ();
-
- virtual void
- end ();
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_EXCEPTION_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 9c5ac4df626..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Factory.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticGraph/Fundamental.hpp"
-
-#include "CCF/IDL2/SemanticAction/Impl/Factory.hpp"
-
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Factory::
- Factory (CompilerElements::Context& context,
- Diagnostic::Stream&,
- SemanticGraph::TranslationUnit& tu)
- : ctx_ (context.get ("trace-semantic-action", false), tu),
-
- attribute_ (ctx_),
- const__ (ctx_),
- enum__ (ctx_),
- exception_ (ctx_),
- include_ (ctx_),
- interface_ (ctx_),
- member_ (ctx_),
- module_ (ctx_),
- native_ (ctx_),
- numeric_expression_ (ctx_),
- operation_ (ctx_),
- struct__ (ctx_),
- typedef__ (ctx_),
- type_id_ (ctx_),
- type_prefix_ (ctx_),
- union__ (ctx_),
- value_type_ (ctx_),
- value_type_factory_ (ctx_),
- value_type_member_ (ctx_)
- {
- // Implied translation region with fundamental types.
- //
- TranslationRegion& ftr (tu.new_node<TranslationRegion> ());
- tu.new_edge<ContainsImplied> (tu, ftr, ".fundamental");
-
- Root& fr (tu.new_node<Root> ());
- tu.new_edge<ContainsRoot> (ftr, fr);
-
- tu.new_edge<Defines> (fr, tu.new_node<Object> (), "Object");
- tu.new_edge<Defines> (fr, tu.new_node<ValueBase> (), "ValueBase");
- tu.new_edge<Defines> (fr, tu.new_node<Any> (), "any");
- tu.new_edge<Defines> (fr, tu.new_node<Boolean> (), "boolean");
- tu.new_edge<Defines> (fr, tu.new_node<Char> (), "char");
- tu.new_edge<Defines> (fr, tu.new_node<Double> (), "double");
- tu.new_edge<Defines> (fr, tu.new_node<Float> (), "float");
- tu.new_edge<Defines> (fr, tu.new_node<Long> (), "long");
- tu.new_edge<Defines> (fr, tu.new_node<LongDouble> (), "long double");
- tu.new_edge<Defines> (fr, tu.new_node<LongLong> (), "long long");
- tu.new_edge<Defines> (fr, tu.new_node<Octet> (), "octet");
- tu.new_edge<Defines> (fr, tu.new_node<Short> (), "short");
- tu.new_edge<Defines> (fr, tu.new_node<String> (), "string");
- tu.new_edge<Defines> (fr, tu.new_node<UnsignedLong> (), "unsigned long");
- tu.new_edge<Defines> (fr, tu.new_node<UnsignedLongLong> (), "unsigned long long");
- tu.new_edge<Defines> (fr, tu.new_node<UnsignedShort> (), "unsigned short");
- tu.new_edge<Defines> (fr, tu.new_node<Void> (), "void");
- tu.new_edge<Defines> (fr, tu.new_node<Wchar> (), "wchar");
- tu.new_edge<Defines> (fr, tu.new_node<Wstring> (), "wstring");
-
- TranslationRegion& principal (tu.new_node<TranslationRegion> ());
- tu.new_edge<ContainsPrincipal> (tu, principal);
-
- Root& root (tu.new_node<Root> ());
- tu.new_edge<ContainsRoot> (principal, root);
-
- ctx_.region (principal);
- ctx_.scope (root);
- }
- }
- }
- }
-}
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 4a0b8aceb8b..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Factory.hpp
+++ /dev/null
@@ -1,194 +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/CompilerElements/Diagnostic.hpp"
-
-#include "CCF/IDL2/SemanticGraph/Translation.hpp"
-
-#include "CCF/IDL2/SemanticAction/Factory.hpp"
-
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-//@@ It would be nice to move this includes into .cpp
-//
-#include "CCF/IDL2/SemanticAction/Impl/Attribute.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Const.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Enum.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Exception.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/Native.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/NumericExpression.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"
-#include "CCF/IDL2/SemanticAction/Impl/Union.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/ValueType.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/ValueTypeMember.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Factory : virtual IDL2::SemanticAction::Factory
- {
- Factory (CompilerElements::Context& context,
- Diagnostic::Stream& dout,
- SemanticGraph::TranslationUnit& tu);
-
- virtual SemanticAction::Attribute&
- attribute ()
- {
- return attribute_;
- }
-
- virtual SemanticAction::Const&
- const_ ()
- {
- return const__;
- }
-
- virtual SemanticAction::Enum&
- enum_ ()
- {
- return enum__;
- }
-
- virtual SemanticAction::Exception&
- exception ()
- {
- return exception_;
- }
-
- 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::Native&
- native ()
- {
- return native_;
- }
-
- virtual SemanticAction::NumericExpression&
- numeric_expression ()
- {
- return numeric_expression_;
- }
-
- virtual SemanticAction::Operation&
- operation ()
- {
- return operation_;
- }
-
- virtual SemanticAction::Struct&
- struct_ ()
- {
- return struct__;
- }
-
- virtual SemanticAction::Typedef&
- typedef_ ()
- {
- return typedef__;
- }
-
- virtual SemanticAction::TypeId&
- type_id ()
- {
- return type_id_;
- }
-
- virtual SemanticAction::TypePrefix&
- type_prefix ()
- {
- return type_prefix_;
- }
-
- virtual SemanticAction::Union&
- union_ ()
- {
- return union__;
- }
-
- virtual SemanticAction::ValueType&
- value_type ()
- {
- return value_type_;
- }
-
- virtual ValueTypeFactory&
- value_type_factory ()
- {
- return value_type_factory_;
- }
-
- virtual SemanticAction::ValueTypeMember&
- value_type_member ()
- {
- return value_type_member_;
- }
-
- protected:
- Context ctx_;
-
- private:
- Attribute attribute_;
- Const const__;
- Enum enum__;
- Exception exception_;
- Include include_;
- Interface interface_;
- Member member_;
- Module module_;
- Native native_;
- NumericExpression numeric_expression_;
- Operation operation_;
- Struct struct__;
- Typedef typedef__;
- TypeId type_id_;
- TypePrefix type_prefix_;
- Union union__;
- ValueType value_type_;
- ValueTypeFactory value_type_factory_;
- ValueTypeMember value_type_member_;
- };
- }
- }
- }
-}
-
-#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 ad6561030f4..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.cpp
+++ /dev/null
@@ -1,50 +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"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- // @@ This is left unimplemented for now. Later code from
- // IDL3 should be copied here. Or better yet this implementation
- // should allow customization via overriding.
- //
- Include::
- Include (Context& c)
- : ctx (c)
- {
- }
-
- void Include::
- quote (StringLiteralPtr const& sl)
- {
- if (ctx.trace ()) cerr << "__qinclude " << sl << endl;
- }
-
- void Include::
- bracket (StringLiteralPtr const& sl)
- {
- if (ctx.trace ()) cerr << "__binclude " << sl << endl;
- }
-
- void Include::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
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 57b573e23a3..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Include.hpp
+++ /dev/null
@@ -1,41 +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 "CCF/IDL2/SemanticAction/Include.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Include : SemanticAction::Include
- {
- Include (Context& c);
-
- virtual void
- quote (StringLiteralPtr const& sl);
-
- virtual void
- bracket (StringLiteralPtr const& sl);
-
- virtual void
- end ();
-
- private:
- Context& ctx;
- };
- }
- }
- }
-}
-
-#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 4f26c633caa..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.cpp
+++ /dev/null
@@ -1,247 +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"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Interface::
- Interface (Context& c)
- : ScopeBase<SemanticGraph::Interface> (c)
- {
- }
-
- void Interface::
- begin_abstract_def (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "abstract interface def " << id << endl;
-
- qualifier_ = Qualifier::abstract;
-
- SimpleName name (id->lexeme ());
-
- //@@ Not handling NotUnique exception.
- //
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<AbstractInterface&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<AbstractInterface> ());
- }
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
- }
-
- void Interface::
- begin_abstract_fwd (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "abstract interface fwd " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<AbstractInterface&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<AbstractInterface> ());
- }
-
- ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
- }
-
- void Interface::
- begin_local_def (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "local interface def " << id << endl;
-
- qualifier_ = Qualifier::local;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<LocalInterface&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<LocalInterface> ());
- }
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
- }
-
- void Interface::
- begin_local_fwd (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "local interface fwd " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<LocalInterface&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<LocalInterface> ());
- }
-
- ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
- }
-
- void Interface::
- begin_unconstrained_def (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "unconstrained interface def " << id
- << endl;
-
- qualifier_ = Qualifier::unconstrained;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<UnconstrainedInterface&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<UnconstrainedInterface> ());
- }
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
- }
-
- void Interface::
- begin_unconstrained_fwd (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "unconstrained interface fwd " << id
- << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<UnconstrainedInterface&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<UnconstrainedInterface> ());
- }
-
- ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
- }
-
- void Interface::
- inherits (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << " inherits " << id << endl;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- SemanticGraph::Interface& i (
- resolve<SemanticGraph::Interface> (from, name, Flags::defined));
-
- switch (qualifier_)
- {
- case Qualifier::abstract:
- {
- if (dynamic_cast<AbstractInterface*> (&i)) break;
-
- throw WrongType (i.scoped_name ());
- }
- case Qualifier::unconstrained:
- {
- if (dynamic_cast<UnconstrainedInterface*> (&i) ||
- dynamic_cast<AbstractInterface*> (&i)) break;
-
- throw WrongType (i.scoped_name ());
- }
- default: break;
- }
-
- check_inheritance (now ().inherits_begin (),
- now ().inherits_end (),
- i);
-
- ctx.tu ().new_edge<Inherits> (now (), i);
- ctx.tu ().new_edge<Extends> (now (), i);
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid inheritance specification" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no interface with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "incompatible type in inheritance specification" << endl;
- }
- catch (NotDefined const& e)
- {
- cerr << "attempt to inherit from forward-declared interface "
- << e.name () << endl;
- cerr << "inheritance from forward-declared interface is illegal"
- << endl;
- }
- catch (AlreadyInherited const& e)
- {
- cerr << "directly inheriting from interface \'" << e.name ()
- << "\' more than once is illegal" << endl;
- }
- }
-
- void Interface::
- open_scope ()
- {
- if (ctx.trace ()) cerr << "scope open" << endl;
-
- push (ctx.scope ());
- ctx.scope (now ());
- }
-
- void Interface::
- close_scope ()
- {
- ctx.scope (top ());
- pop ();
-
- if (ctx.trace ()) cerr << "scope close" << endl;
- }
-
- void Interface::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
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 f25315a1a28..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Interface.hpp
+++ /dev/null
@@ -1,69 +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/SemanticGraph/Interface.hpp"
-#include "CCF/IDL2/SemanticAction/Interface.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Interface : SemanticAction::Interface,
- ScopeBase<SemanticGraph::Interface>
- {
- Interface (Context& c);
-
- virtual void
- begin_abstract_def (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_abstract_fwd (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_local_def (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_local_fwd (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_unconstrained_def (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_unconstrained_fwd (SimpleIdentifierPtr const& id);
-
- virtual void
- inherits (IdentifierPtr const& id);
-
- virtual void
- open_scope ();
-
- virtual void
- close_scope ();
-
- virtual void
- end ();
-
- private:
- struct Qualifier
- {
- enum Value { abstract, local, unconstrained };
- };
-
- Qualifier::Value qualifier_;
- };
-
- }
- }
- }
-}
-
-#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 b68f3251f48..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.cpp
+++ /dev/null
@@ -1,106 +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"
-
-#include "CCF/IDL2/SemanticGraph/Member.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Member::
- Member (Context& c)
- : Base (c)
- {
- }
-
- void Member::
- type (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "member " << id << endl;
-
- type_ = 0;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- // With introduction of CORBA 3.1 we have a new beast:
- // struct with incoplete members which itself becomes
- // incomplete.
- //
- type_ = &resolve<Type> (from, name/*, Flags::complete*/);
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid member declaration" << endl;
- throw;
- }
-
- //@@ I am not handling NotUnique here. For example if
- // I provide module name as type then the compiler
- // will ICE. Think about other places it may happen
- // (attribute, value memebr, typeded, others?).
- //
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type as a member type is illegal" << endl;
- }
- catch (NotComplete const& e)
- {
- cerr << "type \'" << e.name () << "\' is not complete" << endl;
- }
- }
-
-
- void Member::
- name (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << " " << id << endl;
-
- if (type_)
- {
- SimpleName name (id->lexeme ());
-
- SemanticGraph::Member& m (
- ctx.tu ().new_node<SemanticGraph::Member> ());
-
- ctx.tu ().new_edge<Belongs> (m, *type_);
- ctx.tu ().new_edge<Defines> (ctx.scope (), m, name);
- }
- }
-
- void Member::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
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 2ec51a1ab01..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Member.hpp
+++ /dev/null
@@ -1,41 +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/SemanticGraph/Elements.hpp"
-#include "CCF/IDL2/SemanticAction/Member.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Member : SemanticAction::Member, Base
- {
- Member (Context& c);
-
- virtual void
- type (IdentifierPtr const& id);
-
- virtual void
- name (SimpleIdentifierPtr const& id);
-
- virtual void
- end ();
-
- private:
- SemanticGraph::Type* 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 180ac9508c6..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp
+++ /dev/null
@@ -1,63 +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"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Module::
- Module (Context& c)
- : ScopeBase<SemanticGraph::Module> (c)
- {
- }
-
- void Module::
- begin (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "module " << id << endl;
-
- now (ctx.tu ().new_node<SemanticGraph::Module> ());
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), id->lexeme ());
- }
-
- void Module::
- open_scope ()
- {
- if (ctx.trace ()) cerr << "scope open" << endl;
-
- push (ctx.scope ());
- ctx.scope (now ());
- }
-
- void Module::
- close_scope ()
- {
- ctx.scope (top ());
- pop ();
-
- if (ctx.trace ()) cerr << "scope close" << endl;
- }
-
- void Module::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
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 1fbbc4c78fc..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.hpp
+++ /dev/null
@@ -1,42 +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/SemanticGraph/Module.hpp"
-#include "CCF/IDL2/SemanticAction/Module.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Module : SemanticAction::Module,
- ScopeBase<SemanticGraph::Module>
- {
- Module (Context& c);
-
- virtual void
- begin (SimpleIdentifierPtr const& id);
-
- virtual void
- open_scope ();
-
- virtual void
- close_scope ();
-
- virtual void
- end ();
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_MODULE_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Native.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Native.cpp
deleted file mode 100644
index bb4cf12b9af..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Native.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Native.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticGraph/Native.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Native.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Native::
- Native (Context& c)
- : Base (c)
- {
- }
-
- void Native::
- name (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "native " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- SemanticGraph::Native& n (
- ctx.tu ().new_node<SemanticGraph::Native> ());
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), n, name);
- }
-
- void Native::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Native.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Native.hpp
deleted file mode 100644
index 52875c58862..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Native.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Native.hpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_NATIVE_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_NATIVE_HPP
-
-#include "CCF/IDL2/SemanticAction/Native.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Native : SemanticAction::Native, Base
- {
- Native (Context& c);
-
- virtual void
- name (SimpleIdentifierPtr const& id);
-
- virtual void
- end ();
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_NATIVE_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp
deleted file mode 100644
index 49f26cbcacb..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp
+++ /dev/null
@@ -1,338 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/NumericExpression.cpp
-// author : Boris Kolpackov <boris@kolpackov.net>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp"
-
-#include "CCF/IDL2/SemanticGraph/Elements.hpp"
-#include "CCF/IDL2/SemanticGraph/IntExpression.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- NumericExpression::
- NumericExpression (Context& c)
- : Base (c)
- {
- }
-
- void NumericExpression::
- flush ()
- {
- if (ctx.trace ())
- cerr << "expression" << endl;
-
- ctx.int_exp_flush ();
- }
-
- void NumericExpression::
- const_ (IdentifierPtr const& id)
- {
- if (ctx.trace ())
- cerr << "const " << id << endl;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- Const& c (resolve<Const> (from, name));
-
- if (IntConst* ic = dynamic_cast<IntConst*> (&c))
- {
- ctx.int_exp_push (*ic);
- }
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid reference to const" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no const with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a const declaration" << endl;
- cerr << "using non-const as a reference to const is illegal"
- << endl;
- }
- }
-
- void NumericExpression::
- integer_literal (IntegerLiteralPtr const& il)
- {
- if (ctx.trace ())
- cerr << "integer literal " << il->value () << endl;
-
- ctx.int_exp_push (ctx.tu ().new_node<IntLiteral> (il->value ()));
- }
-
- void NumericExpression::
- pos ()
- {
- if (ctx.trace ())
- cerr << "unary +" << endl;
-
- // Nothing to do.
- }
-
- void NumericExpression::
- neg ()
- {
- if (ctx.trace ())
- cerr << "unary -" << endl;
-
- if (ctx.int_exp_size () < 1)
- return;
-
- IntExpression& expr (ctx.int_exp_pop ());
-
- IntNeg& neg (ctx.tu ().new_node<IntNeg> ());
-
- ctx.tu ().new_edge<IntNegates> (neg, expr);
-
- ctx.int_exp_push (neg);
- }
-
- void NumericExpression::
- com ()
- {
- if (ctx.trace ())
- cerr << "unary ~" << endl;
-
- if (ctx.int_exp_size () < 1)
- return;
-
- IntExpression& expr (ctx.int_exp_pop ());
-
- IntCom& com (ctx.tu ().new_node<IntCom> ());
-
- ctx.tu ().new_edge<IntComplements> (com, expr);
-
- ctx.int_exp_push (com);
- }
-
- void NumericExpression::
- mul ()
- {
- if (ctx.trace ())
- cerr << "*" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& multiplier (ctx.int_exp_pop ());
- IntExpression& multiplicand (ctx.int_exp_pop ());
-
- IntMul& mul (ctx.tu ().new_node<IntMul> ());
-
- ctx.tu ().new_edge<IntMultiplies> (mul, multiplicand);
- ctx.tu ().new_edge<IntMultiplies> (mul, multiplier);
-
- ctx.int_exp_push (mul);
- }
-
- void NumericExpression::
- div ()
- {
- if (ctx.trace ())
- cerr << "/" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& divisor (ctx.int_exp_pop ());
- IntExpression& divident (ctx.int_exp_pop ());
-
- IntDiv& div (ctx.tu ().new_node<IntDiv> ());
-
- ctx.tu ().new_edge<IntDivides> (div, divident);
- ctx.tu ().new_edge<IntDivides> (div, divisor);
-
- ctx.int_exp_push (div);
- }
-
- void NumericExpression::
- rem ()
- {
- if (ctx.trace ())
- cerr << "%" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& divisor (ctx.int_exp_pop ());
- IntExpression& divident (ctx.int_exp_pop ());
-
- IntRem& rem (ctx.tu ().new_node<IntRem> ());
-
- ctx.tu ().new_edge<IntDivides> (rem, divident);
- ctx.tu ().new_edge<IntDivides> (rem, divisor);
-
- ctx.int_exp_push (rem);
- }
-
-
- void NumericExpression::
- add ()
- {
- if (ctx.trace ())
- cerr << "+" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& second_item (ctx.int_exp_pop ());
- IntExpression& first_item (ctx.int_exp_pop ());
-
- IntAdd& add (ctx.tu ().new_node<IntAdd> ());
-
- ctx.tu ().new_edge<IntAdds> (add, first_item);
- ctx.tu ().new_edge<IntAdds> (add, second_item);
-
- ctx.int_exp_push (add);
- }
-
- void NumericExpression::
- sub ()
- {
- if (ctx.trace ())
- cerr << "-" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& subtrahend (ctx.int_exp_pop ());
- IntExpression& minuend (ctx.int_exp_pop ());
-
- IntSub& sub (ctx.tu ().new_node<IntSub> ());
-
- ctx.tu ().new_edge<IntSubtracts> (sub, minuend);
- ctx.tu ().new_edge<IntSubtracts> (sub, subtrahend);
-
- ctx.int_exp_push (sub);
- }
-
- void NumericExpression::
- rsh ()
- {
- if (ctx.trace ())
- cerr << ">>" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& factor (ctx.int_exp_pop ());
- IntExpression& pattern (ctx.int_exp_pop ());
-
- IntRsh& rsh (ctx.tu ().new_node<IntRsh> ());
-
- ctx.tu ().new_edge<IntShifts> (rsh, pattern);
- ctx.tu ().new_edge<IntShifts> (rsh, factor);
-
- ctx.int_exp_push (rsh);
- }
-
- void NumericExpression::
- lsh ()
- {
- if (ctx.trace ())
- cerr << "<<" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& factor (ctx.int_exp_pop ());
- IntExpression& pattern (ctx.int_exp_pop ());
-
- IntLsh& lsh (ctx.tu ().new_node<IntLsh> ());
-
- ctx.tu ().new_edge<IntShifts> (lsh, pattern);
- ctx.tu ().new_edge<IntShifts> (lsh, factor);
-
- ctx.int_exp_push (lsh);
- }
-
- void NumericExpression::
- and_ ()
- {
- if (ctx.trace ())
- cerr << "&" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& second_pattern (ctx.int_exp_pop ());
- IntExpression& first_pattern (ctx.int_exp_pop ());
-
- IntAnd& and_ (ctx.tu ().new_node<IntAnd> ());
-
- ctx.tu ().new_edge<IntConjuncts> (and_, first_pattern);
- ctx.tu ().new_edge<IntConjuncts> (and_, second_pattern);
-
- ctx.int_exp_push (and_);
- }
-
- void NumericExpression::
- xor_ ()
- {
- if (ctx.trace ())
- cerr << "^" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& second_pattern (ctx.int_exp_pop ());
- IntExpression& first_pattern (ctx.int_exp_pop ());
-
- IntXor& xor_ (ctx.tu ().new_node<IntXor> ());
-
- ctx.tu ().new_edge<IntExclusivelyDisjuncts> (xor_, first_pattern);
- ctx.tu ().new_edge<IntExclusivelyDisjuncts> (xor_, second_pattern);
-
- ctx.int_exp_push (xor_);
- }
-
- void NumericExpression::
- or_ ()
- {
- if (ctx.trace ())
- cerr << "|" << endl;
-
- if (ctx.int_exp_size () < 2)
- return;
-
- IntExpression& second_pattern (ctx.int_exp_pop ());
- IntExpression& first_pattern (ctx.int_exp_pop ());
-
- IntOr& or_ (ctx.tu ().new_node<IntOr> ());
-
- ctx.tu ().new_edge<IntInclusivelyDisjuncts> (or_, first_pattern);
- ctx.tu ().new_edge<IntInclusivelyDisjuncts> (or_, second_pattern);
-
- ctx.int_exp_push (or_);
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp
deleted file mode 100644
index 53fc8b2e010..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/NumericExpression.hpp
-// author : Boris Kolpackov <boris@kolpackov.net>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_NUMERIC_EXPRESSION_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_NUMERIC_EXPRESSION_HPP
-
-#include "CCF/IDL2/SemanticGraph/Elements.hpp"
-#include "CCF/IDL2/SemanticAction/NumericExpression.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct NumericExpression : SemanticAction::NumericExpression, Base
- {
- NumericExpression (Context& c);
-
- virtual void
- flush ();
-
- virtual void
- const_ (IdentifierPtr const&);
-
- virtual void
- integer_literal (IntegerLiteralPtr const&);
-
- virtual void
- pos ();
-
- virtual void
- neg ();
-
- virtual void
- com ();
-
- virtual void
- mul ();
-
- virtual void
- div ();
-
- virtual void
- rem ();
-
- virtual void
- add ();
-
- virtual void
- sub ();
-
- virtual void
- rsh ();
-
- virtual void
- lsh ();
-
- virtual void
- and_ ();
-
- virtual void
- xor_ ();
-
- virtual void
- or_ ();
-
-
- private:
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_NUMERIC_EXPRESSION_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 6a334438bdf..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.cpp
+++ /dev/null
@@ -1,243 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Operation.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticGraph/Fundamental.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Operation.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Operation::
- Operation (Context& c)
- : Base (c)
- {
- }
-
- void Operation::
- one_way ()
- {
- if (ctx.trace ()) cerr << "oneway ";
-
- op_ = &ctx.tu ().new_node<OneWayOperation> ();
- }
-
- void Operation::
- two_way ()
- {
- if (ctx.trace ()) cerr << "twoway ";
-
- op_ = &ctx.tu ().new_node<TwoWayOperation> ();
- }
-
- void Operation::
- type (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "operation " << id;
-
- type_ = 0;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- struct NotVoid : Resolve {};
-
- try
- {
- try
- {
- Type& t (resolve<Type> (from, name, Flags::complete));
-
- if (dynamic_cast<OneWayOperation*>(op_))
- {
- if (dynamic_cast<Void*> (&t) == 0) throw NotVoid ();
- }
-
- type_ = &t;
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid operation declaration" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type as an operation return type is illegal"
- << endl;
- }
- catch (NotComplete const& e)
- {
- cerr << "type \'" << e.name () << "\' is not complete" << endl;
- }
- catch (NotVoid const&)
- {
- cerr << "oneway operation should have void as a return type"
- << endl;
- }
- }
-
- void Operation::
- name (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << " " << id << endl;
-
- SimpleName name (id->lexeme ());
- ctx.tu ().new_edge<Defines> (ctx.scope (), *op_, name);
-
- if (type_)
- {
- ctx.tu ().new_edge<Returns> (*op_, *type_);
- }
- }
-
-
- void Operation::
- parameter (Direction::Value direction,
- IdentifierPtr const& type_id,
- SimpleIdentifierPtr const& name_id)
- {
- if (ctx.trace ()) cerr << "parameter " << direction << " "
- << type_id << " " << name_id << endl;
-
- Name name (type_id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- struct NotIn : Resolve {};
-
- try
- {
- try
- {
- if (dynamic_cast<OneWayOperation*>(op_) &&
- direction != Direction::in)
- {
- throw NotIn ();
- }
-
- Type& t (resolve<Type> (from, name, Flags::complete));
-
- Parameter* p (0);
-
- switch (direction)
- {
- case Direction::in:
- {
- p = &ctx.tu ().new_node<InParameter> (name_id->lexeme ());
- break;
- }
- case Direction::out:
- {
- p = &ctx.tu ().new_node<OutParameter> (name_id->lexeme ());
- break;
- }
- case Direction::inout:
- {
- p = &ctx.tu ().new_node<InOutParameter> (name_id->lexeme ());
- break;
- }
- }
-
- ctx.tu ().new_edge<Belongs> (*p, t);
- ctx.tu ().new_edge<Receives> (*op_, *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&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type as an operation parameter type is "
- << "illegal" << endl;
- }
- catch (NotComplete const& e)
- {
- cerr << "type \'" << e.name () << "\' is not complete" << endl;
- }
- catch (NotIn const&)
- {
- cerr << "parameter of oneway operation should have \'in\' "
- << "direction" << endl;
- }
- }
-
-
- void Operation::
- raises (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "raises " << id << endl;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- struct OneWay : Resolve {};
-
- try
- {
- try
- {
- if (dynamic_cast<OneWayOperation*>(op_)) throw OneWay ();
-
- SemanticGraph::Exception& e (
- resolve<SemanticGraph::Exception> (from, name));
-
- ctx.tu ().new_edge<Raises> (*op_, 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&)
- {
- 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;
- }
- catch (OneWay const&)
- {
- cerr << "oneway operation may not raise exceptions" << endl;
- }
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp
deleted file mode 100644
index f38a4949206..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Operation.hpp
+++ /dev/null
@@ -1,57 +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/SemanticGraph/Operation.hpp"
-#include "CCF/IDL2/SemanticAction/Operation.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- //
- //
- //
- struct Operation : SemanticAction::Operation, Base
- {
- Operation (Context& c);
-
- virtual void
- one_way ();
-
- virtual void
- two_way ();
-
- virtual void
- type (IdentifierPtr const& id);
-
- virtual void
- name (SimpleIdentifierPtr const& id);
-
- virtual void
- parameter (Direction::Value direction,
- IdentifierPtr const& type_id,
- SimpleIdentifierPtr const& name_id);
-
- virtual void
- raises (IdentifierPtr const& id);
-
- private:
- SemanticGraph::Type* type_;
- SemanticGraph::Operation* op_;
- };
-
- }
- }
- }
-}
-
-#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 3f98a2607f8..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.cpp
+++ /dev/null
@@ -1,97 +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"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Struct::
- Struct (Context& c)
- : ScopeBase<SemanticGraph::Struct> (c)
- {
- }
-
- // @@ I need a mechanism for propagating exceptions from
- // semantic actions to the parser in order to stop
- // semantic action invocation.
- //
-
- void Struct::
- begin_def (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "struct def " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<SemanticGraph::Struct&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<SemanticGraph::Struct> ());
- }
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
- }
-
- void Struct::
- begin_fwd (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "struct fwd " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<SemanticGraph::Struct&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<SemanticGraph::Struct> ());
- }
-
- ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
- }
-
- void Struct::
- open_scope ()
- {
- if (ctx.trace ()) cerr << "scope open" << endl;
-
- push (ctx.scope ());
- ctx.scope (now ());
- }
-
- void Struct::
- close_scope ()
- {
- ctx.scope (top ());
- pop ();
-
- if (ctx.trace ()) cerr << "scope close" << endl;
- }
-
- void Struct::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
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 0fafd69962f..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Struct.hpp
+++ /dev/null
@@ -1,45 +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/SemanticGraph/Struct.hpp"
-#include "CCF/IDL2/SemanticAction/Struct.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Struct : SemanticAction::Struct,
- ScopeBase<SemanticGraph::Struct>
- {
- Struct (Context& c);
-
- virtual void
- begin_def (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_fwd (SimpleIdentifierPtr const& id);
-
- virtual void
- open_scope ();
-
- virtual void
- close_scope ();
-
- virtual void
- end ();
- };
- }
- }
- }
-}
-
-#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 a87fb5c4bcb..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.cpp
+++ /dev/null
@@ -1,134 +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"
-
-#include "CCF/IDL2/SemanticGraph/TypeId.hpp"
-
-// These inclusions are needed to ensure that typeprefix is applied to a
-// suitable declaration.
-
-#include "CCF/IDL2/SemanticGraph/Module.hpp"
-#include "CCF/IDL2/SemanticGraph/Interface.hpp"
-#include "CCF/IDL2/SemanticGraph/ValueType.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- // TypeId
- //
- //
- TypeId::
- TypeId (Context& c)
- : ctx (c)
- {
- }
-
- void TypeId::
- begin (IdentifierPtr const& d, StringLiteralPtr const& id)
- {
- if (ctx.trace ()) cerr << "typeid " << d << " " << id << endl;
-
- Name name (d->lexeme ());
- SemanticGraph::StringLiteral tid (id->value ());
-
- try
- {
- ScopedName from (ctx.scope ().scoped_name ());
- Nameables nodes (resolve (ctx.tu (), from, name));
-
- ScopedName full ((**(nodes.begin ())).scoped_name ());
-
- SemanticGraph::TypeId& ti (
- ctx.tu ().new_node<SemanticGraph::TypeId> (full, tid));
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), ti, "typeid");
- }
- catch (NotFound const&)
- {
- cerr << "error: invalid typeid declaration" << endl;
- cerr << "no declaration with name \'"
- << name << "\' visible from scope \'"
- << ctx.scope ().scoped_name () << "\'" << endl;
- }
- }
-
- void TypeId::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
-
-
- // TypePrefix
- //
- //
- TypePrefix::
- TypePrefix (Context& c)
- : ctx (c)
- {
- }
-
- void TypePrefix::
- begin (IdentifierPtr const& d, StringLiteralPtr const& prefix)
- {
- if (ctx.trace ()) cerr << "typeprefix " << d << " " << prefix
- << endl;
-
- Name name (d->lexeme ());
- SemanticGraph::StringLiteral tprefix (prefix->value ());
-
- try
- {
- ScopedName from (ctx.scope ().scoped_name ());
- Nameables nodes (resolve (ctx.tu (), from, name));
-
- Nameable& node (**(nodes.begin ()));
-
- dynamic_cast<SemanticGraph::Scope&> (node);
-
- ScopedName full (node.scoped_name ());
-
- SemanticGraph::TypePrefix& tp (
- ctx.tu ().new_node<SemanticGraph::TypePrefix> (full, tprefix));
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), tp, "typeprefix");
- }
- catch (NotFound const&)
- {
- cerr << "error: invalid typeprefix declaration" << endl;
- cerr << "no declaration with name \'"
- << name << "\' visible from scope \'"
- << ctx.scope ().scoped_name () << "\'" << endl;
- }
- catch (std::bad_cast const&)
- {
- cerr << "error: invalid typeprefix declaration" << endl;
- cerr << "no suitable declaration with name \'"
- << name << "\' visible from scope \'"
- << ctx.scope ().scoped_name () << "\'" << endl;
- }
- }
-
- void TypePrefix::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
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 e88971eade4..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/TypeId.hpp
+++ /dev/null
@@ -1,58 +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/SemanticAction/TypeId.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- //
- //
- //
- struct TypeId : SemanticAction::TypeId
- {
- TypeId (Context& c);
-
- virtual void
- begin (IdentifierPtr const& d, StringLiteralPtr const& id);
-
- virtual void
- end ();
-
- private:
- Context& ctx;
- };
-
-
- //
- //
- //
- struct TypePrefix : SemanticAction::TypePrefix
- {
- TypePrefix (Context& c);
-
- virtual void
- begin (IdentifierPtr const& d, StringLiteralPtr const& prefix);
-
- virtual void
- end ();
-
- private:
- Context& ctx;
- };
- }
- }
- }
-}
-
-#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 315b69d0e51..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.cpp
+++ /dev/null
@@ -1,292 +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"
-
-#include "CCF/IDL2/SemanticGraph/Elements.hpp"
-
-#include "CCF/IDL2/SemanticGraph/Array.hpp"
-#include "CCF/IDL2/SemanticGraph/Sequence.hpp"
-#include "CCF/IDL2/SemanticGraph/String.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-//@@ names used in smantic actions are inconsistent
-// e.g. begin () vs name (), etc
-//
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Typedef::
- Typedef (Context& c)
- : Base (c)
- {
- }
-
- void Typedef::
- begin (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "typedef " << id << endl;
-
- define_ = false;
- type_ = 0;
- array_type_ = 0;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- type_ = &resolve<Type> (from, name);
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid typedef declaration" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type in typedef is illegal" << endl;
- }
- }
-
- void Typedef::
- begin_unbounded_seq (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "typedef u-sequence<" << id << ">" << endl;
-
- define_ = true;
- type_ = 0;
- array_type_ = 0;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- Type& t (resolve<Type> (from, name));
-
- UnboundedSequence& s (ctx.tu ().new_node<UnboundedSequence> ());
- ctx.tu ().new_edge<ArgumentsWithType> (t, s);
-
- type_ = &s;
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid sequence declaration" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type in sequence specialization is illegal"
- << endl;
- }
- }
-
- void Typedef::
- begin_bounded_seq (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "typedef b-sequence<" << id << ">" << endl;
-
- define_ = true;
- type_ = 0;
- array_type_ = 0;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- Type& t (resolve<Type> (from, name));
-
- BoundedSequence& s (ctx.tu ().new_node<BoundedSequence> ());
- ctx.tu ().new_edge<ArgumentsWithType> (t, s);
-
- type_ = &s;
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid sequence declaration" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type in sequence specialization is illegal"
- << endl;
- }
- }
-
- void Typedef::
- begin_bounded_string ()
- {
- if (ctx.trace ()) cerr << "typedef b-string" << endl;
-
- define_ = true;
- type_ = 0;
- array_type_ = 0;
-
- type_ = &ctx.tu ().new_node<BoundedString> ();
- bound ();
- }
-
- void Typedef::
- begin_bounded_wstring ()
- {
- if (ctx.trace ()) cerr << "typedef b-wstring" << endl;
-
- define_ = true;
- type_ = 0;
- array_type_ = 0;
-
- type_ = &ctx.tu ().new_node<BoundedWideString> ();
- bound ();
- }
-
- void Typedef::
- begin_array ()
- {
- if (ctx.trace ()) cerr << "array" << endl;
-
- define_ = true;
- array_type_ = 0;
-
- if (type_ == 0)
- return;
-
- if (type_->named_begin () == type_->named_end ())
- {
- cerr << "error: anonymous types in array declarations "
- << "are not supported" << endl;
-
- cerr << "use another typedef to name this type" << endl;
-
- return;
- }
-
- Array& a (ctx.tu ().new_node<Array> ());
- ctx.tu ().new_edge<ArgumentsWithType> (*type_, a);
-
- array_type_ = &a;
- }
-
- void Typedef::
- bound ()
- {
- if (ctx.trace ()) cerr << "bound" << endl;
-
- if (ctx.int_exp_size () < 1)
- return;
-
- IntExpression& expr (ctx.int_exp_pop ());
-
- if (array_type_ != 0)
- {
- Specialization& s (dynamic_cast<Specialization&> (*array_type_));
- ctx.tu ().new_edge<ArgumentsWithValue> (expr, s);
- }
- else if (type_ != 0)
- {
- Specialization& s (dynamic_cast<Specialization&> (*type_));
- ctx.tu ().new_edge<ArgumentsWithValue> (expr, s);
- }
- }
-
- void Typedef::
- declarator (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << " " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- try
- {
- if (lookup (ctx.tu (), ctx.scope (), name) == 0)
- {
- if (array_type_ != 0)
- {
- assert (define_);
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), *array_type_, name);
-
- define_ = false;
- array_type_ = 0;
- }
- else if (type_ != 0)
- {
- if (define_)
- {
- ctx.tu ().new_edge<Defines> (ctx.scope (), *type_, name);
- define_ = false;
- }
- else
- {
- ctx.tu ().new_edge<Aliases> (ctx.scope (), *type_, name);
- }
- }
- return;
- }
- }
- catch (NotUnique const& )
- {
- }
-
- cerr << "error: invalid typedef declaration" << endl;
- cerr << "error: redeclaration of name " << name << endl;
-
- array_type_ = 0;
- }
-
- void Typedef::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
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 904a04ee56b..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Typedef.hpp
+++ /dev/null
@@ -1,61 +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/SemanticGraph/Elements.hpp"
-#include "CCF/IDL2/SemanticAction/Typedef.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Typedef : SemanticAction::Typedef, Base
- {
- Typedef (Context& c);
-
- virtual void
- begin (IdentifierPtr const& id);
-
- virtual void
- begin_unbounded_seq (IdentifierPtr const& id);
-
- virtual void
- begin_bounded_seq (IdentifierPtr const& id);
-
- virtual void
- begin_bounded_string ();
-
- virtual void
- begin_bounded_wstring ();
-
- virtual void
- begin_array ();
-
- virtual void
- bound ();
-
- virtual void
- declarator (SimpleIdentifierPtr const& id);
-
- virtual void
- end ();
-
- private:
- bool define_;
- SemanticGraph::Type* type_;
- SemanticGraph::Type* array_type_;
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_TYPEDEF_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Union.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Union.cpp
deleted file mode 100644
index b11d10e4f45..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Union.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Union.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticAction/Impl/Union.hpp"
-
-#include "CCF/IDL2/SemanticGraph/Enum.hpp"
-#include "CCF/IDL2/SemanticGraph/Fundamental.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- Union::
- Union (Context& c)
- : ScopeBase<SemanticGraph::Union> (c)
- {
- }
-
- void Union::
- begin_def (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "union def " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<SemanticGraph::Union&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<SemanticGraph::Union> ());
- }
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
- }
-
- void Union::
- begin_fwd (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "union fwd " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<SemanticGraph::Union&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<SemanticGraph::Union> ());
- }
-
- ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
- }
-
- void Union::
- type (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "type " << id << endl;
-
- type_ = 0;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- type_ = &resolve<Type> (from, name);
-
- if (!(dynamic_cast<Enum*> (type_) ||
- dynamic_cast<Boolean*> (type_) ||
- dynamic_cast<Char*> (type_) ||
- dynamic_cast<Wchar*> (type_) ||
- dynamic_cast<Short*> (type_) ||
- dynamic_cast<UnsignedShort*> (type_) ||
- dynamic_cast<Long*> (type_) ||
- dynamic_cast<UnsignedLong*> (type_) ||
- dynamic_cast<LongLong*> (type_) ||
- dynamic_cast<UnsignedLongLong*> (type_)))
- {
- throw WrongType (type_->scoped_name ());
- }
-
- ctx.tu ().new_edge<ArgumentsWithType> (*type_, now ());
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid union declaration" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a valid discriminant type" << endl;
- }
- }
-
- void Union::
- open_scope ()
- {
- if (ctx.trace ()) cerr << "scope open" << endl;
-
- push (ctx.scope ());
- ctx.scope (now ());
- }
-
- void Union::
- member_type (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "type " << id << endl;
-
- member_type_ = 0;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- // With introduction of CORBA 3.1 we have a new beast:
- // union with incoplete members which itself becomes
- // incomplete.
- //
- member_type_ = &resolve<Type> (from, name/*, Flags::complete*/);
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid union member declaration" << endl;
- throw;
- }
-
- //@@ I am not handling NotUnique here. For example if
- // I provide module name as type then the compiler
- // will ICE. Think about other places it may happen
- // (attribute, value memebr, typeded, others?).
- //
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type as an member type is illegal" << endl;
- }
- catch (NotComplete const& e)
- {
- cerr << "type \'" << e.name () << "\' is not complete" << endl;
- }
- }
-
- void Union::
- member_name (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "name " << id << endl;
-
- if (member_type_)
- {
- SimpleName name (id->lexeme ());
-
- SemanticGraph::UnionMember& m (
- ctx.tu ().new_node<SemanticGraph::UnionMember> ());
-
- ctx.tu ().new_edge<Belongs> (m, *member_type_);
- ctx.tu ().new_edge<Defines> (ctx.scope (), m, name);
- }
- }
-
- void Union::
- close_scope ()
- {
- ctx.scope (top ());
- pop ();
-
- if (ctx.trace ()) cerr << "scope close" << endl;
- }
-
- void Union::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Union.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Union.hpp
deleted file mode 100644
index 8ab8022c62a..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Union.hpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/Union.hpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_UNION_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_UNION_HPP
-
-#include "CCF/IDL2/SemanticGraph/Union.hpp"
-#include "CCF/IDL2/SemanticAction/Union.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct Union : SemanticAction::Union, ScopeBase<SemanticGraph::Union>
- {
- Union (Context& c);
-
- virtual void
- begin_def (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_fwd (SimpleIdentifierPtr const& id);
-
- virtual void
- type (IdentifierPtr const& id);
-
- virtual void
- open_scope ();
-
- virtual void
- member_type (IdentifierPtr const& id);
-
- virtual void
- member_name (SimpleIdentifierPtr const& id);
-
- virtual void
- close_scope ();
-
- virtual void
- end ();
-
- private:
- SemanticGraph::Type* type_;
- SemanticGraph::Type* member_type_;
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_UNION_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueType.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueType.cpp
deleted file mode 100644
index 159aa228b4c..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueType.cpp
+++ /dev/null
@@ -1,267 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/ValueType.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticAction/Impl/ValueType.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- ValueType::
- ValueType (Context& c)
- : ScopeBase<SemanticGraph::ValueType> (c)
- {
- }
-
- void ValueType::
- begin_abstract_def (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "abstract valuetype def " << id << endl;
-
- qualifier_ = Qualifier::abstract;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<AbstractValueType&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<AbstractValueType> ());
- }
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
- }
-
- void ValueType::
- begin_abstract_fwd (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "abstract valuetype fwd " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<AbstractValueType&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<AbstractValueType> ());
- }
-
- ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
- }
-
- void ValueType::
- begin_concrete_def (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "concrete valuetype def " << id << endl;
-
- qualifier_ = Qualifier::concrete;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<ConcreteValueType&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<ConcreteValueType> ());
- }
-
- ctx.tu ().new_edge<Defines> (ctx.scope (), now (), name);
- }
-
- void ValueType::
- begin_concrete_fwd (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "concrete valuetype fwd " << id << endl;
-
- SimpleName name (id->lexeme ());
-
- if (Nameable* s = lookup (ctx.tu (), ctx.scope (), name))
- {
- now (dynamic_cast<ConcreteValueType&>(*s));
- }
- else
- {
- now (ctx.tu ().new_node<ConcreteValueType> ());
- }
-
- ctx.tu ().new_edge<Mentions> (ctx.scope (), now (), name);
- }
-
- void ValueType::
- inherits (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "inherits " << id << endl;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- SemanticGraph::ValueType& v (
- resolve<SemanticGraph::ValueType> (from, name, Flags::defined));
-
- check_inheritance (now ().inherits_begin (),
- now ().inherits_end (),
- v);
-
-
- bool abstract (dynamic_cast<AbstractValueType*> (&v) != 0);
-
- if (dynamic_cast<AbstractValueType*> (&now ()) != 0)
- {
- // Abstract valuetype may only inherit from abstract ones.
- //
- if (!abstract)
- {
- cerr << "abstract valuetype `" << now ().name ()
- << "\' may not inherit from concrete valuetype `"
- << v.scoped_name () << "\'" << endl;
- return;
- }
- }
- else
- {
- // Concrete valuetype may inherit from single concrete
- // valutype in which case it should be the first in the
- // inheritance list.
- //
- if (now ().inherits_begin () != now ().inherits_end () &&
- !abstract)
- {
- cerr << "concrete valuetype `" << v.scoped_name ()
- << "\' is not the first in the inheritance list of "
- << "valuetype `" << now ().name () << "\'" << endl;
- return;
- }
- }
-
- ctx.tu ().new_edge<Inherits> (now (), v);
- ctx.tu ().new_edge<Extends> (now (), v);
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid inheritance specification" << endl;
- throw;
- }
- }
- catch (NotFound const&)
- {
- cerr << "no valuetype with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "incompatible type in inheritance specification" << endl;
- }
- catch (NotDefined const& e)
- {
- cerr << "attempt to inherit from the forward-declared valuetype "
- << e.name () << endl;
- cerr << "inheritance from a forward-declared valuetype is illegal"
- << endl;
- }
- catch (AlreadyInherited const& e)
- {
- cerr << "directly inheriting from valuetype \'" << e.name ()
- << "\' more than once is illegal" << endl;
- }
- }
-
- void ValueType::
- 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, Flags::defined));
-
- check_support (now ().supports_begin (),
- now ().supports_end (),
- i);
-
- ctx.tu ().new_edge<Supports> (now (), i);
- ctx.tu ().new_edge<Extends> (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&)
- {
- cerr << "incompatible type in supports specification" << endl;
- }
- catch (NotDefined const& e)
- {
- cerr << "attempt to support forward-declared interface "
- << 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 ValueType::
- open_scope ()
- {
- if (ctx.trace ()) cerr << "scope open" << endl;
-
- push (ctx.scope ());
- ctx.scope (now ());
- }
-
- void ValueType::
- close_scope ()
- {
- ctx.scope (top ());
- pop ();
-
- if (ctx.trace ()) cerr << "scope close" << endl;
- }
-
- void ValueType::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueType.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueType.hpp
deleted file mode 100644
index da0bea59a84..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueType.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/ValueType.hpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_HPP
-
-#include "CCF/IDL2/SemanticGraph/ValueType.hpp"
-#include "CCF/IDL2/SemanticAction/ValueType.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct ValueType : SemanticAction::ValueType,
- ScopeBase<SemanticGraph::ValueType>
- {
- ValueType (Context& c);
-
- virtual void
- begin_abstract_def (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_abstract_fwd (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_concrete_def (SimpleIdentifierPtr const& id);
-
- virtual void
- begin_concrete_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 ();
-
- private:
- struct Qualifier
- {
- enum Value { abstract, concrete };
- };
-
- Qualifier::Value qualifier_;
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.cpp
deleted file mode 100644
index be0ccecd926..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- ValueTypeFactory::
- ValueTypeFactory (Context& c)
- : Base (c)
- {
- }
-
- void ValueTypeFactory::
- name (SimpleIdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << " " << id << endl;
-
- f_ = 0;
-
- SemanticGraph::ValueType& h (
- dynamic_cast<SemanticGraph::ValueType&>(ctx.scope ()));
-
- SimpleName name (id->lexeme ());
-
- f_ = &ctx.tu ().new_node<SemanticGraph::ValueTypeFactory> ();
-
- ctx.tu ().new_edge<Returns> (*f_, h);
- ctx.tu ().new_edge<Defines> (ctx.scope (), *f_, name);
- }
-
-
- void ValueTypeFactory::
- parameter (IdentifierPtr const& type_id,
- SimpleIdentifierPtr const& name_id)
- {
- if (ctx.trace ()) cerr << "parameter in " << " "
- << type_id << " " << name_id << endl;
-
- if (f_ == 0) return;
-
- Name name (type_id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- Type& t (resolve<Type> (from, name, Flags::complete));
-
- Parameter& p (
- ctx.tu ().new_node<InParameter> (name_id->lexeme ()));
-
- ctx.tu ().new_edge<Belongs> (p, t);
- ctx.tu ().new_edge<Receives> (*f_, 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&)
- {
- 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 ValueTypeFactory::
- raises (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << "raises " << id << endl;
-
- if (f_ == 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> (*f_, 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&)
- {
- 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/IDL2/SemanticAction/Impl/ValueTypeFactory.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.hpp
deleted file mode 100644
index 949492152e5..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.hpp
+++ /dev/null
@@ -1,42 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/ValueTypeFactory.hpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_FACTORY_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_FACTORY_HPP
-
-#include "CCF/IDL2/SemanticGraph/ValueType.hpp"
-#include "CCF/IDL2/SemanticAction/ValueTypeFactory.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct ValueTypeFactory : SemanticAction::ValueTypeFactory, Base
- {
- ValueTypeFactory (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::ValueTypeFactory* f_;
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_FACTORY_HPP
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeMember.cpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeMember.cpp
deleted file mode 100644
index c6de66ccc1b..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeMember.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/ValueTypeMember.cpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#include "CCF/IDL2/SemanticAction/Impl/ValueTypeMember.hpp"
-
-#include "CCF/IDL2/SemanticGraph/ValueTypeMember.hpp"
-
-#include <iostream>
-
-using std::cerr;
-using std::endl;
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- using namespace SemanticGraph;
-
- ValueTypeMember::
- ValueTypeMember (Context& c)
- : Base (c)
- {
- }
-
- void ValueTypeMember::
- begin_private ()
- {
- if (ctx.trace ()) cerr << "private valuetype member" << endl;
-
- access_ = SemanticGraph::ValueTypeMember::Access::private_;
- }
-
- void ValueTypeMember::
- begin_public ()
- {
- if (ctx.trace ()) cerr << "public valuetype member" << endl;
-
- access_ = SemanticGraph::ValueTypeMember::Access::public_;
- }
-
- void ValueTypeMember::
- type (IdentifierPtr const& id)
- {
- if (ctx.trace ()) cerr << " type: " << id << endl;
-
- type_ = 0;
-
- Name name (id->lexeme ());
- ScopedName from (ctx.scope ().scoped_name ());
-
- try
- {
- try
- {
- type_ = &resolve<Type> (from, name, Flags::complete);
- }
- catch (Resolve const&)
- {
- cerr << "error: invalid valuetype member declaration" << endl;
- throw;
- }
-
- //@@ I am not handling NotUnique here. For example if
- // I provide module name as type then the compiler
- // will ICE. Think about other places it may happen
- // (attribute, value memebr, typeded, others?).
- //
- }
- catch (NotFound const&)
- {
- cerr << "no type with name \'" << name
- << "\' visible from scope \'" << from << "\'" << endl;
- }
- catch (WrongType const&)
- {
- cerr << "declaration with name \'" << name
- << "\' visible from scope \'" << from
- << "\' is not a type declaration" << endl;
- cerr << "using non-type as a valuetype member type is illegal"
- << endl;
- }
- catch (NotComplete const& e)
- {
- cerr << "type \'" << e.name () << "\' is not complete" << endl;
- }
- }
-
-
- void ValueTypeMember::
- name (SimpleIdentifierPtr const& id)
- {
- using namespace SemanticGraph;
-
- if (ctx.trace ()) cerr << " name: " << id << endl;
-
- if (type_)
- {
- SimpleName name (id->lexeme ());
-
- SemanticGraph::ValueTypeMember* m;
-
- switch (access_)
- {
- case SemanticGraph::ValueTypeMember::Access::private_:
- {
- m = &ctx.tu ().new_node<ValueTypePrivateMember> ();
- break;
- }
- case SemanticGraph::ValueTypeMember::Access::public_:
- {
- m = &ctx.tu ().new_node<ValueTypePublicMember> ();
- break;
- }
- default:
- {
- abort ();
- }
- }
-
- ctx.tu ().new_edge<Belongs> (*m, *type_);
- ctx.tu ().new_edge<Defines> (ctx.scope (), *m, name);
- }
- }
-
- void ValueTypeMember::
- end ()
- {
- if (ctx.trace ()) cerr << "end" << endl;
- }
- }
- }
- }
-}
diff --git a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeMember.hpp b/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeMember.hpp
deleted file mode 100644
index 96e575cd35f..00000000000
--- a/TAO/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/ValueTypeMember.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// file : CCF/IDL2/SemanticAction/Impl/ValueTypeMember.hpp
-// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
-// cvs-id : $Id$
-
-#ifndef CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_MEMBER_HPP
-#define CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_MEMBER_HPP
-
-#include "CCF/IDL2/SemanticGraph/ValueTypeMember.hpp"
-#include "CCF/IDL2/SemanticAction/ValueTypeMember.hpp"
-#include "CCF/IDL2/SemanticAction/Impl/Elements.hpp"
-
-namespace CCF
-{
- namespace IDL2
- {
- namespace SemanticAction
- {
- namespace Impl
- {
- struct ValueTypeMember : SemanticAction::ValueTypeMember, Base
- {
- ValueTypeMember (Context& c);
-
- virtual void
- begin_private ();
-
- virtual void
- begin_public ();
-
- virtual void
- type (IdentifierPtr const& id);
-
- virtual void
- name (SimpleIdentifierPtr const& id);
-
- virtual void
- end ();
-
- private:
- SemanticGraph::ValueTypeMember::Access::Value access_;
- SemanticGraph::Type* type_;
- };
- }
- }
- }
-}
-
-#endif // CCF_IDL2_SEMANTIC_ACTION_IMPL_VALUE_TYPE_MEMBER_HPP