aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/serializer
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-01-12 15:16:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-01-12 15:16:19 +0200
commit4326461b99a97153dd20a24570712adb04df89a9 (patch)
tree475544d981c5baf196c380d2597b4772c75b33d9 /xsde/cxx/serializer
parent8bf1bbd61d7d9aa50752b647f24f139512628b0e (diff)
Include file component in regex strings for schema being compiled
Diffstat (limited to 'xsde/cxx/serializer')
-rw-r--r--xsde/cxx/serializer/elements.cxx2
-rw-r--r--xsde/cxx/serializer/elements.hxx1
-rw-r--r--xsde/cxx/serializer/generator.cxx18
-rw-r--r--xsde/cxx/serializer/name-processor.cxx11
-rw-r--r--xsde/cxx/serializer/validator.cxx7
5 files changed, 20 insertions, 19 deletions
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<CLI::char_encoding> (),
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<Indentation::SLOC, WideChar> 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<Indentation::SLOC, WideChar> 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<Indentation::SLOC, WideChar> 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<CLI::char_encoding> (),
@@ -45,11 +46,8 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::reserved_name> ()),
- schema_path_ (file),
skel_suffix_ (ops.value<CLI::skel_type_suffix> ()),
impl_suffix_ (ops.value<CLI::impl_type_suffix> ()),
- schema (root),
- schema_path (schema_path_),
impl (ops.value<CLI::generate_empty_impl> () ||
ops.value<CLI::generate_test_driver> ()),
tiein (!ops.value<CLI::reuse_style_mixin> () &&
@@ -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<String, NameSet*> 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);
//
//