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

Function findExpression

lib/astutils.cpp:50–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48#include <utility>
49
50const Token* findExpression(const nonneg int exprid,
51 const Token* start,
52 const Token* end,
53 const std::function<bool(const Token*)>& pred)
54{
55 if (exprid == 0)
56 return nullptr;
57 if (!precedes(start, end))
58 return nullptr;
59 for (const Token* tok = start; tok != end; tok = tok->next()) {
60 if (tok->exprId() != exprid)
61 continue;
62 if (pred(tok))
63 return tok;
64 }
65 return nullptr;
66}
67
68static int findArgumentPosRecursive(const Token* tok, const Token* tokToFind, bool &found, nonneg int depth=0)
69{

Callers 3

beforeConditionMethod · 0.85
checkInnerScopeMethod · 0.85
findVariableChangedFunction · 0.85

Calls 4

precedesFunction · 0.85
nestedInFunctionFunction · 0.85
nextMethod · 0.80
scopeMethod · 0.80

Tested by

no test coverage detected