From b7197929af1cca15e490703ba3632ae52a348b60 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Oct 2010 12:21:35 +0200 Subject: New mapping for anyType with support for polymorphism --- xsde/xsde.cxx | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) (limited to 'xsde/xsde.cxx') diff --git a/xsde/xsde.cxx b/xsde/xsde.cxx index 2281ae9..476869e 100644 --- a/xsde/xsde.cxx +++ b/xsde/xsde.cxx @@ -499,12 +499,6 @@ main (Int argc, Char* argv[]) h_ops = new CXX::Hybrid::CLI::Options ( CLI::parse (CXX::Hybrid::Generator::options_spec (), args)); - if (h_ops->value ()) - p_ops = CXX::Hybrid::Generator::parser_options (*h_ops); - - if (h_ops->value ()) - s_ops = CXX::Hybrid::Generator::serializer_options (*h_ops); - show_sloc = h_ops->value (); } @@ -885,6 +879,18 @@ main (Int argc, Char* argv[]) // The first schema. Will be handled later. // root = &b->schema (); + + // Create parser/serializer options (we need a schema, any + // schema to do this). + // + if (gen_parser && !p_ops) + p_ops = CXX::Hybrid::Generator::parser_options ( + *h_ops, *root, b->path ()); + + if (gen_serializer && !s_ops) + s_ops = CXX::Hybrid::Generator::serializer_options ( + *h_ops, *root, b->path ()); + ++b; for (Schema::UsesIterator e (schema->uses_end ()); b != e; ++b) @@ -909,8 +915,21 @@ main (Int argc, Char* argv[]) } } else + { root = schema.get (); + // Create parser/serializer options (we need a schema, any + // schema to do this). + // + if (gen_parser && !p_ops) + p_ops = CXX::Hybrid::Generator::parser_options ( + *h_ops, *root, tu); + + if (gen_serializer && !s_ops) + s_ops = CXX::Hybrid::Generator::serializer_options ( + *h_ops, *root, tu); + } + // Generate mapping. // TypeMap::Namespaces parser_type_map, serializer_type_map; @@ -1157,6 +1176,17 @@ main (Int argc, Char* argv[]) ? s.context ().get ("renamed") : s.used_begin ()->path ()); + // Create parser/serializer options (we need a schema, any + // schema to do this). + // + if (gen_parser && !p_ops) + p_ops = CXX::Hybrid::Generator::parser_options ( + *h_ops, s, path); + + if (gen_serializer && !s_ops) + s_ops = CXX::Hybrid::Generator::serializer_options ( + *h_ops, s, path); + TypeMap::Namespaces parser_type_map, serializer_type_map; if (gen_hybrid) -- cgit v1.1