[xsd-users] cxx-parser: In typemap file,
C++ types are sometimes incorrectly namespaced
Boris Kolpackov
boris at codesynthesis.com
Mon Jan 5 09:59:38 EST 2009
Hi Jeroen,
Jeroen N. Witmond [Bahco] <jnw at xs4all.nl> writes:
> File mixed.map contains
> namespace "http://metadox.xs4all.nl/mixed" mixed
> {
> include <gmpxx.h>;
> binop ::mpz_class;
> operator_t action;
> }
> This results in compilation error: expected unqualified-id before '::'
> token, for instance on line "virtual mixed::::mpz_class post_binop () =
> 0;" in the generated pskel.hxx file.
The original idea of the C++ namespace for the XML Schema namespace was
to add it to every type in the namespace to save typing. There are a few
situations where this is not desirable. One is a fully-qualified name as
in your case. Another case is the use of fundamental types such as int,
long, etc. I was thinking of fixing this but then realized that it gets
a lot more complex when we consider things like const:
binop "const ::mpz_class*";
operator_t "const action*";
foo "const unsigned long*";
In other words we would need to parse the type in order to figure
out whether and where to add the namespace. I will need to think
some more about other possible complications before attempting to
fix this.
Thanks for reporting this!
Boris
More information about the xsd-users
mailing list