diff options
Diffstat (limited to 'xsde/cxx/parser/validator.cxx')
-rw-r--r-- | xsde/cxx/parser/validator.cxx | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/xsde/cxx/parser/validator.cxx b/xsde/cxx/parser/validator.cxx index 08029e1..bf5dffb 100644 --- a/xsde/cxx/parser/validator.cxx +++ b/xsde/cxx/parser/validator.cxx @@ -25,7 +25,7 @@ namespace CXX public: ValidationContext (SemanticGraph::Schema& root, SemanticGraph::Path const& path, - CLI::Options const& options, + Parser::options const& options, const WarningSet& disabled_warnings, Boolean& valid_) : Context (std::wcerr, root, path, options, 0, 0, 0), @@ -341,7 +341,7 @@ namespace CXX return; if (e.substitutes_p () && - !options.value<CLI::generate_polymorphic> () && + !options.generate_polymorphic () && !subst_group_warning_issued) { subst_group_warning_issued = true; @@ -433,7 +433,7 @@ namespace CXX << "automatically name them" << endl; - if (!options.value<CLI::show_anonymous> ()) + if (!options.show_anonymous ()) wcerr << t.file () << ": info: use --show-anonymous option to see these " << "types" << endl; @@ -462,7 +462,7 @@ namespace CXX { if (traverse_common (e)) { - if (options.value<CLI::show_anonymous> ()) + if (options.show_anonymous ()) { wcerr << e.file () << ":" << e.line () << ":" << e.column () << ": error: element '" << xpath (e) << "' " @@ -487,7 +487,7 @@ namespace CXX { if (traverse_common (a)) { - if (options.value<CLI::show_anonymous> ()) + if (options.show_anonymous ()) { wcerr << a.file () << ":" << a.line () << ":" << a.column () << ": error: attribute '" << xpath (a) << "' " @@ -553,16 +553,16 @@ namespace CXX if (!valid) return; - if (options.value<CLI::root_element_first> ()) + if (options.root_element_first ()) { if (element_ == 0) element_ = &e; } - else if (options.value<CLI::root_element_last> ()) + else if (options.root_element_last ()) { element_ = &e; } - else if (String name = options.value<CLI::root_element> ()) + else if (String name = options.root_element ()) { if (e.name () == name) element_ = &e; @@ -591,18 +591,18 @@ namespace CXX } Boolean Validator:: - validate (CLI::Options const& options, + validate (options const& ops, SemanticGraph::Schema& root, SemanticGraph::Path const& path, Boolean gen_driver, const WarningSet& disabled_warnings) { Boolean valid (true); - ValidationContext ctx (root, path, options, disabled_warnings, valid); + ValidationContext ctx (root, path, ops, disabled_warnings, valid); // // - NarrowString enc (options.value<CLI::char_encoding> ()); + NarrowString enc (ops.char_encoding ()); if (enc != "utf8" && enc != "iso8859-1") { @@ -612,8 +612,7 @@ namespace CXX // // - if (options.value<CLI::generate_noop_impl> () && - options.value<CLI::generate_print_impl> ()) + if (ops.generate_noop_impl () && ops.generate_print_impl ()) { wcerr << "error: mutually exclusive options specified: " << "--generate-noop-impl and --generate-print-impl" @@ -625,9 +624,9 @@ namespace CXX // // { - Boolean ref (options.value<CLI::root_element_first> ()); - Boolean rel (options.value<CLI::root_element_last> ()); - Boolean re (options.value<CLI::root_element> ()); + Boolean ref (ops.root_element_first ()); + Boolean rel (ops.root_element_last ()); + Boolean re (ops.root_element ()); if ((ref && rel) || (ref && re) || (rel && re)) { @@ -642,8 +641,7 @@ namespace CXX // // - if (options.value<CLI::reuse_style_mixin> () && - options.value<CLI::reuse_style_none> ()) + if (ops.reuse_style_mixin () && ops.reuse_style_none ()) { wcerr << "error: mutually exclusive options specified: " << "--reuse-style-mixin and --reuse-style-none" @@ -654,9 +652,9 @@ namespace CXX // // - if (options.value<CLI::reuse_style_none> () && - (options.value<CLI::generate_noop_impl> () || - options.value<CLI::generate_print_impl> ()) && + if (ops.reuse_style_none () && + (ops.generate_noop_impl () || + ops.generate_print_impl ()) && !ctx.is_disabled ("P003")) { wcerr << "warning P003: generating sample implementation without " |