aboutsummaryrefslogtreecommitdiff
path: root/xsd/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-03-01 08:34:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-03-01 08:34:32 +0200
commit2ff19bd5b0ab8bb13a94177ca6c172ae42e7d534 (patch)
treea11306b59428634277558ed2549d74b122864cca /xsd/cxx
parente868680eb0cc91162e590b88156a7f883d123391 (diff)
Move pro/epilogue outside pre/post.hxx includes
Also add pre/post includes to the C++/Parser source file.
Diffstat (limited to 'xsd/cxx')
-rw-r--r--xsd/cxx/parser/generator.cxx36
-rw-r--r--xsd/cxx/tree/generator.cxx72
2 files changed, 57 insertions, 51 deletions
diff --git a/xsd/cxx/parser/generator.cxx b/xsd/cxx/parser/generator.cxx
index 46a0687..58e7043 100644
--- a/xsd/cxx/parser/generator.cxx
+++ b/xsd/cxx/parser/generator.cxx
@@ -787,18 +787,6 @@ namespace CXX
<< endl;
}
- // Version check.
- //
- hxx << "#include <xsd/cxx/config.hxx>" << endl
- << endl
- << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
- << "#error XSD runtime version mismatch" << endl
- << "#endif" << endl
- << endl;
-
- hxx << "#include <xsd/cxx/pre.hxx>" << endl
- << endl;
-
// Copy prologue.
//
hxx << "// Begin prologue." << endl
@@ -811,6 +799,18 @@ namespace CXX
<< "// End prologue." << endl
<< endl;
+ // Version check.
+ //
+ hxx << "#include <xsd/cxx/config.hxx>" << endl
+ << endl
+ << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
+ << "#error XSD runtime version mismatch" << endl
+ << "#endif" << endl
+ << endl;
+
+ hxx << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
// Generate.
//
{
@@ -825,6 +825,9 @@ namespace CXX
if (inline_)
hxx << "#include " << ctx.process_include_path (ixx_name) << endl;
+ hxx << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
// Copy epilogue.
//
hxx << "// Begin epilogue." << endl
@@ -837,9 +840,6 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
- hxx << "#include <xsd/cxx/post.hxx>" << endl
- << endl;
-
hxx << "#endif // " << guard << endl;
if (show_sloc)
@@ -929,6 +929,9 @@ namespace CXX
<< "// End prologue." << endl
<< endl;
+ cxx << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
cxx << "#include " << ctx.process_include_path (hxx_name) << endl
<< endl;
@@ -950,6 +953,9 @@ namespace CXX
}
}
+ cxx << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
// Copy epilogue.
//
cxx << "// Begin epilogue." << endl
diff --git a/xsd/cxx/tree/generator.cxx b/xsd/cxx/tree/generator.cxx
index 35c53bc..709046c 100644
--- a/xsd/cxx/tree/generator.cxx
+++ b/xsd/cxx/tree/generator.cxx
@@ -745,18 +745,6 @@ namespace CXX
<< endl;
}
- // Version check.
- //
- fwd << "#include <xsd/cxx/version.hxx>" << endl
- << endl
- << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
- << "#error XSD runtime version mismatch" << endl
- << "#endif" << endl
- << endl;
-
- fwd << "#include <xsd/cxx/pre.hxx>" << endl
- << endl;
-
// Copy prologue.
//
fwd << "// Begin prologue." << endl
@@ -769,6 +757,18 @@ namespace CXX
<< "// End prologue." << endl
<< endl;
+ // Version check.
+ //
+ fwd << "#include <xsd/cxx/version.hxx>" << endl
+ << endl
+ << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
+ << "#error XSD runtime version mismatch" << endl
+ << "#endif" << endl
+ << endl;
+
+ fwd << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
// Generate.
//
{
@@ -776,6 +776,9 @@ namespace CXX
generate_forward (ctx);
}
+ fwd << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
// Copy epilogue.
//
fwd << "// Begin epilogue." << endl
@@ -788,9 +791,6 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
- fwd << "#include <xsd/cxx/post.hxx>" << endl
- << endl;
-
fwd << "#endif // " << guard << endl;
if (show_sloc)
@@ -862,18 +862,6 @@ namespace CXX
}
}
- // Version check.
- //
- hxx << "#include <xsd/cxx/config.hxx>" << endl
- << endl
- << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
- << "#error XSD runtime version mismatch" << endl
- << "#endif" << endl
- << endl;
-
- hxx << "#include <xsd/cxx/pre.hxx>" << endl
- << endl;
-
// Copy prologue.
//
hxx << "// Begin prologue." << endl
@@ -886,6 +874,18 @@ namespace CXX
<< "// End prologue." << endl
<< endl;
+ // Version check.
+ //
+ hxx << "#include <xsd/cxx/config.hxx>" << endl
+ << endl
+ << "#if (XSD_INT_VERSION != " << XSD_INT_VERSION << "L)" << endl
+ << "#error XSD runtime version mismatch" << endl
+ << "#endif" << endl
+ << endl;
+
+ hxx << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
// Generate.
//
{
@@ -926,6 +926,9 @@ namespace CXX
<< endl;
}
+ hxx << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
// Copy epilogue.
//
hxx << "// Begin epilogue." << endl
@@ -938,9 +941,6 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
- hxx << "#include <xsd/cxx/post.hxx>" << endl
- << endl;
-
hxx << "#endif // " << guard << endl;
if (show_sloc)
@@ -1090,9 +1090,6 @@ namespace CXX
sloc_filter sloc (os);
- os << "#include <xsd/cxx/pre.hxx>" << endl
- << endl;
-
// Copy prologue.
//
os << "// Begin prologue." << endl
@@ -1105,6 +1102,9 @@ namespace CXX
<< "// End prologue." << endl
<< endl;
+ os << "#include <xsd/cxx/pre.hxx>" << endl
+ << endl;
+
os << "#include " << ctx.process_include_path (hxx_name) << endl
<< endl;
@@ -1136,6 +1136,9 @@ namespace CXX
generate_stream_insertion_source (ctx);
}
+ os << "#include <xsd/cxx/post.hxx>" << endl
+ << endl;
+
// Copy epilogue.
//
os << "// Begin epilogue." << endl
@@ -1148,9 +1151,6 @@ namespace CXX
<< "// End epilogue." << endl
<< endl;
- os << "#include <xsd/cxx/post.hxx>" << endl
- << endl;
-
if (show_sloc)
wcerr << cxx_paths[part] << ": " << sloc.stream ().count ()
<< endl;