MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / findAstNode

Function findAstNode

lib/astutils.h:93–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92template<class TFunc>
93const Token* findAstNode(const Token* ast, const TFunc& pred)
94{
95 const Token* result = nullptr;
96 visitAstNodes(ast, [&](const Token* tok) {
97 if (pred(tok)) {
98 result = tok;
99 return ChildrenToVisit::done;
100 }
101 return ChildrenToVisit::op1_and_op2;
102 });
103 return result;
104}
105
106template<class TFunc>
107const Token* findParent(const Token* tok, const TFunc& pred)

Callers 11

isExpressionFunction · 0.85
valueFlowForwardLifetimeFunction · 0.85
valueFlowSymbolicFunction · 0.85
valueFlowAfterAssignFunction · 0.85
isWritableFunction · 0.85
findMatchFunction · 0.85
checkKnownArgumentMethod · 0.85
stopOnConditionFunction · 0.85
reentersLoopFunction · 0.85
isAliasOfFunction · 0.85

Calls 1

visitAstNodesFunction · 0.85

Tested by

no test coverage detected