summaryrefslogtreecommitdiff
path: root/CIAO/CIDLC/OperationHeaderEmitters.cpp
diff options
context:
space:
mode:
authorAbdullah Sowayan <sowayan@users.noreply.github.com>2007-03-18 22:23:37 +0000
committerAbdullah Sowayan <sowayan@users.noreply.github.com>2007-03-18 22:23:37 +0000
commit06a34455bd98b1379cc69bbc5b2cf085e0fc0d9b (patch)
tree8815ce3b3a85c3c4285429295f338e00ea4497f4 /CIAO/CIDLC/OperationHeaderEmitters.cpp
parentd66fcc9b4aaec8e88eeb83fc578fdf8a3cc963de (diff)
downloadATCD-06a34455bd98b1379cc69bbc5b2cf085e0fc0d9b.tar.gz
Diffstat (limited to 'CIAO/CIDLC/OperationHeaderEmitters.cpp')
-rw-r--r--CIAO/CIDLC/OperationHeaderEmitters.cpp222
1 files changed, 222 insertions, 0 deletions
diff --git a/CIAO/CIDLC/OperationHeaderEmitters.cpp b/CIAO/CIDLC/OperationHeaderEmitters.cpp
new file mode 100644
index 00000000000..db72340bb62
--- /dev/null
+++ b/CIAO/CIDLC/OperationHeaderEmitters.cpp
@@ -0,0 +1,222 @@
+// file : CIDLC/OperationHeaderEmitters.cpp
+// author : Jeff Parsons <j.parsons@vanderbilt.edu>
+// cvs-id : $Id$
+
+#include "OperationHeaderEmitters.hpp"
+#include "Literals.hpp"
+
+using namespace StringLiterals;
+
+OperationEmitter::OperationEmitter (Context& c)
+ : EmitterBase (c)
+{
+}
+
+void
+OperationEmitter::pre (Type&)
+{
+ os << "virtual ";
+}
+
+void
+OperationEmitter::name (Type& o)
+{
+ os << endl << o.name ();
+}
+
+void
+OperationEmitter::receives_pre (Type&)
+{
+ os << " (" << endl;
+}
+
+void
+OperationEmitter::receives_none (Type&)
+{
+ os << " ()" << endl;
+}
+
+void
+OperationEmitter::receives_post (Type&)
+{
+ os << endl << ")" << endl;
+}
+
+void
+OperationEmitter::raises (Type&)
+{
+}
+
+void
+OperationEmitter::post (Type&)
+{
+ os << ";" << endl;
+}
+
+void
+OperationEmitter::comma (Type&)
+{
+ os << "," << endl;
+}
+
+// ==================================================
+
+HomeOperationEmitter::HomeOperationEmitter (Context& c)
+ : OperationEmitter (c)
+{
+}
+
+void
+HomeOperationEmitter::traverse (SemanticGraph::HomeFactory&)
+{
+}
+
+void
+HomeOperationEmitter::traverse (SemanticGraph::HomeFinder&)
+{
+}
+
+// ==================================================
+
+FactoryOperationEmitter::FactoryOperationEmitter (Context& c, bool for_exec)
+ : EmitterBase (c),
+ returns_emitter_ (c),
+ for_exec_ (for_exec)
+{
+ returns_.node_traverser (returns_emitter_);
+}
+
+void
+FactoryOperationEmitter::pre (SemanticGraph::HomeFactory&)
+{
+ os << "virtual ";
+}
+
+void
+FactoryOperationEmitter::returns (SemanticGraph::HomeFactory& t)
+{
+ if (for_exec_)
+ {
+ os << STRS[COMP_EC] << "_ptr";
+ }
+ else
+ {
+ Traversal::HomeFactory::returns (t, returns_);
+ }
+
+ os << endl;
+}
+
+void
+FactoryOperationEmitter::name (SemanticGraph::HomeFactory& t)
+{
+ os << t.name ();
+}
+
+void
+FactoryOperationEmitter::receives_none (SemanticGraph::HomeFactory&)
+{
+ os << " ()" << endl;
+}
+
+void
+FactoryOperationEmitter::receives_pre (SemanticGraph::HomeFactory&)
+{
+ os << " (" << endl;
+}
+
+void
+FactoryOperationEmitter::receives_post (SemanticGraph::HomeFactory&)
+{
+ os << endl << ")" << endl;
+}
+
+void
+FactoryOperationEmitter::raises (SemanticGraph::HomeFactory&)
+{
+}
+
+void
+FactoryOperationEmitter::post (SemanticGraph::HomeFactory&)
+{
+ os << ";" << endl;
+}
+
+void
+FactoryOperationEmitter::comma (SemanticGraph::HomeFactory&)
+{
+ os << "," << endl;
+}
+
+// ==================================================
+
+FinderOperationEmitter::FinderOperationEmitter (Context& c, bool for_exec)
+ : EmitterBase (c),
+ returns_emitter_ (c),
+ for_exec_ (for_exec)
+{
+ returns_.node_traverser (returns_emitter_);
+}
+
+void
+FinderOperationEmitter::pre (SemanticGraph::HomeFinder&)
+{
+ os << "virtual ";
+}
+
+void
+FinderOperationEmitter::returns (SemanticGraph::HomeFinder& t)
+{
+ if (for_exec_)
+ {
+ os << STRS[COMP_EC] << "_ptr";
+ }
+ else
+ {
+ Traversal::HomeFinder::returns (t, returns_);
+ }
+
+ os << endl;
+}
+
+void
+FinderOperationEmitter::name (SemanticGraph::HomeFinder& t)
+{
+ os << t.name ();
+}
+
+void
+FinderOperationEmitter::receives_none (SemanticGraph::HomeFinder&)
+{
+ os << " ()" << endl;
+}
+
+void
+FinderOperationEmitter::receives_pre (SemanticGraph::HomeFinder&)
+{
+ os << " (" << endl;
+}
+
+void
+FinderOperationEmitter::receives_post (SemanticGraph::HomeFinder&)
+{
+ os << endl << ")" << endl;
+}
+
+void
+FinderOperationEmitter::raises (SemanticGraph::HomeFinder&)
+{
+}
+
+void
+FinderOperationEmitter::post (SemanticGraph::HomeFinder&)
+{
+ os << ";" << endl;
+}
+
+void
+FinderOperationEmitter::comma (SemanticGraph::HomeFinder&)
+{
+ os << "," << endl;
+}
+