Cppcheck
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
Token Class Reference

The token list that the TokenList generates is a linked-list of this class. More...

#include <token.h>

Classes

struct  stringifyOptions
 

Public Types

enum  Type {
  eVariable , eType , eFunction , eKeyword ,
  eName , eNumber , eString , eChar ,
  eBoolean , eLiteral , eEnumerator , eArithmeticalOp ,
  eComparisonOp , eAssignmentOp , eLogicalOp , eBitOp ,
  eIncDecOp , eExtendedOp , eBracket , eLambda ,
  eEllipsis , eOther , eNone
}
 

Public Member Functions

 Token (const Token &)=delete
 
Tokenoperator= (const Token &)=delete
 
 Token (TokensFrontBack &tokensFrontBack)
 
 Token (const Token *tok)
 
 ~Token ()
 
ConstTokenRange until (const Token *t) const
 
template<typename T >
void str (T &&s)
 
void concatStr (std::string const &b)
 Concatenate two (quoted) strings. More...
 
const std::string & str () const
 
void deleteNext (nonneg int count=1)
 Unlink and delete the next 'count' tokens. More...
 
void deletePrevious (nonneg int count=1)
 Unlink and delete the previous 'count' tokens. More...
 
void swapWithNext ()
 Swap the contents of this token with the next token. More...
 
const TokentokAt (int index) const
 
TokentokAt (int index)
 
const TokenlinkAt (int index) const
 
TokenlinkAt (int index)
 
const std::string & strAt (int index) const
 
const ValueTypevalueType () const
 
void setValueType (ValueType *vt)
 
const ValueTypeargumentType () const
 
Token::Type tokType () const
 
void tokType (Token::Type t)
 
bool isKeyword () const
 
bool isName () const
 
bool isNameOnly () const
 
bool isUpperCaseName () const
 
bool isLiteral () const
 
bool isNumber () const
 
bool isEnumerator () const
 
bool isVariable () const
 
bool isOp () const
 
bool isConstOp () const
 
bool isExtendedOp () const
 
bool isArithmeticalOp () const
 
bool isComparisonOp () const
 
bool isAssignmentOp () const
 
bool isBoolean () const
 
bool isIncDecOp () const
 
bool isBinaryOp () const
 
bool isUnaryOp (const std::string &s) const
 
bool isUnaryPreOp () const
 
uint64_t flags () const
 
void flags (const uint64_t flags_)
 
bool isUnsigned () const
 
void isUnsigned (const bool sign)
 
bool isSigned () const
 
void isSigned (const bool sign)
 
bool isPointerCompare () const
 
void isPointerCompare (const bool b)
 
bool isLong () const
 
void isLong (bool size)
 
bool isStandardType () const
 
void isStandardType (const bool b)
 
bool isExpandedMacro () const
 
bool isCast () const
 
void isCast (bool c)
 
bool isAttributeConstructor () const
 
void isAttributeConstructor (const bool ac)
 
bool isAttributeDestructor () const
 
void isAttributeDestructor (const bool value)
 
bool isAttributeUnused () const
 
void isAttributeUnused (bool unused)
 
bool isAttributeUsed () const
 
void isAttributeUsed (const bool unused)
 
bool isAttributePure () const
 
void isAttributePure (const bool value)
 
bool isAttributeConst () const
 
void isAttributeConst (bool value)
 
bool isAttributeNoreturn () const
 
void isAttributeNoreturn (const bool value)
 
bool isAttributeNothrow () const
 
void isAttributeNothrow (const bool value)
 
bool isAttributeExport () const
 
void isAttributeExport (const bool value)
 
bool isAttributePacked () const
 
void isAttributePacked (const bool value)
 
bool isAttributeNodiscard () const
 
void isAttributeNodiscard (const bool value)
 
bool isAttributeMaybeUnused () const
 
void isAttributeMaybeUnused (const bool value)
 
void setCppcheckAttribute (TokenImpl::CppcheckAttributes::Type type, MathLib::bigint value)
 
bool getCppcheckAttribute (TokenImpl::CppcheckAttributes::Type type, MathLib::bigint &value) const
 
bool hasCppcheckAttributes () const
 
bool isControlFlowKeyword () const
 
bool isOperatorKeyword () const
 
void isOperatorKeyword (const bool value)
 
bool isComplex () const
 
void isComplex (const bool value)
 
bool isEnumType () const
 
void isEnumType (const bool value)
 
bool isAtAddress () const
 
void isAtAddress (bool b)
 
bool isIncompleteVar () const
 
void isIncompleteVar (bool b)
 
bool isSimplifiedTypedef () const
 
void isSimplifiedTypedef (bool b)
 
bool isIncompleteConstant () const
 
void isIncompleteConstant (bool b)
 
bool isConstexpr () const
 
void isConstexpr (bool b)
 
bool isExternC () const
 
void isExternC (bool b)
 
bool isSplittedVarDeclComma () const
 
void isSplittedVarDeclComma (bool b)
 
bool isSplittedVarDeclEq () const
 
void isSplittedVarDeclEq (bool b)
 
bool isImplicitInt () const
 
void isImplicitInt (bool b)
 
bool isInline () const
 
void isInline (bool b)
 
bool isAtomic () const
 
void isAtomic (bool b)
 
bool isRestrict () const
 
void isRestrict (bool b)
 
bool isRemovedVoidParameter () const
 
void setRemovedVoidParameter (bool b)
 
bool isTemplate () const
 
void isTemplate (bool b)
 
bool isSimplifiedScope () const
 
void isSimplifiedScope (bool b)
 
bool isFinalType () const
 
void isFinalType (bool b)
 
bool isInitComma () const
 
void isInitComma (bool b)
 
bool isBitfield () const
 
unsigned char bits () const
 
const std::set< TemplateSimplifier::TokenAndName * > * templateSimplifierPointers () const
 
std::set< TemplateSimplifier::TokenAndName * > * templateSimplifierPointers ()
 
void templateSimplifierPointer (TemplateSimplifier::TokenAndName *tokenAndName)
 
void setBits (const unsigned char b)
 
bool isUtf8 () const
 
bool isUtf16 () const
 
bool isUtf32 () const
 
bool isCChar () const
 
bool isCMultiChar () const
 
bool isTemplateArg () const
 Is current token a template argument? More...
 
void isTemplateArg (const bool value)
 
std::string getMacroName () const
 
void setMacroName (std::string name)
 
nonneg int fileIndex () const
 
void fileIndex (nonneg int indexOfFile)
 
nonneg int linenr () const
 
void linenr (nonneg int lineNumber)
 
nonneg int column () const
 
void column (nonneg int c)
 
Tokennext ()
 
const Tokennext () const
 
TokeninsertToken (const std::string &tokenStr, const std::string &originalNameStr=emptyString, const std::string &macroNameStr=emptyString, bool prepend=false)
 Insert new token after this token. More...
 
TokeninsertTokenBefore (const std::string &tokenStr, const std::string &originalNameStr=emptyString, const std::string &macroNameStr=emptyString)
 
Tokenprevious ()
 
const Tokenprevious () const
 
nonneg int varId () const
 
void varId (nonneg int id)
 
nonneg int exprId () const
 
void exprId (nonneg int id)
 
void setUniqueExprId ()
 
bool isUniqueExprId () const
 
void printOut (const char *title=nullptr) const
 For debugging purposes, prints token and all tokens followed by it. More...
 
void printOut (const char *title, const std::vector< std::string > &fileNames) const
 For debugging purposes, prints token and all tokens followed by it. More...
 
void printLines (int lines=5) const
 print out tokens - used for debugging More...
 
std::string stringify (const stringifyOptions &options) const
 
std::string stringify (bool varid, bool attributes, bool macro) const
 Stringify a token. More...
 
std::string stringifyList (const stringifyOptions &options, const std::vector< std::string > *fileNames=nullptr, const Token *end=nullptr) const
 
std::string stringifyList (const Token *end, bool attributes=true) const
 
std::string stringifyList (bool varid=false) const
 
std::string stringifyList (bool varid, bool attributes, bool linenumbers, bool linebreaks, bool files, const std::vector< std::string > *fileNames=nullptr, const Token *end=nullptr) const
 Stringify a list of token, from current instance on. More...
 
void deleteThis ()
 Remove the contents for this token from the token list. More...
 
void link (Token *linkToToken)
 Create link to given token. More...
 
const Tokenlink () const
 Return token where this token links to. More...
 
Tokenlink ()
 
void scope (const Scope *s)
 Associate this token with given scope. More...
 
const Scopescope () const
 
void function (const Function *f)
 Associate this token with given function. More...
 
const Functionfunction () const
 
void variable (const Variable *v)
 Associate this token with given variable. More...
 
const Variablevariable () const
 
void type (const ::Type *t)
 Associate this token with given type. More...
 
const ::Typetype () const
 
const Enumeratorenumerator () const
 
void enumerator (const Enumerator *e)
 Associate this token with given enumerator. More...
 
std::string strValue () const
 This can be called only for tokens that are strings, else the assert() is called. More...
 
nonneg int progressValue () const
 Get progressValue (0 - 100) More...
 
const TokennextArgument () const
 
TokennextArgument ()
 
const TokennextArgumentBeforeCreateLinks2 () const
 
const TokennextTemplateArgument () const
 
const TokenfindClosingBracket () const
 Returns the closing bracket of opening '<'. More...
 
TokenfindClosingBracket ()
 
const TokenfindOpeningBracket () const
 
TokenfindOpeningBracket ()
 
const std::string & originalName () const
 
const std::list< ValueFlow::Value > & values () const
 
template<typename T >
void originalName (T &&name)
 Sets the original name. More...
 
bool hasKnownIntValue () const
 
bool hasKnownValue () const
 
bool hasKnownValue (ValueFlow::Value::ValueType t) const
 
bool hasKnownSymbolicValue (const Token *tok) const
 
const ValueFlow::ValuegetKnownValue (ValueFlow::Value::ValueType t) const
 
MathLib::bigint getKnownIntValue () const
 
const ValueFlow::ValuegetValue (const MathLib::bigint val) const
 
const ValueFlow::ValuegetMaxValue (bool condition, MathLib::bigint path=0) const
 
const ValueFlow::ValuegetMinValue (bool condition, MathLib::bigint path=0) const
 
const ValueFlow::ValuegetMovedValue () const
 
const ValueFlow::ValuegetValueLE (const MathLib::bigint val, const Settings &settings) const
 
const ValueFlow::ValuegetValueGE (const MathLib::bigint val, const Settings &settings) const
 
const ValueFlow::ValuegetInvalidValue (const Token *ftok, nonneg int argnr, const Settings &settings) const
 
const ValueFlow::ValuegetContainerSizeValue (const MathLib::bigint val) const
 
const TokengetValueTokenMaxStrLength () const
 
const TokengetValueTokenMinStrSize (const Settings &settings, MathLib::bigint *path=nullptr) const
 
bool addValue (const ValueFlow::Value &value)
 Add token value. More...
 
void removeValues (std::function< bool(const ValueFlow::Value &)> pred)
 
nonneg int index () const
 
void assignIndexes ()
 
void astOperand1 (Token *tok)
 
void astOperand2 (Token *tok)
 
void astParent (Token *tok)
 
TokenastOperand1 ()
 
const TokenastOperand1 () const
 
TokenastOperand2 ()
 
const TokenastOperand2 () const
 
TokenastParent ()
 
const TokenastParent () const
 
TokenastSibling ()
 
const TokenastSibling () const
 
TokenastTop ()
 
const TokenastTop () const
 
std::pair< const Token *, const Token * > findExpressionStartEndTokens () const
 
bool isCalculation () const
 Is current token a calculation? Only true for operands. More...
 
void clearValueFlow ()
 
std::string astString (const char *sep="") const
 
std::string astStringVerbose () const
 
std::string astStringZ3 () const
 
std::string expressionString () const
 
void printAst (bool verbose, bool xml, const std::vector< std::string > &fileNames, std::ostream &out) const
 
void printValueFlow (bool xml, std::ostream &out) const
 
void scopeInfo (std::shared_ptr< ScopeInfo2 > newScopeInfo)
 
std::shared_ptr< ScopeInfo2scopeInfo () const
 
void setCpp11init (bool cpp11init) const
 
TokenImpl::Cpp11init isCpp11init () const
 
TokenDebug getTokenDebug () const
 
void setTokenDebug (TokenDebug td)
 
bool isCpp () const
 
bool isC () const
 

Static Public Member Functions

template<size_t count>
static bool simpleMatch (const Token *tok, const char(&pattern)[count])
 Match given token (or list of tokens) to a pattern list. More...
 
static bool simpleMatch (const Token *tok, const char pattern[], size_t pattern_len)
 
static bool Match (const Token *tok, const char pattern[], nonneg int varid=0)
 Match given token (or list of tokens) to a pattern list. More...
 
static nonneg int getStrLength (const Token *tok)
 
static nonneg int getStrArraySize (const Token *tok)
 
static nonneg int getStrSize (const Token *tok, const Settings &settings)
 
template<size_t count>
static const Tokenfindsimplematch (const Token *const startTok, const char(&pattern)[count])
 
static const Tokenfindsimplematch (const Token *const startTok, const char pattern[], size_t pattern_len)
 
template<size_t count>
static const Tokenfindsimplematch (const Token *const startTok, const char(&pattern)[count], const Token *const end)
 
static const Tokenfindsimplematch (const Token *const startTok, const char pattern[], size_t pattern_len, const Token *const end)
 
static const Tokenfindmatch (const Token *const startTok, const char pattern[], const nonneg int varId=0)
 
static const Tokenfindmatch (const Token *const startTok, const char pattern[], const Token *const end, const nonneg int varId=0)
 
template<size_t count>
static Tokenfindsimplematch (Token *const startTok, const char(&pattern)[count])
 
static Tokenfindsimplematch (Token *const startTok, const char pattern[], size_t pattern_len)
 
template<size_t count>
static Tokenfindsimplematch (Token *const startTok, const char(&pattern)[count], const Token *const end)
 
static Tokenfindsimplematch (Token *const startTok, const char pattern[], size_t pattern_len, const Token *const end)
 
static Tokenfindmatch (Token *const startTok, const char pattern[], const nonneg int varId=0)
 
static Tokenfindmatch (Token *const startTok, const char pattern[], const Token *const end, const nonneg int varId=0)
 
static void eraseTokens (Token *begin, const Token *end)
 Delete tokens between begin and end. More...
 
static void replace (Token *replaceThis, Token *start, Token *end)
 Replace token replaceThis with tokens between start and end, including start and end. More...
 
static const ::TypetypeOf (const Token *tok, const Token **typeTok=nullptr)
 
static std::pair< const Token *, const Token * > typeDecl (const Token *tok, bool pointedToType=false)
 
static std::string typeStr (const Token *tok)
 
static void createMutualLinks (Token *begin, Token *end)
 Links two elements against each other. More...
 
static void move (Token *srcStart, Token *srcEnd, Token *newLocation)
 Move srcStart and srcEnd tokens and all tokens between them into new a location. More...
 
static void assignProgressValues (Token *tok)
 Calculate progress values for all tokens. More...
 

Private Types

enum  : uint64_t {
  fIsUnsigned = (1ULL << 0) , fIsSigned = (1ULL << 1) , fIsPointerCompare = (1ULL << 2) , fIsLong = (1ULL << 3) ,
  fIsStandardType = (1ULL << 4) , fIsCast = (1ULL << 6) , fIsAttributeConstructor = (1ULL << 7) , fIsAttributeDestructor = (1ULL << 8) ,
  fIsAttributeUnused = (1ULL << 9) , fIsAttributePure = (1ULL << 10) , fIsAttributeConst = (1ULL << 11) , fIsAttributeNoreturn = (1ULL << 12) ,
  fIsAttributeNothrow = (1ULL << 13) , fIsAttributeUsed = (1ULL << 14) , fIsAttributePacked = (1ULL << 15) , fIsAttributeExport = (1ULL << 16) ,
  fIsAttributeMaybeUnused = (1ULL << 17) , fIsAttributeNodiscard = (1ULL << 18) , fIsControlFlowKeyword = (1ULL << 19) , fIsOperatorKeyword = (1ULL << 20) ,
  fIsComplex = (1ULL << 21) , fIsEnumType = (1ULL << 22) , fIsName = (1ULL << 23) , fIsLiteral = (1ULL << 24) ,
  fIsTemplateArg = (1ULL << 25) , fAtAddress = (1ULL << 26) , fIncompleteVar = (1ULL << 27) , fConstexpr = (1ULL << 28) ,
  fExternC = (1ULL << 29) , fIsSplitVarDeclComma = (1ULL << 30) , fIsSplitVarDeclEq = (1ULL << 31) , fIsImplicitInt = (1ULL << 32) ,
  fIsInline = (1ULL << 33) , fIsTemplate = (1ULL << 34) , fIsSimplifedScope = (1ULL << 35) , fIsRemovedVoidParameter = (1ULL << 36) ,
  fIsIncompleteConstant = (1ULL << 37) , fIsRestrict = (1ULL << 38) , fIsAtomic = (1ULL << 39) , fIsSimplifiedTypedef = (1ULL << 40) ,
  fIsFinalType = (1ULL << 41) , fIsInitComma = (1ULL << 42)
}
 
enum  : uint64_t { efMaxSize = sizeof(nonneg int) * 8 , efIsUnique = efMaxSize - 2 }
 

Private Member Functions

void next (Token *nextToken)
 
void previous (Token *previousToken)
 
void takeData (Token *fromToken)
 used by deleteThis() to take data from token to delete More...
 
bool getFlag (uint64_t flag_) const
 Get specified flag state. More...
 
void setFlag (uint64_t flag_, bool state_)
 Set specified flag state. More...
 
void update_property_info ()
 Updates internal property cache like _isName or _isBoolean. More...
 
void update_property_isStandardType ()
 Update internal property cache about isStandardType() More...
 
void update_property_char_string_literal ()
 Update internal property cache about string and char literals. More...
 
void astStringVerboseRecursive (std::string &ret, const nonneg int indent1=0, const nonneg int indent2=0) const
 Internal helper function to avoid excessive string allocations. More...
 

Static Private Member Functions

static int multiCompare (const Token *tok, const char *haystack, nonneg int varid)
 Needle is build from multiple alternatives. More...
 
static bool firstWordEquals (const char *str, const char *word)
 Works almost like strcmp() except returns only true or false and if str has empty space ' ' character, that character is handled as if it were '\0'. More...
 
static const char * chrInFirstWord (const char *str, char c)
 Works almost like strchr() except if str has empty space ' ' character, that character is handled as if it were '\0'. More...
 

Private Attributes

TokensFrontBackmTokensFrontBack
 
std::string mStr
 
TokenmNext {}
 
TokenmPrevious {}
 
TokenmLink {}
 
Token::Type mTokType = eNone
 
uint64_t mFlags {}
 
TokenImplmImpl {}
 

Friends

class TestToken
 

Detailed Description

The token list that the TokenList generates is a linked-list of this class.

Tokens are stored as strings. The "if", "while", etc are stored in plain text. The reason the Token class is needed (instead of using the string class) is that some extra functionality is also needed for tokens:

The Token class also has other functions for management of token list, matching tokens, etc.

Definition at line 150 of file token.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : uint64_t
private
Enumerator
fIsUnsigned 
fIsSigned 
fIsPointerCompare 
fIsLong 
fIsStandardType 
fIsCast 
fIsAttributeConstructor 
fIsAttributeDestructor 
fIsAttributeUnused 
fIsAttributePure 
fIsAttributeConst 
fIsAttributeNoreturn 
fIsAttributeNothrow 
fIsAttributeUsed 
fIsAttributePacked 
fIsAttributeExport 
fIsAttributeMaybeUnused 
fIsAttributeNodiscard 
fIsControlFlowKeyword 
fIsOperatorKeyword 
fIsComplex 
fIsEnumType 
fIsName 
fIsLiteral 
fIsTemplateArg 
fAtAddress 
fIncompleteVar 
fConstexpr 
fExternC 
fIsSplitVarDeclComma 
fIsSplitVarDeclEq 
fIsImplicitInt 
fIsInline 
fIsTemplate 
fIsSimplifedScope 
fIsRemovedVoidParameter 
fIsIncompleteConstant 
fIsRestrict 
fIsAtomic 
fIsSimplifiedTypedef 
fIsFinalType 
fIsInitComma 

Definition at line 1285 of file token.h.

◆ anonymous enum

anonymous enum : uint64_t
private
Enumerator
efMaxSize 
efIsUnique 

Definition at line 1331 of file token.h.

◆ Type

Enumerator
eVariable 
eType 
eFunction 
eKeyword 
eName 
eNumber 
eString 
eChar 
eBoolean 
eLiteral 
eEnumerator 
eArithmeticalOp 
eComparisonOp 
eAssignmentOp 
eLogicalOp 
eBitOp 
eIncDecOp 
eExtendedOp 
eBracket 
eLambda 
eEllipsis 
eOther 
eNone 

Definition at line 160 of file token.h.

Constructor & Destructor Documentation

◆ Token() [1/3]

Token::Token ( const Token )
delete

Referenced by insertToken().

◆ Token() [2/3]

Token::Token ( TokensFrontBack tokensFrontBack)
explicit

Definition at line 60 of file token.cpp.

References mImpl.

◆ Token() [3/3]

Token::Token ( const Token tok)
explicit

Definition at line 66 of file token.cpp.

References fileIndex(), and linenr().

◆ ~Token()

Token::~Token ( )

Definition at line 73 of file token.cpp.

References mImpl.

Member Function Documentation

◆ addValue()

bool Token::addValue ( const ValueFlow::Value value)

◆ argumentType()

const ValueType* Token::argumentType ( ) const
inline

Definition at line 336 of file token.h.

References astParent(), Match(), mImpl, and TokenImpl::mValueType.

Referenced by CheckIO::ArgumentInfo::ArgumentInfo().

◆ assignIndexes()

void Token::assignIndexes ( )

◆ assignProgressValues()

void Token::assignProgressValues ( Token tok)
static

Calculate progress values for all tokens.

Definition at line 2307 of file token.cpp.

References next().

Referenced by TokenList::createTokens(), and Tokenizer::simplifyTokenList1().

◆ astOperand1() [1/3]

Token* Token::astOperand1 ( )
inline

Definition at line 1378 of file token.h.

Referenced by astStringZ3(), and isUnaryPreOp().

◆ astOperand1() [2/3]

const Token* Token::astOperand1 ( ) const
inline

Definition at line 1381 of file token.h.

◆ astOperand1() [3/3]

void Token::astOperand1 ( Token tok)

Definition at line 1456 of file token.cpp.

References astParent(), astTop(), TokenImpl::mAstOperand1, and mImpl.

Referenced by ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyzeCondition(), ValueFlowAnalyzer::analyzeLifetime(), ValueFlowAnalyzer::analyzeToken(), CheckNullPointer::arithmetic(), CheckBufferOverrun::arrayIndex(), arrayIndexMessage(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySizeAfterValueFlow(), CheckAutoVariables::assignFunctionArg(), astCount(), astHasExpr(), astHasVar(), astIsLHS(), astIsRHS(), astIsVariableComparison(), astParent(), astStringXml(), bifurcate(), CheckBufferOverrun::bufferOverflow(), CheckCondition::checkBadBitmaskCheck(), CheckOther::checkComparePointers(), CheckCondition::checkCompareValueOutOfTypeRange(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckBool::checkComparisonOfBoolWithInt(), CheckBool::checkComparisonOfFuncReturningBool(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckUninitVar::checkExpr(), CheckStl::checkFindInsert(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckCondition::checkIncorrectLogicOperator(), CheckCondition::checkInvalidTestForOverflow(), CheckType::checkLongCast(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckOther::checkOverlappingWrite(), CheckCondition::checkPointerAdditionResultNotNull(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckOther::checkRedundantPointerOp(), CheckClass::checkReturnPtrThis(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckType::checkSignConversion(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckString::checkSuspiciousStringCompare(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckAssert::checkVariableAssignment(), CheckOther::checkVariableScope(), CheckOther::clarifyCalculation(), CheckOther::clarifyStatement(), CheckCondition::comparison(), CheckOther::comparisonNonZeroExpressionLessThanZero(), conditionAlwaysTrueOrFalse(), conditionString(), CheckOther::constStatementError(), SymbolDatabase::createSymbolDatabaseExprIds(), createTokenFromExpression(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensCall(), clangimport::AstNode::createTokensVarDecl(), derefShared(), Tokenizer::dump(), exprDependsOnThis(), extractForLoopValues(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findArgumentPosRecursive(), findConstructor(), SymbolDatabase::findEnumerator(), findExpressionStartEndTokens(), SymbolDatabase::findFunction(), Scope::findFunction(), findInsertValue(), followAllReferences(), PathAnalysis::forwardRecursive(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), getAddressContainer(), CheckMemoryLeak::getAllocationType(), Library::getAllocFuncInfo(), getArgumentPos(), getArgumentStart(), getAstParentSkipPossibleCastAndAddressOf(), getBufAndOffset(), getCastTypeStartToken(), Library::getContainerFromAction(), getContainerFromSize(), Library::getContainerFromYield(), getContainerSizeFromConstructorArgs(), Library::getContainerYield(), getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getDeallocFuncInfo(), getExpressionRange(), getExprUsage(), CTU::getFileInfo(), Library::getFunctionName(), getIteratorExpression(), getLHSVariable(), getLHSVariableRecursive(), getLHSVariables(), getLHSVariablesRecursive(), getLHSVariableToken(), getLibraryContainer(), getLifetimeTokens(), getnumchildren(), getOperatorFunction(), getParentLifetimeObject(), getParentMember(), getParentVar(), CheckMemoryLeak::getReallocationType(), Library::getReallocFuncInfo(), getSingleFunctionCall(), getSingleReturnVar(), hasFunctionCall(), hasGccCompoundStatement(), hasNoreturnFunction(), FwdAnalysis::hasOperand(), hasVarIds(), if_findCompare(), ifvar(), innerSmtString(), CheckStl::invalidContainer(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), isAddressOfLocalVariable(), isAutoVarArray(), isBracketAccess(), isCalculation(), isCallFunction(), isConstExpression(), isConstFunctionCall(), isConstStatement(), isConstVarExpression(), CheckStl::isContainerSize(), CheckStl::isContainerSizeGE(), Library::isContainerYield(), isCPPCast(), FwdAnalysis::isEscapedAlias(), isExpression(), isForLoopCondition(), isGlobalData(), isIfConstexpr(), isInConstructorList(), isIntegralOrPointer(), isLikelyStreamRead(), isLocalContainerBuffer(), isMapFind(), CheckUninitVar::isMemberVariableUsage(), isMoveOrForward(), SymbolicConditionHandler::isNegatedBool(), isNonConstFunctionCall(), isNullOperand(), isOperandExpanded(), isOppositeCond(), isOppositeExpression(), CheckCondition::isOverlappingCond(), CheckNullPointer::isPointerDeRef(), isSameExpression(), Library::isScopeNoReturn(), isSimpleExpr(), isTemporary(), isThisChanged(), isUniqueExpression(), isUsedAsBool(), isVarDeclOp(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableExpression(), isVariableInit(), CheckUninitVar::isVariableUsage(), isVariableUsed(), isVarUsedInTree(), isVLAIndex(), isVoidStmt(), SubExpressionAnalyzer::match(), minmaxCompare(), minUnsignedValue(), CheckStl::mismatchingContainerIterator(), CheckCondition::multiCondition2(), CheckBufferOverrun::negativeArraySize(), notvar(), CheckBufferOverrun::objectIndex(), CheckString::overlappingStrcmp(), SimpleConditionHandler::parse(), IteratorConditionHandler::parse(), SymbolicConditionHandler::parse(), ContainerConditionHandler::parse(), parseBinaryIntOp(), parseCompareEachInt(), parseComparison(), CheckBool::pointerArithBool(), CheckBool::pointerArithBoolCond(), CheckBufferOverrun::pointerArithmetic(), FwdAnalysis::possiblyAliased(), programMemoryParseCondition(), CheckLeakAutoVar::ret(), setTokenValue(), ValueFlow::setValues(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), singleAssignInScope(), singleMemberCallInScope(), skipLocalVars(), SymbolicConditionHandler::skipNot(), CheckString::sprintfOverlappingData(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckSizeof::suspiciousSizeofCalculation(), CheckOther::testIfNonZeroExpressionIsPositive(), truncateImplicitConversion(), typeDecl(), typeOf(), FwdAnalysis::unusedValue(), useFunctionArgs(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowArrayElement(), valueFlowBitAnd(), ValueFlow::valueFlowConstantFoldAST(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForwardLifetime(), valueFlowFunctionReturn(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowLifetime(), valueFlowLifetimeUserConstructor(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSameExpressions(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSymbolic(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), and valueFlowUnknownFunctionReturn().

◆ astOperand2() [1/3]

Token* Token::astOperand2 ( )
inline

Definition at line 1384 of file token.h.

Referenced by astStringZ3(), isCalculation(), and isUnaryPreOp().

◆ astOperand2() [2/3]

const Token* Token::astOperand2 ( ) const
inline

Definition at line 1387 of file token.h.

◆ astOperand2() [3/3]

void Token::astOperand2 ( Token tok)

Definition at line 1468 of file token.cpp.

References astParent(), astTop(), TokenImpl::mAstOperand2, and mImpl.

Referenced by ConditionHandler::afterCondition(), ValueFlowAnalyzer::analyzeCondition(), CheckBufferOverrun::argumentSize(), CheckNullPointer::arithmetic(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndex(), Tokenizer::arraySizeAfterValueFlow(), astCount(), astHasExpr(), astHasVar(), astIsLHS(), astIsRHS(), astIsVariableComparison(), astParent(), astSibling(), astStringXml(), bifurcate(), CheckBufferOverrun::bufferOverflow(), CheckCondition::checkBadBitmaskCheck(), CheckOther::checkCharVariable(), CheckOther::checkComparePointers(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckBool::checkComparisonOfBoolWithInt(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckIO::checkCoutCerrMisusage(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckUninitVar::checkExpr(), CheckStl::checkFindInsert(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckCondition::checkIncorrectLogicOperator(), CheckOther::checkKnownArgument(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckOther::checkOverlappingWrite(), CheckCondition::checkPointerAdditionResultNotNull(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckUninitVar::checkRhs(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckString::checkSuspiciousStringCompare(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkVariableScope(), CheckCondition::comparison(), CheckOther::comparisonNonZeroExpressionLessThanZero(), conditionAlwaysTrueOrFalse(), conditionString(), CheckOther::constStatementError(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensCall(), clangimport::AstNode::createTokensVarDecl(), Tokenizer::dump(), CheckCondition::duplicateCondition(), exprDependsOnThis(), extractForLoopValues(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findArgumentPosRecursive(), findExpressionStartEndTokens(), findInsertValue(), followAllReferences(), PathAnalysis::forwardRecursive(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), getAddressContainer(), Library::getAllocFuncInfo(), getArgumentPos(), getArgumentStart(), getAstParentSkipPossibleCastAndAddressOf(), getBufAndOffset(), getCastTypeStartToken(), Library::getContainerFromAction(), Library::getContainerFromYield(), getContainerIndex(), getContainerSizeFromConstructorArgs(), Library::getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getDeallocFuncInfo(), getDimensionsEtc(), getEnumType(), getExpressionRange(), Library::getFunctionName(), getInitListSize(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLifetimeTokens(), getLoopContainer(), getnumchildren(), getOperatorFunction(), getOverrunIndexValues(), getParentMember(), Library::getReallocFuncInfo(), getVariableInitExpression(), Scope::getVariableList(), getVariableValues(), hasFunctionCall(), hasGccCompoundStatement(), hasNoreturnFunction(), FwdAnalysis::hasOperand(), hasVarIds(), CheckStl::if_find(), if_findCompare(), ifvar(), CheckOther::invalidPointerCast(), isAddressOfLocalVariable(), isArray(), isAutoVarArray(), isBasicForLoop(), isBracketAccess(), isCalculation(), isConstExpression(), isConstStatement(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSizeGE(), Library::isContainerYield(), isCPPCast(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isEscapedReference(), isExpression(), isForLoopIncrement(), isInConstructorList(), isIntegralOrPointer(), isLeafDot(), isLikelyStreamRead(), isLocalContainerBuffer(), isMapFind(), isNullablePointer(), isNullOperand(), isOperandExpanded(), isOppositeCond(), CheckCondition::isOverlappingCond(), CheckNullPointer::isPointerDeRef(), isRangeForScope(), isSameExpression(), isSimpleExpr(), isStrlenOf(), isTemporary(), isType(), isUniqueExpression(), isVarDeclOp(), isVariableChangedByFunctionCall(), isVariableExpression(), isVariableInit(), isVariableUsed(), isVarUsedInTree(), isVLAIndex(), isWithoutSideEffects(), ValueFlowAnalyzer::isWritable(), ContainerExpressionAnalyzer::isWritable(), isZeroBoundCond(), CheckStl::knownEmptyContainer(), lifetimeType(), minUnsignedValue(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), CheckBufferOverrun::negativeArraySize(), CheckStl::negativeIndex(), notvar(), CheckBufferOverrun::objectIndex(), SimpleConditionHandler::parse(), IteratorConditionHandler::parse(), SymbolicConditionHandler::parse(), ContainerConditionHandler::parse(), parseBinaryIntOp(), parseCompareEachInt(), parseComparison(), CheckBool::pointerArithBool(), CheckBool::pointerArithBoolCond(), CheckBufferOverrun::pointerArithmetic(), FwdAnalysis::possiblyAliased(), programMemoryParseCondition(), CheckLeakAutoVar::ret(), CheckFunctions::returnLocalStdMove(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), CheckString::sprintfOverlappingData(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckBufferOverrun::stringNotZeroTerminated(), CheckString::strPlusCharError(), CheckSizeof::suspiciousSizeofCalculation(), CheckOther::testIfNonZeroExpressionIsPositive(), truncateImplicitConversion(), typeDecl(), typeOf(), useFunctionArgs(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowAfterSwap(), valueFlowArrayElement(), valueFlowBitAnd(), valueFlowConditionExpressions(), ValueFlow::valueFlowConstantFoldAST(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowEnumValue(), valueFlowForLoop(), valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForwardLifetime(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowLifetimeUserConstructor(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSameExpressions(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSymbolic(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), and ContainerExpressionAnalyzer::writeValue().

◆ astParent() [1/3]

Token* Token::astParent ( )
inline

Definition at line 1390 of file token.h.

Referenced by astParent().

◆ astParent() [2/3]

const Token* Token::astParent ( ) const
inline

Definition at line 1393 of file token.h.

◆ astParent() [3/3]

void Token::astParent ( Token tok)

Definition at line 1437 of file token.cpp.

References astOperand1(), astOperand2(), astParent(), TokenImpl::mAstOperand1, TokenImpl::mAstOperand2, TokenImpl::mAstParent, and mImpl.

Referenced by ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyzeLifetime(), ValueFlowAnalyzer::analyzeMatch(), ValueFlowAnalyzer::analyzeToken(), CheckIO::ArgumentInfo::ArgumentInfo(), argumentType(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), assignExpr(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astHasToken(), astIsLHS(), astIsLhs(), astIsRangeBasedForDecl(), astIsRHS(), astIsRhs(), astOperand1(), astOperand2(), astParent(), astParentSkipParens(), ConditionHandler::beforeCondition(), bifurcateVariableChanged(), CheckBufferOverrun::bufferOverflow(), CheckCondition::checkBadBitmaskCheck(), CheckOther::checkCharVariable(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckIO::checkCoutCerrMisusage(), CheckStl::checkDereferenceInvalidIterator2(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckStl::checkFindInsertError(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckFunctions::checkIgnoredReturnValue(), CheckStl::checkIteratorPair(), CheckFunctions::checkLibraryMatchFunctions(), CheckUninitVar::checkLoopBodyRecursive(), CheckOther::checkMisusedScopedObject(), CheckOther::checkNegativeBitwiseShift(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckExceptionSafety::checkRethrowCopy(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckMemoryLeakStructMember::checkStructVariable(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckOther::clarifyStatement(), conditionString(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::debugSymbolDatabase(), CheckUninitVar::diag(), CheckCondition::diag(), Tokenizer::dump(), endOfExpression(), CheckStl::eraseCheckLoopVar(), CheckStl::eraseIteratorOutOfBounds(), findEndOfFunctionCallForParameter(), SymbolDatabase::findEnumerator(), Scope::findFunction(), findIteratorYield(), findLambdaStartToken(), findParent(), Function::findReturns(), findStartToken(), findVarBound(), followVariableExpression(), CheckLeakAutoVar::functionCall(), getAstParentSkipPossibleCastAndAddressOf(), getContainerFunction(), getContainerYield(), getExprUsage(), Library::getFunctionName(), getFunctionUsage(), CheckClass::getIfStmtBodyStart(), getIncompleteNameID(), getInvalidMethod(), getLifetimeTokens(), getOtherOperand(), getOverrunIndexValues(), getParentMember(), getParentMembers(), getParentValueTypes(), Library::getUseRetValType(), hasEmptyCaptureList(), hasOverloadedAssignment(), CheckCondition::identicalConditionAfterEarlyExitError(), CheckStl::if_find(), if_findCompare(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), SubExpressionAnalyzer::internalMatch(), CheckStl::invalidContainer(), SubExpressionAnalyzer::isAlias(), isAssignedToNonLocal(), isConditionKnown(), isConstStatement(), isConstTop(), ValueFlow::isContainerSizeChanged(), isContainerSizeChangedByFunction(), isConvertedToBool(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isDanglingSubFunction(), isDeadTemporary(), isDecayedPointer(), isForLoopCondition(), isForLoopIncrement(), Library::isFunctionConst(), ValueFlowAnalyzer::isGlobalModified(), isInConstructorList(), isIntegralOrPointer(), isLeafDot(), ValueFlow::isLifetimeBorrowed(), isLikelyStream(), isLikelyStreamRead(), isMacroUsage(), CheckUninitVar::isMemberVariableUsage(), ValueFlowAnalyzer::isModified(), ContainerExpressionAnalyzer::isModified(), isMoveOrForward(), Library::isnoreturn(), isNullOperand(), isOppositeExpression(), CheckNullPointer::isPointerDeRef(), isSameExpression(), isSimpleExpr(), isStructuredBindingVariable(), isTemporary(), isUnchanged(), isUsedAsBool(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableExprHidden(), isVariableMutableInInitializer(), CheckUninitVar::isVariableUsage(), isVariableUsed(), ValueFlowAnalyzer::isWritable(), ContainerExpressionAnalyzer::isWritable(), CheckStl::mismatchingContainerIterator(), CheckStl::missingComparison(), CheckCondition::multiCondition2(), CheckBufferOverrun::objectIndexError(), CheckStl::outOfBounds(), CheckString::overlappingStrcmpError(), SimpleConditionHandler::parse(), ContainerConditionHandler::parse(), CheckPostfixOperator::postfixOperator(), CheckLeakAutoVar::ret(), Library::returnValueType(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), ConditionHandler::skipNotAndCasts(), CheckSizeof::suspiciousSizeofCalculation(), ConditionHandler::traverseCondition(), typeDecl(), CheckUninitVar::uninitvarError(), ValueFlowAnalyzer::update(), CheckStl::uselessCalls(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowArray(), valueFlowArrayBool(), valueFlowDebug(), valueFlowDynamicBufferSize(), valueFlowForLoopSimplify(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowPointerAlias(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSymbolic(), CheckUninitVar::valueFlowUninit(), valueFlowUnknownFunctionReturn(), CheckMemoryLeakInClass::variable(), ContainerExpressionAnalyzer::writeValue(), and ValueFlowAnalyzer::writeValue().

◆ astSibling() [1/2]

Token* Token::astSibling ( )
inline

◆ astSibling() [2/2]

const Token* Token::astSibling ( ) const
inline

Definition at line 1406 of file token.h.

References astOperand2().

◆ astString()

std::string Token::astString ( const char *  sep = "") const
inline

Definition at line 1446 of file token.h.

◆ astStringVerbose()

std::string Token::astStringVerbose ( ) const

Definition at line 1748 of file token.cpp.

References astStringVerboseRecursive().

◆ astStringVerboseRecursive()

void Token::astStringVerboseRecursive ( std::string &  ret,
const nonneg int  indent1 = 0,
const nonneg int  indent2 = 0 
) const
private

Internal helper function to avoid excessive string allocations.

Definition at line 1716 of file token.cpp.

Referenced by astStringVerbose().

◆ astStringZ3()

std::string Token::astStringZ3 ( ) const

Definition at line 1755 of file token.cpp.

References astOperand1(), astOperand2(), astStringZ3(), and str().

Referenced by astStringZ3().

◆ astTop() [1/2]

Token* Token::astTop ( )
inline

◆ astTop() [2/2]

const Token* Token::astTop ( ) const
inline

Definition at line 1423 of file token.h.

References TokenImpl::mAstParent, and mImpl.

◆ bits()

unsigned char Token::bits ( ) const
inline

Definition at line 689 of file token.h.

Referenced by SymbolDatabase::setValueType().

◆ chrInFirstWord()

const char * Token::chrInFirstWord ( const char *  str,
char  c 
)
staticprivate

Works almost like strchr() except if str has empty space ' ' character, that character is handled as if it were '\0'.

Definition at line 675 of file token.cpp.

References str().

Referenced by Match().

◆ clearValueFlow()

void Token::clearValueFlow ( )
inline

Definition at line 1441 of file token.h.

Referenced by ValueFlow::setValues().

◆ column() [1/2]

nonneg int Token::column ( ) const
inline

◆ column() [2/2]

void Token::column ( nonneg int  c)
inline

Definition at line 826 of file token.h.

◆ concatStr()

void Token::concatStr ( std::string const &  b)

Concatenate two (quoted) strings.

Automatically cuts of the last/first character. Example: "hello ""world" -> "hello world". Used by the token simplifier.

Definition at line 212 of file token.cpp.

References getStringLiteral(), isCChar(), isStringLiteral(), mStr, and update_property_info().

Referenced by Tokenizer::combineStringAndCharLiterals().

◆ createMutualLinks()

void Token::createMutualLinks ( Token begin,
Token end 
)
static

◆ deleteNext()

void Token::deleteNext ( nonneg int  count = 1)

◆ deletePrevious()

void Token::deletePrevious ( nonneg int  count = 1)

Unlink and delete the previous 'count' tokens.

Definition at line 265 of file token.cpp.

References TokensFrontBack::front, link(), mLink, mPrevious, mTokensFrontBack, next(), and previous().

Referenced by deleteThis(), TemplateSimplifier::deleteToken(), Tokenizer::simplifyTypedefCpp(), and Tokenizer::simplifyUsing().

◆ deleteThis()

void Token::deleteThis ( )

◆ enumerator() [1/2]

const Enumerator* Token::enumerator ( ) const
inline

◆ enumerator() [2/2]

void Token::enumerator ( const Enumerator e)
inline

Associate this token with given enumerator.

Parameters
eEnumerator to be associated

Definition at line 1119 of file token.h.

◆ eraseTokens()

void Token::eraseTokens ( Token begin,
const Token end 
)
static

Delete tokens between begin and end.

E.g. if begin = 1 and end = 5, tokens 2,3 and 4 would be erased.

Parameters
beginTokens after this will be erased.
endTokens before this will be erased.

Definition at line 1238 of file token.cpp.

References deleteNext(), and next().

Referenced by Tokenizer::deleteInvalidTypedef(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removePragma(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifySQL(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), and Tokenizer::simplifyUsing().

◆ expressionString()

std::string Token::expressionString ( ) const

Definition at line 1647 of file token.cpp.

References findExpressionStartEndTokens(), and stringFromTokenRange().

Referenced by ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalseError(), Function::argsMatch(), CheckCondition::assignmentInCondition(), ValueFlow::Value::assumeCondition(), ConditionHandler::beforeCondition(), CheckBufferOverrun::bufferOverflowError(), CheckStl::checkDereferenceInvalidIterator2(), CheckStl::checkFindInsertError(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckUnusedVar::checkFunctionVariableUsage(), CheckOther::checkIncompleteArrayFill(), CheckCondition::checkIncorrectLogicOperator(), CheckStl::checkIteratorPair(), CheckOther::checkKnownArgument(), CheckUninitVar::checkLoopBody(), CheckOther::checkSignOfUnsignedVariable(), CheckString::checkSuspiciousStringCompare(), conditionString(), CheckOther::constStatementError(), CheckStl::dereferenceInvalidIteratorError(), CheckCondition::duplicateConditionalAssignError(), CheckOther::duplicateExpressionError(), ValueFlow::eitherTheConditionIsRedundant(), CheckStl::eraseIteratorOutOfBoundsError(), CheckAutoVariables::errorDanglngLifetime(), followAllReferences(), followVariableExpressionError(), LifetimeStore::fromFunctionArg(), Check::getErrorPath(), CTU::getFileInfo(), getIncompleteNameID(), getLifetimeTokens(), CheckCondition::identicalConditionAfterEarlyExitError(), CheckCondition::identicalInnerConditionError(), ValueFlow::Value::infoString(), CheckType::integerOverflowError(), CheckStl::invalidContainerReferenceError(), CheckCondition::invalidTestForOverflow(), CheckOther::knownArgumentError(), CheckStl::knownEmptyContainerError(), CheckOther::knownPointerToBoolError(), makeConditionValue(), CheckFunctions::memsetInvalid2ndParam(), CheckStl::mismatchingContainerExpressionError(), CheckStl::mismatchingContainerIteratorError(), CheckStl::mismatchingContainersError(), CheckBufferOverrun::negativeArraySizeError(), CheckBufferOverrun::objectIndexError(), CheckCondition::oppositeInnerConditionError(), CheckStl::outOfBounds(), CheckStl::outOfBoundsError(), CheckStl::outOfBoundsIndexExpressionError(), CheckString::overlappingStrcmpError(), CheckCondition::pointerAdditionResultNotNullError(), CheckBufferOverrun::pointerArithmeticError(), CheckType::signConversionError(), CheckString::sprintfOverlappingData(), ValueFlow::Value::toString(), CheckUninitVar::uninitvarError(), CheckOther::unknownEvaluationOrder(), ValueFlow::Value::Value(), valueFlowAfterMove(), valueFlowLifetimeFunction(), and valueFlowSubFunction().

◆ exprId() [1/2]

nonneg int Token::exprId ( ) const
inline

◆ exprId() [2/2]

void Token::exprId ( nonneg int  id)
inline

Definition at line 888 of file token.h.

◆ fileIndex() [1/2]

nonneg int Token::fileIndex ( ) const
inline

◆ fileIndex() [2/2]

void Token::fileIndex ( nonneg int  indexOfFile)
inline

Definition at line 812 of file token.h.

◆ findClosingBracket() [1/2]

Token * Token::findClosingBracket ( )

Definition at line 976 of file token.cpp.

References findClosingBracket().

◆ findClosingBracket() [2/2]

const Token * Token::findClosingBracket ( ) const

Returns the closing bracket of opening '<'.

Should only be used if link() is unavailable.

Returns
closing '>', ')', ']' or '}'. if no closing bracket is found, NULL is returned

Definition at line 917 of file token.cpp.

References isName(), isOperator(), link(), Match(), mPrevious, mStr, next(), previous(), simpleMatch(), str(), strAt(), and tokAt().

Referenced by TemplateSimplifier::addInstantiation(), Tokenizer::createLinks2(), TemplateSimplifier::expandTemplate(), findClosingBracket(), getFunctionToken(), TemplateSimplifier::getNewName(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), TemplateSimplifier::getTemplateParametersInDeclaration(), TemplateSimplifier::instantiateMatch(), matchMemberName(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), nextArgumentBeforeCreateLinks2(), TemplateSimplifier::printOut(), TemplateSimplifier::replaceTemplateUsage(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), Tokenizer::simplifyHeadersAndUnusedTemplates(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), skipRequires(), Tokenizer::splitTemplateRightAngleBrackets(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), and TemplateSimplifier::useDefaultArgumentValues().

◆ findExpressionStartEndTokens()

std::pair< const Token *, const Token * > Token::findExpressionStartEndTokens ( ) const

◆ findmatch() [1/4]

const Token * Token::findmatch ( const Token *const  startTok,
const char  pattern[],
const nonneg int  varId = 0 
)
static

◆ findmatch() [2/4]

const Token * Token::findmatch ( const Token *const  startTok,
const char  pattern[],
const Token *const  end,
const nonneg int  varId = 0 
)
static

Definition at line 1084 of file token.cpp.

References findmatchImpl(), and varId().

◆ findmatch() [3/4]

Token * Token::findmatch ( Token *const  startTok,
const char  pattern[],
const nonneg int  varId = 0 
)
static

Definition at line 1070 of file token.cpp.

References findmatchImpl(), and varId().

◆ findmatch() [4/4]

Token * Token::findmatch ( Token *const  startTok,
const char  pattern[],
const Token *const  end,
const nonneg int  varId = 0 
)
static

Definition at line 1089 of file token.cpp.

References findmatchImpl(), and varId().

◆ findOpeningBracket() [1/2]

Token * Token::findOpeningBracket ( )

Definition at line 1008 of file token.cpp.

References findOpeningBracket().

◆ findOpeningBracket() [2/2]

const Token * Token::findOpeningBracket ( ) const

◆ findsimplematch() [1/8]

const Token * Token::findsimplematch ( const Token *const  startTok,
const char  pattern[],
size_t  pattern_len 
)
static

Definition at line 1026 of file token.cpp.

References findsimplematchImpl().

◆ findsimplematch() [2/8]

const Token * Token::findsimplematch ( const Token *const  startTok,
const char  pattern[],
size_t  pattern_len,
const Token *const  end 
)
static

Definition at line 1046 of file token.cpp.

References findsimplematchImpl().

◆ findsimplematch() [3/8]

template<size_t count>
static const Token* Token::findsimplematch ( const Token *const  startTok,
const char(&)  pattern[count] 
)
inlinestatic

◆ findsimplematch() [4/8]

template<size_t count>
static const Token* Token::findsimplematch ( const Token *const  startTok,
const char(&)  pattern[count],
const Token *const  end 
)
inlinestatic

Definition at line 769 of file token.h.

◆ findsimplematch() [5/8]

Token * Token::findsimplematch ( Token *const  startTok,
const char  pattern[],
size_t  pattern_len 
)
static

Definition at line 1031 of file token.cpp.

References findsimplematchImpl().

◆ findsimplematch() [6/8]

Token * Token::findsimplematch ( Token *const  startTok,
const char  pattern[],
size_t  pattern_len,
const Token *const  end 
)
static

Definition at line 1051 of file token.cpp.

References findsimplematchImpl().

◆ findsimplematch() [7/8]

template<size_t count>
static Token* Token::findsimplematch ( Token *const  startTok,
const char(&)  pattern[count] 
)
inlinestatic

Definition at line 778 of file token.h.

◆ findsimplematch() [8/8]

template<size_t count>
static Token* Token::findsimplematch ( Token *const  startTok,
const char(&)  pattern[count],
const Token *const  end 
)
inlinestatic

Definition at line 783 of file token.h.

◆ firstWordEquals()

bool Token::firstWordEquals ( const char *  str,
const char *  word 
)
staticprivate

Works almost like strcmp() except returns only true or false and if str has empty space ' ' character, that character is handled as if it were '\0'.

Definition at line 660 of file token.cpp.

References str().

Referenced by Match().

◆ flags() [1/2]

uint64_t Token::flags ( ) const
inline

Definition at line 418 of file token.h.

Referenced by TokenList::addtoken(), TokenList::copyTokens(), and TokenList::insertTokens().

◆ flags() [2/2]

void Token::flags ( const uint64_t  flags_)
inline

Definition at line 421 of file token.h.

◆ function() [1/2]

const Function* Token::function ( ) const
inline
Returns
a pointer to the Function associated with this token.

Definition at line 1062 of file token.h.

◆ function() [2/2]

void Token::function ( const Function f)

Associate this token with given function.

Parameters
fFunction to be associated

Definition at line 1093 of file token.cpp.

References eFunction, eLambda, eName, Function::isLambda(), TokenImpl::mFunction, mImpl, mTokType, and tokType().

Referenced by CheckIO::ArgumentInfo::ArgumentInfo(), astStringXml(), CheckClass::checkConstFunc(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkMisusedScopedObject(), CheckOther::checkRedundantCopy(), CheckLeakAutoVar::checkScope(), CheckOther::checkVarFuncNullUB(), compareTokenRanges(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), clangimport::AstNode::createTokensFunctionDecl(), Tokenizer::dump(), exprDependsOnThis(), findConstructor(), SymbolDatabase::findEnumerator(), SymbolDatabase::findFunction(), followAllReferences(), clangimport::Data::funcDecl(), CheckMemoryLeak::getAllocationType(), getArgumentVars(), CheckClass::getFirstVirtualFunctionCallStack(), getFunction(), getFunctionUsage(), getLifetimeTokens(), getParentValueTypes(), getSingleFunctionCall(), hasNoreturnFunction(), CheckClass::initializeVarList(), isConstFunctionCall(), CheckClass::isConstMemberFunc(), isConstVarExpression(), isContainerSizeChangedByFunction(), isEscapeFunction(), isExpressionChangedAt(), Library::isFunctionConst(), CheckUninitVar::isFunctionParUsage(), ValueFlowAnalyzer::isGlobalModified(), isMacroUsage(), CheckClass::isMemberFunc(), CheckUninitVar::isMemberVariableAssignment(), isNonConstFunctionCall(), Library::isnoreturn(), Library::isNotLibraryFunction(), Library::isnotnoreturn(), isParameterChanged(), isSameExpression(), Tokenizer::isScopeNoReturn(), isSimpleExpr(), isTemporary(), isThisChanged(), isUniqueExpression(), isVariableChanged(), isVariableChangedByFunctionCall(), CheckCondition::multiCondition2(), parsedecl(), CheckNullPointer::parseFunctionCall(), clangimport::Data::Decl::ref(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), CheckSizeof::sizeofFunction(), CheckStl::string_c_str(), CheckClass::thisUseAfterFree(), tokenIsFunctionReturningBool(), typeDecl(), typeOf(), CheckOther::unreachableCodeError(), valueFlowFunctionReturn(), valueFlowLifetimeFunction(), valueFlowSubFunction(), and SymbolDatabase::~SymbolDatabase().

◆ getContainerSizeValue()

const ValueFlow::Value * Token::getContainerSizeValue ( const MathLib::bigint  val) const

Definition at line 2618 of file token.cpp.

References mImpl, and TokenImpl::mValues.

◆ getCppcheckAttribute()

bool Token::getCppcheckAttribute ( TokenImpl::CppcheckAttributes::Type  type,
MathLib::bigint value 
) const
inline

Definition at line 539 of file token.h.

Referenced by valueFlowSafeFunctions().

◆ getFlag()

bool Token::getFlag ( uint64_t  flag_) const
inlineprivate

Get specified flag state.

Parameters
flag_flag to get state of
Returns
true if flag set or false in flag not set

Definition at line 1347 of file token.h.

◆ getInvalidValue()

const ValueFlow::Value * Token::getInvalidValue ( const Token ftok,
nonneg int  argnr,
const Settings settings 
) const

◆ getKnownIntValue()

MathLib::bigint Token::getKnownIntValue ( ) const
inline

◆ getKnownValue()

const ValueFlow::Value * Token::getKnownValue ( ValueFlow::Value::ValueType  t) const

Definition at line 2552 of file token.cpp.

References mImpl, and TokenImpl::mValues.

Referenced by CheckStl::eraseIteratorOutOfBounds(), and valueFlowGetStrLength().

◆ getMacroName()

std::string Token::getMacroName ( ) const
inline

◆ getMaxValue()

const ValueFlow::Value * Token::getMaxValue ( bool  condition,
MathLib::bigint  path = 0 
) const

Definition at line 2592 of file token.cpp.

References getCompareValue(), mImpl, and TokenImpl::mValues.

Referenced by isOutOfBoundsImpl().

◆ getMinValue()

const ValueFlow::Value * Token::getMinValue ( bool  condition,
MathLib::bigint  path = 0 
) const

Definition at line 2599 of file token.cpp.

References getCompareValue(), mImpl, and TokenImpl::mValues.

◆ getMovedValue()

const ValueFlow::Value * Token::getMovedValue ( ) const

Definition at line 2606 of file token.cpp.

References mImpl, and TokenImpl::mValues.

◆ getStrArraySize()

nonneg int Token::getStrArraySize ( const Token tok)
static
Returns
array length of C-string.

Should be called for %str%% tokens only.

Parameters
toktoken with C-string

Definition at line 807 of file token.cpp.

References eString, getStringLiteral(), str(), and tokType().

Referenced by Tokenizer::arraySize(), getDimensionsEtc(), getStrSize(), and CheckFunctions::invalidFunctionUsage().

◆ getStrLength()

nonneg int Token::getStrLength ( const Token tok)
static

◆ getStrSize()

nonneg int Token::getStrSize ( const Token tok,
const Settings settings 
)
static
Returns
sizeof of C-string.

Should be called for %str%% tokens only.

Parameters
toktoken with C-string
settingsSettings

Definition at line 822 of file token.cpp.

References eString, ValueFlow::getSizeOf(), getStrArraySize(), nonneg, ValueType::pointer, tokType(), and valueType().

Referenced by getValueTokenMinStrSize(), and valueFlowSetConstantValue().

◆ getTokenDebug()

TokenDebug Token::getTokenDebug ( ) const
inline

Definition at line 1475 of file token.h.

Referenced by SymbolDatabase::debugSymbolDatabase(), and valueFlowDebug().

◆ getValue()

const ValueFlow::Value * Token::getValue ( const MathLib::bigint  val) const

◆ getValueGE()

const ValueFlow::Value * Token::getValueGE ( const MathLib::bigint  val,
const Settings settings 
) const

◆ getValueLE()

const ValueFlow::Value * Token::getValueLE ( const MathLib::bigint  val,
const Settings settings 
) const

◆ getValueTokenMaxStrLength()

const Token * Token::getValueTokenMaxStrLength ( ) const

◆ getValueTokenMinStrSize()

const Token * Token::getValueTokenMinStrSize ( const Settings settings,
MathLib::bigint path = nullptr 
) const

◆ hasCppcheckAttributes()

bool Token::hasCppcheckAttributes ( ) const
inline

Definition at line 543 of file token.h.

◆ hasKnownIntValue()

bool Token::hasKnownIntValue ( ) const

Definition at line 2519 of file token.cpp.

References mImpl, and TokenImpl::mValues.

Referenced by accumulateBoolLiteral(), addByOne(), ValueFlowAnalyzer::analyzeCondition(), Variable::arrayDimensions(), Tokenizer::arraySizeAfterValueFlow(), ConditionHandler::beforeCondition(), bifurcate(), checkBufferSize(), CheckCondition::checkCompareValueOutOfTypeRange(), PathAnalysis::checkCond(), CheckStl::checkDereferenceInvalidIterator2(), CheckOther::checkKnownArgument(), checkMissingReturnScope(), CheckOther::checkOverlappingWrite(), CheckCondition::checkPointerAdditionResultNotNull(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckUninitVar::checkScopeForVariable(), conditionAlwaysTrueOrFalse(), CheckCondition::duplicateCondition(), ValueFlowAnalyzer::evaluateInt(), evaluateKnownValues(), CheckLeakAutoVar::functionCall(), getBufAndOffset(), getContainerSizeFromConstructorArgs(), getEnumType(), getExpressionRange(), getVariableValues(), if_findCompare(), inferCondition(), CheckFunctions::invalidFunctionUsage(), CheckStl::isContainerSizeGE(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isFalseKeyword(), isNonZero(), isSameToken(), isTrueKeyword(), isUsedAsBool(), makeContainerSizeValue(), match(), minUnsignedValue(), CheckCondition::multiCondition2(), CheckNullPointer::nullConstantDereference(), CheckBufferOverrun::objectIndex(), CheckStl::outOfBounds(), SimpleConditionHandler::parse(), SymbolicConditionHandler::parse(), parseCompareEachInt(), ValueFlow::parseCompareInt(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), ProgramMemory::setValue(), ConditionHandler::skipNotAndCasts(), solveExprValue(), MultiValueFlowAnalyzer::stopOnCondition(), CheckBufferOverrun::stringNotZeroTerminated(), ConditionHandler::traverseCondition(), CheckFunctions::useStandardLibrary(), valueFlowArrayBool(), valueFlowArrayElement(), valueFlowConditionExpressions(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowEnumValue(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowSameExpressions(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), and CheckOther::warningOldStylePointerCast().

◆ hasKnownSymbolicValue()

bool Token::hasKnownSymbolicValue ( const Token tok) const

Definition at line 2541 of file token.cpp.

References exprId(), mImpl, and TokenImpl::mValues.

Referenced by SymbolicConditionHandler::parse().

◆ hasKnownValue() [1/2]

bool Token::hasKnownValue ( ) const

◆ hasKnownValue() [2/2]

bool Token::hasKnownValue ( ValueFlow::Value::ValueType  t) const

Definition at line 2533 of file token.cpp.

References mImpl, and TokenImpl::mValues.

◆ index()

nonneg int Token::index ( ) const
inline

Definition at line 1247 of file token.h.

Referenced by assignIndexes(), linkAt(), precedes(), succeeds(), and tokAt().

◆ insertToken()

Token * Token::insertToken ( const std::string &  tokenStr,
const std::string &  originalNameStr = emptyString,
const std::string &  macroNameStr = emptyString,
bool  prepend = false 
)

Insert new token after this token.

This function will handle relations between next and previous token also.

Parameters
tokenStrString for the new token.
originalNameStrString used for Token::originalName().
prependInsert the new token before this token when it's not the first one on the tokens list.

Definition at line 1105 of file token.cpp.

References TokensFrontBack::back, findOpeningBracket(), TokensFrontBack::front, linkAt(), Match(), TokenImpl::mFileIndex, mImpl, TokenImpl::mLineNumber, TokenImpl::mProgressValue, TokenImpl::mScopeInfo, mStr, mTokensFrontBack, next(), originalName(), previous(), scope(), scopeInfo(), setMacroName(), simpleMatch(), str(), strAt(), tokAt(), and Token().

Referenced by TemplateSimplifier::addNamespace(), Tokenizer::addSemicolonAfterUnknownMacro(), TokenList::addtoken(), CheckIO::ArgumentInfo::ArgumentInfo(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), TokenList::copyTokens(), TokenList::createTokens(), Tokenizer::elseif(), TemplateSimplifier::expandTemplate(), TemplateSimplifier::getTemplateInstantiations(), Tokenizer::initVar(), TokenList::insertTokens(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyLabelsCaseDefault(), Tokenizer::simplifySQL(), Tokenizer::simplifyStaticConst(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), Tokenizer::sizeofAddParentheses(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), and TemplateSimplifier::useDefaultArgumentValues().

◆ insertTokenBefore()

Token* Token::insertTokenBefore ( const std::string &  tokenStr,
const std::string &  originalNameStr = emptyString,
const std::string &  macroNameStr = emptyString 
)
inline

◆ isArithmeticalOp()

bool Token::isArithmeticalOp ( ) const
inline

◆ isAssignmentOp()

bool Token::isAssignmentOp ( ) const
inline

◆ isAtAddress() [1/2]

bool Token::isAtAddress ( ) const
inline

Definition at line 567 of file token.h.

◆ isAtAddress() [2/2]

void Token::isAtAddress ( bool  b)
inline

Definition at line 570 of file token.h.

◆ isAtomic() [1/2]

bool Token::isAtomic ( ) const
inline

Definition at line 636 of file token.h.

Referenced by Tokenizer::dump().

◆ isAtomic() [2/2]

void Token::isAtomic ( bool  b)
inline

Definition at line 639 of file token.h.

◆ isAttributeConst() [1/2]

bool Token::isAttributeConst ( ) const
inline

Definition at line 494 of file token.h.

Referenced by isSameExpression().

◆ isAttributeConst() [2/2]

void Token::isAttributeConst ( bool  value)
inline

Definition at line 497 of file token.h.

◆ isAttributeConstructor() [1/2]

bool Token::isAttributeConstructor ( ) const
inline

Definition at line 464 of file token.h.

◆ isAttributeConstructor() [2/2]

void Token::isAttributeConstructor ( const bool  ac)
inline

Definition at line 467 of file token.h.

◆ isAttributeDestructor() [1/2]

bool Token::isAttributeDestructor ( ) const
inline

Definition at line 470 of file token.h.

◆ isAttributeDestructor() [2/2]

void Token::isAttributeDestructor ( const bool  value)
inline

Definition at line 473 of file token.h.

◆ isAttributeExport() [1/2]

bool Token::isAttributeExport ( ) const
inline

Definition at line 512 of file token.h.

Referenced by Tokenizer::dump().

◆ isAttributeExport() [2/2]

void Token::isAttributeExport ( const bool  value)
inline

Definition at line 515 of file token.h.

◆ isAttributeMaybeUnused() [1/2]

bool Token::isAttributeMaybeUnused ( ) const
inline

Definition at line 530 of file token.h.

Referenced by Tokenizer::dump(), and Variable::evaluate().

◆ isAttributeMaybeUnused() [2/2]

void Token::isAttributeMaybeUnused ( const bool  value)
inline

Definition at line 533 of file token.h.

◆ isAttributeNodiscard() [1/2]

bool Token::isAttributeNodiscard ( ) const
inline

Definition at line 524 of file token.h.

◆ isAttributeNodiscard() [2/2]

void Token::isAttributeNodiscard ( const bool  value)
inline

Definition at line 527 of file token.h.

◆ isAttributeNoreturn() [1/2]

bool Token::isAttributeNoreturn ( ) const
inline

Definition at line 500 of file token.h.

◆ isAttributeNoreturn() [2/2]

void Token::isAttributeNoreturn ( const bool  value)
inline

Definition at line 503 of file token.h.

◆ isAttributeNothrow() [1/2]

bool Token::isAttributeNothrow ( ) const
inline

Definition at line 506 of file token.h.

◆ isAttributeNothrow() [2/2]

void Token::isAttributeNothrow ( const bool  value)
inline

Definition at line 509 of file token.h.

◆ isAttributePacked() [1/2]

bool Token::isAttributePacked ( ) const
inline

Definition at line 518 of file token.h.

Referenced by CheckUnusedVar::checkStructMemberUsage().

◆ isAttributePacked() [2/2]

void Token::isAttributePacked ( const bool  value)
inline

Definition at line 521 of file token.h.

◆ isAttributePure() [1/2]

bool Token::isAttributePure ( ) const
inline

Definition at line 488 of file token.h.

Referenced by isSameExpression().

◆ isAttributePure() [2/2]

void Token::isAttributePure ( const bool  value)
inline

Definition at line 491 of file token.h.

◆ isAttributeUnused() [1/2]

bool Token::isAttributeUnused ( ) const
inline

Definition at line 476 of file token.h.

Referenced by CheckUnusedVar::checkFunctionVariableUsage(), and Tokenizer::dump().

◆ isAttributeUnused() [2/2]

void Token::isAttributeUnused ( bool  unused)
inline

Definition at line 479 of file token.h.

References unused().

◆ isAttributeUsed() [1/2]

bool Token::isAttributeUsed ( ) const
inline

Definition at line 482 of file token.h.

Referenced by CheckUnusedVar::checkFunctionVariableUsage().

◆ isAttributeUsed() [2/2]

void Token::isAttributeUsed ( const bool  unused)
inline

Definition at line 485 of file token.h.

References unused().

◆ isBinaryOp()

bool Token::isBinaryOp ( ) const
inline

◆ isBitfield()

bool Token::isBitfield ( ) const
inline

Definition at line 686 of file token.h.

◆ isBoolean()

bool Token::isBoolean ( ) const
inline

◆ isC()

bool Token::isC ( ) const

◆ isCalculation()

bool Token::isCalculation ( ) const

Is current token a calculation? Only true for operands.

For '*' and '&' tokens it is looked up if this is a dereference or address-of. A dereference or address-of is not counted as a calculation.

Returns
returns true if current token is a calculation

Definition at line 1556 of file token.cpp.

References astOperand1(), astOperand2(), isNumber(), Match(), str(), and varId().

Referenced by CheckOther::checkConstVariable(), and CheckSizeof::sizeofCalculation().

◆ isCast() [1/2]

bool Token::isCast ( ) const
inline

◆ isCast() [2/2]

void Token::isCast ( bool  c)
inline

Definition at line 461 of file token.h.

◆ isCChar()

bool Token::isCChar ( ) const
inline

◆ isCMultiChar()

bool Token::isCMultiChar ( ) const
inline

◆ isComparisonOp()

bool Token::isComparisonOp ( ) const
inline

◆ isComplex() [1/2]

bool Token::isComplex ( ) const
inline

Definition at line 555 of file token.h.

Referenced by compareTokenFlags(), Tokenizer::dump(), stringify(), and tokenType().

◆ isComplex() [2/2]

void Token::isComplex ( const bool  value)
inline

Definition at line 558 of file token.h.

◆ isConstexpr() [1/2]

bool Token::isConstexpr ( ) const
inline

Definition at line 594 of file token.h.

Referenced by CheckCondition::alwaysTrueFalse(), and Tokenizer::simplifyTokenList1().

◆ isConstexpr() [2/2]

void Token::isConstexpr ( bool  b)
inline

Definition at line 597 of file token.h.

◆ isConstOp()

bool Token::isConstOp ( ) const
inline

◆ isControlFlowKeyword()

bool Token::isControlFlowKeyword ( ) const
inline

◆ isCpp()

bool Token::isCpp ( ) const

Definition at line 2718 of file token.cpp.

References TokenList::isCPP(), TokensFrontBack::list, and mTokensFrontBack.

Referenced by Scope::addEnum(), Function::argsMatch(), Variable::arrayDimensions(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckString::checkSuspiciousStringCompare(), Scope::checkVariable(), CheckClass::copyconstructors(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), Tokenizer::duplicateTypedef(), Variable::evaluate(), findLambdaStartToken(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), CheckMemoryLeak::getDeallocationType(), isDifferentType(), Library::isFloatArgValid(), SymbolDatabase::isFunction(), Tokenizer::isFunctionHead(), Library::isIntArgValid(), isLikelyStream(), isLikelyStreamRead(), isLocalVarNoAutoDealloc(), isNullOperand(), SymbolDatabase::isReservedName(), isSameExpression(), isTemporary(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), CheckUninitVar::isVariableUsage(), isWithoutSideEffects(), CheckCondition::multiCondition2(), needsInitialization(), CheckBufferOverrun::objectIndex(), parsedecl(), Scope::Scope(), clangimport::AstNode::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyVarDecl(), CheckType::tooBigSignedBitwiseShiftError(), CheckFunctions::useStandardLibrary(), CheckVaarg::va_list_usage(), valueFlowDynamicBufferSize(), valueFlowGlobalStaticVar(), valueFlowLibraryFunction(), valueFlowSetConstantValue(), and valueFlowUnknownFunctionReturn().

◆ isCpp11init()

TokenImpl::Cpp11init Token::isCpp11init ( ) const
inline

Definition at line 1471 of file token.h.

◆ isEnumerator()

bool Token::isEnumerator ( ) const
inline

◆ isEnumType() [1/2]

bool Token::isEnumType ( ) const
inline

◆ isEnumType() [2/2]

void Token::isEnumType ( const bool  value)
inline

Definition at line 564 of file token.h.

◆ isExpandedMacro()

bool Token::isExpandedMacro ( ) const
inline

◆ isExtendedOp()

bool Token::isExtendedOp ( ) const
inline

Definition at line 391 of file token.h.

Referenced by CheckUnusedVar::checkFunctionVariableUsage_iterateScopes().

◆ isExternC() [1/2]

bool Token::isExternC ( ) const
inline

◆ isExternC() [2/2]

void Token::isExternC ( bool  b)
inline

Definition at line 604 of file token.h.

◆ isFinalType() [1/2]

bool Token::isFinalType ( ) const
inline

Definition at line 671 of file token.h.

Referenced by CheckClass::checkVirtualFunctionCallInConstructor().

◆ isFinalType() [2/2]

void Token::isFinalType ( bool  b)
inline

Definition at line 674 of file token.h.

◆ isImplicitInt() [1/2]

bool Token::isImplicitInt ( ) const
inline

Definition at line 622 of file token.h.

Referenced by Tokenizer::dump().

◆ isImplicitInt() [2/2]

void Token::isImplicitInt ( bool  b)
inline

Definition at line 625 of file token.h.

◆ isIncDecOp()

bool Token::isIncDecOp ( ) const
inline

◆ isIncompleteConstant() [1/2]

bool Token::isIncompleteConstant ( ) const
inline

◆ isIncompleteConstant() [2/2]

void Token::isIncompleteConstant ( bool  b)
inline

Definition at line 590 of file token.h.

◆ isIncompleteVar() [1/2]

bool Token::isIncompleteVar ( ) const
inline

◆ isIncompleteVar() [2/2]

void Token::isIncompleteVar ( bool  b)
inline

Definition at line 576 of file token.h.

◆ isInitComma() [1/2]

bool Token::isInitComma ( ) const
inline

Definition at line 678 of file token.h.

Referenced by isUsedAsBool(), setTokenValue(), and ValueFlow::setValues().

◆ isInitComma() [2/2]

void Token::isInitComma ( bool  b)
inline

Definition at line 681 of file token.h.

◆ isInline() [1/2]

bool Token::isInline ( ) const
inline

Definition at line 629 of file token.h.

Referenced by Function::setFlags(), and Tokenizer::simplifyTypedefCpp().

◆ isInline() [2/2]

void Token::isInline ( bool  b)
inline

Definition at line 632 of file token.h.

◆ isKeyword()

bool Token::isKeyword ( ) const
inline

◆ isLiteral()

bool Token::isLiteral ( ) const
inline

◆ isLong() [1/2]

bool Token::isLong ( ) const
inline

◆ isLong() [2/2]

void Token::isLong ( bool  size)
inline

Definition at line 446 of file token.h.

◆ isName()

bool Token::isName ( ) const
inline

Definition at line 361 of file token.h.

Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), Tokenizer::arraySize(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckClass::checkConst(), CheckClass::checkConstFunc(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkInnerScope(), FwdAnalysis::checkRecursive(), CheckLeakAutoVar::checkScope(), CheckOther::checkVarFuncNullUB(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), conditionAlwaysTrueOrFalse(), conditionString(), doAssignment(), Tokenizer::dump(), CheckStl::erase(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), findClosingBracket(), SymbolDatabase::findScope(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), CheckMemoryLeak::getAllocationType(), FwdAnalysis::getExprVarIds(), Library::getFunctionName(), getIteratorExpression(), iscast(), isConstExpression(), isExpressionChangedAt(), SymbolDatabase::isFunction(), isFunctionCall(), CheckUninitVar::isFunctionParUsage(), isGlobalData(), CheckUninitVar::isMemberVariableAssignment(), isReturnScope(), isSameExpression(), Library::isScopeNoReturn(), isUpperCaseName(), isVariableChangedByFunctionCall(), CheckUninitVar::isVariableUsage(), multiComparePercent(), CheckCondition::multiCondition2(), Type::name(), parsedecl(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), Tokenizer::setVarId(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), CheckType::signConversionError(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyInitVar(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyVarDecl(), stringify(), TemplateSimplifier::templateParameters(), valueFlowNumber(), valueFlowSwitchVariable(), and valueFlowUnknownFunctionReturn().

◆ isNameOnly()

bool Token::isNameOnly ( ) const
inline

Definition at line 364 of file token.h.

Referenced by Tokenizer::simplifyTypedefCpp(), and Tokenizer::simplifyUsing().

◆ isNumber()

bool Token::isNumber ( ) const
inline

◆ isOp()

bool Token::isOp ( ) const
inline

◆ isOperatorKeyword() [1/2]

bool Token::isOperatorKeyword ( ) const
inline

Definition at line 549 of file token.h.

Referenced by isOperator(), and Tokenizer::setVarIdPass1().

◆ isOperatorKeyword() [2/2]

void Token::isOperatorKeyword ( const bool  value)
inline

Definition at line 552 of file token.h.

◆ isPointerCompare() [1/2]

bool Token::isPointerCompare ( ) const
inline

Definition at line 437 of file token.h.

◆ isPointerCompare() [2/2]

void Token::isPointerCompare ( const bool  b)
inline

Definition at line 440 of file token.h.

◆ isRemovedVoidParameter()

bool Token::isRemovedVoidParameter ( ) const
inline

Definition at line 650 of file token.h.

Referenced by Tokenizer::dump().

◆ isRestrict() [1/2]

bool Token::isRestrict ( ) const
inline

Definition at line 643 of file token.h.

Referenced by Tokenizer::dump().

◆ isRestrict() [2/2]

void Token::isRestrict ( bool  b)
inline

Definition at line 646 of file token.h.

◆ isSigned() [1/2]

bool Token::isSigned ( ) const
inline

◆ isSigned() [2/2]

void Token::isSigned ( const bool  sign)
inline

Definition at line 433 of file token.h.

References sign().

◆ isSimplifiedScope() [1/2]

bool Token::isSimplifiedScope ( ) const
inline

Definition at line 664 of file token.h.

Referenced by CheckOther::checkInnerScope(), and Tokenizer::simplifyIfSwitchForInit().

◆ isSimplifiedScope() [2/2]

void Token::isSimplifiedScope ( bool  b)
inline

Definition at line 667 of file token.h.

◆ isSimplifiedTypedef() [1/2]

bool Token::isSimplifiedTypedef ( ) const
inline

◆ isSimplifiedTypedef() [2/2]

void Token::isSimplifiedTypedef ( bool  b)
inline

Definition at line 583 of file token.h.

◆ isSplittedVarDeclComma() [1/2]

bool Token::isSplittedVarDeclComma ( ) const
inline

Definition at line 608 of file token.h.

Referenced by Tokenizer::dump(), and Tokenizer::simplifyVarDecl().

◆ isSplittedVarDeclComma() [2/2]

void Token::isSplittedVarDeclComma ( bool  b)
inline

Definition at line 611 of file token.h.

◆ isSplittedVarDeclEq() [1/2]

bool Token::isSplittedVarDeclEq ( ) const
inline

◆ isSplittedVarDeclEq() [2/2]

void Token::isSplittedVarDeclEq ( bool  b)
inline

Definition at line 618 of file token.h.

◆ isStandardType() [1/2]

bool Token::isStandardType ( ) const
inline

◆ isStandardType() [2/2]

void Token::isStandardType ( const bool  b)
inline

Definition at line 452 of file token.h.

◆ isTemplate() [1/2]

bool Token::isTemplate ( ) const
inline

Definition at line 657 of file token.h.

Referenced by Tokenizer::removeExtraTemplateKeywords().

◆ isTemplate() [2/2]

void Token::isTemplate ( bool  b)
inline

Definition at line 660 of file token.h.

◆ isTemplateArg() [1/2]

bool Token::isTemplateArg ( ) const
inline

Is current token a template argument?

Original code:

template<class C> struct S {
    C x;
};
S<int> s;

Resulting code:

struct S<int> {
    int x ;  // <- "int" is a template argument
}
S<int> s;

Definition at line 748 of file token.h.

Referenced by CheckOther::checkConstPointer(), compareTokenFlags(), Tokenizer::dump(), TemplateSimplifier::expandTemplate(), isSameConstantValue(), valueFlowNumber(), and valueFlowSetConstantValue().

◆ isTemplateArg() [2/2]

void Token::isTemplateArg ( const bool  value)
inline

Definition at line 751 of file token.h.

◆ isUnaryOp()

bool Token::isUnaryOp ( const std::string &  s) const
inline

◆ isUnaryPreOp()

bool Token::isUnaryPreOp ( ) const

◆ isUniqueExprId()

bool Token::isUniqueExprId ( ) const
inline

Definition at line 898 of file token.h.

Referenced by ExpressionAnalyzer::ExpressionAnalyzer().

◆ isUnsigned() [1/2]

bool Token::isUnsigned ( ) const
inline

◆ isUnsigned() [2/2]

void Token::isUnsigned ( const bool  sign)
inline

Definition at line 427 of file token.h.

References sign().

◆ isUpperCaseName()

bool Token::isUpperCaseName ( ) const

◆ isUtf16()

bool Token::isUtf16 ( ) const
inline

◆ isUtf32()

bool Token::isUtf32 ( ) const
inline

◆ isUtf8()

bool Token::isUtf8 ( ) const
inline

◆ isVariable()

bool Token::isVariable ( ) const
inline

Definition at line 377 of file token.h.

◆ linenr() [1/2]

nonneg int Token::linenr ( ) const
inline

◆ linenr() [2/2]

void Token::linenr ( nonneg int  lineNumber)
inline

Definition at line 819 of file token.h.

◆ link() [1/3]

Token* Token::link ( )
inline

Definition at line 1034 of file token.h.

◆ link() [2/3]

const Token* Token::link ( ) const
inline

Return token where this token links to.

Supported links are: "{" <-> "}" "(" <-> ")" "[" <-> "]"

Returns
The token where this token links to.

Definition at line 1030 of file token.h.

◆ link() [3/3]

void Token::link ( Token linkToToken)
inline

Create link to given token.

Parameters
linkToTokenThe token where this token should link to.

Definition at line 1015 of file token.h.

Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Scope::addEnum(), SymbolDatabase::addNewFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), ConditionHandler::afterCondition(), CheckIO::ArgumentInfo::ArgumentInfo(), Variable::arrayDimensions(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckAssert::assertWithSideEffects(), CheckCondition::assignIfParseScope(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astParentSkipParens(), ConditionHandler::beforeCondition(), Tokenizer::calculateScopes(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBoost::checkBoostForeachModification(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), Tokenizer::checkConfiguration(), CheckClass::checkConstFunc(), CheckStl::checkDereferenceInvalidIterator(), CheckStl::checkDereferenceInvalidIterator2(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckStl::checkFindInsert(), Tokenizer::checkForEnumsWithTypedef(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckUninitVar::checkIfForWhileHead(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckUninitVar::checkLoopBodyRecursive(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), checkReturns(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckSizeof::checkSizeofForPointerSize(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkUnreachableCode(), CheckClass::checkUselessOverride(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckOther::clarifyCalculation(), Function::constructorMemberInitialization(), CheckClass::constructors(), TokenList::copyTokens(), Tokenizer::createLinks2(), createMutualLinks(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), SymbolDatabase::createSymbolDatabaseSetScopePointers(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensCall(), clangimport::AstNode::createTokensFunctionDecl(), clangimport::AstNode::createTokensVarDecl(), Variable::declEndToken(), deleteNext(), deletePrevious(), deleteThis(), Library::detectContainerInternal(), doAssignment(), Tokenizer::dump(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), CheckStl::eraseCheckLoopVar(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), findClosingBracket(), findExpressionStartEndTokens(), findLambdaEndScope(), findLambdaEndTokenGeneric(), findLambdaStartToken(), findOpeningBracket(), Function::findReturns(), findTypeEnd(), findUnmatchedTernaryOp(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), getArgumentPos(), getArgumentStart(), getEnableIfReturnType(), CheckClass::getIfStmtBodyStart(), CheckMemoryLeak::getReallocationType(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTypeString(), Scope::getVariableList(), getVariableValues(), CheckClass::getVirtualFunctionCalls(), goToLeftParenthesis(), goToRightParenthesis(), CheckClass::hasAllocationInIfScope(), Type::initBaseInfo(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), CheckStl::invalidContainer(), isAlignAttribute(), isBasicForLoop(), isBreakScope(), isCallFunction(), iscast(), isConstMethod(), isCPPAttribute(), isDeadTemporary(), isEarlyExit(), isEscapeScope(), isExecutableScope(), SymbolDatabase::isFunction(), isFunctionCall(), Tokenizer::isFunctionHead(), CheckUninitVar::isFunctionParUsage(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), isOperator(), isParameterChanged(), isPartOfClassStructUnion(), CheckNullPointer::isPointerDeRef(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isReturnScope(), isSameExpression(), isStdMoveOrStdForwarded(), isTemporary(), isType(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), isVariableInit(), isVoidStmt(), CheckStl::iterators(), CheckStl::knownEmptyContainer(), Lambda::Lambda(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), Type::name(), nextArgumentBeforeCreateLinks2(), nextTemplateArgument(), CheckNullPointer::nullConstantDereference(), parsedecl(), CheckUnusedFunctions::parseTokens(), Tokenizer::processFunc(), CheckOther::redundantBitwiseOperationInSwitchError(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantSemicolons(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), Scope::setBodyStartEnd(), Function::setFlags(), ValueFlow::setValues(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), singleConditionalInScope(), singleMemberCallInScope(), singleStatement(), skipBrackets(), skipBracketsAndMembers(), skipCaseLabel(), skipDecl(), skipPointers(), skipRequires(), skipTernaryOp(), splitDefinitionFromTypedef(), CheckStl::string_c_str(), CheckBufferOverrun::stringNotZeroTerminated(), CheckSizeof::suspiciousSizeofCalculation(), takeData(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), typeDecl(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::useStlAlgorithm(), Tokenizer::validate(), valueFlowAfterMove(), valueFlowArray(), valueFlowConditionExpressions(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowForLoopSimplify(), valueFlowLifetime(), valueFlowSwitchVariable(), CheckMemoryLeakInClass::variable(), Variable::Variable(), CheckClass::virtualFunctionCallInConstructorError(), and CheckOther::warningOldStylePointerCast().

◆ linkAt() [1/2]

Token * Token::linkAt ( int  index)

Definition at line 418 of file token.cpp.

References index(), and linkAtImpl().

◆ linkAt() [2/2]

const Token * Token::linkAt ( int  index) const
Returns
the link to the token in given index, related to this token. For example index 1 would return the link to next token.

Definition at line 413 of file token.cpp.

References index(), and linkAtImpl().

Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Scope::addEnum(), SymbolDatabase::addNewFunction(), ConditionHandler::afterCondition(), ValueFlowAnalyzer::analyze(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckCondition::assignIfParseScope(), ValueFlowAnalyzer::assume(), Tokenizer::calculateScopes(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBoost::checkBoostForeachModification(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateBranch(), CheckIO::checkFileUsage(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInvalidFree(), CheckUninitVar::checkLoopBodyRecursive(), CheckOther::checkMisusedScopedObject(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkRhs(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkUnreachableCode(), CheckClass::checkUnsafeClassRefMember(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckClass::copyconstructors(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), Tokenizer::deleteInvalidTypedef(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), CheckStl::erase(), CheckStl::eraseCheckLoopVar(), TemplateSimplifier::expandTemplate(), SymbolDatabase::findFunction(), SymbolDatabase::findFunctionInScope(), findLambdaEndScope(), findNextTokenFromBreak(), SymbolDatabase::findScope(), findStartToken(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), SymbolDatabase::findVariableType(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), functionThrowsRecursive(), getIteratorExpression(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), CheckStl::if_find(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), insertToken(), CheckOther::invalidPointerCast(), isBasicForLoop(), iscast(), CheckIO::ArgumentInfo::isComplexType(), isCPPAttribute(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), SymbolDatabase::isFunction(), Tokenizer::isFunctionHead(), CheckUninitVar::isFunctionParUsage(), CheckClass::isMemberVar(), isRangeForScope(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), Library::isScopeNoReturn(), Tokenizer::isScopeNoReturn(), isStlStringType(), Scope::isVariableDeclaration(), CheckStl::iterators(), Tokenizer::markCppCasts(), CheckStl::missingComparison(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), parsedecl(), CheckUnusedFunctions::parseTokens(), Tokenizer::processFunc(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removePragma(), Tokenizer::reportUnknownMacros(), setValues(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), singleConditionalInScope(), singleMemberCallInScope(), Tokenizer::sizeofAddParentheses(), skipDecl(), skipPointers(), skipRequires(), skipScopeIdentifiers(), Tokenizer::startOfExecutableScope(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), Type::Type(), typeDecl(), CheckStl::uselessCalls(), CheckVaarg::va_list_usage(), valueFlowContainerSize(), valueFlowForLoopSimplify(), valueFlowForLoopSimplifyAfter(), valueFlowImpossibleValues(), valueFlowSetConstantValue(), and CheckClass::virtualDestructor().

◆ Match()

bool Token::Match ( const Token tok,
const char  pattern[],
nonneg int  varid = 0 
)
static

Match given token (or list of tokens) to a pattern list.

Possible patterns

  • "%any%" any token
  • "%assign%" a assignment operand
  • "%bool%" true or false
  • "%char%" Any token enclosed in '-character.
  • "%comp%" Any token such that isComparisonOp() returns true.
  • "%cop%" Any token such that isConstOp() returns true.
  • "%name%" any token which is a name, variable or type e.g. "hello" or "int". Also matches keywords.
  • "%num%" Any numeric token, e.g. "23"
  • "%op%" Any token such that isOp() returns true.
  • "%or%" A bitwise-or operator '|'
  • "%oror%" A logical-or operator '||'
  • "%type%" Anything that can be a variable type, e.g. "int". Also matches keywords.
  • "%str%" Any token starting with "-character (C-string).
  • "%var%" Match with token with varId > 0
  • "%varid%" Match with parameter varid
  • "[abc]" Any of the characters 'a' or 'b' or 'c'
  • "int|void|char" Any of the strings, int, void or char
  • "int|void|char|" Any of the strings, int, void or char or no token
  • "!!else" No tokens or any token that is not "else".
  • "someRandomText" If token contains "someRandomText".

multi-compare patterns such as "int|void|char" can contain %or%, %oror% and %op% it is recommended to put such an %cmd% as the first pattern. For example: "%var%|%num%|)" means yes to a variable, a number or ')'.

The patterns can be also combined to compare to multiple tokens at once by separating tokens with a space, e.g. ") const|void {" will return true if first token is ')' next token is either "const" or "void" and token after that is '{'. If even one of the tokens does not match its pattern, false is returned.

Parameters
tokList of tokens to be compared to the pattern
patternThe pattern against which the tokens are compared, e.g. "const" or ") const|volatile| {".
varidif %varid% is given in the pattern the Token::varId will be matched against this argument
Returns
true if given token matches with given pattern false if given token does not match with given pattern

Definition at line 688 of file token.cpp.

References chrInFirstWord(), firstWordEquals(), multiCompareImpl(), next(), and str().

Referenced by accumulateBool(), accumulateBoolLiteral(), Function::addArguments(), addByOne(), SymbolDatabase::addClassFunction(), Scope::addEnum(), TemplateSimplifier::addNamespace(), SymbolDatabase::addNewFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), clangimport::AstNode::addTypeTokens(), ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyze(), ValueFlowAnalyzer::analyzeCondition(), ValueFlowAnalyzer::analyzeMatch(), ValueFlowAnalyzer::analyzeToken(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::argumentSize(), argumentType(), CheckIO::argumentType(), CheckNullPointer::arithmetic(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), assignExpr(), CheckAutoVariables::assignFunctionArg(), CheckCondition::assignIf(), CheckCondition::assignIfParseScope(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astCanonicalType(), astParentSkipParens(), CheckAutoVariables::autoVariables(), ConditionHandler::beforeCondition(), bifurcate(), bifurcateVariableChanged(), CheckBufferOverrun::bufferOverflow(), Tokenizer::calculateScopes(), CheckUninitVar::check(), CheckString::checkAlwaysTrueOrFalseStringCompare(), CheckCondition::checkAssignmentInCondition(), CheckAutoVariables::checkAutoVariableAssignment(), CheckCondition::checkBadBitmaskCheck(), CheckBoost::checkBoostForeachModification(), CheckOther::checkCastIntToCharAndBack(), CheckOther::checkCharVariable(), CheckOther::checkCommaSeparatedReturn(), CheckOther::checkComparePointers(), CheckOther::checkComparisonFunctionIsAlwaysTrueOrFalse(), CheckBool::checkComparisonOfBoolExpressionWithInt(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), Tokenizer::checkConfiguration(), CheckClass::checkConst(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckIO::checkCoutCerrMisusage(), CheckStl::checkDereferenceInvalidIterator2(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckUninitVar::checkExpr(), CheckIO::checkFileUsage(), CheckStl::checkFindInsert(), CheckType::checkFloatToIntegerOverflow(), Tokenizer::checkForEnumsWithTypedef(), CheckIO::checkFormatString(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckUninitVar::checkIfForWhileHead(), CheckFunctions::checkIgnoredReturnValue(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncompleteStatement(), CheckCondition::checkIncorrectLogicOperator(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckOther::checkInvalidFree(), CheckCondition::checkInvalidTestForOverflow(), CheckStl::checkIteratorPair(), CheckOther::checkKnownArgument(), CheckOther::checkKnownPointerToBool(), CheckFunctions::checkLibraryMatchFunctions(), CheckType::checkLongCast(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckClass::checkMemsetType(), CheckFunctions::checkMissingReturn(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckStl::checkMutexes(), CheckOther::checkNanInArithmeticExpression(), CheckOther::checkNegativeBitwiseShift(), CheckOther::checkOverlappingWrite(), CheckFunctions::checkProhibitedFunctions(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), checkReturns(), CheckUninitVar::checkRhs(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckType::checkSignConversion(), CheckSizeof::checkSizeofForArrayParameter(), CheckSizeof::checkSizeofForNumericParameter(), CheckSizeof::checkSizeofForPointerSize(), CheckUninitVar::checkStruct(), CheckUnusedVar::checkStructMemberUsage(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousCaseInSwitch(), CheckString::checkSuspiciousStringCompare(), CheckClass::checkThisUseAfterFree(), CheckClass::checkThisUseAfterFreeRecursive(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckType::checkTooBigBitwiseShift(), CheckOther::checkUnreachableCode(), CheckClass::checkUnsafeClassRefMember(), CheckOther::checkUnusedLabel(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), checkVariableCallMatch(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::clarifyCalculation(), CheckCondition::clarifyCondition(), CheckOther::clarifyStatement(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), CheckCondition::comparison(), CheckOther::comparisonNonZeroExpressionLessThanZero(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), conditionString(), CheckClass::constructors(), CheckOther::constStatementError(), containerAppendsElement(), containerPopsElement(), containerYieldsElement(), CheckClass::copyconstructors(), TokenList::copyTokens(), Summaries::create(), Tokenizer::createLinks2(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseFunctionReturnTypes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), createTokenFromExpression(), clangimport::AstNode::createTokens(), CheckExceptionSafety::deallocThrow(), Variable::declEndToken(), Library::detectContainerInternal(), Library::detectSmartPointer(), CheckUninitVar::diag(), CheckCondition::diag(), doAssignment(), TemplateSimplifier::TokenAndName::dump(), Tokenizer::dump(), CheckOther::duplicateExpressionError(), Tokenizer::duplicateTypedef(), ValueFlow::eitherTheConditionIsRedundant(), Tokenizer::elseif(), CheckStl::erase(), CheckStl::eraseCheckLoopVar(), Variable::evaluate(), ValueFlowAnalyzer::evaluateInt(), TemplateSimplifier::expandTemplate(), exprDependsOnThis(), ExpressionAnalyzer::ExpressionAnalyzer(), extractForLoopValues(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findClosingBracket(), findEndOfFunctionCallForParameter(), SymbolDatabase::findEnumerator(), findExpressionStartEndTokens(), findFormat(), SymbolDatabase::findFunction(), Scope::findFunction(), SymbolDatabase::findFunctionInScope(), findInsertValue(), findLambdaEndScope(), findLambdaEndTokenGeneric(), findmatchImpl(), findOpeningBracket(), findStartToken(), findTemplateDeclarationEndImpl(), findTokensSkipDeadCodeImpl(), SymbolDatabase::findType(), findTypeEnd(), SymbolDatabase::findTypeInNested(), findUnmatchedTernaryOp(), SymbolDatabase::findVariableType(), TemplateSimplifier::fixForwardDeclaredDefaultArgumentValues(), followAllReferences(), followVariableExpression(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), CheckMemoryLeak::getAllocationType(), getArgumentPos(), getArgumentStart(), getArgumentVars(), getAstParentSkipPossibleCastAndAddressOf(), getBufAndOffset(), getCastTypeStartToken(), Library::getContainerFromAction(), getContainerFromSize(), Library::getContainerFromYield(), getContainerFunction(), getContainerIndex(), getContainerName(), getContainerYield(), ConditionHandler::Condition::getContextAndValues(), CheckMemoryLeak::getDeallocationType(), getDimensionsEtc(), getEnableIfReturnType(), getExpression(), getExprUsage(), CheckClass::getFileInfo(), getFunction(), getFunctionArgumentValues(), Library::getFunctionName(), getFunctionToken(), getFunctionUsage(), getFuncTokFromThis(), getIncompleteNameID(), getInitTokImpl(), getInvalidMethod(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariables(), getLHSVariablesRecursive(), getLHSVariableToken(), getLifetimeTokens(), TemplateSimplifier::getNewName(), Function::getOverriddenFunctionRecursive(), getOverrunIndexValues(), getParentValueTypes(), CheckMemoryLeak::getReallocationType(), getSingleFunctionCall(), getStepTokImpl(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePosition(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTokenArgumentFunctionImpl(), gettokenlistfromvalid(), Variable::getTypeName(), getTypeString(), getUnsafeFunction(), getVariableInitExpression(), Scope::getVariableList(), getVariableValues(), CheckClass::getVirtualFunctionCalls(), CheckClass::hasAllocation(), hasFunctionCall(), hasNoreturnFunction(), CheckStl::if_find(), ifvar(), inBooleanFunction(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), TokenList::insertTokens(), TemplateSimplifier::instantiateMatch(), CheckStl::invalidContainer(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), CheckIO::invalidScanf(), isAddressOfLocalVariable(), CheckCondition::isAliased(), isAliased(), ValueFlowAnalyzer::isAliasModified(), CheckIO::ArgumentInfo::isArrayOrPointer(), isAutoVar(), isBool(), isBreakOrContinueScope(), isCalculation(), isCallFunction(), iscast(), isClassStructUnionEnumStart(), isComputableValue(), isConditionKnown(), isConstant(), isConstFunctionCall(), isConstStatement(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSize(), ValueFlow::isContainerSizeChanged(), isContainerSizeChangedByFunction(), isConvertedToBool(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isDanglingSubFunction(), isEnumDefinition(), isEnumScope(), isEnumStart(), isEscaped(), isEscapedOrJump(), isEscapeFunction(), isExecutableScope(), isExpression(), isExpressionChangedAt(), Library::isFloatArgValid(), isForwardJump(), SymbolDatabase::isFunction(), isFunctionCall(), Tokenizer::isFunctionHead(), isFunctionOrBreakPattern(), CheckUninitVar::isFunctionParUsage(), isGlobalData(), ValueFlowAnalyzer::isGlobalModified(), isInConstructorList(), isInitialVarAssign(), isInLoopCondition(), Library::isIntArgValid(), isIntegralOnlyOperator(), isIntegralOrPointer(), isIterator(), CheckIO::ArgumentInfo::isKnownType(), isLikelyStream(), isLikelyStreamRead(), isLocalVarNoAutoDealloc(), isLockGuard(), isLowerEqualThanMulDiv(), isLowerThanLogicalAnd(), isLowerThanMulDiv(), isLowerThanPlusMinus(), CheckMemoryLeakStructMember::isMalloc(), isMapFind(), Tokenizer::isMemberFunction(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), ValueFlowAnalyzer::isModified(), ContainerExpressionAnalyzer::isModified(), isMutex(), isNonInvertibleOperation(), isNullOperand(), isOpenParenthesisMemberFunctionCallOfVarId(), CheckCondition::isOverlappingCond(), isParameterChanged(), CheckNullPointer::isPointerDeRef(), isPointerReleased(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), CheckMemoryLeak::isReopenStandardStream(), isReturnScope(), isSameConstantValue(), isSameExpression(), ValueFlowAnalyzer::isSameSymbolicValue(), isScopeBracket(), Library::isScopeNoReturn(), isSimpleExpr(), CheckIO::ArgumentInfo::isStdContainer(), isStdMoveOrStdForwarded(), CheckIO::ArgumentInfo::isStdVectorOrString(), isStlStringType(), isStructuredBindingVariable(), isTemporary(), isThisChanged(), isType(), isUnchanged(), isUnevaluated(), isUnknownType(), isUsedAsBool(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableDecl(), Scope::isVariableDeclaration(), isVariableMutableInInitializer(), isVariablesChanged(), CheckUninitVar::isVariableUsage(), isVariableUsed(), isVoidStmt(), ValueFlowAnalyzer::isWritable(), ContainerExpressionAnalyzer::isWritable(), CheckStl::iterators(), CheckStl::knownEmptyContainer(), Lambda::Lambda(), Tokenizer::markCppCasts(), matchMemberFunctionName(), matchMemberName(), matchMemberVarName(), TemplateSimplifier::matchSpecialization(), CheckFunctions::memsetInvalid2ndParam(), CheckFunctions::memsetZeroBytes(), minmaxCompare(), minUnsignedValue(), CheckStl::mismatchingContainerIterator(), CheckStl::mismatchingContainers(), CheckStl::missingComparison(), CheckCondition::multiCondition2(), Type::name(), CheckBufferOverrun::negativeArraySize(), CheckStl::negativeIndex(), nextAfterAstRightmostLeafGeneric(), nextArgumentBeforeCreateLinks2(), nextArgumentImpl(), nextTemplateArgument(), notvar(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckClass::operatorEqToSelf(), CheckStl::outOfBoundsIndexExpression(), CheckString::overlappingStrcmp(), SimpleConditionHandler::parse(), IteratorConditionHandler::parse(), SymbolicConditionHandler::parse(), ContainerConditionHandler::parse(), clangimport::parseClangAstDump(), parsedecl(), CheckNullPointer::parseFunctionCall(), CheckUnusedFunctions::parseTokens(), CheckBool::pointerArithBoolCond(), CheckBufferOverrun::pointerArithmetic(), Check64BitPortability::pointerassignment(), FwdAnalysis::possiblyAliased(), CheckPostfixOperator::postfixOperator(), SymbolDatabase::printOut(), Tokenizer::processFunc(), programMemoryParseCondition(), CheckOther::redundantBitwiseOperationInSwitchError(), CheckStl::redundantCondition(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacroInClassDef(), Tokenizer::removeMacrosInGlobalScope(), TemplateSimplifier::replaceTemplateUsage(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), CheckFunctions::returnLocalStdMove(), Function::returnsReference(), CheckBool::returnValueOfFunctionReturningBool(), Scope::Scope(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), setConditionalValues(), Function::setFlags(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), setValueBound(), ValueFlow::setValues(), Variable::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyParameterVoid(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleAssignInScope(), singleIncrementInScope(), singleMemberCallInScope(), CheckStl::size(), Tokenizer::sizeofAddParentheses(), CheckSizeof::sizeofsizeof(), CheckSizeof::sizeofVoid(), skipBracketsAndMembers(), skipCaseLabel(), skipCVRefs(), skipDecl(), skipEnumBody(), skipInitializerList(), skipLocalVars(), skipMembers(), ConditionHandler::skipNotAndCasts(), skipPointers(), skipPointersAndQualifiers(), skipRequires(), skipScopeIdentifiers(), skipTernaryOp(), Variable::smartPointerType(), ValueFlow::solveExprValue(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckString::sprintfOverlappingData(), Tokenizer::startOfExecutableScope(), CheckStl::stlBoundaries(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), stringFromTokenRange(), CheckString::stringLiteralWrite(), MemberExpressionAnalyzer::submatch(), CheckSizeof::suspiciousSizeofCalculation(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), tokenIsFunctionReturningBool(), ConditionHandler::traverseCondition(), typeDecl(), typeOf(), TemplateSimplifier::useDefaultArgumentValues(), useFunctionArgs(), CheckStl::uselessCalls(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), usingNamespace(), CheckVaarg::va_list_usage(), Tokenizer::validate(), Tokenizer::validateC(), valueFlowAfterMove(), valueFlowArray(), valueFlowArrayBool(), valueFlowArrayElement(), valueFlowConditionExpressions(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowForLoopSimplify(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowFunctionDefaultParameter(), valueFlowFunctionReturn(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowLifetime(), valueFlowLifetimeClassConstructor(), valueFlowLifetimeConstructor(), valueFlowLifetimeFunction(), valueFlowNumber(), valueFlowSameExpressions(), valueFlowSetConditionToKnown(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSubFunction(), valueFlowSwitchVariable(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), CheckUninitVar::valueFlowUninit(), valueFlowUninit(), CheckMemoryLeakInClass::variable(), Variable::Variable(), CheckClass::virtualDestructor(), CheckClass::virtualFunctionCallInConstructorError(), CheckOther::warningOldStylePointerCast(), and ContainerExpressionAnalyzer::writeValue().

◆ move()

void Token::move ( Token srcStart,
Token srcEnd,
Token newLocation 
)
static

Move srcStart and srcEnd tokens and all tokens between them into new a location.

Only links between tokens are changed.

Parameters
srcStartThis is the first token to be moved
srcEndThe last token to be moved
newLocationsrcStart will be placed after this token.

[newLocation] -> b -> c -> [srcStart] -> [srcEnd] -> f

Definition at line 834 of file token.cpp.

References mImpl, TokenImpl::mProgressValue, next(), and previous().

Referenced by Tokenizer::simplifyAddBracesPair().

◆ multiCompare()

int Token::multiCompare ( const Token tok,
const char *  haystack,
nonneg int  varid 
)
staticprivate

Needle is build from multiple alternatives.

If one of them is equal to haystack, return value is 1. If there are no matches, but one alternative to needle is empty string, return value is 0. If needle was not found, return value is -1.

Parameters
tokCurrent token (needle)
haystacke.g. "one|two" or "|one|two"
varidoptional varid of token
Returns
1 if needle is found from the haystack 0 if needle was empty string -1 if needle was not found

Definition at line 626 of file token.cpp.

References multiCompareImpl().

◆ next() [1/3]

Token* Token::next ( )
inline

Definition at line 830 of file token.h.

Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Scope::addEnum(), TemplateSimplifier::addInstantiation(), SymbolDatabase::addNewFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyzeMatch(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::argumentSize(), CheckIO::argumentType(), CheckNullPointer::arithmetic(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckAssert::assertWithSideEffects(), CheckAutoVariables::assignFunctionArg(), CheckCondition::assignIf(), CheckCondition::assignIfParseScope(), assignIndexes(), assignProgressValues(), CheckAutoVariables::autoVariables(), bifurcateVariableChanged(), CheckBufferOverrun::bufferOverflow(), TokenList::calculateHash(), Tokenizer::calculateScopes(), CheckUninitVar::check(), FwdAnalysis::check(), CheckOther::checkAccessOfMovedVariable(), CheckString::checkAlwaysTrueOrFalseStringCompare(), CheckBool::checkAssignBoolToFloat(), CheckBool::checkAssignBoolToPointer(), CheckCondition::checkAssignmentInCondition(), CheckAutoVariables::checkAutoVariableAssignment(), CheckCondition::checkBadBitmaskCheck(), CheckBool::checkBitwiseOnBoolean(), CheckBoost::checkBoostForeachModification(), CheckOther::checkCastIntToCharAndBack(), CheckOther::checkCharVariable(), CheckOther::checkCommaSeparatedReturn(), CheckOther::checkComparePointers(), CheckCondition::checkCompareValueOutOfTypeRange(), CheckOther::checkComparisonFunctionIsAlwaysTrueOrFalse(), CheckBool::checkComparisonOfBoolExpressionWithInt(), CheckBool::checkComparisonOfBoolWithBool(), CheckBool::checkComparisonOfBoolWithInt(), CheckBool::checkComparisonOfFuncReturningBool(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), Tokenizer::checkConfiguration(), CheckClass::checkConst(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckIO::checkCoutCerrMisusage(), CheckStl::checkDereferenceInvalidIterator(), CheckStl::checkDereferenceInvalidIterator2(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CppCheck::checkFile(), CheckIO::checkFileUsage(), CheckStl::checkFindInsert(), CheckType::checkFloatToIntegerOverflow(), Tokenizer::checkForEnumsWithTypedef(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckUninitVar::checkIfForWhileHead(), CheckFunctions::checkIgnoredReturnValue(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncompleteStatement(), CheckCondition::checkIncorrectLogicOperator(), CheckString::checkIncorrectStringCompare(), CheckBool::checkIncrementBoolean(), CheckOther::checkInnerScope(), CheckType::checkIntegerOverflow(), CheckOther::checkInterlockedDecrement(), CheckOther::checkInvalidFree(), CheckCondition::checkInvalidTestForOverflow(), CheckOther::checkKnownArgument(), CheckOther::checkKnownPointerToBool(), CheckFunctions::checkLibraryMatchFunctions(), CheckType::checkLongCast(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckOther::checkModuloOfOne(), CheckStl::checkMutexes(), CheckOther::checkNanInArithmeticExpression(), CheckOther::checkNegativeBitwiseShift(), CheckOther::checkOverlappingWrite(), CheckCondition::checkPointerAdditionResultNotNull(), CheckFunctions::checkProhibitedFunctions(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckOther::checkRedundantPointerOp(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkRhs(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckType::checkSignConversion(), CheckOther::checkSignOfUnsignedVariable(), CheckSizeof::checkSizeofForArrayParameter(), CheckSizeof::checkSizeofForNumericParameter(), CheckSizeof::checkSizeofForPointerSize(), CheckUninitVar::checkStruct(), CheckUnusedVar::checkStructMemberUsage(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousCaseInSwitch(), CheckString::checkSuspiciousStringCompare(), CheckClass::checkThisUseAfterFree(), CheckClass::checkThisUseAfterFreeRecursive(), CheckType::checkTooBigBitwiseShift(), CheckOther::checkUnreachableCode(), CheckClass::checkUnsafeClassRefMember(), CheckOther::checkUnusedLabel(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::checkZeroDivision(), CheckOther::clarifyCalculation(), CheckCondition::clarifyCondition(), CheckOther::clarifyStatement(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), compareTokenRanges(), CheckCondition::comparison(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), CheckClass::constructors(), CheckClass::copyconstructors(), TokenList::copyTokens(), countPar(), Summaries::create(), Tokenizer::createLinks(), Tokenizer::createLinks2(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseEnums(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseFunctionReturnTypes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), SymbolDatabase::createSymbolDatabaseSetScopePointers(), SymbolDatabase::createSymbolDatabaseSetTypePointers(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), createTokenFromExpression(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensFunctionDecl(), clangimport::AstNode::createTokensVarDecl(), CheckExceptionSafety::deallocThrow(), SymbolDatabase::debugSymbolDatabase(), Variable::declEndToken(), Tokenizer::deleteInvalidTypedef(), deleteNext(), deletePrevious(), TemplateSimplifier::deleteToken(), TokenList::deleteTokens(), CheckExceptionSafety::destructors(), Library::detectSmartPointer(), doAssignment(), Tokenizer::dump(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), ValueFlow::eitherTheConditionIsRedundant(), Tokenizer::elseif(), endOfExpression(), CheckStl::eraseCheckLoopVar(), CheckStl::eraseIteratorOutOfBounds(), TemplateSimplifier::eraseTokens(), eraseTokens(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), extractForLoopValues(), findClosingBracket(), findExpression(), SymbolDatabase::findFunction(), Scope::findFunction(), SymbolDatabase::findFunctionInScope(), findIncompleteVar(), findLambdaEndScope(), findmatchImpl(), findNextTokenFromBreak(), Function::findReturns(), SymbolDatabase::findScope(), findsimplematchImpl(), findThisChanged(), SymbolDatabase::findType(), findTypeEnd(), SymbolDatabase::findTypeInNested(), findUnmatchedTernaryOp(), findVarBound(), findVariableChanged(), TemplateSimplifier::fixForwardDeclaredDefaultArgumentValues(), followVariableExpression(), ConditionHandler::forward(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), functionThrowsRecursive(), CheckMemoryLeak::getAllocationType(), getArgumentPos(), getArgumentStart(), getCastTypeStartToken(), getContainerFunction(), CheckMemoryLeak::getDeallocationType(), getEnableIfReturnType(), getEndOfVarScope(), getEnumType(), getExpression(), CTU::getFileInfo(), CheckClass::getFileInfo(), getFunctionArguments(), Library::getFunctionName(), getFunctionToken(), getFunctionUsage(), getFuncTokFromThis(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLoopContainer(), TemplateSimplifier::getNewName(), getPointerDepth(), CheckMemoryLeak::getReallocationType(), getSingleFunctionCall(), getSingleReturnVar(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), TemplateSimplifier::getTemplateParametersInDeclaration(), gettokenlistfromvalid(), ValueFlowPassRunner::getTotalValues(), getTypeString(), getUnsafeFunction(), getVariableChangedStart(), Scope::getVariableList(), getVariableValues(), goToLeftParenthesis(), CheckClass::hasAllocation(), CheckClass::hasAssignSelf(), hasToken(), CheckStl::if_find(), ifvar(), inBooleanFunction(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), TokenList::insertTokens(), TemplateSimplifier::instantiateMatch(), invalidateForwardDecls(), invalidateInst(), CheckStl::invalidContainer(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), CheckIO::invalidScanf(), CheckCondition::isAliased(), isAliased(), TemplateSimplifier::TokenAndName::isAliasToken(), isAlignAttribute(), CheckIO::ArgumentInfo::isArrayOrPointer(), isCallFunction(), iscast(), isConstExpression(), isConstFunctionCall(), isConstStatement(), isContainerSizeChanged(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isEarlyExit(), isEnumDefinition(), Library::isFloatArgValid(), isForwardJump(), SymbolDatabase::isFunction(), isFunctionCall(), Tokenizer::isFunctionHead(), CheckUnusedVar::isFunctionWithoutSideEffects(), ValueFlowAnalyzer::isGlobalModified(), Library::isIntArgValid(), CheckMemoryLeakStructMember::isMalloc(), CheckUninitVar::isMemberVariableUsage(), isNonConstFunctionCall(), isNotEqual(), isOpenParenthesisMemberFunctionCallOfVarId(), isPointerReleased(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isSameExpression(), isTemporary(), isUnchanged(), isUnknownType(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableDecl(), Scope::isVariableDeclaration(), isVariableInit(), isVariableMutableInInitializer(), isVariablesChanged(), CheckStl::iterators(), CheckStl::knownEmptyContainer(), Lambda::Lambda(), Tokenizer::markCppCasts(), SuppressionList::markUnmatchedInlineSuppressionsAsChecked(), Match(), matchMemberName(), matchMemberVarName(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), CheckFunctions::memsetInvalid2ndParam(), CheckFunctions::memsetZeroBytes(), CheckStl::mismatchingContainerIterator(), CheckStl::mismatchingContainers(), CheckStl::missingComparison(), move(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), Type::name(), CheckBufferOverrun::negativeArraySize(), CheckStl::negativeIndex(), nextArgumentBeforeCreateLinks2(), nextTemplateArgument(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByDeRefAndChec(), numberOfArgumentsWithoutAst(), CheckBufferOverrun::objectIndex(), CheckStl::outOfBounds(), CheckStl::outOfBoundsIndexExpression(), CheckString::overlappingStrcmp(), clangimport::parseClangAstDump(), parsedecl(), CheckUnusedFunctions::parseTokens(), CheckBool::pointerArithBool(), CheckBufferOverrun::pointerArithmetic(), Check64BitPortability::pointerassignment(), CheckPostfixOperator::postfixOperator(), Tokenizer::printDebugOutput(), printLines(), SymbolDatabase::printOut(), TemplateSimplifier::printOut(), printValueFlow(), SymbolDatabase::printVariable(), Tokenizer::processFunc(), programMemoryParseCondition(), CheckOther::redundantBitwiseOperationInSwitchError(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacroInClassDef(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removePragma(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::removeTemplate(), replace(), TemplateSimplifier::replaceTemplateUsage(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), CheckExceptionSafety::rethrowNoCurrentException(), CheckBool::returnValueOfFunctionReturningBool(), Scope::Scope(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), setTokenValue(), setTypes(), ExpressionAnalyzer::setupExprVarIds(), setValues(), ValueFlow::setValues(), Variable::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), Tokenizer::setVarId(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), simpleMatch(), Tokenizer::simplifyAddBraces(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyParameterVoid(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySQL(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTokens1(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingError(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleAssignInScope(), singleConditionalInScope(), singleIncrementInScope(), singleMemberCallInScope(), singleStatement(), CheckStl::size(), Tokenizer::sizeofAddParentheses(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), CheckSizeof::sizeofsizeof(), CheckSizeof::sizeofVoid(), skipCaseLabel(), skipCVRefs(), skipDecl(), skipLocalVars(), skipPointers(), skipPointersAndQualifiers(), skipRequires(), skipScopeIdentifiers(), skipTernaryOp(), Variable::smartPointerType(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckString::sprintfOverlappingData(), Tokenizer::startOfExecutableScope(), CheckStl::stlBoundaries(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), stringFromTokenRange(), stringifyList(), CheckString::stringLiteralWrite(), CheckBufferOverrun::stringNotZeroTerminated(), CheckString::strPlusChar(), MemberExpressionAnalyzer::submatch(), CheckSizeof::suspiciousSizeofCalculation(), TemplateSimplifier::templateParameters(), CheckClass::thisSubtraction(), tokDistance(), TemplateSimplifier::TokenAndName::TokenAndName(), ConditionHandler::traverseCondition(), Type::Type(), typeDecl(), typeOf(), typesMatch(), CheckExceptionSafety::unhandledExceptionSpecification(), Tokenizer::unsupportedTypedef(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), usingNamespace(), CheckVaarg::va_list_usage(), CheckVaarg::va_start_argument(), Tokenizer::validate(), Tokenizer::validateC(), validTokenEnd(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowAfterSwap(), valueFlowArray(), valueFlowArrayBool(), valueFlowArrayElement(), valueFlowBitAnd(), valueFlowConditionExpressions(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowDebug(), valueFlowDynamicBufferSize(), valueFlowForLoop(), valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForLoopSimplifyAfter(), valueFlowForwardAssign(), valueFlowForwardConst(), valueFlowForwardLifetime(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowInjectParameter(), valueFlowIteratorInfer(), valueFlowIterators(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowNumber(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSafeFunctions(), valueFlowSameExpressions(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowString(), valueFlowSubFunction(), valueFlowSwitchVariable(), valueFlowSymbolic(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), CheckUninitVar::valueFlowUninit(), valueFlowUninit(), valueFlowUnknownFunctionReturn(), CheckMemoryLeakInClass::variable(), Variable::Variable(), variableIsUsedInScope(), CheckClass::virtualDestructor(), CheckClass::virtualFunctionCallInConstructorError(), CheckOther::warningOldStylePointerCast(), Variables::write(), and SymbolDatabase::~SymbolDatabase().

◆ next() [2/3]

const Token* Token::next ( ) const
inline

Definition at line 834 of file token.h.

◆ next() [3/3]

void Token::next ( Token nextToken)
inlineprivate

Definition at line 1255 of file token.h.

◆ nextArgument() [1/2]

Token * Token::nextArgument ( )

Definition at line 874 of file token.cpp.

References nextArgumentImpl().

◆ nextArgument() [2/2]

const Token * Token::nextArgument ( ) const

◆ nextArgumentBeforeCreateLinks2()

const Token * Token::nextArgumentBeforeCreateLinks2 ( ) const
Returns
the first token of the next argument. Does only work on argument lists. Should be used only before Tokenizer::createLinks2() was called. Returns 0, if there is no next argument.

Definition at line 879 of file token.cpp.

References findClosingBracket(), link(), Match(), and next().

Referenced by getFunctionArguments(), and Tokenizer::setVarIdPass1().

◆ nextTemplateArgument()

const Token * Token::nextTemplateArgument ( ) const
Returns
the first token of the next template argument. Does only work on template argument lists. Requires that Tokenizer::createLinks2() has been called before. Returns 0, if there is no next argument.

Definition at line 896 of file token.cpp.

References link(), Match(), and next().

Referenced by Variable::arrayDimensions(), CheckStl::if_find(), and parsedecl().

◆ operator=()

Token& Token::operator= ( const Token )
delete

◆ originalName() [1/2]

const std::string& Token::originalName ( ) const
inline

◆ originalName() [2/2]

template<typename T >
void Token::originalName ( T &&  name)
inline

Sets the original name.

Definition at line 1205 of file token.h.

◆ previous() [1/3]

Token* Token::previous ( )
inline

Definition at line 862 of file token.h.

Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), ValueFlowAnalyzer::analyzeCondition(), CheckIO::ArgumentInfo::ArgumentInfo(), Tokenizer::arraySize(), CheckCondition::assignIf(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astParentSkipParens(), ConditionHandler::beforeCondition(), LifetimeStore::byDerefCopy(), Tokenizer::calculateScopes(), CheckLeakAutoVar::changeAllocStatus(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBool::checkComparisonOfBoolWithBool(), CheckBool::checkComparisonOfFuncReturningBool(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckUninitVar::checkExpr(), CheckIO::checkFileUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteStatement(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckUninitVar::checkLoopBodyRecursive(), CheckClass::checkMemset(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantCopy(), checkReturns(), CheckUninitVar::checkRhs(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSuspiciousSemicolon(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkUnreachableCode(), CheckOther::checkUnusedLabel(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckOther::clarifyStatement(), Tokenizer::combineOperators(), CheckClass::constructors(), Tokenizer::createLinks2(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensVarDecl(), Tokenizer::deleteInvalidTypedef(), deleteNext(), deletePrevious(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), CheckStl::erase(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findClosingBracket(), SymbolDatabase::findFunction(), Scope::findFunction(), findOpeningBracket(), findOpenParentesisOfMove(), findStartToken(), TemplateSimplifier::fixForwardDeclaredDefaultArgumentValues(), followAllReferences(), Function::Function(), getArgumentVars(), Library::getContainerFromAction(), Library::getContainerFromYield(), getContainerYield(), getExpression(), FwdAnalysis::getExprVarIds(), Library::getFunctionName(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLifetimeTokens(), Function::getOverriddenFunctionRecursive(), getParentLifetime(), getSingleFunctionCall(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateParametersInDeclaration(), Scope::getVariableList(), getVariableValues(), CheckClass::getVirtualFunctionCalls(), goToRightParenthesis(), hasGccCompoundStatement(), hasNoreturnFunction(), CheckClass::initializeVarList(), insertToken(), isBasicForLoop(), isCallFunction(), iscast(), isClassStructUnionEnumStart(), isConditionKnown(), isConstFunctionCall(), isConstStatement(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSize(), Library::isContainerYield(), isCPPCast(), isDanglingSubFunction(), isEnumScope(), isExecutableScope(), isForwardJump(), SymbolDatabase::isFunction(), CheckUninitVar::isFunctionParUsage(), isGlobalData(), isInConstructorList(), isInLoopCondition(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), isParameterChanged(), isPartOfClassStructUnion(), Variable::isPointerArray(), CheckNullPointer::isPointerDeRef(), isRangeForScope(), isReturnScope(), isSameExpression(), Library::isScopeNoReturn(), Tokenizer::isScopeNoReturn(), isSimpleExpr(), isStrlenOf(), isStructuredBindingVariable(), isTemporary(), isThisChanged(), isVariableChanged(), isVariableChangedByFunctionCall(), CheckUninitVar::isVariableUsage(), isVoidStmt(), CheckStl::iterators(), TemplateSimplifier::matchSpecialization(), move(), CheckCondition::multiCondition2(), CheckNullPointer::nullConstantDereference(), CheckClass::operatorEqToSelf(), parsedecl(), CheckUnusedFunctions::parseTokens(), Check64BitPortability::pointerassignment(), FwdAnalysis::possiblyAliased(), CheckPostfixOperator::postfixOperator(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacrosInGlobalScope(), replace(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), Function::returnsPointer(), Function::returnsReference(), Function::returnsStandardType(), Function::returnsVoid(), Function::setFlags(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), setValues(), Variable::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleAssignInScope(), CheckStl::size(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), skipDecl(), skipLocalVars(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckStl::string_c_str(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), tokenIsFunctionReturningBool(), ConditionHandler::traverseCondition(), typeDecl(), typeOf(), typesMatch(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), CheckVaarg::va_list_usage(), Tokenizer::validateC(), validTokenStart(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowEnumValue(), valueFlowForLoopSimplify(), valueFlowForwardLifetime(), valueFlowFunctionReturn(), valueFlowLibraryFunction(), valueFlowLifetime(), valueFlowLifetimeClassConstructor(), valueFlowLifetimeConstructor(), valueFlowLifetimeFunction(), valueFlowSmartPointer(), valueFlowSwitchVariable(), valueFlowUnknownFunctionReturn(), Variable::Variable(), CheckClass::virtualFunctionCallInConstructorError(), and CheckOther::warningOldStylePointerCast().

◆ previous() [2/3]

const Token* Token::previous ( ) const
inline

Definition at line 866 of file token.h.

◆ previous() [3/3]

void Token::previous ( Token previousToken)
inlineprivate

Definition at line 1258 of file token.h.

◆ printAst()

void Token::printAst ( bool  verbose,
bool  xml,
const std::vector< std::string > &  fileNames,
std::ostream &  out 
) const

Definition at line 1681 of file token.cpp.

Referenced by Tokenizer::printDebugOutput().

◆ printLines()

void Token::printLines ( int  lines = 5) const

print out tokens - used for debugging

Definition at line 1272 of file token.cpp.

References Token::stringifyOptions::forDebugExprId(), linenr(), next(), and stringifyList().

◆ printOut() [1/2]

void Token::printOut ( const char *  title,
const std::vector< std::string > &  fileNames 
) const

For debugging purposes, prints token and all tokens followed by it.

Parameters
titleTitle for the printout or use default parameter or 0 for no title.
fileNamesPrints out file name instead of file index. File index should match the index of the string in this vector.

Definition at line 1264 of file token.cpp.

References Token::stringifyOptions::forPrintOut(), and stringifyList().

◆ printOut() [2/2]

void Token::printOut ( const char *  title = nullptr) const

For debugging purposes, prints token and all tokens followed by it.

Parameters
titleTitle for the printout or use default parameter or 0 for no title.

Definition at line 1257 of file token.cpp.

References Token::stringifyOptions::forPrintOut(), and stringifyList().

Referenced by Tokenizer::printDebugOutput(), and TemplateSimplifier::simplifyTemplates().

◆ printValueFlow()

void Token::printValueFlow ( bool  xml,
std::ostream &  out 
) const

◆ progressValue()

nonneg int Token::progressValue ( ) const
inline

◆ removeValues()

void Token::removeValues ( std::function< bool(const ValueFlow::Value &)>  pred)
inline

Definition at line 1242 of file token.h.

Referenced by valueFlowSmartPointer().

◆ replace()

void Token::replace ( Token replaceThis,
Token start,
Token end 
)
static

Replace token replaceThis with tokens between start and end, including start and end.

The replaceThis token is deleted.

Parameters
replaceThisThis token will be deleted.
startThis will be in the place of replaceThis
endThis is also in the place of replaceThis

Definition at line 346 of file token.cpp.

References TokensFrontBack::back, mImpl, TokenImpl::mProgressValue, mTokensFrontBack, next(), and previous().

Referenced by Tokenizer::simplifyFunctionParameters(), and Tokenizer::simplifyTypedef().

◆ scope() [1/2]

const Scope* Token::scope ( ) const
inline
Returns
a pointer to the scope containing this token.

Definition at line 1049 of file token.h.

Referenced by insertToken(), typeDecl(), and typeOf().

◆ scope() [2/2]

void Token::scope ( const Scope s)
inline

Associate this token with given scope.

Parameters
sScope to be associated

Definition at line 1042 of file token.h.

Referenced by accumulateStructMembers(), SymbolDatabase::addClassFunction(), clangimport::AstNode::addFullScopeNameTokens(), clangimport::AstNode::addtoken(), clangimport::AstNode::addTypeTokens(), CheckBufferOverrun::arrayIndex(), Tokenizer::arraySizeAfterValueFlow(), CheckOther::checkConstPointer(), CheckOther::checkDuplicateExpression(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkInnerScope(), CheckClass::checkMemset(), checkMissingReturnScope(), CheckStl::checkMutexes(), FwdAnalysis::checkRecursive(), CheckOther::checkUnreachableCode(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckClass::constructors(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensForCXXRecord(), clangimport::AstNode::createTokensFunctionDecl(), clangimport::AstNode::createTokensVarDecl(), CheckExceptionSafety::deallocThrow(), Tokenizer::dump(), exprDependsOnThis(), fillProgramMemoryFromConditions(), SymbolDatabase::findEnumerator(), findExpression(), SymbolDatabase::findFunction(), Scope::findFunction(), findNextTokenFromBreak(), Function::findReturns(), findStartToken(), followVariableExpression(), PathAnalysis::forward(), Function::Function(), getEndOfVarScope(), Library::getFunctionName(), getLoopScope(), clangimport::AstNode::getNestedInScope(), getVariableValues(), inBooleanFunction(), CheckAssert::inSameScope(), isDanglingSubFunction(), isDeadScope(), isEscapeScope(), isExpression(), isInScope(), CheckNullPointer::isPointerDeRef(), isScope(), isScopeBracket(), isWithinScope(), CheckStl::iterators(), CheckCondition::multiCondition2(), parsedecl(), CheckUnusedFunctions::parseTokens(), FwdAnalysis::possiblyAliased(), CheckLeakAutoVar::ret(), CheckBool::returnValueOfFunctionReturningBool(), clangimport::AstNode::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), TemplateSimplifier::simplifyTemplateAliases(), skipLocalVars(), Variable::smartPointerType(), typeDecl(), typeOf(), SingleValueFlowAnalyzer::updateScope(), MultiValueFlowAnalyzer::updateScope(), CheckVaarg::va_list_usage(), valueFlowContainerSize(), valueFlowForLoopSimplifyAfter(), valueFlowForward(), valueFlowIteratorInfer(), valueFlowIterators(), valueFlowLifetime(), valueFlowSmartPointer(), valueFlowUninit(), and SymbolDatabase::~SymbolDatabase().

◆ scopeInfo() [1/2]

std::shared_ptr< ScopeInfo2 > Token::scopeInfo ( ) const

Definition at line 2514 of file token.cpp.

References mImpl, and TokenImpl::mScopeInfo.

◆ scopeInfo() [2/2]

void Token::scopeInfo ( std::shared_ptr< ScopeInfo2 newScopeInfo)

◆ setBits()

void Token::setBits ( const unsigned char  b)
inline

Definition at line 703 of file token.h.

◆ setCpp11init()

void Token::setCpp11init ( bool  cpp11init) const
inline

Definition at line 1468 of file token.h.

References TokenImpl::CPP11INIT, and TokenImpl::NOINIT.

◆ setCppcheckAttribute()

void Token::setCppcheckAttribute ( TokenImpl::CppcheckAttributes::Type  type,
MathLib::bigint  value 
)
inline

Definition at line 536 of file token.h.

◆ setFlag()

void Token::setFlag ( uint64_t  flag_,
bool  state_ 
)
inlineprivate

Set specified flag state.

Parameters
flag_flag to set state
state_new state of flag

Definition at line 1356 of file token.h.

Referenced by update_property_info().

◆ setMacroName()

void Token::setMacroName ( std::string  name)
inline

◆ setRemovedVoidParameter()

void Token::setRemovedVoidParameter ( bool  b)
inline

Definition at line 653 of file token.h.

Referenced by Tokenizer::simplifyParameterVoid().

◆ setTokenDebug()

void Token::setTokenDebug ( TokenDebug  td)
inline

Definition at line 1478 of file token.h.

Referenced by TokenList::copyTokens().

◆ setUniqueExprId()

void Token::setUniqueExprId ( )
inline

Definition at line 892 of file token.h.

◆ setValueType()

void Token::setValueType ( ValueType vt)

◆ simpleMatch() [1/2]

bool Token::simpleMatch ( const Token tok,
const char  pattern[],
size_t  pattern_len 
)
static

Definition at line 631 of file token.cpp.

References mStr, and next().

◆ simpleMatch() [2/2]

template<size_t count>
static bool Token::simpleMatch ( const Token tok,
const char(&)  pattern[count] 
)
inlinestatic

Match given token (or list of tokens) to a pattern list.

Possible patterns "someRandomText" If token contains "someRandomText".

Note
Use Match() if you want to use flags in patterns

The patterns can be also combined to compare to multiple tokens at once by separating tokens with a space, e.g. ") void {" will return true if first token is ')' next token is "void" and token after that is '{'. If even one of the tokens does not match its pattern, false is returned.

Parameters
tokList of tokens to be compared to the pattern
patternThe pattern against which the tokens are compared, e.g. "const" or ") void {".
Returns
true if given token matches with given pattern false if given token does not match with given pattern

Definition at line 252 of file token.h.

Referenced by accumulateBool(), Function::addArguments(), SymbolDatabase::addClassFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), ConditionHandler::afterCondition(), TemplateSimplifier::alreadyHasNamespace(), CheckCondition::alwaysTrueFalse(), CheckCondition::alwaysTrueFalseError(), ValueFlowAnalyzer::analyze(), ValueFlowAnalyzer::analyzeLifetime(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckAssert::assertWithSideEffects(), CheckCondition::assignIfParseScope(), ProgramMemoryState::assume(), ValueFlowAnalyzer::assume(), astIsRangeBasedForDecl(), astParentSkipParens(), CheckAutoVariables::autoVariables(), ConditionHandler::beforeCondition(), CheckBufferOverrun::bufferOverflow(), Tokenizer::calculateScopes(), CheckLeakAutoVar::changeAllocStatus(), CheckCondition::checkAssignmentInCondition(), CheckAutoVariables::checkAutoVariableAssignment(), CheckBoost::checkBoostForeachModification(), CheckOther::checkCharVariable(), CheckBool::checkComparisonOfFuncReturningBool(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckClass::checkExplicitConstructors(), CheckIO::checkFileUsage(), CheckStl::checkFindInsert(), CheckStl::checkFindInsertError(), CheckMemoryLeakNoVar::checkForUnreleasedInputArgument(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteStatement(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckFunctions::checkLibraryMatchFunctions(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckOther::checkNanInArithmeticExpression(), CheckOther::checkOverlappingWrite(), CheckFunctions::checkProhibitedFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), checkReturns(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousSemicolon(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckType::checkTooBigBitwiseShift(), CheckOther::checkUnreachableCode(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckCondition::clarifyCondition(), Tokenizer::combineOperators(), CheckOther::comparePointersError(), Function::constructorMemberInitialization(), CheckClass::constructors(), CheckOther::constStatementError(), Summaries::create(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseNeedInitialization(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), clangimport::AstNode::createTokens(), CheckExceptionSafety::deallocThrow(), CheckExceptionSafety::destructors(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), endOfExpression(), CheckStl::erase(), CheckStl::eraseCheckLoopVar(), CheckStl::eraseIteratorOutOfBounds(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), exprDependsOnThis(), extractForLoopValues(), fillProgramMemoryFromAssignments(), findAllocFuncCallToken(), findClosingBracket(), SymbolDatabase::findEnumerator(), findExpressionStartEndTokens(), SymbolDatabase::findFunction(), findInsertValue(), findLambdaEndScope(), findLambdaStartToken(), findNextTokenFromBreak(), Function::findReturns(), SymbolDatabase::findScope(), findsimplematchImpl(), findStartToken(), findTemplateDeclarationEndImpl(), findTokensSkipDeadCodeImpl(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), findVarBound(), SymbolDatabase::findVariableType(), followAllReferences(), PathAnalysis::forwardRange(), Function::Function(), CheckLeakAutoVar::functionCall(), functionThrowsRecursive(), getAddressContainer(), CheckMemoryLeak::getAllocationType(), Library::getAllocFuncInfo(), getArgumentStart(), getArgumentVars(), getBufAndOffset(), getCastTypeStartToken(), getCondTokFromEndImpl(), getCondTokImpl(), Library::getContainerFromAction(), Library::getContainerFromYield(), getContainerIndex(), getContainerSizeFromConstructor(), getContainerSizeFromConstructorArgs(), Library::getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getDeallocFuncInfo(), getEnableIfReturnType(), getExprUsage(), CheckClass::getFileInfo(), getFunction(), Library::getFunctionName(), getFunctionToken(), getFuncTokFromThis(), CheckClass::getIfStmtBodyStart(), getInitTokImpl(), getIteratorExpression(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLifetimeTokens(), getLoopContainer(), getOverrunIndexValues(), getParentLifetime(), getParentLifetimeObject(), getParentMember(), getParentMembers(), getParentValueTypes(), getParentVar(), getPointerDepth(), Library::getReallocFuncInfo(), getSingleExpressionInBlock(), getSingleFunctionCall(), getStepTokImpl(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTokenArgumentFunctionImpl(), Variable::getTypeName(), Library::getUseRetValType(), Scope::getVariableList(), CheckClass::getVirtualFunctionCalls(), CheckClass::hasAssignSelf(), hasEmptyCaptureList(), hasGccCompoundStatement(), hasNoreturnFunction(), hasOverloadedAssignment(), hasVolatileCastOrVar(), CheckCondition::identicalConditionAfterEarlyExitError(), CheckStl::if_find(), ifvar(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), insertToken(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), isAlignAttribute(), isArray(), isAssignedToNonLocal(), isAutoVarArray(), isBasicForLoop(), isBracketAccess(), isBreakOrContinueScope(), isBreakScope(), iscast(), isConditionKnown(), isConstFunctionCall(), isConstMethod(), isConstStatement(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSize(), ValueFlow::isContainerSizeChanged(), isContainerSizeChangedByFunction(), Library::isContainerYield(), isCPPAttribute(), isCPPCast(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isDanglingSubFunction(), isDeadTemporary(), isDecayedPointer(), isEnumDefinition(), isEnumScope(), isEscaped(), isEscapedOrJump(), isEscapedReference(), isEscapeScope(), isExecutableScope(), isExpression(), isForLoopCondition(), isForLoopIncrement(), SymbolDatabase::isFunction(), isFunctionCall(), Library::isFunctionConst(), CheckUninitVar::isFunctionParUsage(), CheckUnusedVar::isFunctionWithoutSideEffects(), ValueFlowAnalyzer::isGlobalModified(), isIfConstexpr(), isInConstructorList(), CheckClass::isInverted(), isLeafDot(), isLocalContainerBuffer(), isMapFind(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), ValueFlowAnalyzer::isModified(), isMoveOrForward(), SymbolicConditionHandler::isNegatedBool(), isNonMacro(), Library::isnoreturn(), isNullablePointer(), CheckMemoryLeak::isOpenDevNull(), isRangeForScope(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isReturnScope(), isSameExpression(), isScope(), Library::isScopeNoReturn(), Tokenizer::isScopeNoReturn(), isStdMoveOrStdForwarded(), isStlStringType(), isStrlenOf(), isStructuredBindingVariable(), isTemporary(), isThisChanged(), isType(), isUnchanged(), isUsedAsBool(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), isVariableExpression(), isVariableExprHidden(), isVariableInit(), CheckUninitVar::isVariableUsage(), isVarUsedInTree(), isVector(), isVoidCast(), isVoidStmt(), ContainerExpressionAnalyzer::isWritable(), CheckStl::iterators(), CheckStl::knownEmptyContainer(), Lambda::Lambda(), lifetimeType(), Tokenizer::markCppCasts(), matchMemberName(), ValueType::matchParameter(), TemplateSimplifier::matchSpecialization(), CheckFunctions::memsetInvalid2ndParam(), CheckStl::mismatchingContainerIterator(), CheckStl::missingComparison(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), CheckNullPointer::nullConstantDereference(), numberOfArgumentsWithoutAst(), CheckBufferOverrun::objectIndex(), CheckBufferOverrun::objectIndexError(), CheckStl::outOfBounds(), CheckString::overlappingStrcmp(), SimpleConditionHandler::parse(), parsedecl(), CheckUnusedFunctions::parseTokens(), FwdAnalysis::possiblyAliased(), Tokenizer::processFunc(), programMemoryParseCondition(), Tokenizer::removePragma(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::removeTemplate(), TemplateSimplifier::replaceTemplateUsage(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), CheckExceptionSafety::rethrowNoCurrentException(), CheckFunctions::returnLocalStdMove(), Function::returnsPointer(), Function::returnsReference(), Function::returnsVoid(), CheckBool::returnValueOfFunctionReturningBool(), Library::returnValueType(), setConditionalValues(), Function::setFlags(), setTokenValue(), setTypes(), ExpressionAnalyzer::setupExprVarIds(), setValues(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySQL(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypedefLHS(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), singleAssignInScope(), singleConditionalInScope(), singleMemberCallInScope(), singleStatement(), Tokenizer::sizeofAddParentheses(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), CheckSizeof::sizeofVoid(), skipDecl(), skipLocalVars(), SymbolicConditionHandler::skipNot(), ConditionHandler::skipNotAndCasts(), skipPointers(), skipRequires(), ValueFlow::solveExprValue(), Tokenizer::splitTemplateRightAngleBrackets(), CheckString::sprintfOverlappingData(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckString::stringLiteralWrite(), CheckBufferOverrun::stringNotZeroTerminated(), CheckSizeof::suspiciousSizeofCalculation(), TemplateSimplifier::templateParameters(), CheckOther::testIfNonZeroExpressionIsPositive(), TemplateSimplifier::TokenAndName::TokenAndName(), Type::Type(), typeDecl(), typeOf(), CheckUninitVar::uninitvarError(), FwdAnalysis::unusedValue(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), CheckVaarg::va_list_usage(), CheckVaarg::va_start_argument(), Tokenizer::validateC(), valueFlowAfterMove(), valueFlowAfterSwap(), valueFlowArray(), valueFlowArrayElement(), valueFlowConditionExpressions(), valueFlowContainerSetTokValue(), valueFlowContainerSize(), valueFlowForLoop(), valueFlowForLoopSimplify(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowImpossibleValues(), valueFlowLifetime(), valueFlowLifetimeConstructor(), valueFlowLifetimeUserConstructor(), valueFlowPointerAlias(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSwitchVariable(), valueFlowSymbolic(), valueFlowSymbolicOperators(), CheckUninitVar::valueFlowUninit(), Variable::Variable(), variableIsUsedInScope(), CheckClass::virtualDestructor(), CheckOther::warningOldStylePointerCast(), Variables::write(), and ContainerExpressionAnalyzer::writeValue().

◆ str() [1/2]

const std::string& Token::str ( ) const
inline

◆ str() [2/2]

template<typename T >
void Token::str ( T &&  s)
inline

Definition at line 179 of file token.h.

Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), Scope::addEnum(), Scope::addFunction(), SymbolDatabase::addGlobalFunction(), TemplateSimplifier::addNamespace(), SymbolDatabase::addNewFunction(), Tokenizer::addSemicolonAfterUnknownMacro(), TokenList::addtoken(), clangimport::AstNode::addTypeTokens(), addValue(), ConditionHandler::afterCondition(), CheckCondition::alwaysTrueFalse(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), arithmeticTypeString(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), CheckCondition::assignIf(), CheckCondition::assignIfParseScope(), astContainerAction(), astContainerYield(), astCount(), astIsVariableComparison(), astStringXml(), Tokenizer::calculateScopes(), CheckLeakAutoVar::changeAllocStatus(), CheckLeakAutoVar::changeAllocStatusIfRealloc(), CheckAutoVariables::checkAutoVariableAssignment(), CheckCondition::checkBadBitmaskCheck(), CheckOther::checkCastIntToCharAndBack(), CheckBool::checkComparisonOfBoolWithBool(), CheckBool::checkComparisonOfBoolWithInt(), CheckBool::checkComparisonOfFuncReturningBool(), Tokenizer::checkConfiguration(), CheckClass::checkConst(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateBranch(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckOther::checkEvaluationOrder(), CheckIO::checkFileUsage(), CheckIO::checkFormatString(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckMemoryLeakNoVar::checkForUnusedReturnValue(), CheckOther::checkFuncArgNamesDifferent(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckCondition::checkIncorrectLogicOperator(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckCondition::checkInvalidTestForOverflow(), CheckOther::checkKnownArgument(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckClass::checkMemsetType(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckCondition::checkModuloAlwaysTrueFalse(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkRhs(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckSizeof::checkSizeofForArrayParameter(), CheckSizeof::checkSizeofForPointerSize(), CheckUninitVar::checkStruct(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousCaseInSwitch(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkUnreachableCode(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), checkVariableCallMatch(), CheckOther::checkVariableScope(), CheckOther::clarifyCalculation(), CheckOther::clarifyStatement(), Tokenizer::combineOperators(), Tokenizer::combineStringAndCharLiterals(), compareTokenRanges(), CheckCondition::comparison(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), conditionAlwaysTrueOrFalse(), conditionString(), CheckClass::constructors(), CheckOther::constStatementError(), CheckClass::copyconstructors(), createBuiltinLibraryFunctions(), Tokenizer::createLinks2(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), SymbolDatabase::createSymbolDatabaseSetFunctionPointers(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), TokenList::createTokens(), clangimport::AstNode::createTokens(), clangimport::AstNode::createTokensFunctionDecl(), clangimport::AstNode::createTokensVarDecl(), CheckExceptionSafety::deallocThrow(), Tokenizer::deleteInvalidTypedef(), derefShared(), Library::detectSmartPointer(), doAssignment(), Tokenizer::dump(), CheckOther::duplicateAssignExpressionError(), CheckCondition::duplicateConditionalAssignError(), CheckOther::duplicateExpressionError(), Tokenizer::duplicateTypedef(), ValueFlow::eitherTheConditionIsRedundant(), Tokenizer::elseif(), CheckStl::eraseCheckLoopVar(), CheckStl::eraseIteratorOutOfBounds(), CheckStl::eraseIteratorOutOfBoundsError(), CheckAutoVariables::errorDanglingReference(), CheckAutoVariables::errorInvalidDeallocation(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), exprDependsOnThis(), extractForLoopValues(), findArgumentPosRecursive(), findClosingBracket(), SymbolDatabase::findEnumerator(), findExpressionStartEndTokens(), SymbolDatabase::findFunction(), Scope::findFunction(), SymbolDatabase::findFunctionInScope(), findLambdaEndTokenGeneric(), findLambdaStartToken(), findOpeningBracket(), findOpenParentesisOfMove(), Function::findReturns(), SymbolDatabase::findScope(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), findUnmatchedTernaryOp(), SymbolDatabase::findVariableType(), SymbolDatabase::findVariableTypeInBase(), followVariableExpressionError(), LifetimeStore::fromFunctionArg(), CheckOther::funcArgNamesDifferent(), CheckOther::funcArgOrderDifferent(), Function::Function(), CheckLeakAutoVar::functionCall(), functionThrowsRecursive(), CheckMemoryLeak::getAllocationType(), ValueFlowAnalyzer::getAssign(), getAstParentSkipPossibleCastAndAddressOf(), getCastTypeStartToken(), getConditions(), getContainerName(), Library::getContainerYield(), CheckMemoryLeak::getDeallocationType(), getExpression(), getExpressionRange(), getExprUsage(), FwdAnalysis::getExprVarIds(), getFunctionArguments(), Library::getFunctionName(), getFunctionUsage(), getIncompleteNameID(), getInvalidMethod(), getIteratorExpression(), getLifetimeTokens(), clangimport::AstNode::getNestedInScope(), getnumchildren(), getOperatorFunction(), Function::getOverloadedFunctions(), Function::getOverriddenFunctionRecursive(), getOverrunIndexValues(), CheckMemoryLeak::getReallocationType(), getSingleFunctionCall(), getSingleReturnVar(), getStrArraySize(), getStrLength(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePosition(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTypeString(), CTU::getUnsafeUsage(), Scope::getVariableList(), getVariableValues(), CheckClass::getVirtualFunctionCalls(), CheckClass::hasAllocationInIfScope(), hasGccCompoundStatement(), hasNoreturnFunction(), CheckStl::if_find(), if_findCompare(), ifvar(), ValueFlow::Value::infoString(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), innerSmtString(), insertToken(), TokenList::insertTokens(), CheckStl::invalidContainerLoopError(), CheckFunctions::invalidFunctionUsage(), CheckIO::invalidPrintfArgTypeError_float(), CheckIO::invalidPrintfArgTypeError_n(), CheckIO::invalidPrintfArgTypeError_p(), CheckIO::invalidPrintfArgTypeError_s(), CheckIO::invalidPrintfArgTypeError_sint(), CheckIO::invalidPrintfArgTypeError_uint(), CheckIO::invalidScanf(), CheckIO::invalidScanfArgTypeError_float(), CheckIO::invalidScanfArgTypeError_int(), CheckIO::invalidScanfArgTypeError_s(), CheckIO::invalidScanfError(), isAddressOfLocalVariable(), isAutoVarArray(), isBracketAccess(), isCallFunction(), iscast(), isChar(), CheckIO::ArgumentInfo::isComplexType(), isConditionKnown(), isConstExpression(), isConstFunctionCall(), isConstTop(), isConstVarExpression(), CheckStl::isContainerSize(), CheckStl::isContainerSizeGE(), Library::isContainerYield(), isCPPCastKeyword(), isEarlyExit(), isEnumDefinition(), isEnumStart(), Type::isEnumType(), isForwardJump(), SymbolDatabase::isFunction(), isFunctionCall(), Tokenizer::isFunctionHead(), CheckUninitVar::isFunctionParUsage(), isGlobalData(), CheckClass::isInverted(), isIterator(), ValueFlow::isLifetimeBorrowed(), isLikelyStreamRead(), isLocalContainerBuffer(), isLowerThanAnd(), isLowerThanOr(), isLowerThanShift(), isLowerThanXor(), CheckClass::isMemberFunc(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), isNonConstFunctionCall(), isNonMacro(), isNotEqual(), isNullOperand(), CheckMemoryLeak::isOpenDevNull(), isOperator(), isOppositeCond(), CheckCondition::isOverlappingCond(), isParameterChanged(), isPartOfClassStructUnion(), Variable::isPointerArray(), CheckNullPointer::isPointerDeRef(), SymbolDatabase::isReservedName(), isReturnScope(), isSameExpression(), isScopeBracket(), Library::isScopeNoReturn(), isSimpleExpr(), isStdMoveOrStdForwarded(), isStructuredBindingVariable(), isType(), Type::isTypeAlias(), isUnchanged(), isUsedAsBool(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), isVariableInit(), CheckUninitVar::isVariableUsage(), isVariableUsed(), isVarUsedInTree(), isVLAIndex(), ValueFlowAnalyzer::isWritable(), isZeroBoundCond(), CheckStl::iterators(), CheckOther::knownArgumentError(), CheckStl::knownEmptyContainer(), CheckLeakAutoVar::leakIfAllocated(), linkBrackets(), Match(), match(), matchMemberName(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), CheckFunctions::mathfunctionCallWarning(), CheckFunctions::memsetInvalid2ndParam(), CheckFunctions::memsetZeroBytes(), minUnsignedValue(), CheckStl::mismatchingContainerIterator(), multiCompareImpl(), multiComparePercent(), CheckCondition::multiCondition2(), Type::name(), notvar(), CheckNullPointer::nullConstantDereference(), numberOfArgumentsWithoutAst(), CheckClass::operatorEqToSelf(), CheckOther::oppositeExpressionError(), CheckStl::outOfBoundsIndexExpressionError(), CheckString::overlappingStrcmp(), CheckOther::overlappingWriteFunction(), SimpleConditionHandler::parse(), ContainerConditionHandler::parse(), parseComparison(), parsedecl(), CheckUnusedFunctions::parseTokens(), CheckBool::pointerArithBoolCond(), CheckNullPointer::pointerArithmeticError(), FwdAnalysis::possiblyAliased(), CheckPostfixOperator::postfixOperator(), SymbolDatabase::printOut(), TemplateSimplifier::printOut(), printValueFlow(), SymbolDatabase::printVariable(), Tokenizer::processFunc(), programMemoryParseCondition(), CheckStl::redundantCondition(), CheckNullPointer::redundantConditionWarning(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::replaceTemplateUsage(), Tokenizer::reportUnknownMacros(), SymbolDatabase::returnImplicitIntError(), Library::returnValueType(), Scope::Scope(), SymbolDatabase::setArrayDimensionsUsingValueFlow(), Function::setFlags(), setTokenValue(), setTypes(), ValueFlow::setValues(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), CheckOther::shadowError(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySQL(), Tokenizer::simplifyStaticConst(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTokens1(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingError(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleConditionalInScope(), singleIncrementInScope(), singleMemberCallInScope(), singleStatement(), CheckStl::size(), CheckStl::sizeError(), CheckSizeof::sizeofFunction(), Tokenizer::sizeOfType(), skipBrackets(), skipBracketsAndMembers(), skipCaseLabel(), skipDecl(), skipInitializerList(), skipRequires(), skipTernaryOp(), Variable::smartPointerType(), ValueFlow::solveExprValue(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckString::sprintfOverlappingDataError(), Tokenizer::startOfExecutableScope(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckString::stringLiteralWriteError(), MemberExpressionAnalyzer::submatch(), CheckOther::suspiciousSemicolonError(), CheckSizeof::suspiciousSizeofCalculation(), TemplateSimplifier::templateParameters(), CheckClass::thisUseAfterFree(), TemplateSimplifier::TokenAndName::TokenAndName(), tokenToString(), tokenType(), ValueFlow::Value::toString(), Type::type(), typeDecl(), typesMatch(), Tokenizer::unhandled_macro_class_x_y(), Tokenizer::unhandledCharLiteral(), CheckExceptionSafety::unhandledExceptionSpecificationError(), Tokenizer::unknownMacroError(), Tokenizer::unmatchedToken(), CheckOther::unreachableCodeError(), Tokenizer::unsupportedTypedef(), CheckOther::unusedLabelError(), TemplateSimplifier::useDefaultArgumentValues(), useFunctionArgs(), CheckStl::uselessCalls(), CheckStl::uselessCallsConstructorError(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), usingNamespace(), CheckVaarg::va_list_usage(), Tokenizer::validate(), Tokenizer::validateC(), SymbolDatabase::validateExecutableScopes(), valueFlowAfterAssign(), valueFlowAfterMove(), valueFlowBitAnd(), valueFlowDynamicBufferSize(), valueFlowForLoop2(), valueFlowForLoopSimplify(), valueFlowForwardLifetime(), valueFlowFunctionReturn(), valueFlowInferCondition(), valueFlowLifetimeClassConstructor(), valueFlowLifetimeFunction(), valueFlowNumber(), valueFlowPointerAlias(), valueFlowRightShift(), valueFlowSetConstantValue(), valueFlowSwitchVariable(), valueFlowSymbolicInfer(), valueFlowSymbolicOperators(), valueFlowUninit(), valueFlowUnknownFunctionReturn(), CheckMemoryLeakInClass::variable(), Variable::Variable(), CheckClass::virtualDestructor(), CheckClass::virtualFunctionCallInConstructorError(), CheckOther::warningOldStylePointerCast(), ValueFlowAnalyzer::writeValue(), CheckIO::wrongPrintfScanfArgumentsError(), and CheckOther::zerodivError().

◆ strAt()

const std::string & Token::strAt ( int  index) const
Returns
String of the token in given index, related to this token. If that token does not exist, an empty string is being returned.

Definition at line 423 of file token.cpp.

References emptyString, mStr, and tokAt().

Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), TemplateSimplifier::addNamespace(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), Tokenizer::arraySize(), CheckCondition::assignIf(), CheckCondition::assignIfParseScope(), bifurcate(), Tokenizer::calculateScopes(), CheckClass::checkConstFunc(), CheckStl::checkDereferenceInvalidIterator(), CheckOther::checkEvaluationOrder(), CheckIO::checkFileUsage(), CheckIO::checkFormatString(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckClass::checkMemset(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckOther::checkUnreachableCode(), checkVariableCallMatch(), containerAppendsElement(), containerPopsElement(), containerYieldsElement(), Tokenizer::createLinks2(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), doAssignment(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), Variable::evaluate(), TemplateSimplifier::expandTemplate(), findClosingBracket(), SymbolDatabase::findEnumerator(), SymbolDatabase::findFunction(), SymbolDatabase::findFunctionInScope(), SymbolDatabase::findScope(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), SymbolDatabase::findVariableType(), Function::Function(), CheckMemoryLeak::getAllocationType(), Library::getContainerFromAction(), getContainerFromSize(), Library::getContainerFromYield(), getContainerIndex(), getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getFunctionName(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateParametersInDeclaration(), getTypeString(), CheckClass::initializationListUsage(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), TemplateSimplifier::instantiateMatch(), CheckIO::ArgumentInfo::isArrayOrPointer(), CheckIO::ArgumentInfo::isComplexType(), isContainerSizeChangedByFunction(), isEnumStart(), SymbolDatabase::isFunction(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), isOperator(), isPartOfClassStructUnion(), isStdMoveOrStdForwarded(), CheckIO::ArgumentInfo::isStdVectorOrString(), Scope::isVariableDeclaration(), CheckStl::iterators(), matchMemberVarName(), CheckFunctions::mathfunctionCallWarning(), CheckNullPointer::nullConstantDereference(), Check64BitPortability::pointerassignment(), SymbolDatabase::printOut(), TemplateSimplifier::printOut(), CheckOther::redundantBitwiseOperationInSwitchError(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), SymbolDatabase::setValueType(), setVarIdClassDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyCAlternativeTokens(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyLabelsCaseDefault(), Tokenizer::simplifyRedundantParentheses(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTokenList1(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyUsing(), Tokenizer::simplifyVarDecl(), CheckStl::size(), skipPointers(), skipScopeIdentifiers(), Tokenizer::splitTemplateRightAngleBrackets(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckClass::thisSubtraction(), TemplateSimplifier::TokenAndName::TokenAndName(), Tokenizer::unhandled_macro_class_x_y(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), Tokenizer::validateC(), valueFlowArrayElement(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), and CheckOther::warningOldStylePointerCast().

◆ stringify() [1/2]

std::string Token::stringify ( bool  varid,
bool  attributes,
bool  macro 
) const

Stringify a token.

Parameters
varidPrint varids. (Style: "varname\@id")
attributesPrint attributes of tokens like "unsigned" in front of it.
macroPrints $ in front of the token if it was expanded from a macro.

Definition at line 1328 of file token.cpp.

References Token::stringifyOptions::attributes, Token::stringifyOptions::macro, stringify(), and Token::stringifyOptions::varid.

◆ stringify() [2/2]

std::string Token::stringify ( const stringifyOptions options) const

◆ stringifyList() [1/4]

std::string Token::stringifyList ( bool  varid,
bool  attributes,
bool  linenumbers,
bool  linebreaks,
bool  files,
const std::vector< std::string > *  fileNames = nullptr,
const Token end = nullptr 
) const

Stringify a list of token, from current instance on.

Parameters
varidPrint varids. (Style: "varname\@id")
attributesPrint attributes of tokens like "unsigned" in front of it.
linenumbersPrint line number in front of each line
linebreaksInsert "\\n" into string when line number changes
filesprint Files as numbers or as names (if fileNames is given)
fileNamesVector of filenames. Used (if given) to print filenames as strings instead of numbers.
endStringification ends before this token is reached. 0 to stringify until end of list.
Returns
Stringified token list as a string

Definition at line 1415 of file token.cpp.

References Token::stringifyOptions::attributes, Token::stringifyOptions::files, Token::stringifyOptions::linebreaks, Token::stringifyOptions::linenumbers, Token::stringifyOptions::macro, stringifyList(), and Token::stringifyOptions::varid.

◆ stringifyList() [2/4]

std::string Token::stringifyList ( bool  varid = false) const

Definition at line 1432 of file token.cpp.

References stringifyList().

◆ stringifyList() [3/4]

std::string Token::stringifyList ( const stringifyOptions options,
const std::vector< std::string > *  fileNames = nullptr,
const Token end = nullptr 
) const

◆ stringifyList() [4/4]

std::string Token::stringifyList ( const Token end,
bool  attributes = true 
) const

Definition at line 1427 of file token.cpp.

References stringifyList().

◆ strValue()

std::string Token::strValue ( ) const

This can be called only for tokens that are strings, else the assert() is called.

If Token is e.g. '"hello"', this will return 'hello' (removing the double quotes).

Returns
String value

Definition at line 223 of file token.cpp.

References eString, getStringLiteral(), mStr, and mTokType.

Referenced by CheckIO::checkFileUsage().

◆ swapWithNext()

void Token::swapWithNext ( )

Swap the contents of this token with the next token.

Definition at line 285 of file token.cpp.

References mFlags, mImpl, mLink, mNext, mStr, TokenImpl::mTemplateSimplifierPointers, mTokType, and templateSimplifierPointer().

Referenced by Tokenizer::simplifyStaticConst().

◆ takeData()

void Token::takeData ( Token fromToken)
private

used by deleteThis() to take data from token to delete

Definition at line 311 of file token.cpp.

References link(), mFlags, mImpl, mLink, mStr, TokenImpl::mTemplateSimplifierPointers, mTokType, templateSimplifierPointer(), and tokType().

Referenced by deleteThis().

◆ templateSimplifierPointer()

void Token::templateSimplifierPointer ( TemplateSimplifier::TokenAndName tokenAndName)
inline

Definition at line 698 of file token.h.

Referenced by swapWithNext(), takeData(), and TemplateSimplifier::TokenAndName::TokenAndName().

◆ templateSimplifierPointers() [1/2]

std::set<TemplateSimplifier::TokenAndName*>* Token::templateSimplifierPointers ( )
inline

Definition at line 695 of file token.h.

◆ templateSimplifierPointers() [2/2]

const std::set<TemplateSimplifier::TokenAndName*>* Token::templateSimplifierPointers ( ) const
inline

Definition at line 692 of file token.h.

◆ tokAt() [1/2]

Token * Token::tokAt ( int  index)

Definition at line 398 of file token.cpp.

References index(), and tokAtImpl().

◆ tokAt() [2/2]

const Token * Token::tokAt ( int  index) const
Returns
token in given index, related to this token. For example index 1 would return next token, and 2 would return next from that one.

Definition at line 393 of file token.cpp.

References index(), and tokAtImpl().

Referenced by accumulateBoolLiteral(), Function::addArguments(), addByOne(), SymbolDatabase::addClassFunction(), TemplateSimplifier::addInstantiation(), TemplateSimplifier::addNamespace(), SymbolDatabase::addNewFunction(), ConditionHandler::afterCondition(), TemplateSimplifier::TokenAndName::aliasStartToken(), TemplateSimplifier::alreadyHasNamespace(), ValueFlowAnalyzer::analyzeCondition(), Function::argsMatch(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), Tokenizer::arraySize(), Tokenizer::arraySizeAfterValueFlow(), CheckCondition::assignIf(), CheckCondition::assignIfError(), CheckCondition::assignIfParseScope(), ValueFlowAnalyzer::assume(), CheckAutoVariables::autoVariables(), bifurcate(), Tokenizer::calculateScopes(), CheckBoost::checkBoostForeachModification(), CheckExceptionSafety::checkCatchExceptionByValue(), TemplateSimplifier::checkComplicatedSyntaxErrorsInTemplates(), Tokenizer::checkConfiguration(), CheckClass::checkConstFunc(), CheckStl::checkDereferenceInvalidIterator(), CheckOther::checkDuplicateBranch(), CheckOther::checkDuplicateExpression(), CheckIO::checkFileUsage(), Tokenizer::checkForEnumsWithTypedef(), CheckMemoryLeakNoVar::checkForUnsafeArgAlloc(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckUninitVar::checkIfForWhileHead(), CheckOther::checkIncompleteArrayFill(), CheckString::checkIncorrectStringCompare(), CheckOther::checkInnerScope(), CheckOther::checkInterlockedDecrement(), CheckFunctions::checkLibraryMatchFunctions(), CheckUninitVar::checkLoopBodyRecursive(), CheckFunctions::checkMathFunctions(), CheckClass::checkMemset(), CheckClass::checkMemsetType(), checkMissingReturnScope(), CheckOther::checkMisusedScopedObject(), CheckStl::checkMutexes(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantCopy(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), checkReturns(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckUninitVar::checkStruct(), CheckOther::checkSuspiciousSemicolon(), CheckClass::checkThisUseAfterFreeRecursive(), CheckLeakAutoVar::checkTokenInsideExpression(), CheckOther::checkUnreachableCode(), CheckClass::checkUnsafeClassRefMember(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckCondition::clarifyCondition(), Tokenizer::combineOperators(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), CheckClass::copyconstructors(), Tokenizer::createLinks2(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseClassInfo(), SymbolDatabase::createSymbolDatabaseFindAllScopes(), SymbolDatabase::createSymbolDatabaseIncompleteVars(), doAssignment(), CheckCondition::duplicateCondition(), Tokenizer::duplicateTypedef(), CheckStl::erase(), CheckStl::eraseCheckLoopVar(), TemplateSimplifier::expandTemplate(), findClosingBracket(), SymbolDatabase::findEnumerator(), SymbolDatabase::findFunction(), SymbolDatabase::findFunctionInScope(), SymbolDatabase::findScope(), findStartToken(), SymbolDatabase::findType(), SymbolDatabase::findTypeInNested(), SymbolDatabase::findVariableType(), PathAnalysis::forwardRange(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), getCastTypeStartToken(), Library::getContainerFromAction(), getContainerFromSize(), Library::getContainerFromYield(), getContainerIndex(), getContainerName(), getContainerYield(), CheckMemoryLeak::getDeallocationType(), Library::getFunctionName(), getFuncTokFromThis(), getLifetimeTokens(), TemplateSimplifier::getNewName(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePosition(), TemplateSimplifier::getTemplateNamePositionTemplateClass(), TemplateSimplifier::getTemplateNamePositionTemplateFunction(), TemplateSimplifier::getTemplateNamePositionTemplateVariable(), getTypeString(), getVariableChangedStart(), getVariableInitExpression(), Scope::getVariableList(), CheckClass::hasAllocation(), CheckStl::if_find(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), CheckFunctions::invalidFunctionUsage(), CheckIO::invalidScanf(), isAutoVar(), isBreakOrContinueScope(), CheckIO::ArgumentInfo::isComplexType(), isConstFunctionCall(), isEnumStart(), isFunctionCall(), Tokenizer::isFunctionHead(), CheckUnusedVar::isFunctionWithoutSideEffects(), isInitialVarAssign(), CheckClass::isMemberFunc(), Tokenizer::isMemberFunction(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), isOpenParenthesisMemberFunctionCallOfVarId(), CheckNullPointer::isPointerDeRef(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isReturnScope(), isSameExpression(), Library::isScopeNoReturn(), Tokenizer::isScopeNoReturn(), CheckIO::ArgumentInfo::isStdContainer(), isStdMoveOrStdForwarded(), CheckIO::ArgumentInfo::isStdVectorOrString(), isThisChanged(), isUnknownType(), isVariableChanged(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), ContainerExpressionAnalyzer::isWritable(), CheckStl::iterators(), matchMemberName(), matchMemberVarName(), TemplateSimplifier::matchSpecialization(), matchTemplateParameters(), CheckStl::missingComparison(), CheckCondition::multiCondition(), CheckCondition::multiCondition2(), Type::name(), CheckNullPointer::nullConstantDereference(), parsedecl(), CheckNullPointer::parseFunctionCall(), CheckUnusedFunctions::parseTokens(), CheckBool::pointerArithBool(), FwdAnalysis::possiblyAliased(), SymbolDatabase::printOut(), Tokenizer::processFunc(), CheckStl::redundantCondition(), Tokenizer::removeExtraTemplateKeywords(), Tokenizer::removeMacroInClassDef(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::reportUnknownMacros(), CheckLeakAutoVar::ret(), setTypes(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), setVarIdParseDeclaration(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCaseRange(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyHeadersAndUnusedTemplates(), Tokenizer::simplifyIfSwitchForInit(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyLabelsCaseDefault(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySQL(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateArgs(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTypedefCpp(), Tokenizer::simplifyTypeIntrinsics(), Tokenizer::simplifyUsing(), Tokenizer::simplifyUsingToTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), singleAssignInScope(), singleIncrementInScope(), singleMemberCallInScope(), CheckStl::size(), CheckSizeof::sizeofCalculation(), CheckSizeof::sizeofFunction(), skipBracketsAndMembers(), skipDecl(), skipInitializerList(), skipMembers(), skipPointers(), skipRequires(), skipScopeIdentifiers(), splitDefinitionFromTypedef(), Tokenizer::splitTemplateRightAngleBrackets(), CheckStl::stlOutOfBounds(), strAt(), CheckStl::string_c_str(), TemplateSimplifier::templateParameters(), TemplateSimplifier::TokenAndName::TokenAndName(), Type::Type(), typeDecl(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), usingNamespace(), CheckVaarg::va_list_usage(), CheckVaarg::va_start_argument(), Tokenizer::validateC(), valueFlowArray(), valueFlowArrayElement(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowFunctionDefaultParameter(), valueFlowImpossibleValues(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSwitchVariable(), CheckMemoryLeakInClass::variable(), CheckClass::virtualDestructor(), and CheckOther::warningOldStylePointerCast().

◆ tokType() [1/2]

Token::Type Token::tokType ( ) const
inline

Definition at line 343 of file token.h.

Referenced by CheckIO::ArgumentInfo::ArgumentInfo(), CheckIO::argumentType(), CheckBufferOverrun::arrayIndex(), CheckBufferOverrun::arrayIndexThenCheck(), CheckClass::checkConstFunc(), CheckIO::checkFileUsage(), CheckIO::checkFormatString(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteStatement(), CheckString::checkSuspiciousStringCompare(), CheckAssert::checkVariableAssignment(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), CheckClass::constructors(), CheckOther::constStatementError(), TokenList::copyTokens(), createBuiltinLibraryFunctions(), Tokenizer::createLinks2(), SymbolDatabase::createSymbolDatabaseExprIds(), Tokenizer::dump(), CheckAutoVariables::errorInvalidDeallocation(), function(), getParentValueTypes(), getStrArraySize(), getStrSize(), TemplateSimplifier::getTemplateInstantiations(), TokenList::insertTokens(), CheckIO::invalidScanf(), isConstExpression(), ValueFlowAnalyzer::isGlobalModified(), isSameExpression(), isSimpleExpr(), isUnaryPreOp(), isVariableChanged(), isVariableChangedByFunctionCall(), ContainerExpressionAnalyzer::isWritable(), multiComparePercent(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), Tokenizer::setVarIdPass2(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyTokens1(), CheckStl::size(), CheckSizeof::sizeofFunction(), Tokenizer::sizeOfType(), takeData(), TemplateSimplifier::templateParameters(), type(), update_property_info(), update_property_isStandardType(), valueFlowConditionExpressions(), valueFlowDynamicBufferSize(), valueFlowGetStrLength(), valueFlowSetConstantValue(), valueFlowString(), CheckOther::warningOldStylePointerCast(), and ContainerExpressionAnalyzer::writeValue().

◆ tokType() [2/2]

void Token::tokType ( Token::Type  t)
inline

Definition at line 346 of file token.h.

◆ type() [1/2]

const ::Type* Token::type ( ) const
inline
Returns
a pointer to the type associated with this token.

Definition at line 1094 of file token.h.

◆ type() [2/2]

void Token::type ( const ::Type t)

◆ typeDecl()

std::pair< const Token *, const Token * > Token::typeDecl ( const Token tok,
bool  pointedToType = false 
)
static

◆ typeOf()

const ::Type * Token::typeOf ( const Token tok,
const Token **  typeTok = nullptr 
)
static

◆ typeStr()

std::string Token::typeStr ( const Token tok)
static

Definition at line 2496 of file token.cpp.

References ValueType::str(), typeDecl(), and valueType().

Referenced by valueFlowLifetimeFunction().

◆ until()

ConstTokenRange Token::until ( const Token t) const

Definition at line 84 of file token.cpp.

◆ update_property_char_string_literal()

void Token::update_property_char_string_literal ( )
private

Update internal property cache about string and char literals.

Definition at line 194 of file token.cpp.

References eChar, eString, isLong(), isPrefixStringCharLiteral(), mStr, and mTokType.

Referenced by update_property_info().

◆ update_property_info()

void Token::update_property_info ( )
private

◆ update_property_isStandardType()

void Token::update_property_isStandardType ( )
private

Update internal property cache about isStandardType()

Definition at line 181 of file token.cpp.

References eType, isStandardType(), mStr, stdTypes, and tokType().

Referenced by update_property_info().

◆ values()

const std::list<ValueFlow::Value>& Token::values ( ) const
inline

Definition at line 1197 of file token.h.

References TokenImpl::mEmptyValueList.

Referenced by CheckCondition::alwaysTrueFalse(), astStringXml(), LifetimeStore::byDerefCopy(), LifetimeStore::byRef(), LifetimeStore::byVal(), PathAnalysis::checkCond(), CheckStl::checkDereferenceInvalidIterator2(), CheckOther::checkKnownArgument(), FwdAnalysis::checkRecursive(), CheckUninitVar::checkScopeForVariable(), compareKnownValue(), Tokenizer::dump(), ValueFlowAnalyzer::evaluate(), ValueFlowAnalyzer::evaluateInt(), ConditionHandler::fillFromPath(), findFormat(), CheckLeakAutoVar::functionCall(), getBufferSizeValue(), getCompareValue(), getContainerValues(), getExpressionRange(), CTU::getFileInfo(), getFunctionArgumentValues(), getInnerLifetime(), getKnownValueFromToken(), ValueFlow::getLifetimeObjValues(), getLifetimeTokens(), getOOBIterValue(), ValueFlowAnalyzer::getSymbols(), ValueFlowPassRunner::getTotalValues(), inferCondition(), isAliasOf(), isAutoVarArray(), CheckStl::isContainerSizeGE(), isKnownEmptyContainer(), isNonZero(), isOutOfBoundsImpl(), ValueFlowAnalyzer::isSameSymbolicValue(), isSameToken(), isStrlenOf(), isUsedAsBool(), ContainerExpressionAnalyzer::isWritable(), makeContainerSizeValue(), match(), minUnsignedValue(), CheckNullPointer::nullConstantDereference(), CheckBufferOverrun::objectIndex(), CheckStl::outOfBounds(), parseCompareEachInt(), printValueFlow(), setTokenValue(), ExpressionAnalyzer::setupExprVarIds(), Tokenizer::simplifyTokens1(), ConditionHandler::skipNotAndCasts(), MultiValueFlowAnalyzer::stopOnCondition(), valueFlowAfterAssign(), valueFlowArrayBool(), valueFlowArrayElement(), ValueFlow::valueFlowConstantFoldAST(), valueFlowContainerSize(), valueFlowDebug(), valueFlowDynamicBufferSize(), valueFlowEnumValue(), valueFlowForwardConst(), valueFlowForwardLifetime(), valueFlowFunctionDefaultParameter(), valueFlowImpossibleValues(), valueFlowInferCondition(), valueFlowIteratorInfer(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowLifetimeUserConstructor(), valueFlowSmartPointer(), valueFlowSymbolicOperators(), CheckOther::warningOldStylePointerCast(), and ContainerExpressionAnalyzer::writeValue().

◆ valueType()

const ValueType* Token::valueType ( ) const
inline

Definition at line 331 of file token.h.

Referenced by ConditionHandler::afterCondition(), CheckNullPointer::arithmetic(), astContainerAction(), astContainerYield(), astIsBool(), astIsCharWithSign(), astIsContainerString(), astIsFloat(), astIsGenericChar(), astIsIntegral(), astIsIterator(), astIsPointer(), astIsPrimitive(), astIsSmartPointer(), astIsUniqueSmartPointer(), astIsUnsigned(), ConditionHandler::beforeCondition(), CheckBufferOverrun::bufferOverflow(), CheckOther::checkCharVariable(), CheckCondition::checkCompareValueOutOfTypeRange(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckOther::checkConstVariable(), CheckOther::checkDuplicateExpression(), CheckStl::checkFindInsert(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckCondition::checkIncorrectLogicOperator(), CheckCondition::checkInvalidTestForOverflow(), CheckType::checkLongCast(), CheckCondition::checkPointerAdditionResultNotNull(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantPointerOp(), CheckOther::checkSignOfUnsignedVariable(), CheckSizeof::checkSizeofForPointerSize(), CheckString::checkSuspiciousStringCompare(), CheckOther::clarifyCalculation(), CheckOther::comparisonNonZeroExpressionLessThanZero(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), clangimport::AstNode::createTokens(), SymbolDatabase::debugSymbolDatabase(), Tokenizer::dump(), CheckStl::eraseIteratorOutOfBounds(), findExpressionChangedImpl(), SymbolDatabase::findFunction(), Scope::findFunction(), followVariableExpression(), CheckLeakAutoVar::functionCall(), getBufAndOffset(), CheckBufferOverrun::getBufferSize(), getClassScope(), Library::getContainerFromAction(), Library::getContainerFromYield(), getContainerFunction(), getDimensionsEtc(), getEnumType(), getExprUsage(), CTU::getFileInfo(), ContainerExpressionAnalyzer::getIndirect(), getInvalidMethod(), getLibraryContainer(), getParentValueTypes(), getPointerDepth(), getStrSize(), hasOverloadedAssignment(), CheckCondition::identicalConditionAfterEarlyExitError(), CheckClass::initializeVarList(), CheckFunctions::invalidFunctionUsage(), CheckOther::invalidPointerCast(), ValueFlowAnalyzer::isAliasModified(), CheckStl::isContainerSize(), ValueFlow::isContainerSizeChanged(), isContainerSizeChangedByFunction(), CheckBufferOverrun::isCtuUnsafeBufferUsage(), isDifferentType(), isGlobalData(), isIntegralOrPointer(), isIterator(), ValueFlow::isLifetimeBorrowed(), isMapFind(), isNegative(), isNullOperand(), isSameConstantValue(), isSameExpression(), isStdMoveOrStdForwarded(), isTemporary(), isTrivialConstructor(), isVariableChanged(), isVariableChangedByFunctionCall(), CheckUninitVar::isVariableUsage(), isVoidCast(), ContainerExpressionAnalyzer::isWritable(), CheckCondition::multiCondition2(), CheckBufferOverrun::objectIndex(), CheckStl::outOfBoundsError(), parsedecl(), CheckBufferOverrun::pointerArithmetic(), printValueFlow(), SymbolDatabase::printVariable(), CheckLeakAutoVar::ret(), CheckFunctions::returnLocalStdMove(), Library::returnValueType(), setAutoTokenProperties(), setTokenValue(), Variable::setValueType(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), CheckString::sprintfOverlappingData(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckOther::testIfNonZeroExpressionIsPositive(), typeStr(), useFunctionArgs(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), valueFlowAfterAssign(), valueFlowContainerSize(), valueFlowDynamicBufferSize(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowIsSameContainerType(), valueFlowLifetime(), valueFlowLifetimeClassConstructor(), valueFlowLifetimeConstructor(), valueFlowLifetimeFunction(), valueFlowSetConstantValue(), clangimport::Data::varDecl(), ContainerExpressionAnalyzer::writeValue(), and ValueFlowAnalyzer::writeValue().

◆ variable() [1/2]

const Variable* Token::variable ( ) const
inline
Returns
a pointer to the variable associated with this token.

Definition at line 1081 of file token.h.

◆ variable() [2/2]

void Token::variable ( const Variable v)
inline

Associate this token with given variable.

Parameters
vVariable to be associated

Definition at line 1070 of file token.h.

Referenced by ConditionHandler::afterCondition(), CheckIO::ArgumentInfo::ArgumentInfo(), CheckBufferOverrun::argumentSize(), CheckBufferOverrun::arrayIndex(), CheckAutoVariables::assignFunctionArg(), astStringXml(), bifurcate(), CheckBufferOverrun::bufferOverflow(), CheckExceptionSafety::checkCatchExceptionByValue(), CheckOther::checkComparePointers(), CheckBool::checkComparisonOfBoolWithBool(), CheckClass::checkConstFunc(), CheckOther::checkConstPointer(), CheckCondition::checkDuplicateConditionalAssign(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckClass::checkMemset(), CheckStl::checkMutexes(), FwdAnalysis::checkRecursive(), CheckOther::checkRedundantCopy(), CheckOther::checkRedundantPointerOp(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkShadowVariables(), CheckSizeof::checkSizeofForArrayParameter(), CheckSizeof::checkSizeofForPointerSize(), CheckClass::checkUnsafeClassRefMember(), CheckOther::checkVariableScope(), CheckAutoVariables::checkVarLifetimeScope(), CheckOther::comparePointersError(), CheckOther::comparisonNonZeroExpressionLessThanZero(), CheckClass::copyconstructors(), clangimport::AstNode::createScope(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseSetVariablePointers(), Tokenizer::dump(), CheckStl::erase(), CheckAutoVariables::errorInvalidDeallocation(), exprDependsOnThis(), SymbolDatabase::findEnumerator(), findExpressionChangedImpl(), findFormat(), Scope::findFunction(), followAllReferences(), followVariableExpression(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), getArgumentVars(), CheckBufferOverrun::getBufferSize(), getDimensionsEtc(), ValueFlow::getEndOfExprScope(), getExprUsage(), CTU::getFileInfo(), getFunction(), getFunctionUsage(), getLHSVariable(), getLHSVariableRecursive(), getLHSVariablesRecursive(), getLHSVariableToken(), getLifetimeTokens(), ValueFlow::getLifetimeVariable(), getOverrunIndexValues(), getParentLifetime(), getParentVar(), getVariables(), hasUniqueOwnership(), hasUnknownVars(), hasVolatileCastOrVar(), CheckStl::if_find(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), CheckStl::invalidContainer(), CheckFunctions::invalidFunctionUsage(), isAddressOfLocalVariable(), isArray(), isArrayArg(), isArrayVar(), isAutoVar(), isAutoVarArray(), isBracketAccess(), isConstExpression(), isConstFunctionCall(), isConstVarExpression(), isCpp03ContainerSizeSlow(), isDanglingSubFunction(), isDeadScope(), isExpression(), CheckUninitVar::isFunctionParUsage(), CheckUnusedVar::isFunctionWithoutSideEffects(), isGlobalData(), isInitialVarAssign(), isInScope(), isLocal(), isLocalContainerBuffer(), isLocalVarNoAutoDealloc(), CheckUninitVar::isMemberVariableUsage(), isNonConstFunctionCall(), isNonReferenceArg(), isNullablePointer(), isOutOfBoundsImpl(), CheckNullPointer::isPointerDeRef(), isPtrArg(), CheckUnusedVar::isRecordTypeWithoutSideEffects(), isRefPtrArg(), isSameExpression(), Tokenizer::isScopeNoReturn(), CheckIO::ArgumentInfo::isStdContainer(), isUniqueExpression(), isVarDecl(), isVarDeclOp(), isVariableChanged(), isVariableChangedByFunctionCall(), isVariableDecl(), isVariableMutableInInitializer(), CheckUninitVar::isVariableUsage(), isVector(), isWithoutSideEffects(), CheckStl::iterators(), ValueFlow::lifetimeMessage(), CheckCondition::multiCondition2(), CheckStl::negativeIndex(), CheckNullPointer::nullConstantDereference(), parsedecl(), CheckBufferOverrun::pointerArithmetic(), clangimport::Data::Decl::ref(), CheckFunctions::returnLocalStdMove(), ExpressionAnalyzer::setupExprVarIds(), SymbolDatabase::setValueType(), SymbolDatabase::setValueTypeInTokenList(), skipLocalVars(), CheckStl::string_c_str(), CheckSizeof::suspiciousSizeofCalculation(), typeDecl(), typeOf(), useFunctionArgs(), CheckStl::uselessCalls(), CheckStl::useStlAlgorithm(), CheckVaarg::va_start_argument(), valueFlowAfterMove(), valueFlowArray(), valueFlowArrayBool(), valueFlowContainerSetTokValue(), valueFlowDynamicBufferSize(), valueFlowForLoopSimplifyAfter(), valueFlowForwardAssign(), valueFlowForwardLifetime(), valueFlowGlobalConstVar(), valueFlowGlobalStaticVar(), valueFlowLifetime(), valueFlowLifetimeFunction(), valueFlowPointerAlias(), valueFlowSetConstantValue(), valueFlowSmartPointer(), valueFlowSubFunction(), valueFlowSwitchVariable(), valueFlowUninit(), clangimport::Data::varDecl(), and SymbolDatabase::~SymbolDatabase().

◆ varId() [1/2]

nonneg int Token::varId ( ) const
inline

Definition at line 870 of file token.h.

Referenced by Function::addArguments(), ConditionHandler::afterCondition(), CheckAutoVariables::assignFunctionArg(), CheckClass::assignVar(), astHasVar(), astIsVariableComparison(), astStringXml(), bifurcate(), CheckLeakAutoVar::changeAllocStatus(), CheckLeakAutoVar::changeAllocStatusIfRealloc(), CheckBoost::checkBoostForeachModification(), CheckOther::checkComparePointers(), CheckBool::checkComparisonOfBoolWithBool(), CheckBool::checkComparisonOfBoolWithInt(), CheckClass::checkConstFunc(), CheckStl::checkDereferenceInvalidIterator(), CheckCondition::checkDuplicateConditionalAssign(), CheckOther::checkDuplicateExpression(), CheckUninitVar::checkExpr(), CheckIO::checkFileUsage(), CheckOther::checkFuncArgNamesDifferent(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkInnerScope(), CheckOther::checkInvalidFree(), CheckCondition::checkInvalidTestForOverflow(), CheckOther::checkMisusedScopedObject(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckMemoryLeakInFunction::checkReallocUsage(), FwdAnalysis::checkRecursive(), CheckExceptionSafety::checkRethrowCopy(), CheckUninitVar::checkRhs(), CheckLeakAutoVar::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckClass::checkSelfInitialization(), CheckOther::checkShadowVariables(), CheckSizeof::checkSizeofForPointerSize(), CheckMemoryLeakStructMember::checkStructVariable(), CheckLeakAutoVar::checkTokenInsideExpression(), Scope::checkVariable(), CheckOther::checkVariableScope(), conditionAlwaysTrueOrFalse(), CheckClass::copyconstructors(), TokenList::copyTokens(), SymbolDatabase::createSymbolDatabaseExprIds(), SymbolDatabase::createSymbolDatabaseVariableSymbolTable(), Library::detectContainerInternal(), doAssignment(), Tokenizer::dump(), CheckStl::eraseCheckLoopVar(), SymbolDatabase::findFunction(), findmatch(), findVarBound(), SymbolDatabase::fixVarId(), followAllReferences(), followVariableExpression(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getDeallocationType(), FwdAnalysis::getExprVarIds(), getLifetimeTokens(), MultiValueFlowAnalyzer::getValue(), getVariableValues(), getVarIds(), CheckClass::hasAllocation(), hasUnknownVars(), ifvar(), CheckClass::initializeVarList(), Tokenizer::initVar(), TokenList::insertTokens(), CheckStl::invalidContainer(), SingleValueFlowAnalyzer::isAlias(), MultiValueFlowAnalyzer::isAlias(), isAliasOf(), isCalculation(), iscast(), isConstStatement(), isExpressionChangedAt(), SymbolDatabase::isFunction(), isGlobalData(), isInitialVarAssign(), CheckClass::isMemberVar(), Library::isNotLibraryFunction(), isNullablePointer(), CheckNullPointer::isPointerDeRef(), isSameExpression(), isSimpleExpr(), isType(), isVarDeclOp(), ExpressionAnalyzer::isVariable(), isVariableChangedByFunctionCall(), Scope::isVariableDeclaration(), isVariableExpression(), isVariableUsed(), isVarUsedInTree(), isVLAIndex(), isWithoutSideEffects(), CheckStl::iterators(), CheckLeakAutoVar::leakIfAllocated(), MultiValueFlowAnalyzer::match(), match(), multiComparePercent(), CheckCondition::multiCondition2(), notvar(), CheckNullPointer::nullConstantDereference(), parsedecl(), CheckUnusedFunctions::parseTokens(), FwdAnalysis::possiblyAliased(), clangimport::Data::Decl::ref(), CheckLeakAutoVar::ret(), ExpressionAnalyzer::setupExprVarIds(), Tokenizer::setVarId(), setVarIdClassDeclaration(), Tokenizer::setVarIdClassFunction(), Tokenizer::setVarIdPass1(), Tokenizer::setVarIdPass2(), setVarIdStructMembers(), Tokenizer::simplifyArrayAccessSyntax(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyVarDecl(), singleIncrementInScope(), CheckStl::stlOutOfBounds(), MultiValueFlowAnalyzer::stopOnCondition(), useFunctionArgs(), CheckStl::uselessCalls(), CheckFunctions::useStandardLibrary(), CheckStl::useStlAlgorithm(), CheckVaarg::va_list_usage(), valueFlowAfterMove(), valueFlowArray(), valueFlowDynamicBufferSize(), valueFlowForLoopSimplify(), valueFlowForLoopSimplifyAfter(), valueFlowForwardConst(), valueFlowLifetime(), valueFlowNumber(), valueFlowSetConstantValue(), clangimport::Data::varDecl(), and CheckMemoryLeakInClass::variable().

◆ varId() [2/2]

void Token::varId ( nonneg int  id)
inline

Definition at line 873 of file token.h.

Friends And Related Function Documentation

◆ TestToken

friend class TestToken
friend

Definition at line 151 of file token.h.

Member Data Documentation

◆ mFlags

uint64_t Token::mFlags {}
private

Definition at line 1338 of file token.h.

Referenced by swapWithNext(), and takeData().

◆ mImpl

TokenImpl* Token::mImpl {}
private

◆ mLink

Token* Token::mLink {}
private

Definition at line 1283 of file token.h.

Referenced by deleteNext(), deletePrevious(), swapWithNext(), takeData(), and update_property_info().

◆ mNext

Token* Token::mNext {}
private

Definition at line 1281 of file token.h.

Referenced by deleteNext(), deleteThis(), isUnaryPreOp(), and swapWithNext().

◆ mPrevious

Token* Token::mPrevious {}
private

Definition at line 1282 of file token.h.

Referenced by assignIndexes(), deletePrevious(), deleteThis(), findClosingBracket(), and isUnaryPreOp().

◆ mStr

std::string Token::mStr
private

◆ mTokensFrontBack

TokensFrontBack& Token::mTokensFrontBack
private

◆ mTokType

Token::Type Token::mTokType = eNone
private

The documentation for this class was generated from the following files: