From 4326461b99a97153dd20a24570712adb04df89a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Jan 2010 15:16:19 +0200 Subject: Include file component in regex strings for schema being compiled --- xsde/cxx/hybrid/elements.cxx | 2 ++ xsde/cxx/hybrid/elements.hxx | 1 + xsde/cxx/hybrid/generator.cxx | 24 ++++++++++++++---------- xsde/cxx/hybrid/parser-name-processor.cxx | 11 ++--------- xsde/cxx/hybrid/serializer-name-processor.cxx | 11 ++--------- xsde/cxx/hybrid/tree-name-processor.cxx | 13 ++----------- xsde/cxx/hybrid/tree-type-map.cxx | 8 ++++++-- xsde/cxx/hybrid/tree-type-map.hxx | 1 + xsde/cxx/hybrid/validator.cxx | 7 ++++--- 9 files changed, 34 insertions(+), 44 deletions(-) (limited to 'xsde/cxx/hybrid') diff --git a/xsde/cxx/hybrid/elements.cxx b/xsde/cxx/hybrid/elements.cxx index 27e983a..e3bd02b 100644 --- a/xsde/cxx/hybrid/elements.cxx +++ b/xsde/cxx/hybrid/elements.cxx @@ -12,12 +12,14 @@ namespace CXX Context:: Context (std::wostream& o, SemanticGraph::Schema& root, + SemanticGraph::Path const& path, CLI::Options const& ops, Regex const* fe, Regex const* he, Regex const* ie) : CXX::Context (o, root, + path, "name", "char", ops.value (), diff --git a/xsde/cxx/hybrid/elements.hxx b/xsde/cxx/hybrid/elements.hxx index 5a2e12e..01030d5 100644 --- a/xsde/cxx/hybrid/elements.hxx +++ b/xsde/cxx/hybrid/elements.hxx @@ -30,6 +30,7 @@ namespace CXX public: Context (std::wostream&, SemanticGraph::Schema&, + SemanticGraph::Path const&, CLI::Options const&, Regex const* fwd_expr, Regex const* hxx_expr, diff --git a/xsde/cxx/hybrid/generator.cxx b/xsde/cxx/hybrid/generator.cxx index 14cba6a..c39b062 100644 --- a/xsde/cxx/hybrid/generator.cxx +++ b/xsde/cxx/hybrid/generator.cxx @@ -1409,7 +1409,8 @@ namespace CXX // if (forward) { - Context ctx (fwd, schema, ops, &fwd_expr, &hxx_expr, &ixx_expr); + Context ctx ( + fwd, schema, file_path, ops, &fwd_expr, &hxx_expr, &ixx_expr); Indentation::Clip fwd_sloc (fwd); @@ -1493,7 +1494,8 @@ namespace CXX // HXX // { - Context ctx (hxx, schema, ops, &fwd_expr, &hxx_expr, &ixx_expr); + Context ctx ( + hxx, schema, file_path, ops, &fwd_expr, &hxx_expr, &ixx_expr); Indentation::Clip hxx_sloc (hxx); @@ -1690,7 +1692,8 @@ namespace CXX // if (inline_) { - Context ctx (ixx, schema, ops, &fwd_expr, &hxx_expr, &ixx_expr); + Context ctx ( + ixx, schema, file_path, ops, &fwd_expr, &hxx_expr, &ixx_expr); Indentation::Clip ixx_sloc (ixx); // Guard @@ -1763,7 +1766,8 @@ namespace CXX // if (source) { - Context ctx (cxx, schema, ops, &fwd_expr, &hxx_expr, &ixx_expr); + Context ctx ( + cxx, schema, file_path, ops, &fwd_expr, &hxx_expr, &ixx_expr); Indentation::Clip cxx_sloc (cxx); @@ -1842,8 +1846,8 @@ namespace CXX if (ops.value () || ops.value ()) { - generate_tree_type_map ( - ops, schema, hxx_name, parser_type_map, serializer_type_map); + generate_tree_type_map (ops, schema, file_path, hxx_name, + parser_type_map, serializer_type_map); } return sloc; @@ -2086,7 +2090,7 @@ namespace CXX // HXX // { - Context ctx (hxx, schema, ops, 0, &hxx_expr, 0); + Context ctx (hxx, schema, file_path, ops, 0, &hxx_expr, 0); Indentation::Clip hxx_sloc (hxx); @@ -2189,7 +2193,7 @@ namespace CXX // CXX // { - Context ctx (cxx, schema, ops, 0, &hxx_obj_expr, 0); + Context ctx (cxx, schema, file_path, ops, 0, &hxx_obj_expr, 0); Indentation::Clip cxx_sloc (cxx); @@ -2477,7 +2481,7 @@ namespace CXX // HXX // { - Context ctx (hxx, schema, ops, 0, &hxx_expr, 0); + Context ctx (hxx, schema, file_path, ops, 0, &hxx_expr, 0); Indentation::Clip hxx_sloc (hxx); @@ -2580,7 +2584,7 @@ namespace CXX // CXX // { - Context ctx (cxx, schema, ops, 0, &hxx_expr, 0); + Context ctx (cxx, schema, file_path, ops, 0, &hxx_expr, 0); Indentation::Clip cxx_sloc (cxx); diff --git a/xsde/cxx/hybrid/parser-name-processor.cxx b/xsde/cxx/hybrid/parser-name-processor.cxx index afb0df4..15b0459 100644 --- a/xsde/cxx/hybrid/parser-name-processor.cxx +++ b/xsde/cxx/hybrid/parser-name-processor.cxx @@ -31,9 +31,10 @@ namespace CXX public: Context (CLI::Options const& ops, SemanticGraph::Schema& root, - SemanticGraph::Path const& file) + SemanticGraph::Path const& path) : CXX::Context (std::wcerr, root, + path, "name", "char", ops.value (), @@ -47,12 +48,9 @@ namespace CXX ops.value (), ops.value (), ops.value ()), - schema_path_ (file), impl_suffix_ (ops.value ()), aggr_suffix_ (ops.value ()), options (ops), - schema (root), - schema_path (schema_path_), aggregate (ops.value ()), impl_suffix (impl_suffix_), aggr_suffix (aggr_suffix_), @@ -111,8 +109,6 @@ namespace CXX Context (Context& c) : CXX::Context (c), options (c.options), - schema (c.schema), - schema_path (c.schema_path), aggregate (c.aggregate), impl_suffix (c.impl_suffix), aggr_suffix (c.aggr_suffix), @@ -232,7 +228,6 @@ namespace CXX CustomParserMap; private: - SemanticGraph::Path const schema_path_; String const impl_suffix_; String const aggr_suffix_; CustomParserMap custom_parser_map_; @@ -241,8 +236,6 @@ namespace CXX public: CLI::Options const& options; - SemanticGraph::Schema& schema; - SemanticGraph::Path const& schema_path; Boolean aggregate; String const& impl_suffix; String const& aggr_suffix; diff --git a/xsde/cxx/hybrid/serializer-name-processor.cxx b/xsde/cxx/hybrid/serializer-name-processor.cxx index 5da88b9..17522cf 100644 --- a/xsde/cxx/hybrid/serializer-name-processor.cxx +++ b/xsde/cxx/hybrid/serializer-name-processor.cxx @@ -30,9 +30,10 @@ namespace CXX public: Context (CLI::Options const& ops, SemanticGraph::Schema& root, - SemanticGraph::Path const& file) + SemanticGraph::Path const& path) : CXX::Context (std::wcerr, root, + path, "name", "char", ops.value (), @@ -46,12 +47,9 @@ namespace CXX ops.value (), ops.value (), ops.value ()), - schema_path_ (file), impl_suffix_ (ops.value ()), aggr_suffix_ (ops.value ()), options (ops), - schema (root), - schema_path (schema_path_), aggregate (ops.value ()), impl_suffix (impl_suffix_), aggr_suffix (aggr_suffix_), @@ -110,8 +108,6 @@ namespace CXX Context (Context& c) : CXX::Context (c), options (c.options), - schema (c.schema), - schema_path (c.schema_path), aggregate (c.aggregate), impl_suffix (c.impl_suffix), aggr_suffix (c.aggr_suffix), @@ -225,7 +221,6 @@ namespace CXX CustomSerializerMap; private: - SemanticGraph::Path const schema_path_; String const impl_suffix_; String const aggr_suffix_; CustomSerializerMap custom_serializer_map_; @@ -234,8 +229,6 @@ namespace CXX public: CLI::Options const& options; - SemanticGraph::Schema& schema; - SemanticGraph::Path const& schema_path; Boolean aggregate; String const& impl_suffix; String const& aggr_suffix; diff --git a/xsde/cxx/hybrid/tree-name-processor.cxx b/xsde/cxx/hybrid/tree-name-processor.cxx index b2a2c69..10a9280 100644 --- a/xsde/cxx/hybrid/tree-name-processor.cxx +++ b/xsde/cxx/hybrid/tree-name-processor.cxx @@ -33,9 +33,10 @@ namespace CXX public: Context (CLI::Options const& ops, SemanticGraph::Schema& root, - SemanticGraph::Path const& file) + SemanticGraph::Path const& path) : CXX::Context (std::wcerr, root, + path, "name", "char", ops.value (), @@ -49,9 +50,6 @@ namespace CXX ops.value (), ops.value (), ops.value ()), - schema_path_ (file), - schema (root), - schema_path (schema_path_), stl (!ops.value ()), detach (ops.value ()), enum_ (!ops.value ()), @@ -179,8 +177,6 @@ namespace CXX protected: Context (Context& c) : CXX::Context (c), - schema (c.schema), - schema_path (c.schema_path), stl (c.stl), detach (c.detach), enum_ (c.enum_), @@ -271,17 +267,12 @@ namespace CXX CustomTypeMap; private: - SemanticGraph::Path const schema_path_; - CustomDataMap custom_data_map_; CustomTypeMap custom_type_map_; Cult::Containers::Map global_type_names_; public: - SemanticGraph::Schema& schema; - SemanticGraph::Path const& schema_path; - Boolean stl; Boolean detach; Boolean enum_; diff --git a/xsde/cxx/hybrid/tree-type-map.cxx b/xsde/cxx/hybrid/tree-type-map.cxx index 1b22ff9..12b83de 100644 --- a/xsde/cxx/hybrid/tree-type-map.cxx +++ b/xsde/cxx/hybrid/tree-type-map.cxx @@ -22,9 +22,12 @@ namespace CXX class Context: public CXX::Context { public: - Context (CLI::Options const& ops, SemanticGraph::Schema& root) + Context (CLI::Options const& ops, + SemanticGraph::Schema& root, + SemanticGraph::Path const& path) : CXX::Context (std::wcerr, root, + path, "name", "char", ops.value (), @@ -202,6 +205,7 @@ namespace CXX Void generate_tree_type_map (CLI::Options const& ops, XSDFrontend::SemanticGraph::Schema& tu, + XSDFrontend::SemanticGraph::Path const& path, String const& hxx_name, TypeMap::Namespaces& parser_map, TypeMap::Namespaces& serializer_map) @@ -209,7 +213,7 @@ namespace CXX if (tu.names_begin ()->named ().name () != L"http://www.w3.org/2001/XMLSchema") { - Context ctx (ops, tu); + Context ctx (ops, tu, path); // We don't want include in the included/imported/sources // schema so split the traversal into two part. diff --git a/xsde/cxx/hybrid/tree-type-map.hxx b/xsde/cxx/hybrid/tree-type-map.hxx index 6f5f946..ec05558 100644 --- a/xsde/cxx/hybrid/tree-type-map.hxx +++ b/xsde/cxx/hybrid/tree-type-map.hxx @@ -23,6 +23,7 @@ namespace CXX Void generate_tree_type_map (CLI::Options const& options, XSDFrontend::SemanticGraph::Schema&, + XSDFrontend::SemanticGraph::Path const&, String const& hxx_name, TypeMap::Namespaces& parser_type_map, TypeMap::Namespaces& serializer_type_map); diff --git a/xsde/cxx/hybrid/validator.cxx b/xsde/cxx/hybrid/validator.cxx index 716f072..7641025 100644 --- a/xsde/cxx/hybrid/validator.cxx +++ b/xsde/cxx/hybrid/validator.cxx @@ -27,10 +27,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), + : Context (std::wcerr, root, path, options, 0, 0, 0), disabled_warnings_ (disabled_warnings), disabled_warnings_all_ (false), valid (valid_), @@ -483,11 +484,11 @@ namespace CXX Boolean Validator:: validate (CLI::Options const& options, SemanticGraph::Schema& root, - SemanticGraph::Path const&, + SemanticGraph::Path const& path, 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