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

Function getStepTokImpl

lib/astutils.cpp:894–908  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

892}
893
894template<class T, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
895static T* getStepTokImpl(T* tok)
896{
897 if (!tok)
898 return nullptr;
899 if (Token::Match(tok, "%name% ("))
900 return getStepTokImpl(tok->next());
901 if (tok->str() != "(")
902 return nullptr;
903 if (!Token::simpleMatch(tok->astOperand2(), ";"))
904 return nullptr;
905 if (!Token::simpleMatch(tok->astOperand2()->astOperand2(), ";"))
906 return nullptr;
907 return tok->astOperand2()->astOperand2()->astOperand2();
908}
909
910Token* getCondTok(Token* tok)
911{

Callers 1

getStepTokFunction · 0.85

Calls 4

nextMethod · 0.80
astOperand2Method · 0.80
simpleMatchFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected