clang-tags
C/C++ source code indexing tool based on libclang
 All Classes Functions Variables Typedefs Groups Pages
Classes
LibClang++

C++ wrapper around libclang's C API. More...

Classes

class  LibClang::Cursor
 Node representing an entity in the AST. More...
class  LibClang::Index
 Set of translation units. More...
class  LibClang::SourceLocation
 Location in the source code. More...
class  LibClang::TranslationUnit
 Translation unit. More...
class  LibClang::Visitor< VISITOR >
 Base class for AST visitors. More...

Detailed Description

C++ wrapper around libclang's C API.

// Define the visitor class
class MyVisitor : public LibClang::Visitor<MyVisitor> {
public:
MyVisitor () { }
CXChildVisitResult visit (LibClang::Cursor cursor,
{
std::cerr << cursor.USR();
return CXChildVisit_Recurse;
}
};
// Use it to traverse a TranslationUnit
MyVisitor visitor;
TranslationUnit tu;
visitor.visitChildren (tu.cursor());