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

Function findParent

lib/astutils.h:107–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105
106template<class TFunc>
107const Token* findParent(const Token* tok, const TFunc& pred)
108{
109 if (!tok)
110 return nullptr;
111 const Token* parent = tok->astParent();
112 while (parent && !pred(parent)) {
113 parent = parent->astParent();
114 }
115 return parent;
116}
117
118const Token* findExpression(nonneg int exprid,
119 const Token* start,

Callers 3

iscpp11init_implFunction · 0.85
setTokenValueFunction · 0.85

Calls 1

astParentMethod · 0.80

Tested by

no test coverage detected