From 9159ba48b1feeb64cf1ab9a5f684a851321335b9 Mon Sep 17 00:00:00 2001 From: parsons Date: Thu, 28 May 2009 14:11:33 +0000 Subject: ChangeLogTag: Thu May 28 14:01:45 UTC 2009 Jeff Parsons --- CIAO/CIDLC/ExecutorMappingGenerator.cpp | 36 +++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'CIAO/CIDLC/ExecutorMappingGenerator.cpp') diff --git a/CIAO/CIDLC/ExecutorMappingGenerator.cpp b/CIAO/CIDLC/ExecutorMappingGenerator.cpp index e5aa0a8b445..8bd8f38d7a6 100644 --- a/CIAO/CIDLC/ExecutorMappingGenerator.cpp +++ b/CIAO/CIDLC/ExecutorMappingGenerator.cpp @@ -1649,8 +1649,9 @@ namespace Traversal::BracketIncludes, Emitter { - IncludesEmitter (Context& c, ostream& os) - : Emitter (c, os) + IncludesEmitter (Context& c, ostream& os, CommandLine const& cl) + : Emitter (c, os), + cl_ (cl) { } @@ -1658,6 +1659,14 @@ namespace traverse (SemanticGraph::QuoteIncludes& qi) { os << "#include \"" << qi.file ().string () << "\"" << endl; + + string enclosing = cl_.get_value ("lem-enclosing-module", ""); + + if (enclosing != "") + { + os << endl << "module " << enclosing << endl + << "{"; + } } virtual void @@ -1665,6 +1674,9 @@ namespace { os << "#include <" << bi.file ().string () << ">" << endl; } + + private: + CommandLine const& cl_; }; } @@ -1693,6 +1705,14 @@ options (CL::Description& d) "Use provided regular expression when constructing " "name of local executor mapping file.", CL::OptionType::value)); + + d.add_option (CL::OptionDescription ( + "lem-enclosing-module", + "name", + "Adds an enclosing module to the entire IDL file " + "to disambiguate repeated code generation of " + "inherited facets.", + CL::OptionType::value)); } @@ -1942,7 +1962,7 @@ generate (CommandLine const& cl, { os << "#include " << endl; } - + Traversal::TranslationUnit unit; // Layer 1 @@ -1968,7 +1988,7 @@ generate (CommandLine const& cl, Traversal::ContainsRoot contains_root; Traversal::QuoteIncludes quote_includes; Traversal::BracketIncludes bracket_includes; - IncludesEmitter includes_emitter (ctx, os); + IncludesEmitter includes_emitter (ctx, os, cl); principal_region.edge_traverser (includes_emitter); @@ -2095,5 +2115,13 @@ generate (CommandLine const& cl, // end unit.traverse (tu); + + string enclosing = cl.get_value ("lem-enclosing-module", ""); + + if (enclosing != "") + { + os << endl + << "};" << endl; + } } } -- cgit v1.2.1