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

Function compileScope

lib/tokenlist.cpp:924–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922}
923
924static void compileScope(Token *&tok, AST_state& state)
925{
926 compileTerm(tok, state);
927 while (tok) {
928 if (tok->str() == "::") {
929 const Token *lastOp = state.op.empty() ? nullptr : state.op.top();
930 if (Token::Match(lastOp, ":: %name%"))
931 lastOp = lastOp->next();
932 if (Token::Match(lastOp, "%name%") &&
933 (lastOp->next() == tok || (Token::Match(lastOp, "%name% <") && lastOp->linkAt(1) && tok == lastOp->linkAt(1)->next())))
934 compileBinOp(tok, state, compileTerm);
935 else
936 compileUnaryOp(tok, state, compileTerm);
937 } else break;
938 }
939}
940
941static bool isPrefixUnary(const Token* tok, bool cpp)
942{

Callers 1

compilePrecedence2Function · 0.85

Calls 7

compileTermFunction · 0.85
compileBinOpFunction · 0.85
compileUnaryOpFunction · 0.85
nextMethod · 0.80
linkAtMethod · 0.80
strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected