diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-02-24 15:16:26 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-02-24 15:16:26 +0200 |
commit | 707cc94fe52463870a9c6c8e2e66eaaa389e601d (patch) | |
tree | 13e10ff28bf4455d915f9d59b401bdbb62a393cb /tests/type-map |
Start tracking XSD/e with git after version 3.0.03.0.0
Diffstat (limited to 'tests/type-map')
-rw-r--r-- | tests/type-map/driver.cxx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/type-map/driver.cxx b/tests/type-map/driver.cxx new file mode 100644 index 0000000..ce54b86 --- /dev/null +++ b/tests/type-map/driver.cxx @@ -0,0 +1,47 @@ + std::ifstream is (argv[1]); + TypeMap::Lexer l (is, argv[1]); + + /* + for (TypeMap::Lexer::Token t (l.next ()); + t.type () != TypeMap::Lexer::Token::eos; + t = l.next ()) + { + e << t.line () << ": " << t.lexeme () << endl; + } + */ + + TypeMap::Parser p (l, argv[1]); + + TypeMap::Namespaces ns; + + if (!p.parse (ns)) + { + e << "failed" << endl; + return 1; + } + + for (TypeMap::Namespaces::ConstIterator n (type_map.begin ()); + n != type_map.end (); ++n) + { + wcerr << "namespace " << n->xsd_name () << " " << n->cxx_name () << endl + << "{" << endl; + + for (TypeMap::Namespace::IncludesIterator i (n->includes_begin ()); + i != n->includes_end (); ++i) + { + wcerr << "include " << *i << ";" << endl; + } + + for (TypeMap::Namespace::TypesIterator t (n->types_begin ()); + t != n->types_end (); ++t) + { + wcerr << "type " << t->xsd_name () << " " << t->cxx_ret_name (); + + if (t->cxx_arg_name ()) + wcerr << " " << t->cxx_arg_name (); + + wcerr << ";" << endl; + } + + wcerr << "}" << endl; + } |