diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-09-13 20:24:55 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-09-13 20:24:55 +0200 |
commit | 83c0c33a8ee9d5d5a7c83d4285f4a32594cb6c3f (patch) | |
tree | 8507eb8c0d5051f84b683a80dd1e403c5cd3c154 | |
parent | b4c3242a763e0461f454cc29be28c2ab26e4a495 (diff) |
Don't instantiate factories for abstract types in parsing functions
-rw-r--r-- | xsd/cxx/tree/parser-source.cxx | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/xsd/cxx/tree/parser-source.cxx b/xsd/cxx/tree/parser-source.cxx index c93368c..cf4d6cc 100644 --- a/xsd/cxx/tree/parser-source.cxx +++ b/xsd/cxx/tree/parser-source.cxx @@ -324,8 +324,16 @@ namespace CXX << "::xsd::cxx::tree::type_factory_map_instance< " << poly_plate << ", " << char_type << " > ().create (" << endl << strlit (e.name ()) << "," << endl - << strlit (e.namespace_().name ()) << "," << endl - << "&::xsd::cxx::tree::factory_impl< " << type << " >," << endl + << strlit (e.namespace_().name ()) << "," << endl; + + SemanticGraph::Complex* tc; + if ((tc = dynamic_cast<SemanticGraph::Complex*> (&t)) != 0 && + tc->abstract_p ()) + os << "0,"; + else + os << "&::xsd::cxx::tree::factory_impl< " << type << " >,"; + + os << endl << "true, true, e, n, f, 0));" << endl << "if (tmp.get () != 0)" @@ -416,8 +424,16 @@ namespace CXX << "::xsd::cxx::tree::type_factory_map_instance< " << poly_plate << ", " << char_type << " > ().create (" << endl << strlit (e.name ()) << "," << endl - << strlit (e.namespace_().name ()) << "," << endl - << "&::xsd::cxx::tree::factory_impl< " << type << " >," << endl + << strlit (e.namespace_().name ()) << "," << endl; + + SemanticGraph::Complex* tc; + if ((tc = dynamic_cast<SemanticGraph::Complex*> (&t)) != 0 && + tc->abstract_p ()) + os << "0,"; + else + os << "&::xsd::cxx::tree::factory_impl< " << type << " >,"; + + os << endl << "true, true, e, n, f, 0));" << endl << "if (tmp.get () != 0)" |