clang API Documentation
Typedefs | |
typedef enum CXChildVisitResult(* | CXCursorVisitor )(CXCursor cursor, CXCursor parent, CXClientData client_data) |
Visitor invoked for each cursor found by a traversal. | |
Enumerations | |
enum | CXChildVisitResult { CXChildVisit_Break, CXChildVisit_Continue, CXChildVisit_Recurse } |
Describes how the traversal of the children of a particular cursor should proceed after visiting a particular child cursor. More... | |
Functions | |
CINDEX_LINKAGE unsigned | clang_visitChildren (CXCursor parent, CXCursorVisitor visitor, CXClientData client_data) |
Visit the children of a particular cursor. |
These routines provide the ability to traverse the abstract syntax tree using cursors.
typedef enum CXChildVisitResult(* CXCursorVisitor)(CXCursor cursor, CXCursor parent, CXClientData client_data) |
Visitor invoked for each cursor found by a traversal.
This visitor function will be invoked for each cursor found by clang_visitCursorChildren(). Its first argument is the cursor being visited, its second argument is the parent visitor for that cursor, and its third argument is the client data provided to clang_visitCursorChildren().
The visitor should return one of the CXChildVisitResult
values to direct clang_visitCursorChildren().
enum CXChildVisitResult |
Describes how the traversal of the children of a particular cursor should proceed after visiting a particular child cursor.
A value of this enumeration type should be returned by each CXCursorVisitor
to indicate how clang_visitChildren() proceed.
CINDEX_LINKAGE unsigned clang_visitChildren | ( | CXCursor | parent, |
CXCursorVisitor | visitor, | ||
CXClientData | client_data | ||
) |
Visit the children of a particular cursor.
This function visits all the direct children of the given cursor, invoking the given visitor
function with the cursors of each visited child. The traversal may be recursive, if the visitor returns CXChildVisit_Recurse
. The traversal may also be ended prematurely, if the visitor returns CXChildVisit_Break
.
parent | the cursor whose child may be visited. All kinds of cursors can be visited, including invalid cursors (which, by definition, have no children). |
visitor | the visitor function that will be invoked for each child of parent . |
client_data | pointer data supplied by the client, which will be passed to the visitor each time it is invoked. |
CXChildVisit_Break
.