diff options
Diffstat (limited to 'modules/CIAO/CIDLC/OperationHeaderEmitters.cpp')
-rw-r--r-- | modules/CIAO/CIDLC/OperationHeaderEmitters.cpp | 264 |
1 files changed, 264 insertions, 0 deletions
diff --git a/modules/CIAO/CIDLC/OperationHeaderEmitters.cpp b/modules/CIAO/CIDLC/OperationHeaderEmitters.cpp new file mode 100644 index 00000000000..e41e3d6d023 --- /dev/null +++ b/modules/CIAO/CIDLC/OperationHeaderEmitters.cpp @@ -0,0 +1,264 @@ +// 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_pre (Type&) +{ + os << STRS[EXCP_START] << " " + << STRS[EXCP_SYS] << "," << endl; +} + +void +OperationEmitter::raises_none (Type&) +{ + os << STRS[EXCP_SNGL]; +} + +void +OperationEmitter::raises_post (Type&) +{ + os << "))"; +} + +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_none (SemanticGraph::HomeFactory&) +{ + os << STRS[EXCP_SNGL]; +} + +void +FactoryOperationEmitter::raises_pre (SemanticGraph::HomeFactory&) +{ + os << STRS[EXCP_START] << " " + << STRS[EXCP_SYS] << "," << endl; +} + +void +FactoryOperationEmitter::raises_post (SemanticGraph::HomeFactory&) +{ + os << "))"; +} + +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_none (SemanticGraph::HomeFinder&) +{ + os << STRS[EXCP_SNGL]; +} + +void +FinderOperationEmitter::raises_pre (SemanticGraph::HomeFinder&) +{ + os << STRS[EXCP_START] << " " + << STRS[EXCP_SYS] << "," << endl; +} + +void +FinderOperationEmitter::raises_post (SemanticGraph::HomeFinder&) +{ + os << "))"; +} + +void +FinderOperationEmitter::post (SemanticGraph::HomeFinder&) +{ + os << ";" << endl; +} + +void +FinderOperationEmitter::comma (SemanticGraph::HomeFinder&) +{ + os << "," << endl; +} + |