mirror of
https://github.com/nasa/trick.git
synced 2025-06-14 05:08:22 +00:00
Introduce Open Dynamics Engine examples
I want Trick to parse and understand ODE header files. The ODE header files include some typedef constructs ICG was skipping. Added code to handle the typedefs we did not handle before. Also made a small change the way TRICK_ICG_EXCLDUE and TRICK_EXCLUDE are used so that they support excluding individual files as well as directories.
This commit is contained in:
@ -429,6 +429,9 @@ bool FieldVisitor::VisitTypedefType(clang::TypedefType *tt) {
|
||||
}
|
||||
|
||||
if ( tt->isEnumeralType() ) {
|
||||
if ( debug_level >= 4 ) {
|
||||
std::cout << " FieldVisitor VisitTypedefType enumerated" << std::endl ;
|
||||
}
|
||||
fdes->setEnumString("TRICK_ENUMERATED") ;
|
||||
fdes->setEnum(true) ;
|
||||
std::string enum_type_name = tt->desugar().getAsString() ;
|
||||
@ -534,8 +537,28 @@ bool FieldVisitor::VisitTypedefType(clang::TypedefType *tt) {
|
||||
fdes->setTypeName(type_name) ;
|
||||
fdes->setHasType(true) ;
|
||||
} else if ( tt->isBuiltinType() ) {
|
||||
if ( debug_level >= 4 ) {
|
||||
std::cout << " FieldVisitor VisitTypedefType builtintype" << std::endl ;
|
||||
}
|
||||
const clang::BuiltinType * bt = tt->getAs<clang::BuiltinType>() ;
|
||||
VisitBuiltinType((clang::BuiltinType *)bt) ;
|
||||
} else if ( tt->isArrayType() || tt->isPointerType()) {
|
||||
clang::QualType qt = tt->desugar() ;
|
||||
if ( debug_level >= 4 ) {
|
||||
std::cout << "Typedef to constant array type" << std::endl ;
|
||||
qt->dump() ;
|
||||
}
|
||||
// Calling visit type recursively with the typedeffed type
|
||||
TraverseType(qt) ;
|
||||
|
||||
if ( debug_level >= 4 ) {
|
||||
std::cout << "After TraverseType" << std::endl ;
|
||||
std::cout << *fdes << std::endl ;
|
||||
}
|
||||
} else {
|
||||
if ( debug_level >= 4 ) {
|
||||
std::cout << "Typedef to something we don't handle yet" << std::endl ;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user