[xsd-users] cxx-parser: In typemap file,
C++ types are sometimes incorrectly namespaced
Jeroen N. Witmond [Bahco]
jnw at xs4all.nl
Thu Jan 1 07:21:06 EST 2009
Happy New Year, everybody!
In XSD version 3.2.0, I came across a small problem in the handling of
namespaces for the C++ types in the typemap file. All source files needed
to reproduce this problem, including a Makefile, can be found in tarball
http://www.xs4all.nl/~jnw/codesynthesis/parser-typemap-namespace.tgz
This tarball expands in the current directory.
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 problem can be bypassed by splitting the content of the typemap file,
as shown in file split.map, which contains
namespace "http://metadox.xs4all.nl/mixed" mixed
{
operator_t action;
}
namespace "http://metadox.xs4all.nl/mixed"
{
include <gmpxx.h>;
binop ::mpz_class;
}
The code generated by XSD when using split.map compiles and executes as
well as should be expected without customizing the generated
implementation.
Regards,
Jeroen.
More information about the xsd-users
mailing list