From f3e67f694188a16e426e92fda846998fd26db50d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Jan 2010 15:14:06 +0200 Subject: Include file component in regex strings for schema being compiled --- xsd/cxx/parser/elements.cxx | 2 ++ xsd/cxx/parser/elements.hxx | 1 + xsd/cxx/parser/generator.cxx | 8 +++++++- xsd/cxx/parser/name-processor.cxx | 11 ++--------- xsd/cxx/parser/validator.cxx | 7 ++++--- 5 files changed, 16 insertions(+), 13 deletions(-) (limited to 'xsd/cxx/parser') diff --git a/xsd/cxx/parser/elements.cxx b/xsd/cxx/parser/elements.cxx index 399553a..392bf16 100644 --- a/xsd/cxx/parser/elements.cxx +++ b/xsd/cxx/parser/elements.cxx @@ -41,6 +41,7 @@ namespace CXX Context:: Context (std::wostream& o, SemanticGraph::Schema& root, + SemanticGraph::Path const& path, CLI::Options const& ops, StringLiteralMap const* map, Regex const* he, @@ -48,6 +49,7 @@ namespace CXX Regex const* hie) : CXX::Context (o, root, + path, map, ops.value (), ops.value (), diff --git a/xsd/cxx/parser/elements.hxx b/xsd/cxx/parser/elements.hxx index 58e3c63..ca766f6 100644 --- a/xsd/cxx/parser/elements.hxx +++ b/xsd/cxx/parser/elements.hxx @@ -38,6 +38,7 @@ namespace CXX public: Context (std::wostream&, SemanticGraph::Schema&, + SemanticGraph::Path const& path, CLI::Options const&, StringLiteralMap const*, Regex const* hxx_expr, diff --git a/xsd/cxx/parser/generator.cxx b/xsd/cxx/parser/generator.cxx index b4cc0d1..60d2785 100644 --- a/xsd/cxx/parser/generator.cxx +++ b/xsd/cxx/parser/generator.cxx @@ -715,7 +715,7 @@ namespace CXX String xns; { - Context ctx (std::wcerr, schema, ops, 0, 0, 0, 0); + Context ctx (std::wcerr, schema, file_path, ops, 0, 0, 0, 0); xns = ctx.xs_ns_name (); } @@ -1160,6 +1160,7 @@ namespace CXX { Context ctx (hxx, schema, + file_path, ops, &string_literal_map, &hxx_expr, @@ -1253,6 +1254,7 @@ namespace CXX { Context ctx (ixx, schema, + file_path, ops, &string_literal_map, &hxx_expr, @@ -1315,6 +1317,7 @@ namespace CXX { Context ctx (cxx, schema, + file_path, ops, &string_literal_map, &hxx_expr, @@ -1385,6 +1388,7 @@ namespace CXX { Context ctx (hxx_impl, schema, + file_path, ops, &string_literal_map, &hxx_expr, @@ -1419,6 +1423,7 @@ namespace CXX { Context ctx (cxx_impl, schema, + file_path, ops, &string_literal_map, &hxx_expr, @@ -1441,6 +1446,7 @@ namespace CXX { Context ctx (cxx_driver, schema, + file_path, ops, &string_literal_map, &hxx_expr, diff --git a/xsd/cxx/parser/name-processor.cxx b/xsd/cxx/parser/name-processor.cxx index 9573ca8..3bc616e 100644 --- a/xsd/cxx/parser/name-processor.cxx +++ b/xsd/cxx/parser/name-processor.cxx @@ -34,10 +34,11 @@ namespace CXX public: Context (CLI::Options const& ops, SemanticGraph::Schema& root, - SemanticGraph::Path const& file, + SemanticGraph::Path const& path, StringLiteralMap const* map) : CXX::Context (std::wcerr, root, + path, map, ops.value (), ops.value (), @@ -51,11 +52,8 @@ namespace CXX ops.value (), ops.value (), ops.value ()), - schema_path_ (file), skel_suffix_ (ops.value ()), impl_suffix_ (ops.value ()), - schema (root), - schema_path (schema_path_), impl (ops.value () || ops.value () || ops.value ()), @@ -69,8 +67,6 @@ namespace CXX protected: Context (Context& c) : CXX::Context (c), - schema (c.schema), - schema_path (c.schema_path), impl (c.impl), skel_suffix (c.skel_suffix), impl_suffix (c.impl_suffix), @@ -98,15 +94,12 @@ namespace CXX } private: - SemanticGraph::Path const schema_path_; String const skel_suffix_; String const impl_suffix_; Cult::Containers::Map global_type_names_; public: - SemanticGraph::Schema& schema; - SemanticGraph::Path const& schema_path; Boolean const impl; String const& skel_suffix; String const& impl_suffix; diff --git a/xsd/cxx/parser/validator.cxx b/xsd/cxx/parser/validator.cxx index 2ca1d69..d70e333 100644 --- a/xsd/cxx/parser/validator.cxx +++ b/xsd/cxx/parser/validator.cxx @@ -24,10 +24,11 @@ namespace CXX { public: ValidationContext (SemanticGraph::Schema& root, + SemanticGraph::Path const& path, CLI::Options const& options, const WarningSet& disabled_warnings, Boolean& valid_) - : Context (std::wcerr, root, options, 0, 0, 0, 0), + : Context (std::wcerr, root, path, options, 0, 0, 0, 0), disabled_warnings_ (disabled_warnings), disabled_warnings_all_ (false), valid (valid_), @@ -552,12 +553,12 @@ namespace CXX Boolean Validator:: validate (CLI::Options const& options, SemanticGraph::Schema& root, - SemanticGraph::Path const&, + SemanticGraph::Path const& path, Boolean gen_driver, const WarningSet& disabled_warnings) { Boolean valid (true); - ValidationContext ctx (root, options, disabled_warnings, valid); + ValidationContext ctx (root, path, options, disabled_warnings, valid); // // -- cgit v1.1