Janosch Machowinski
2014-07-18 13:50:24 UTC
Hey,
I try to generate a typlib enum, but typelib throws an BadName()...
enum FOO
{
BAR = -5,
SEMMEL,
FOOBAR,
};
This is what I get from Clang:
TypeClassName Enum
DeclName FOO
Enum CONST BAR Value -5
Enum CONST SEMMEL Value -4
Enum CONST FOOBAR Value -3
This is the code I use to add the type :
Typelib::Enum *enumVal =new
Typelib::Enum(decl->getQualifiedNameAsString());
for(clang::EnumDecl::enumerator_iterator it =
decl->enumerator_begin(); it != decl->enumerator_end(); it++)
{
enumVal->add(it->getDeclName().getAsString(),
it->getInitVal().getSExtValue());
std::cout << "Enum CONST " << it->getDeclName().getAsString()
<< " Value " << it->getInitVal().getSExtValue() << std::endl;
}
registry.add(enumVal);
And this is my Error message :
terminate called after throwing an instance of 'Typelib::BadName'
what(): FOO is not a valid type name
I don't get the error, a enum should be allowed to be named FOO...
Greetings
Janosch
--
Dipl. Inf. Janosch Machowinski
SAR- & Sicherheitsrobotik
Universit?t Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Stra?e 1
28359 Bremen, Germany
Zentrale: +49 421 178 45-6611
Besuchsadresse der Nebengesch?ftstelle:
Robert-Hooke-Stra?e 5
28359 Bremen, Germany
Tel.: +49 421 178 45-6614
Empfang: +49 421 178 45-6600
Fax: +49 421 178 45-4150
E-Mail: jmachowinski at informatik.uni-bremen.de
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik
I try to generate a typlib enum, but typelib throws an BadName()...
enum FOO
{
BAR = -5,
SEMMEL,
FOOBAR,
};
This is what I get from Clang:
TypeClassName Enum
DeclName FOO
Enum CONST BAR Value -5
Enum CONST SEMMEL Value -4
Enum CONST FOOBAR Value -3
This is the code I use to add the type :
Typelib::Enum *enumVal =new
Typelib::Enum(decl->getQualifiedNameAsString());
for(clang::EnumDecl::enumerator_iterator it =
decl->enumerator_begin(); it != decl->enumerator_end(); it++)
{
enumVal->add(it->getDeclName().getAsString(),
it->getInitVal().getSExtValue());
std::cout << "Enum CONST " << it->getDeclName().getAsString()
<< " Value " << it->getInitVal().getSExtValue() << std::endl;
}
registry.add(enumVal);
And this is my Error message :
terminate called after throwing an instance of 'Typelib::BadName'
what(): FOO is not a valid type name
I don't get the error, a enum should be allowed to be named FOO...
Greetings
Janosch
--
Dipl. Inf. Janosch Machowinski
SAR- & Sicherheitsrobotik
Universit?t Bremen
FB 3 - Mathematik und Informatik
AG Robotik
Robert-Hooke-Stra?e 1
28359 Bremen, Germany
Zentrale: +49 421 178 45-6611
Besuchsadresse der Nebengesch?ftstelle:
Robert-Hooke-Stra?e 5
28359 Bremen, Germany
Tel.: +49 421 178 45-6614
Empfang: +49 421 178 45-6600
Fax: +49 421 178 45-4150
E-Mail: jmachowinski at informatik.uni-bremen.de
Weitere Informationen: http://www.informatik.uni-bremen.de/robotik