aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/hybrid
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/hybrid
parent8bf1bbd61d7d9aa50752b647f24f139512628b0e (diff)
Include file component in regex strings for schema being compiled
Diffstat (limited to 'xsde/cxx/hybrid')
-rw-r--r--xsde/cxx/hybrid/elements.cxx2
-rw-r--r--xsde/cxx/hybrid/elements.hxx1
-rw-r--r--xsde/cxx/hybrid/generator.cxx24
-rw-r--r--xsde/cxx/hybrid/parser-name-processor.cxx11
-rw-r--r--xsde/cxx/hybrid/serializer-name-processor.cxx11
-rw-r--r--xsde/cxx/hybrid/tree-name-processor.cxx13
-rw-r--r--xsde/cxx/hybrid/tree-type-map.cxx8
-rw-r--r--xsde/cxx/hybrid/tree-type-map.hxx1
-rw-r--r--xsde/cxx/hybrid/validator.cxx7
9 files changed, 34 insertions, 44 deletions
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<CLI::char_encoding> (),
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<Indentation::SLOC, WideChar> 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<Indentation::SLOC, WideChar> 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<Indentation::SLOC, WideChar> 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<Indentation::SLOC, WideChar> cxx_sloc (cxx);
@@ -1842,8 +1846,8 @@ namespace CXX
if (ops.value<CLI::generate_parser> () ||
ops.value<CLI::generate_serializer> ())
{
- 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<Indentation::SLOC, WideChar> 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<Indentation::SLOC, WideChar> 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<Indentation::SLOC, WideChar> 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<Indentation::SLOC, WideChar> 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<CLI::char_encoding> (),
@@ -47,12 +48,9 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::reserved_name> ()),
- schema_path_ (file),
impl_suffix_ (ops.value<CLI::pimpl_type_suffix> ()),
aggr_suffix_ (ops.value<CLI::paggr_type_suffix> ()),
options (ops),
- schema (root),
- schema_path (schema_path_),
aggregate (ops.value<CLI::generate_aggregate> ()),
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<CLI::char_encoding> (),
@@ -46,12 +47,9 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::reserved_name> ()),
- schema_path_ (file),
impl_suffix_ (ops.value<CLI::simpl_type_suffix> ()),
aggr_suffix_ (ops.value<CLI::saggr_type_suffix> ()),
options (ops),
- schema (root),
- schema_path (schema_path_),
aggregate (ops.value<CLI::generate_aggregate> ()),
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<CLI::char_encoding> (),
@@ -49,9 +50,6 @@ namespace CXX
ops.value<CLI::include_regex_trace> (),
ops.value<CLI::generate_inline> (),
ops.value<CLI::reserved_name> ()),
- schema_path_ (file),
- schema (root),
- schema_path (schema_path_),
stl (!ops.value<CLI::no_stl> ()),
detach (ops.value<CLI::generate_detach> ()),
enum_ (!ops.value<CLI::suppress_enum> ()),
@@ -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<String, NameSet*> 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<CLI::char_encoding> (),
@@ -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);
//
//