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/serializer/elements.cxx | 2 ++ xsde/cxx/serializer/elements.hxx | 1 + xsde/cxx/serializer/generator.cxx | 18 +++++++++++------- xsde/cxx/serializer/name-processor.cxx | 11 ++--------- xsde/cxx/serializer/validator.cxx | 7 ++++--- 5 files changed, 20 insertions(+), 19 deletions(-) (limited to 'xsde/cxx/serializer') diff --git a/xsde/cxx/serializer/elements.cxx b/xsde/cxx/serializer/elements.cxx index f59a102..0192faf 100644 --- a/xsde/cxx/serializer/elements.cxx +++ b/xsde/cxx/serializer/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* he, Regex const* ie, Regex const* hie) : CXX::Context (o, root, + path, "s:name", "char", ops.value (), diff --git a/xsde/cxx/serializer/elements.hxx b/xsde/cxx/serializer/elements.hxx index 7c16416..50a54eb 100644 --- a/xsde/cxx/serializer/elements.hxx +++ b/xsde/cxx/serializer/elements.hxx @@ -38,6 +38,7 @@ namespace CXX public: Context (std::wostream&, SemanticGraph::Schema&, + SemanticGraph::Path const&, CLI::Options const&, Regex const* hxx_expr, Regex const* ixx_expr, diff --git a/xsde/cxx/serializer/generator.cxx b/xsde/cxx/serializer/generator.cxx index cf6091d..9d519b9 100644 --- a/xsde/cxx/serializer/generator.cxx +++ b/xsde/cxx/serializer/generator.cxx @@ -685,7 +685,7 @@ namespace CXX // String xns; { - Context ctx (std::wcerr, schema, ops, 0, 0, 0); + Context ctx (std::wcerr, schema, file_path, ops, 0, 0, 0); xns = ctx.xs_ns_name (); } @@ -1161,7 +1161,8 @@ namespace CXX // HXX // { - Context ctx (hxx, schema, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); + Context ctx ( + hxx, schema, file_path, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); Indentation::Clip hxx_sloc (hxx); @@ -1419,7 +1420,8 @@ namespace CXX // if (inline_) { - Context ctx (ixx, schema, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); + Context ctx ( + ixx, schema, file_path, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); Indentation::Clip ixx_sloc (ixx); @@ -1475,7 +1477,8 @@ namespace CXX // if (source) { - Context ctx (cxx, schema, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); + Context ctx ( + cxx, schema, file_path, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); Indentation::Clip cxx_sloc (cxx); @@ -1538,7 +1541,8 @@ namespace CXX // if (impl) { - Context ctx (hxx_impl, schema, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); + Context ctx (hxx_impl, schema, file_path, ops, + &hxx_expr, &ixx_expr, &hxx_impl_expr); String guard (guard_expr.merge (guard_prefix + hxx_impl_name)); guard = ctx.escape (guard); // Make it a C++ id. @@ -1566,7 +1570,7 @@ namespace CXX // if (impl) { - Context ctx (cxx_impl, schema, ops, + Context ctx (cxx_impl, schema, file_path, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); // Set auto-indentation. @@ -1583,7 +1587,7 @@ namespace CXX // if (driver) { - Context ctx (cxx_driver, schema, ops, + Context ctx (cxx_driver, schema, file_path, ops, &hxx_expr, &ixx_expr, &hxx_impl_expr); // Set auto-indentation. diff --git a/xsde/cxx/serializer/name-processor.cxx b/xsde/cxx/serializer/name-processor.cxx index ddc9c4e..bc7ac8a 100644 --- a/xsde/cxx/serializer/name-processor.cxx +++ b/xsde/cxx/serializer/name-processor.cxx @@ -29,9 +29,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, "s:name", "char", ops.value (), @@ -45,11 +46,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 ()), tiein (!ops.value () && @@ -65,8 +63,6 @@ namespace CXX protected: Context (Context& c) : CXX::Context (c), - schema (c.schema), - schema_path (c.schema_path), impl (c.impl), tiein (c.tiein), skel_suffix (c.skel_suffix), @@ -101,15 +97,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; Boolean const tiein; String const& skel_suffix; diff --git a/xsde/cxx/serializer/validator.cxx b/xsde/cxx/serializer/validator.cxx index c163459..f5125e0 100644 --- a/xsde/cxx/serializer/validator.cxx +++ b/xsde/cxx/serializer/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), + : Context (std::wcerr, root, path, options, 0, 0, 0), disabled_warnings_ (disabled_warnings), disabled_warnings_all_ (false), valid (valid_), @@ -401,12 +402,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