clang API Documentation
Maps string IDs to AST nodes matched by parts of a matcher. More...
#include <ASTMatchers.h>
Public Types | |
typedef internal::BoundNodesMap::IDToNodeMap | IDToNodeMap |
Type of mapping from binding identifiers to bound nodes. This type is an associative container with a key type of std::string and a value type of clang::ast_type_traits::DynTypedNode . | |
Public Member Functions | |
template<typename T > | |
const T * | getNodeAs (StringRef ID) const |
Returns the AST node bound to ID . | |
const IDToNodeMap & | getMap () const |
Retrieve mapping from binding identifiers to bound nodes. | |
template<typename T > | |
const T * | getDeclAs (StringRef ID) const |
Deprecated. Please use getNodeAs instead. | |
template<typename T > | |
const T * | getStmtAs (StringRef ID) const |
Friends | |
class | internal::BoundNodesTreeBuilder |
Maps string IDs to AST nodes matched by parts of a matcher.
The bound nodes are generated by calling bind
("id") on the node matchers of the nodes we want to access later.
The instances of BoundNodes are created by MatchFinder
when the user's callbacks are executed every time a match is found.
Definition at line 66 of file ASTMatchers.h.
typedef internal::BoundNodesMap::IDToNodeMap clang::ast_matchers::BoundNodes::IDToNodeMap |
Type of mapping from binding identifiers to bound nodes. This type is an associative container with a key type of std::string
and a value type of clang::ast_type_traits::DynTypedNode
.
Definition at line 92 of file ASTMatchers.h.
const T* clang::ast_matchers::BoundNodes::getDeclAs | ( | StringRef | ID | ) | const [inline] |
Deprecated. Please use getNodeAs
instead.
Definition at line 80 of file ASTMatchers.h.
const IDToNodeMap& clang::ast_matchers::BoundNodes::getMap | ( | ) | const [inline] |
Retrieve mapping from binding identifiers to bound nodes.
Definition at line 95 of file ASTMatchers.h.
const T* clang::ast_matchers::BoundNodes::getNodeAs | ( | StringRef | ID | ) | const [inline] |
Returns the AST node bound to ID
.
Returns NULL if there was no node bound to ID
or if there is a node but it cannot be converted to the specified type.
Definition at line 73 of file ASTMatchers.h.
const T* clang::ast_matchers::BoundNodes::getStmtAs | ( | StringRef | ID | ) | const [inline] |
Definition at line 84 of file ASTMatchers.h.
Referenced by clang::tooling::ReplaceStmtWithText::run(), clang::tooling::ReplaceStmtWithStmt::run(), and clang::tooling::ReplaceIfStmtWithItsBody::run().
friend class internal::BoundNodesTreeBuilder [friend] |
Definition at line 106 of file ASTMatchers.h.