summaryrefslogtreecommitdiff
path: root/modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp')
-rw-r--r--modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp b/modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp
new file mode 100644
index 00000000000..b2b003d6d73
--- /dev/null
+++ b/modules/CIAO/CCF/CCF/IDL2/SemanticAction/Impl/Module.cpp
@@ -0,0 +1,65 @@
+// 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.file (), id->line ()));
+
+ 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;
+ }
+ }
+ }
+ }
+}