clang_annotateTokens

\brief Annotate the given set of tokens by providing cursors for each token that can be mapped to a specific entity within the abstract syntax tree.

This token-annotation routine is equivalent to invoking clang_getCursor() for the source locations of each of the tokens. The cursors provided are filtered, so that only those cursors that have a direct correspondence to the token are accepted. For example, given a function call \c f(x), clang_getCursor() would provide the following cursors:

* when the cursor is over the 'f', a DeclRefExpr cursor referring to 'f'. * when the cursor is over the '(' or the ')', a CallExpr referring to 'f'. * when the cursor is over the 'x', a DeclRefExpr cursor referring to 'x'.

Only the first and last of these cursors will occur within the annotate, since the tokens "f" and "x' directly refer to a function and a variable, respectively, but the parentheses are just a small part of the full syntax of the function call expression, which is not provided as an annotation.

\param TU the translation unit that owns the given tokens.

\param Tokens the set of tokens to annotate.

\param NumTokens the number of tokens in \p Tokens.

\param Cursors an array of \p NumTokens cursors, whose contents will be replaced with the cursors corresponding to each token.

extern (C)
void
clang_annotateTokens
(
CXTranslationUnit TU
,,,
)

Meta