diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-03-18 22:23:37 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-03-18 22:23:37 +0000 |
commit | 06a34455bd98b1379cc69bbc5b2cf085e0fc0d9b (patch) | |
tree | 8815ce3b3a85c3c4285429295f338e00ea4497f4 /CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp | |
parent | d66fcc9b4aaec8e88eeb83fc578fdf8a3cc963de (diff) | |
download | ATCD-Static_RT_DAnCE.tar.gz |
Diffstat (limited to 'CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp')
-rw-r--r-- | CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp b/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp new file mode 100644 index 00000000000..a39a801cd15 --- /dev/null +++ b/CIAO/CCF/CCF/CIDL/SemanticAction/Impl/Composition.cpp @@ -0,0 +1,83 @@ +// file : CCF/CIDL/SemanticAction/Impl/Composition.cpp +// author : Boris Kolpackov <boris@dre.vanderbilt.edu> +// cvs-id : $Id$ + +#include "CCF/CIDL/SemanticAction/Impl/Composition.hpp" + +#include <iostream> + +using std::cerr; +using std::endl; + +namespace CCF +{ + namespace CIDL + { + namespace SemanticAction + { + namespace Impl + { + using namespace SemanticGraph; + + Composition:: + Composition (Context& c) + : ScopeBase<SemanticGraph::Composition> (c) + { + } + + void Composition:: + begin (SimpleIdentifierPtr const& id, Category::Value c) + { + if (ctx.trace ()) cerr << "composition " << id << endl; + + if(c == Category::entity) + { + now (ctx.tu ().new_node<EntityComposition> ( + ctx.file (), id->line ())); + } + else if (c == Category::process) + { + now (ctx.tu ().new_node<ProcessComposition> ( + ctx.file (), id->line ())); + } + else if (c == Category::service) + { + now (ctx.tu ().new_node<ServiceComposition> ( + ctx.file (), id->line ())); + } + else + { + now (ctx.tu ().new_node<SessionComposition> ( + ctx.file (), id->line ())); + } + + ctx.tu ().new_edge<Defines> (ctx.scope (), now (), id->lexeme ()); + } + + void Composition:: + open_scope () + { + if (ctx.trace ()) cerr << "scope open" << endl; + + push (ctx.scope ()); + ctx.scope (now ()); + } + + void Composition:: + close_scope () + { + ctx.scope (top ()); + pop (); + + if (ctx.trace ()) cerr << "scope close" << endl; + } + + void Composition:: + end () + { + if (ctx.trace ()) cerr << "end" << endl; + } + } + } + } +} |