/* * typetreevisitor.cpp * * Created on: Jun 16, 2016 * Author: gregor */ #include #include "typetreevisitor.h" void TypeTreeVisitor::visitNode(gltb::RefPtr node) { if(dynamic_cast(node.getNakedPointer()) != nullptr) { gltb::RefPtr thisNamespace = dynamic_cast(node.getNakedPointer()); handleNamespace(thisNamespace); } else if(dynamic_cast(node.getNakedPointer()) != nullptr) { gltb::RefPtr thisClass = dynamic_cast(node.getNakedPointer()); handleClass(thisClass); } else if(dynamic_cast(node.getNakedPointer()) != nullptr) { gltb::RefPtr baseClassSpecifier = dynamic_cast(node.getNakedPointer()); handleBaseClassSpecifier(baseClassSpecifier); } else if(dynamic_cast(node.getNakedPointer()) != nullptr) { gltb::RefPtr typeRef = dynamic_cast(node.getNakedPointer()); handleTypeRef(typeRef); } // TODO implement the rest of this auto &children = node->getChildren(); for(auto iter = children.begin(); iter != children.end(); ++iter) { visitNode(iter->second); } }