diff options
Diffstat (limited to 'xsde/cxx/parser/generator.cxx')
-rw-r--r-- | xsde/cxx/parser/generator.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/xsde/cxx/parser/generator.cxx b/xsde/cxx/parser/generator.cxx index c8a9f68..74ba2ea 100644 --- a/xsde/cxx/parser/generator.cxx +++ b/xsde/cxx/parser/generator.cxx @@ -125,6 +125,7 @@ namespace CXX extern Key generate_polymorphic = "generate-polymorphic"; extern Key runtime_polymorphic = "runtime-polymorphic"; extern Key suppress_reset = "suppress-reset"; + extern Key custom_allocator = "custom-allocator"; extern Key generate_noop_impl = "generate-noop-impl"; extern Key generate_print_impl = "generate-print-impl"; extern Key generate_test_driver = "generate-test-driver"; @@ -246,6 +247,11 @@ namespace CXX << " Suppress the generation of parser reset code." << endl; + e << "--custom-allocator" << endl + << " Generate code that uses custom allocator functions\n" + << " instead of operator new/delete." + << endl; + e << "--generate-noop-impl" << endl << " Generate a sample parser implementation that\n" << " does nothing (no operation)." @@ -1396,6 +1402,25 @@ namespace CXX << endl; } + if (ops.value<CLI::custom_allocator> ()) + { + hxx << "#ifndef XSDE_CUSTOM_ALLOCATOR" << endl + << "#error the generated code uses custom allocator while " << + "the XSD/e runtime does not (reconfigure the runtime or " << + "remove --custom-allocator)" << endl + << "#endif" << endl + << endl; + } + else + { + hxx << "#ifdef XSDE_CUSTOM_ALLOCATOR" << endl + << "#error the XSD/e runtime uses custom allocator while " << + "the generated code does not (reconfigure the runtime or " << + "add --custom-allocator)" << endl + << "#endif" << endl + << endl; + } + // // |