|
clang-tags
C/C++ source code indexing tool based on libclang
|
Base class for AST visitors. More...
#include <visitor.hxx>
Public Member Functions | |
| unsigned int | visitChildren (const Cursor &top) |
| visit an AST | |
| virtual CXChildVisitResult | visit (Cursor cursor, LibClang::Cursor parent)=0 |
| visit a cursor in the AST and decide what to do next | |
Base class for AST visitors.
This class provides the needed interface for visiting an Abstract Syntax Tree (AST). Every functor used to visit ASTs should derive from this using a CRTP, and specialize the visit() method.
Below is an example of a visitor functor printing the USR of all visited nodes:
|
pure virtual |
visit a cursor in the AST and decide what to do next
This method visits a Cursor in the AST, and returns a code indicating which action should be taken next:
CXChildVisit_Recurse: continue recursively visiting the ASTCXChildVisit_Continue: continue visiting the AST, but don't recurse into the current cursors childrenCXChildVisit_Break: stop traversing the AST| cursor | |
| parent |
Implemented in FindDefinition, and Indexer.
|
inline |
visit an AST
Visit an Abastract Syntax Tree (AST), starting from a top Cursor and recursively visiting its children. The visiting strategy and actions taken for each Cursor in the AST are defined by the visit() method.
| top | a Cursor representing the AST to visit |
1.8.1.2