aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/parser
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-03-26 17:09:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-03-26 17:09:53 +0200
commite4c22d3686da0e973e21eae0561c1169c0eeff36 (patch)
tree0a49e9167edc88938b0287949080931314e8afea /xsde/cxx/parser
parent0d62005a3ff3b62d02c2eb3fd8644e0e19b202e8 (diff)
Implement support for XML Schema polymorphism in C++/Hybrid
examples/cxx/hybrid/polyroot/ examples/cxx/hybrid/polymorphism/: new examples tests/cxx/hybrid/polymorphism/: new tests
Diffstat (limited to 'xsde/cxx/parser')
-rw-r--r--xsde/cxx/parser/generator.cxx10
-rw-r--r--xsde/cxx/parser/generator.hxx17
-rw-r--r--xsde/cxx/parser/name-processor.cxx11
-rw-r--r--xsde/cxx/parser/name-processor.hxx5
-rw-r--r--xsde/cxx/parser/validator.cxx2
5 files changed, 35 insertions, 10 deletions
diff --git a/xsde/cxx/parser/generator.cxx b/xsde/cxx/parser/generator.cxx
index e552c92..aed6e53 100644
--- a/xsde/cxx/parser/generator.cxx
+++ b/xsde/cxx/parser/generator.cxx
@@ -526,6 +526,14 @@ namespace CXX
return spec;
}
+ Void Parser::Generator::
+ process_names (CLI::Options const& ops,
+ XSDFrontend::SemanticGraph::Schema& schema,
+ XSDFrontend::SemanticGraph::Path const& file)
+ {
+ NameProcessor proc;
+ proc.process (ops, schema, file, false);
+ }
namespace
{
@@ -646,7 +654,7 @@ namespace CXX
//
{
NameProcessor proc;
- proc.process (ops, schema, file_path);
+ proc.process (ops, schema, file_path, true);
}
Boolean validation (!ops.value<CLI::suppress_validation> ());
diff --git a/xsde/cxx/parser/generator.hxx b/xsde/cxx/parser/generator.hxx
index a261eca..305d8b1 100644
--- a/xsde/cxx/parser/generator.hxx
+++ b/xsde/cxx/parser/generator.hxx
@@ -35,17 +35,26 @@ namespace CXX
static CLI::OptionsSpec
options_spec ();
+ // Assign names to global declarations.
+ //
+ static Void
+ process_names (CLI::Options const&,
+ XSDFrontend::SemanticGraph::Schema&,
+ XSDFrontend::SemanticGraph::Path const&);
+
+ // Generate code.
+ //
struct Failed {};
static UnsignedLong
- generate (CLI::Options const& options,
+ generate (CLI::Options const&,
XSDFrontend::SemanticGraph::Schema&,
- XSDFrontend::SemanticGraph::Path const& file,
+ XSDFrontend::SemanticGraph::Path const&,
TypeMap::Namespaces& type_map,
Boolean gen_driver,
const WarningSet& disabled_warnings,
- FileList& file_list,
- AutoUnlinks& unlinks);
+ FileList&,
+ AutoUnlinks&);
private:
Generator ();
diff --git a/xsde/cxx/parser/name-processor.cxx b/xsde/cxx/parser/name-processor.cxx
index bc0e7a5..9c945b3 100644
--- a/xsde/cxx/parser/name-processor.cxx
+++ b/xsde/cxx/parser/name-processor.cxx
@@ -1224,7 +1224,8 @@ namespace CXX
Void
process_impl (CLI::Options const& ops,
SemanticGraph::Schema& tu,
- SemanticGraph::Path const& file)
+ SemanticGraph::Path const& file,
+ Boolean deep)
{
Context ctx (ops, tu, file);
@@ -1290,6 +1291,9 @@ namespace CXX
schema.dispatch (tu);
}
+ if (!deep)
+ return;
+
// Pass three - assign names inside complex types. Here we don't
// need to go into included/imported schemas.
//
@@ -1318,9 +1322,10 @@ namespace CXX
Void NameProcessor::
process (CLI::Options const& ops,
SemanticGraph::Schema& tu,
- SemanticGraph::Path const& file)
+ SemanticGraph::Path const& file,
+ Boolean deep)
{
- process_impl (ops, tu, file);
+ process_impl (ops, tu, file, deep);
}
}
}
diff --git a/xsde/cxx/parser/name-processor.hxx b/xsde/cxx/parser/name-processor.hxx
index 8d55f30..6a7af9f 100644
--- a/xsde/cxx/parser/name-processor.hxx
+++ b/xsde/cxx/parser/name-processor.hxx
@@ -22,9 +22,10 @@ namespace CXX
{
public:
Void
- process (CLI::Options const& options,
+ process (CLI::Options const&,
XSDFrontend::SemanticGraph::Schema&,
- XSDFrontend::SemanticGraph::Path const& file);
+ XSDFrontend::SemanticGraph::Path const&,
+ Boolean deep);
};
}
}
diff --git a/xsde/cxx/parser/validator.cxx b/xsde/cxx/parser/validator.cxx
index 570a0bf..842fc4e 100644
--- a/xsde/cxx/parser/validator.cxx
+++ b/xsde/cxx/parser/validator.cxx
@@ -34,6 +34,8 @@ namespace CXX
subst_group_warning_issued (subst_group_warning_issued_),
subst_group_warning_issued_ (false)
{
+ if (disabled_warnings_.find ("all") != disabled_warnings_.end ())
+ disabled_warnings_all_ = true;
}
public: