|
Cppcheck
|
The token list that the TokenList generates is a linked-list of this class. More...
#include <token.h>
Public Types | |
| enum | Type { eVariable, eType, eFunction, eName, eNumber, eString, eChar, eBoolean, eLiteral, eArithmeticalOp, eComparisonOp, eAssignmentOp, eLogicalOp, eBitOp, eIncDecOp, eExtendedOp, eBracket, eOther, eNone } |
Public Member Functions | |
| Token (Token **tokensBack) | |
| ~Token () | |
| void | str (const std::string &s) |
| void | concatStr (std::string const &b) |
| Concatenate two (quoted) strings. | |
| const std::string & | str () const |
| void | deleteNext (unsigned long index=1) |
| Unlink and delete the next 'index' tokens. | |
| const Token * | tokAt (int index) const |
| Returns token in given index, related to this token. | |
| Token * | tokAt (int index) |
| const Token * | linkAt (int index) const |
| Returns the link to the token in given index, related to this token. | |
| Token * | linkAt (int index) |
| const std::string & | strAt (int index) const |
| Type | type () const |
| void | type (Type t) |
| bool | isName () const |
| bool | isUpperCaseName () const |
| bool | isNumber () const |
| bool | isOp () const |
| bool | isConstOp () const |
| bool | isExtendedOp () const |
| bool | isArithmeticalOp () const |
| bool | isComparisonOp () const |
| bool | isAssignmentOp () const |
| bool | isBoolean () const |
| bool | isUnsigned () const |
| void | isUnsigned (bool sign) |
| bool | isSigned () const |
| void | isSigned (bool sign) |
| bool | isPointerCompare () const |
| void | isPointerCompare (bool b) |
| bool | isLong () const |
| void | isLong (bool size) |
| bool | isUnused () const |
| void | isUnused (bool used) |
| bool | isStandardType () const |
| bool | isExpandedMacro () const |
| void | setExpandedMacro (bool m) |
| unsigned int | linenr () const |
| void | linenr (unsigned int lineNumber) |
| unsigned int | fileIndex () const |
| void | fileIndex (unsigned int indexOfFile) |
| Token * | next () const |
| void | insertToken (const std::string &tokenStr, bool prepend=false) |
| Insert new token after this token. | |
| Token * | previous () const |
| unsigned int | varId () const |
| void | varId (unsigned int id) |
| void | printOut (const char *title=0) const |
| For debugging purposes, prints token and all tokens followed by it. | |
| void | printOut (const char *title, const std::vector< std::string > &fileNames) const |
| For debugging purposes, prints token and all tokens followed by it. | |
| void | stringify (std::ostream &os, bool varid, bool attributes) const |
| Stringify a token. | |
| std::string | stringifyList (bool varid, bool attributes, bool linenumbers, bool linebreaks, bool files, const std::vector< std::string > *fileNames=0, const Token *end=0) const |
| Stringify a list of token, from current instance on. | |
| std::string | stringifyList (const Token *end, bool attributes=true) const |
| std::string | stringifyList (bool varid=false) const |
| void | deleteThis () |
| Remove the contents for this token from the token list. | |
| void | link (Token *linkToToken) |
| Create link to given token. | |
| Token * | link () const |
| Return token where this token links to. | |
| void | scope (const Scope *s) |
| Associate this token with given scope. | |
| const Scope * | scope () const |
| Returns a pointer to the scope containing this token. | |
| void | function (const Function *f) |
| Associate this token with given function. | |
| const Function * | function () const |
| Returns a pointer to the Function associated with this token. | |
| void | variable (const Variable *v) |
| Associate this token with given variable. | |
| const Variable * | variable () const |
| Returns a pointer to the variable associated with this token. | |
| std::string | strValue () const |
| This can be called only for tokens that are strings, else the assert() is called. | |
| unsigned int | progressValue () const |
| Get progressValue. | |
| void | assignProgressValues () |
| Calculate progress values for all tokens. | |
| Token * | nextArgument () const |
| Returns the first token of the next argument. | |
| bool | findClosingBracket (const Token *&closing) const |
| Returns the closing bracket of opening '<'. | |
| bool | findClosingBracket (Token *&closing) const |
| void | astOperand1 (Token *tok) |
| void | astOperand2 (Token *tok) |
| void | astFunctionCall () |
| void | astHandleParentheses () |
| const Token * | astOperand1 () const |
| const Token * | astOperand2 () const |
| const Token * | astTop () const |
| std::string | astString () const |
Static Public Member Functions | |
| static bool | simpleMatch (const Token *tok, const char pattern[]) |
| Match given token (or list of tokens) to a pattern list. | |
| static bool | Match (const Token *tok, const char pattern[], unsigned int varid=0) |
| Match given token (or list of tokens) to a pattern list. | |
| static std::size_t | getStrLength (const Token *tok) |
| Return length of C-string. | |
| static std::string | getCharAt (const Token *tok, std::size_t index) |
| Return char of C-string at index (possible escaped "\\n") | |
| static const Token * | findsimplematch (const Token *tok, const char pattern[]) |
| static const Token * | findsimplematch (const Token *tok, const char pattern[], const Token *end) |
| static const Token * | findmatch (const Token *tok, const char pattern[], unsigned int varId=0) |
| static const Token * | findmatch (const Token *tok, const char pattern[], const Token *end, unsigned int varId=0) |
| static Token * | findsimplematch (Token *tok, const char pattern[]) |
| static Token * | findsimplematch (Token *tok, const char pattern[], const Token *end) |
| static Token * | findmatch (Token *tok, const char pattern[], unsigned int varId=0) |
| static Token * | findmatch (Token *tok, const char pattern[], const Token *end, unsigned int varId=0) |
| static int | multiCompare (const Token *tok, const char *haystack, const char *needle) |
| Needle is build from multiple alternatives. | |
| static void | eraseTokens (Token *begin, const Token *end) |
| Delete tokens between begin and end. | |
| static void | replace (Token *replaceThis, Token *start, Token *end) |
| Replace token replaceThis with tokens between start and end, including start and end. | |
| static void | createMutualLinks (Token *begin, Token *end) |
| Links two elements against each other. | |
| static void | move (Token *srcStart, Token *srcEnd, Token *newLocation) |
| Move srcStart and srcEnd tokens and all tokens between them into new a location. | |
Private Member Functions | |
| Token () | |
| Token (const Token &) | |
| Token | operator= (const Token &) |
| void | next (Token *nextToken) |
| void | previous (Token *previousToken) |
| void | update_property_info () |
| Updates internal property cache like _isName or _isBoolean. | |
| void | update_property_isStandardType () |
| Update internal property cache about isStandardType() | |
Static Private Member Functions | |
| 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'. | |
| 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'. | |
| static int | firstWordLen (const char *str) |
| Works almost like strlen() except if str has empty space ' ' character, that character is handled as if it were '\0'. | |
Private Attributes | |
| Token ** | tokensBack |
| Token * | _next |
| Token * | _previous |
| Token * | _link |
| const Scope * | _scope |
| union { | |
| const Function * _function | |
| const Variable * _variable | |
| }; | |
| std::string | _str |
| unsigned int | _varId |
| unsigned int | _fileIndex |
| unsigned int | _linenr |
| unsigned int | _progressValue |
| A value from 0-100 that provides a rough idea about where in the token list this token is located. | |
| Type | _type |
| bool | _isUnsigned |
| bool | _isSigned |
| bool | _isPointerCompare |
| bool | _isLong |
| bool | _isUnused |
| bool | _isStandardType |
| bool | _isExpandedMacro |
| Token * | _astOperand1 |
| Token * | _astOperand2 |
| Token * | _astParent |
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.
| enum Token::Type |
| Token::Token | ( | ) | [private] |
Referenced by insertToken().
| Token::Token | ( | const Token & | ) | [private] |
| Token::Token | ( | Token ** | tokensBack | ) | [explicit] |
| Token::~Token | ( | ) |
| void Token::assignProgressValues | ( | ) | [inline] |
Calculate progress values for all tokens.
Definition at line 527 of file token.h.
References next().
Referenced by TokenList::createTokens(), Tokenizer::simplifyTokenList(), and Tokenizer::tokenize().
| void Token::astFunctionCall | ( | ) |
Definition at line 1079 of file token.cpp.
References _astOperand1, _astParent, and _next.
| void Token::astHandleParentheses | ( | ) |
Definition at line 1085 of file token.cpp.
References _astOperand1, _astOperand2, _astParent, _next, _previous, _str, and Match().
| void Token::astOperand1 | ( | Token * | tok | ) |
Definition at line 1061 of file token.cpp.
References _astOperand1, and _astParent.
Referenced by TokenList::createAst().
| const Token* Token::astOperand1 | ( | ) | const [inline] |
| void Token::astOperand2 | ( | Token * | tok | ) |
Definition at line 1070 of file token.cpp.
References _astOperand2, and _astParent.
| const Token* Token::astOperand2 | ( | ) | const [inline] |
| std::string Token::astString | ( | ) | const [inline] |
| const Token* Token::astTop | ( | ) | const [inline] |
Definition at line 640 of file token.h.
References _astParent.
| const char * Token::chrInFirstWord | ( | const char * | str, |
| char | c | ||
| ) | [static, private] |
| 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 158 of file token.cpp.
References _str, and update_property_info().
| void Token::createMutualLinks | ( | Token * | begin, |
| Token * | end | ||
| ) | [static] |
Links two elements against each other.
Definition at line 946 of file token.cpp.
References link().
Referenced by Tokenizer::createLinks2(), Tokenizer::elseif(), TemplateSimplifier::expandTemplate(), TokenList::insertTokens(), linkBrackets(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAsm(), Tokenizer::simplifyAssignmentInFunctionCall(), Tokenizer::simplifyCompoundAssignment(), Preprocessor::simplifyCondition(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), Tokenizer::simplifyIfNot(), Tokenizer::simplifySizeof(), Tokenizer::simplifyTokenList(), Tokenizer::simplifyTypedef(), and TemplateSimplifier::useDefaultArgumentValues().
| void Token::deleteNext | ( | unsigned long | index = 1 | ) |
Unlink and delete the next 'index' tokens.
Definition at line 172 of file token.cpp.
References _next, next(), previous(), and tokensBack.
Referenced by Tokenizer::arraySize(), Tokenizer::deleteInvalidTypedef(), deleteThis(), Tokenizer::eraseDeadCode(), eraseTokens(), CheckMemoryLeakInFunction::getcode(), Tokenizer::removeRedundantConditions(), TemplateSimplifier::removeTemplate(), Tokenizer::simplifyAssignmentBlock(), Tokenizer::simplifyBitfields(), CheckMemoryLeakInFunction::simplifycode(), Tokenizer::simplifyComma(), Tokenizer::simplifyCompoundAssignment(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyEnum(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfNotNull(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyMulAndParens(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyRealloc(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyTemplates(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyUndefinedSizeArray(), and splitDefinitionFromTypedef().
| void Token::deleteThis | ( | ) |
Remove the contents for this token from the token list.
The contents are replaced with the contents of the next token and the next token is unlinked and deleted from the token list.
So this token will still be valid after the 'deleteThis()'.
Definition at line 186 of file token.cpp.
References _fileIndex, _function, _isExpandedMacro, _isLong, _isPointerCompare, _isSigned, _isStandardType, _isUnsigned, _isUnused, _linenr, _link, _next, _previous, _scope, _str, _type, _variable, _varId, deleteNext(), link(), and str().
Referenced by Tokenizer::deleteInvalidTypedef(), Tokenizer::initVar(), Tokenizer::removeRedundantConditions(), TemplateSimplifier::removeTemplate(), EnumValue::simplify(), Tokenizer::simplifyCasts(), CheckMemoryLeakInFunction::simplifycode(), Tokenizer::simplifyEnum(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyReturnStrncat(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), Tokenizer::simplifyTokenList(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyWhile0(), splitDefinitionFromTypedef(), and TemplateSimplifier::useDefaultArgumentValues().
| 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.
| begin | Tokens after this will be erased. |
| end | Tokens before this will be erased. |
Definition at line 936 of file token.cpp.
References deleteNext(), and next().
Referenced by TemplateSimplifier::cleanupAfterSimplify(), Tokenizer::deleteInvalidTypedef(), Tokenizer::eraseDeadCode(), TemplateSimplifier::expandSpecialized(), Tokenizer::removeExceptionSpecifications(), Tokenizer::removeMacroInVarDecl(), Tokenizer::removeMacrosInGlobalScope(), TemplateSimplifier::removeTemplate(), Tokenizer::simplifyAsm(), Tokenizer::simplifyAssignmentInFunctionCall(), Tokenizer::simplifyAttribute(), Tokenizer::simplifyBitfields(), Tokenizer::simplifyBorland(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCasts(), Tokenizer::simplifyConditions(), Tokenizer::simplifyConstTernaryOp(), Tokenizer::simplifyDeclspec(), Tokenizer::simplifyEnum(), Tokenizer::simplifyErrNoInWhile(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyIfNotNull(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyMathExpressions(), Tokenizer::simplifyNamespaceStd(), Tokenizer::simplifyOperatorName(), Tokenizer::simplifySizeof(), Tokenizer::simplifySQL(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTypedef(), and TemplateSimplifier::useDefaultArgumentValues().
| unsigned int Token::fileIndex | ( | ) | const [inline] |
Definition at line 316 of file token.h.
Referenced by TokenList::addtoken(), addtoken(), Tokenizer::copyTokens(), TokenList::file(), CheckMemoryLeakInFunction::getcode(), TokenList::insertTokens(), Tokenizer::simplifyEnum(), Tokenizer::simplifyIfAssign(), and stringifyList().
| void Token::fileIndex | ( | unsigned int | indexOfFile | ) | [inline] |
| bool Token::findClosingBracket | ( | const Token *& | closing | ) | const |
Returns the closing bracket of opening '<'.
Should only be used if link() is unavailable.
| closing | The closing token is stored in that parameter |
Definition at line 832 of file token.cpp.
References _str, link(), next(), and str().
Referenced by Variable::evaluate(), TemplateSimplifier::getTemplateInstantiations(), Type::initBaseInfo(), Scope::isVariableDeclaration(), setVarIdParseDeclaration(), Tokenizer::simplifyCasts(), Tokenizer::simplifyComma(), Tokenizer::simplifyTypedef(), and Tokenizer::simplifyVarDecl().
| bool Token::findClosingBracket | ( | Token *& | closing | ) | const [inline] |
| const Token * Token::findmatch | ( | const Token * | tok, |
| const char | pattern[], | ||
| unsigned int | varId = 0 |
||
| ) | [static] |
Definition at line 878 of file token.cpp.
References Match(), and next().
Referenced by CheckAutoVariables::autoVariables(), CheckOther::checkAlwaysTrueOrFalseStringCompare(), CheckStl::checkAutoPointer(), CheckOther::checkDoubleFree(), CheckBufferOverrun::checkGlobalAndLocalVariable(), CheckOther::checkInvalidFree(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckOther::checkRedundantAssignment(), CheckMemoryLeakInFunction::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckUnusedVar::checkStructMemberUsage(), CheckOther::checkSuspiciousCaseInSwitch(), CheckOther::checkSuspiciousEqualityComparison(), CheckOther::checkUnreachableCode(), Scope::checkVariable(), CheckStl::erase(), TemplateSimplifier::expandSpecialized(), findAssertPattern(), CheckMemoryLeakInFunction::findleak(), findRedundantCondition(), findSelfAssignPattern(), CheckMemoryLeak::getAllocationType(), CheckMemoryLeakInFunction::getcode(), CheckStl::iterators(), CheckBufferOverrun::negativeIndex(), CheckNullPointer::nullPointerDefaultArgument(), CheckMemoryLeakInFunction::simplifycode(), Tokenizer::simplifySizeof(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyWhile0(), CheckStl::string_c_str(), CheckClass::thisSubtraction(), and CheckOther::warningOldStylePointerCast().
| const Token * Token::findmatch | ( | const Token * | tok, |
| const char | pattern[], | ||
| const Token * | end, | ||
| unsigned int | varId = 0 |
||
| ) | [static] |
| static Token* Token::findmatch | ( | Token * | tok, |
| const char | pattern[], | ||
| unsigned int | varId = 0 |
||
| ) | [inline, static] |
| static Token* Token::findmatch | ( | Token * | tok, |
| const char | pattern[], | ||
| const Token * | end, | ||
| unsigned int | varId = 0 |
||
| ) | [inline, static] |
| const Token * Token::findsimplematch | ( | const Token * | tok, |
| const char | pattern[] | ||
| ) | [static] |
Definition at line 860 of file token.cpp.
References next(), and simpleMatch().
Referenced by CheckAssignIf::assignIf(), CheckAutoVariables::autoVariables(), CheckMemoryLeakInFunction::call_func(), CheckOther::checkRedundantCopy(), ExecutionPath::checkScope(), CheckMemoryLeakInFunction::checkScope(), CheckBufferOverrun::checkScopeForBody(), CheckOther::checkSwitchCaseFallThrough(), CheckOther::checkUnreachableCode(), Tokenizer::eraseDeadCode(), PreprocessorMacro::expandInnerMacros(), TemplateSimplifier::expandSpecialized(), CheckMemoryLeakInFunction::findleak(), hasArrayEnd(), hasArrayEndParen(), Tokenizer::hasEnumsWithTypedef(), TemplateSimplifier::instantiateMatch(), CheckStl::iterators(), CheckClass::privateFunctions(), CheckStl::pushback(), Tokenizer::setVarId(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyNamespaceStd(), Tokenizer::simplifyRedundantParentheses(), CheckStl::stlOutOfBounds(), and CheckStl::string_c_str().
| const Token * Token::findsimplematch | ( | const Token * | tok, |
| const char | pattern[], | ||
| const Token * | end | ||
| ) | [static] |
Definition at line 869 of file token.cpp.
References next(), and simpleMatch().
| static Token* Token::findsimplematch | ( | Token * | tok, |
| const char | pattern[] | ||
| ) | [inline, static] |
| static Token* Token::findsimplematch | ( | Token * | tok, |
| const char | pattern[], | ||
| const Token * | end | ||
| ) | [inline, static] |
| bool Token::firstWordEquals | ( | const char * | str, |
| const char * | word | ||
| ) | [static, private] |
| int Token::firstWordLen | ( | const char * | str | ) | [static, private] |
| void Token::function | ( | const Function * | f | ) | [inline] |
Associate this token with given function.
| f | Function to be associated |
Definition at line 465 of file token.h.
Referenced by CheckMemoryLeakInFunction::call_func(), CheckNullPointer::CanFunctionAssignPointer(), CheckOther::checkComparisonOfFuncReturningBool(), CheckBufferOverrun::checkFunctionParameter(), CheckOther::checkRedundantCopy(), CheckOther::checkVarFuncNullUB(), CheckMemoryLeak::getAllocationType(), CheckClass::initializeVarList(), CheckUninitVar::isVariableUsage(), and CheckAutoVariables::returnTemporary().
| const Function* Token::function | ( | ) | const [inline] |
| std::string Token::getCharAt | ( | const Token * | tok, |
| std::size_t | index | ||
| ) | [static] |
Return char of C-string at index (possible escaped "\\n")
Should be called for str% tokens only.
| tok | token with C-string |
| index | position of character |
Definition at line 768 of file token.cpp.
References str(), and strValue().
Referenced by Tokenizer::simplifyCharAt().
| std::size_t Token::getStrLength | ( | const Token * | tok | ) | [static] |
Return length of C-string.
Should be called for str% tokens only.
| tok | token with C-string |
Definition at line 744 of file token.cpp.
References str(), and strValue().
Referenced by CheckOther::checkIncorrectStringCompare(), CheckBufferOverrun::checkScope(), CheckBufferOverrun::countSprintfLength(), UninitVar::parse(), Tokenizer::simplifyCharAt(), Tokenizer::simplifySizeof(), Tokenizer::simplifyTokenList(), Tokenizer::sizeOfType(), and CheckBufferOverrun::writeOutsideBufferSize().
| void Token::insertToken | ( | const std::string & | tokenStr, |
| bool | prepend = false |
||
| ) |
Insert new token after this token.
This function will handle relations between next and previous token also.
| tokenStr | String for the new token. |
| prepend | Insert the new token before this token when it's not the first one on the tokens list. |
Definition at line 896 of file token.cpp.
References _fileIndex, _linenr, _progressValue, _str, next(), previous(), str(), Token(), and tokensBack.
Referenced by TokenList::addtoken(), Tokenizer::copyTokens(), Tokenizer::initVar(), TokenList::insertTokens(), Tokenizer::removeRedundantFor(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAssignmentBlock(), Tokenizer::simplifyBitfields(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyEnum(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyNestedStrcat(), Tokenizer::simplifyRealloc(), Tokenizer::simplifyReturnStrncat(), Tokenizer::simplifySizeof(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), Tokenizer::simplifyTemplates(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyVariableMultipleAssign(), simplifyVarMapExpandValue(), splitDefinitionFromTypedef(), and TemplateSimplifier::useDefaultArgumentValues().
| bool Token::isArithmeticalOp | ( | ) | const [inline] |
Definition at line 223 of file token.h.
Referenced by CheckOther::checkModuloAlwaysTrueFalse(), CheckOther::clarifyCalculation(), if_findCompare(), CheckNullPointer::nullPointerByDeRefAndChec(), Tokenizer::simplifyRedundantParentheses(), and CheckStl::size().
| bool Token::isAssignmentOp | ( | ) | const [inline] |
Definition at line 229 of file token.h.
Referenced by CheckOther::checkAssignmentInAssert(), isLowerThanOr(), CheckNullPointer::isPointerDeRef(), CheckUninitVar::isVariableUsage(), UninitVar::parse(), CheckStl::pushback(), and Tokenizer::simplifyMulAndParens().
| bool Token::isBoolean | ( | ) | const [inline] |
Definition at line 232 of file token.h.
Referenced by CheckOther::checkComparisonOfBoolWithInt(), Scope::checkVariable(), CheckOther::checkVariableScope(), Match(), and Tokenizer::simplifyKnownVariablesGetData().
| bool Token::isComparisonOp | ( | ) | const [inline] |
Definition at line 226 of file token.h.
Referenced by if_findCompare(), and Match().
| bool Token::isConstOp | ( | ) | const [inline] |
Definition at line 213 of file token.h.
Referenced by CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isVariableUsage(), Match(), multiCompare(), multiComparePercent(), and Nullpointer::parse().
| bool Token::isExpandedMacro | ( | ) | const [inline] |
Definition at line 269 of file token.h.
Referenced by CheckOther::checkDuplicateExpression(), and CheckNullPointer::nullPointerByDeRefAndChec().
| bool Token::isExtendedOp | ( | ) | const [inline] |
Definition at line 219 of file token.h.
Referenced by Tokenizer::simplifyKnownVariablesSimplify().
| bool Token::isLong | ( | ) | const [inline] |
Definition at line 254 of file token.h.
Referenced by TokenList::addtoken(), analyzeType(), Function::argsMatch(), Tokenizer::copyTokens(), TokenList::insertTokens(), Tokenizer::simplifyBitfields(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::sizeOfType(), stringify(), and SymbolDatabase::SymbolDatabase().
| void Token::isLong | ( | bool | size | ) | [inline] |
| bool Token::isName | ( | ) | const [inline] |
Definition at line 200 of file token.h.
Referenced by SymbolDatabase::addClassFunction(), SymbolDatabase::addNewFunction(), UninitVar::analyseFunctions(), CheckOther::checkAssignmentInAssert(), CheckOther::checkInnerScope(), CheckOther::checkNegativeBitwiseShift(), CheckBufferOverrun::checkScope(), CheckOther::checkVarFuncNullUB(), CheckOther::clarifyCalculation(), CheckOther::clarifyCondition(), PreprocessorMacro::code(), CheckClass::constructors(), doAssignment(), Tokenizer::duplicateDefinition(), Variable::evaluate(), TemplateSimplifier::expandSpecialized(), SymbolDatabase::findScope(), SymbolDatabase::findType(), CheckMemoryLeak::getAllocationType(), SymbolDatabase::isFunction(), Tokenizer::IsScopeNoReturn(), isUpperCaseName(), CheckUninitVar::isVariableUsage(), Match(), CheckNonReentrantFunctions::nonReentrantFunctions(), UninitVar::parse(), EraseCheckLoop::parse(), setVarIdParseDeclaration(), Tokenizer::simplifyAsm(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyEnum(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyOperatorName(), Tokenizer::simplifyVarDecl(), CheckStl::string_c_str(), and TemplateSimplifier::templateParameters().
| bool Token::isNumber | ( | ) | const [inline] |
Definition at line 205 of file token.h.
Referenced by Variable::arrayDimensions(), CheckOther::checkComparisonOfBoolExpressionWithInt(), CheckOther::checkComparisonOfBoolWithInt(), CheckOther::checkMathFunctions(), CheckBufferOverrun::checkSprintfCall(), CheckOther::checkVariableScope(), CheckOther::clarifyCalculation(), CheckOther::clarifyCondition(), for_init(), Tokenizer::initVar(), Match(), Tokenizer::simplifyAsm(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyKnownVariablesGetData(), TemplateSimplifier::simplifyNumericCalculations(), and TemplateSimplifier::templateParameters().
| bool Token::isOp | ( | ) | const [inline] |
Definition at line 208 of file token.h.
Referenced by TokenList::createAst(), CheckNullPointer::isPointerDeRef(), CheckUninitVar::isVariableUsage(), Match(), multiCompare(), multiComparePercent(), CheckNullPointer::nullConstantDereference(), and Nullpointer::parse().
| bool Token::isPointerCompare | ( | ) | const [inline] |
Definition at line 248 of file token.h.
Referenced by Tokenizer::copyTokens(), TokenList::insertTokens(), and Tokenizer::simplifyIfNotNull().
| void Token::isPointerCompare | ( | bool | b | ) | [inline] |
| bool Token::isSigned | ( | ) | const [inline] |
Definition at line 242 of file token.h.
Referenced by TokenList::addtoken(), CheckOther::checkCastIntToCharAndBack(), Tokenizer::copyTokens(), TokenList::insertTokens(), Tokenizer::simplifyBitfields(), TemplateSimplifier::simplifyTemplateInstantiations(), stringify(), and SymbolDatabase::SymbolDatabase().
| void Token::isSigned | ( | bool | sign | ) | [inline] |
| bool Token::isStandardType | ( | ) | const [inline] |
Definition at line 266 of file token.h.
Referenced by Function::addArguments(), UninitVar::analyseFunctions(), CheckMemoryLeakInClass::check(), CheckMemoryLeakStructMember::check(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkNegativeBitwiseShift(), CheckUninitVar::checkScope(), CheckOther::checkVariableScope(), Variable::evaluate(), Tokenizer::initVar(), CheckOther::invalidPointerCast(), CheckMemoryLeak::isclass(), Tokenizer::isFunctionParameterPassedByValue(), isKnownType(), isNonBoolStdType(), CheckAutoVariables::isNonReferenceArg(), CheckUninitVar::isVariableUsage(), Tokenizer::printUnknownTypes(), Tokenizer::removeMacroInVarDecl(), Tokenizer::setVarId(), and Tokenizer::simplifyTypedef().
| bool Token::isUnsigned | ( | ) | const [inline] |
Definition at line 236 of file token.h.
Referenced by TokenList::addtoken(), Function::argsMatch(), CheckOther::checkCharVariable(), CheckOther::checkSignOfUnsignedVariable(), CheckIO::checkWrongPrintfScanfArguments(), Tokenizer::copyTokens(), TokenList::insertTokens(), CheckOther::isSigned(), isSignedChar(), CheckOther::isUnsigned(), Tokenizer::simplifyBitfields(), TemplateSimplifier::simplifyTemplateInstantiations(), stringify(), and SymbolDatabase::SymbolDatabase().
| void Token::isUnsigned | ( | bool | sign | ) | [inline] |
| bool Token::isUnused | ( | ) | const [inline] |
Definition at line 260 of file token.h.
Referenced by TokenList::addtoken(), CheckUnusedVar::checkFunctionVariableUsage(), Tokenizer::copyTokens(), and TokenList::insertTokens().
| void Token::isUnused | ( | bool | used | ) | [inline] |
| bool Token::isUpperCaseName | ( | ) | const |
Definition at line 139 of file token.cpp.
References _str, and isName().
Referenced by CheckClass::checkConst(), UninitVar::parse(), and Tokenizer::removeMacroInVarDecl().
| unsigned int Token::linenr | ( | ) | const [inline] |
Definition at line 309 of file token.h.
Referenced by TokenList::addtoken(), addtoken(), CppCheck::checkFile(), CheckOther::checkSelfAssignment(), CheckOther::checkUnreachableCode(), Tokenizer::copyTokens(), CheckMemoryLeakInFunction::getcode(), TokenList::insertTokens(), CheckStl::missingComparisonError(), CheckAssignIf::multiCondition(), CheckUnusedFunctions::parseTokens(), Tokenizer::simplifyAsm(), Tokenizer::simplifyEnum(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), and stringifyList().
| void Token::linenr | ( | unsigned int | lineNumber | ) | [inline] |
| void Token::link | ( | Token * | linkToToken | ) | [inline] |
Create link to given token.
| linkToToken | The token where this token should link to. |
Definition at line 427 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addNewFunction(), UninitVar::analyseFunctions(), Variable::arrayDimensions(), Tokenizer::arraySize(), CheckAssignIf::assignIfParseScope(), CheckMemoryLeakNoVar::check(), CheckOther::checkAssignmentInAssert(), CheckBoost::checkBoostForeachModification(), CheckOther::checkComparisonOfBoolExpressionWithInt(), CheckOther::checkComparisonOfFuncReturningBool(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateExpression(), CheckOther::checkDuplicateIf(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckBufferOverrun::checkGlobalAndLocalVariable(), CheckUninitVar::checkIfForWhileHead(), CheckOther::checkInnerScope(), CheckBufferOverrun::checkInsecureCmdLineArgs(), CheckUninitVar::checkLoopBody(), CheckOther::checkMemsetZeroBytes(), CheckBufferOverrun::checkReadlinkBufferUsage(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantAssignmentInSwitch(), CheckLeakAutoVar::checkScope(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), EraseCheckLoop::checkScope(), CheckBufferOverrun::checkScopeForBody(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkUnreachableCode(), CheckOther::checkUnsignedDivision(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckOther::clarifyCalculation(), CheckOther::clarifyCondition(), CheckOther::clarifyStatement(), CheckAssignIf::comparison(), CheckOther::complexDuplicateExpressionCheck(), CheckClass::constructors(), Tokenizer::copyTokens(), countMinArgs(), createMutualLinks(), deleteThis(), doAssignment(), Tokenizer::duplicateDefinition(), Tokenizer::duplicateTypedef(), Tokenizer::eraseDeadCode(), Variable::evaluate(), findClosingBracket(), for_bailout(), for_condition(), CheckMemoryLeak::getAllocationType(), CheckMemoryLeakInFunction::getcode(), CheckMemoryLeak::getReallocationType(), Scope::getVariableList(), CheckClass::hasAssignSelf(), TemplateSimplifier::hasComplicatedSyntaxErrorsInTemplates(), CheckStl::if_find(), if_findCompare(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), CheckOther::invalidPointerCast(), SymbolDatabase::isFunction(), CheckClass::isMemberVar(), isPartOfClassStructUnion(), CheckNullPointer::isPointerDeRef(), Scope::isVariableDeclaration(), CheckUninitVar::isVariableUsage(), linkAt(), CheckAssignIf::multiCondition(), CheckBufferOverrun::negativeIndex(), nextArgument(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckNullPointer::nullPointerDefaultArgument(), CheckNullPointer::nullPointerStructByDeRefAndChec(), UninitVar::parse(), Nullpointer::parse(), CheckBufferOverrun::parse_for_body(), UninitVar::parserhs(), CheckUnusedFunctions::parseTokens(), processFunc(), Tokenizer::removeRedundantAssignment(), Tokenizer::removeRedundantConditions(), Tokenizer::removeRedundantFor(), Tokenizer::removeUnnecessaryQualification(), CheckAutoVariables::returnTemporary(), Tokenizer::setVarId(), setVarIdClassDeclaration(), setVarIdParseDeclaration(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyAsm(), Tokenizer::simplifyAssignmentInFunctionCall(), Tokenizer::simplifyBitfields(), Tokenizer::simplifyBorland(), Tokenizer::simplifyBuiltinExpect(), Tokenizer::simplifyCasts(), Tokenizer::simplifyComma(), Tokenizer::simplifyCompoundAssignment(), Tokenizer::simplifyConditions(), Tokenizer::simplifyEnum(), Tokenizer::simplifyErrNoInWhile(), Tokenizer::simplifyFlowControl(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), Tokenizer::simplifyIfNot(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyLogicalOperators(), Tokenizer::simplifyMathExpressions(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyNestedStrcat(), Tokenizer::simplifyOperatorName(), Tokenizer::simplifyRealloc(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyReference(), Tokenizer::simplifyReturnStrncat(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), Tokenizer::simplifyTokenList(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyWhile0(), skipBrackets(), skipBracketsAndMembers(), splitDefinitionFromTypedef(), CheckStl::string_c_str(), SymbolDatabase::SymbolDatabase(), TemplateSimplifier::templateParameters(), TemplateSimplifier::useDefaultArgumentValues(), and CheckMemoryLeakInClass::variable().
| Token* Token::link | ( | ) | const [inline] |
| 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 288 of file token.cpp.
References link(), and tokAt().
Referenced by Tokenizer::arraySize(), CheckAutoVariables::autoVariables(), bailoutIfSwitch(), CheckMemoryLeakInFunction::call_func(), CheckOther::checkConstantFunctionParameter(), CheckClass::checkConstFunc(), CheckOther::checkDoubleFree(), CheckOther::checkDuplicateBranch(), CheckOther::checkDuplicateIf(), CheckIO::checkFileUsage(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkInnerScope(), CheckOther::checkInvalidFree(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), CheckLeakAutoVar::checkScope(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSelfAssignment(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousEqualityComparison(), Scope::checkVariable(), CheckClass::copyconstructors(), Tokenizer::deleteInvalidTypedef(), Tokenizer::duplicateTypedef(), Tokenizer::eraseDeadCode(), CheckMemoryLeakInFunction::getcode(), CheckStl::if_find(), CheckClass::initializationListUsage(), CheckClass::initializeVarList(), isComplexType(), isInitList(), CheckClass::isMemberVar(), Tokenizer::IsScopeNoReturn(), CheckStl::iterators(), CheckStl::mismatchingContainers(), CheckStl::missingComparison(), CheckAssignIf::multiCondition(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerLinkedList(), CheckOther::oppositeInnerCondition(), UninitVar::parse(), Nullpointer::parse(), UninitVar::parseLoopBody(), CheckUnusedFunctions::parseTokens(), processFunc(), CheckStl::pushback(), Tokenizer::removeRedundantConditions(), Tokenizer::removeRedundantFor(), CheckAutoVariables::returnTemporary(), Tokenizer::setVarId(), Tokenizer::simplifyBuiltinExpect(), Tokenizer::simplifyFlowControl(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyMathExpressions(), Tokenizer::simplifyReturnStrncat(), Tokenizer::simplifyTypedef(), CheckOther::sizeofCalculation(), splitDefinitionFromTypedef(), CheckOther::suspiciousSizeofCalculation(), SymbolDatabase::SymbolDatabase(), and CheckClass::virtualDestructor().
| Token* Token::linkAt | ( | int | index | ) | [inline] |
| bool Token::Match | ( | const Token * | tok, |
| const char | pattern[], | ||
| unsigned int | varid = 0 |
||
| ) | [static] |
Match given token (or list of tokens) to a pattern list.
Possible patterns
multi-compare patterns such as "int|void|char" can contain or%, oror% and op% but it is not recommended to put such an cmd% as the first pattern.
It's possible to use multi-compare patterns with all the other cmds%, except for varid%, and normal names, but the cmds% should be put as the first patterns in the list, then the normal names. 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.
| tok | List of tokens to be compared to the pattern |
| pattern | The pattern against which the tokens are compared, e.g. "const" or ") const|volatile| {". |
| varid | if varid% is given in the pattern the Token::varId will be matched against this argument |
Definition at line 529 of file token.cpp.
References _str, chrInFirstWord(), eChar, eString, firstWordEquals(), firstWordLen(), isBoolean(), isComparisonOp(), isConstOp(), isName(), isNumber(), isOp(), multiCompare(), multicompare, next(), str(), type(), and varId().
Referenced by Function::addArguments(), SymbolDatabase::addNewFunction(), UninitVar::analyseFunctions(), analyzeLogicOperatorCondition(), analyzeType(), Function::argsMatch(), CheckBufferOverrun::arrayIndexInForLoop(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), CheckAssignIf::assignIf(), CheckAssignIf::assignIfParseScope(), astHandleParentheses(), CheckAutoVariables::autoVariables(), CheckMemoryLeakInFunction::call_func(), CheckNullPointer::CanFunctionAssignPointer(), CheckMemoryLeakNoVar::check(), CheckOther::checkAssignBoolToPointer(), CheckOther::checkAssignmentInAssert(), CheckStl::checkAutoPointer(), CheckOther::checkBitwiseOnBoolean(), CheckBoost::checkBoostForeachModification(), CheckBufferOverrun::checkBufferAllocatedWithStrlen(), CheckOther::checkCastIntToCharAndBack(), CheckOther::checkCCTypeFunctions(), CheckOther::checkCharVariable(), CheckOther::checkComparisonOfBoolExpressionWithInt(), CheckOther::checkComparisonOfFuncReturningBool(), CheckClass::checkConst(), CheckOther::checkConstantFunctionParameter(), CheckClass::checkConstFunc(), CheckIO::checkCoutCerrMisusage(), CheckOther::checkDoubleFree(), CheckOther::checkDuplicateExpression(), CheckOther::checkExpressionRange(), CheckIO::checkFileUsage(), CheckBufferOverrun::checkFunctionCall(), CheckBufferOverrun::checkFunctionParameter(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckBufferOverrun::checkGlobalAndLocalVariable(), CheckUninitVar::checkIfForWhileHead(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncompleteStatement(), CheckOther::checkIncorrectLogicOperator(), CheckOther::checkIncorrectStringCompare(), CheckOther::checkIncrementBoolean(), CheckOther::checkInnerScope(), CheckBufferOverrun::checkInsecureCmdLineArgs(), CheckOther::checkInvalidFree(), CheckUninitVar::checkLoopBody(), CheckOther::checkMathFunctions(), CheckOther::checkMisusedScopedObject(), CheckOther::checkModuloAlwaysTrueFalse(), CheckOther::checkNegativeBitwiseShift(), CheckOther::checkPipeParameterSize(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckBufferOverrun::checkReadlinkBufferUsage(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantAssignmentInSwitch(), CheckOther::checkRedundantCopy(), CheckInternal::checkRedundantNextPrevious(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), CheckMemoryLeakInFunction::checkScope(), EraseCheckLoop::checkScope(), CheckBufferOverrun::checkScopeForBody(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSelfAssignment(), CheckOther::checkSignOfUnsignedVariable(), CheckOther::checkSizeofForArrayParameter(), CheckOther::checkSizeofForNumericParameter(), CheckOther::checkSizeofForPointerSize(), CheckOther::checkSleepTimeInterval(), CheckBufferOverrun::checkSprintfCall(), CheckUnusedVar::checkStructMemberUsage(), CheckBufferOverrun::checkStructVariable(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousCaseInSwitch(), CheckOther::checkSuspiciousEqualityComparison(), CheckOther::checkSuspiciousStringCompare(), CheckOther::checkSwitchCaseFallThrough(), CheckOther::checkUnreachableCode(), CheckOther::checkUnsignedDivision(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::checkZeroDivision(), CheckOther::clarifyCalculation(), CheckOther::clarifyCondition(), CheckOther::clarifyStatement(), TemplateSimplifier::cleanupAfterSimplify(), PreprocessorMacro::code(), CheckAssignIf::comparison(), CheckOther::complexDuplicateExpressionCheck(), Tokenizer::concatenateDoubleSharp(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), conditionAlwaysTrueOrFalse(), CheckClass::copyconstructors(), countMinArgs(), TokenList::createAst(), Tokenizer::createLinks2(), Tokenizer::createSymbolDatabase(), CheckExceptionSafety::deallocThrow(), Nullpointer::dereference(), doAssignment(), Tokenizer::duplicateDefinition(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), CheckStl::erase(), Tokenizer::eraseDeadCode(), Variable::evaluate(), PreprocessorMacro::expandInnerMacros(), TemplateSimplifier::expandTemplate(), expressionHasSideEffects(), SymbolDatabase::findFunction(), CheckMemoryLeakInFunction::findleak(), findmatch(), for3(), for_bailout(), for_condition(), for_init(), CheckMemoryLeak::functionArgAlloc(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::functionReturnType(), CheckMemoryLeak::getAllocationType(), Preprocessor::getcfgs(), Preprocessor::getcode(), CheckMemoryLeakInFunction::getcode(), CheckMemoryLeak::getDeallocationType(), CheckMemoryLeak::getReallocationType(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), TemplateSimplifier::getTemplateNamePosition(), Scope::getVariableList(), CheckClass::hasAllocation(), CheckClass::hasAssignSelf(), TemplateSimplifier::hasComplicatedSyntaxErrorsInTemplates(), Tokenizer::hasEnumsWithTypedef(), CheckStl::if_find(), if_findCompare(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), TokenList::insertTokens(), TemplateSimplifier::instantiateMatch(), CheckOther::invalidFunctionUsage(), CheckOther::invalidPointerCast(), CheckIO::invalidScanf(), CheckBufferOverrun::isArrayOfStruct(), isContainerSizeSlow(), SymbolDatabase::isFunction(), isFunctionOrBreakPattern(), Tokenizer::isFunctionParameterPassedByValue(), isInitList(), isint(), isLowerEqualThanMulDiv(), isLowerThanOr(), isLowerThanShift(), CheckMemoryLeakStructMember::isMalloc(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), CheckNullPointer::isPointerDeRef(), Tokenizer::IsScopeNoReturn(), CheckOther::isSigned(), Scope::isVariableDeclaration(), CheckUninitVar::isVariableUsage(), CheckStl::iterators(), CheckStl::mismatchingContainers(), CheckStl::missingComparison(), CheckAssignIf::multiCondition(), CheckClass::noMemset(), CheckNonReentrantFunctions::nonReentrantFunctions(), CheckMemoryLeakInFunction::notvar(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckNullPointer::nullPointerDefaultArgument(), CheckNullPointer::nullPointerLinkedList(), CheckNullPointer::nullPointerStructByDeRefAndChec(), CheckObsoleteFunctions::obsoleteFunctions(), CheckClass::operatorEq(), CheckClass::operatorEqRetRefThis(), CheckClass::operatorEqToSelf(), CheckOther::oppositeInnerCondition(), UninitVar::parse(), EraseCheckLoop::parse(), Nullpointer::parse(), ExecutionPathBufferOverrun::parse(), CheckBufferOverrun::parse_for_body(), CheckMemoryLeakInFunction::parse_noreturn(), ExecutionPath::parseCondition(), UninitVar::parseCondition(), Nullpointer::parseCondition(), CheckNullPointer::parseFunctionCall(), Nullpointer::parseLoopBody(), UninitVar::parserhs(), CheckUnusedFunctions::parseTokens(), Check64BitPortability::pointerassignment(), CheckPostfixOperator::postfixOperator(), PreprocessorMacro::PreprocessorMacro(), Tokenizer::printUnknownTypes(), processFunc(), CheckStl::pushback(), Tokenizer::removeExceptionSpecifications(), Tokenizer::removeMacroInVarDecl(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantAssignment(), Tokenizer::removeRedundantConditions(), Tokenizer::removeRedundantFor(), TemplateSimplifier::removeTemplate(), Tokenizer::removeUnnecessaryQualification(), CheckLeakAutoVar::ret(), CheckAutoVariables::returnPointerToLocalArray(), CheckAutoVariables::returnReference(), CheckAutoVariables::returnTemporary(), Scope::Scope(), Tokenizer::setVarId(), setVarIdClassDeclaration(), setVarIdParseDeclaration(), setVarIdStructMembers(), EnumValue::simplify(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyArrayAccessSyntax(), Tokenizer::simplifyAsm(), Tokenizer::simplifyAssignmentBlock(), Tokenizer::simplifyAssignmentInFunctionCall(), Tokenizer::simplifyAttribute(), Tokenizer::simplifyBitfields(), Tokenizer::simplifyBorland(), Tokenizer::simplifyBuiltinExpect(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCallingConvention(), Tokenizer::simplifyCasts(), Tokenizer::simplifyCharAt(), CheckMemoryLeakInFunction::simplifycode(), Tokenizer::simplifyComma(), Tokenizer::simplifyComparisonOrder(), Tokenizer::simplifyCompoundAssignment(), Preprocessor::simplifyCondition(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyConditions(), Tokenizer::simplifyConst(), Tokenizer::simplifyConstTernaryOp(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyEnum(), Tokenizer::simplifyErrNoInWhile(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFlowControl(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyFunctionReturn(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), Tokenizer::simplifyIfNot(), Tokenizer::simplifyIfNotNull(), Tokenizer::simplifyIfSameInnerCondition(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyKeyword(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyLabelsCaseDefault(), Tokenizer::simplifyLogicalOperators(), Tokenizer::simplifyMathExpressions(), Tokenizer::simplifyMathFunctions(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyMicrosoftMFC(), Tokenizer::simplifyMicrosoftStringFunctions(), Tokenizer::simplifyMulAndParens(), Tokenizer::simplifyNamespaceStd(), Tokenizer::simplifyNestedStrcat(), Tokenizer::simplifyNull(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyOperatorName(), Tokenizer::simplifyParameterVoid(), Tokenizer::simplifyPlatformTypes(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyQtSignalsSlots(), Tokenizer::simplifyRealloc(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyReference(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySizeof(), Tokenizer::simplifyStd(), Tokenizer::simplifyStdType(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTemplates(), Tokenizer::simplifyTokenList(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyUndefinedSizeArray(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), Tokenizer::simplifyWhile0(), CheckStl::size(), CheckOther::sizeofCalculation(), CheckOther::sizeofsizeof(), skipBracketsAndMembers(), skipPointers(), skipScopeIdentifiers(), skipTernaryOp(), splitDefinitionFromTypedef(), CheckStl::stlBoundaries(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), CheckOther::strPlusChar(), SymbolDatabase::SymbolDatabase(), TemplateSimplifier::templateParameters(), Tokenizer::tokenize(), UninitVar::use(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), Tokenizer::validate(), CheckMemoryLeakInClass::variable(), CheckClass::virtualDestructor(), CheckOther::warningOldStylePointerCast(), and CheckBufferOverrun::writeOutsideBufferSize().
| 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.
| srcStart | This is the first token to be moved |
| srcEnd | The last token to be moved |
| newLocation | srcStart will be placed after this token. |
[newLocation] -> b -> c -> [srcStart] -> [srcEnd] -> f
Definition at line 796 of file token.cpp.
References _progressValue, next(), and previous().
Referenced by Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyNestedStrcat(), and Tokenizer::simplifyRealloc().
| int Token::multiCompare | ( | const Token * | tok, |
| const char * | haystack, | ||
| const char * | needle | ||
| ) | [static] |
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.
| tok | Current token |
| haystack | e.g. "one|two" or "|one|two" |
| needle | e.g. "one", "two" or "invalid" |
Definition at line 352 of file token.cpp.
References isConstOp(), isOp(), and multiComparePercent().
Referenced by Match().
| Token* Token::next | ( | ) | const [inline] |
Definition at line 323 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addGlobalFunction(), SymbolDatabase::addNewFunction(), UninitVar::analyseFunctions(), Function::argsMatch(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndexInForLoop(), CheckBufferOverrun::arrayIndexThenCheck(), Tokenizer::arraySize(), CheckAssignIf::assignIf(), CheckAssignIf::assignIfParseScope(), assignProgressValues(), CheckAutoVariables::autoVariables(), bailoutIfSwitch(), CheckMemoryLeakInFunction::call_func(), CheckMemoryLeakInFunction::check(), CheckMemoryLeakNoVar::check(), CheckOther::checkAssignBoolToPointer(), CheckOther::checkAssignmentInAssert(), CheckStl::checkAutoPointer(), CheckOther::checkBitwiseOnBoolean(), CheckBoost::checkBoostForeachModification(), CheckBufferOverrun::checkBufferAllocatedWithStrlen(), CheckOther::checkCastIntToCharAndBack(), CheckOther::checkCCTypeFunctions(), CheckOther::checkCharVariable(), CheckOther::checkComparisonOfBoolExpressionWithInt(), CheckOther::checkComparisonOfBoolWithBool(), CheckOther::checkComparisonOfBoolWithInt(), CheckOther::checkComparisonOfFuncReturningBool(), CheckClass::checkConstFunc(), CheckIO::checkCoutCerrMisusage(), CheckOther::checkDoubleFree(), CheckOther::checkDuplicateBranch(), CheckOther::checkDuplicateExpression(), CheckOther::checkDuplicateIf(), CheckOther::checkExpressionRange(), CppCheck::checkFile(), CheckIO::checkFileUsage(), CheckBufferOverrun::checkFunctionParameter(), checkFunctionUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckBufferOverrun::checkGlobalAndLocalVariable(), CheckUninitVar::checkIfForWhileHead(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncompleteStatement(), CheckOther::checkIncorrectLogicOperator(), CheckOther::checkIncorrectStringCompare(), CheckOther::checkIncrementBoolean(), CheckOther::checkInnerScope(), CheckBufferOverrun::checkInsecureCmdLineArgs(), CheckOther::checkInvalidFree(), CheckUninitVar::checkLoopBody(), CheckOther::checkMathFunctions(), CheckOther::checkMemsetZeroBytes(), CheckInternal::checkMissingPercentCharacter(), CheckOther::checkMisusedScopedObject(), CheckOther::checkModuloAlwaysTrueFalse(), CheckOther::checkNegativeBitwiseShift(), CheckOther::checkPipeParameterSize(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckBufferOverrun::checkReadlinkBufferUsage(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantAssignmentInSwitch(), CheckOther::checkRedundantCopy(), CheckInternal::checkRedundantNextPrevious(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), CheckUninitVar::checkScope(), CheckLeakAutoVar::checkScope(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), CheckMemoryLeakInFunction::checkScope(), EraseCheckLoop::checkScope(), CheckBufferOverrun::checkScopeForBody(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSelfAssignment(), CheckOther::checkSignOfUnsignedVariable(), CheckOther::checkSizeofForArrayParameter(), CheckOther::checkSizeofForNumericParameter(), CheckOther::checkSizeofForPointerSize(), CheckOther::checkSleepTimeInterval(), CheckBufferOverrun::checkSprintfCall(), CheckUnusedVar::checkStructMemberUsage(), CheckBufferOverrun::checkStructVariable(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousCaseInSwitch(), CheckOther::checkSuspiciousEqualityComparison(), CheckOther::checkSuspiciousStringCompare(), CheckOther::checkSwitchCaseFallThrough(), CheckInternal::checkTokenMatchPatterns(), CheckInternal::checkTokenSimpleMatchPatterns(), CheckInternal::checkUnknownPattern(), CheckOther::checkUnreachableCode(), CheckOther::checkUnsignedDivision(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::checkZeroDivision(), CheckOther::clarifyCalculation(), CheckOther::clarifyCondition(), CheckOther::clarifyStatement(), TemplateSimplifier::cleanupAfterSimplify(), PreprocessorMacro::code(), Tokenizer::combineOperators(), Tokenizer::combineStrings(), CheckAssignIf::comparison(), CheckOther::complexDuplicateExpressionCheck(), Tokenizer::concatenateDoubleSharp(), Tokenizer::concatenateNegativeNumberAndAnyPositive(), conditionAlwaysTrueOrFalse(), CheckClass::copyconstructors(), Tokenizer::copyTokens(), countMinArgs(), TokenList::createAst(), Tokenizer::createLinks(), Tokenizer::createLinks2(), Tokenizer::createSymbolDatabase(), CheckExceptionSafety::deallocThrow(), Tokenizer::deleteInvalidTypedef(), deleteNext(), Tokenizer::deleteSymbolDatabase(), TokenList::deleteTokens(), CheckExceptionSafety::destructors(), doAssignment(), Tokenizer::duplicateDefinition(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), CheckStl::erase(), Tokenizer::eraseDeadCode(), eraseTokens(), Variable::evaluate(), TemplateSimplifier::expandSpecialized(), TemplateSimplifier::expandTemplate(), expressionHasSideEffects(), findClosingBracket(), CheckMemoryLeakInFunction::findleak(), findmatch(), SymbolDatabase::findScope(), findsimplematch(), SymbolDatabase::findType(), for_condition(), for_init(), CheckMemoryLeak::functionArgAlloc(), CheckMemoryLeak::functionReturnType(), CheckMemoryLeak::getAllocationType(), Preprocessor::getcfgs(), CheckMemoryLeakInFunction::getcode(), CheckMemoryLeak::getDeallocationType(), CheckMemoryLeak::getReallocationType(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), Scope::getVariableList(), CheckClass::hasAllocation(), CheckClass::hasAssignSelf(), TemplateSimplifier::hasComplicatedSyntaxErrorsInTemplates(), Tokenizer::hasEnumsWithTypedef(), CheckStl::if_find(), if_findCompare(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), TokenList::insertTokens(), TemplateSimplifier::instantiateMatch(), CheckOther::invalidFunctionUsage(), CheckOther::invalidPointerCast(), CheckIO::invalidScanf(), CheckBufferOverrun::isArrayOfStruct(), SymbolDatabase::isFunction(), Tokenizer::isFunctionParameterPassedByValue(), isKnownType(), CheckMemoryLeakStructMember::isMalloc(), CheckNullPointer::isPointerDeRef(), Scope::isVariableDeclaration(), CheckUninitVar::isVariableUsage(), CheckStl::iterators(), Match(), CheckStl::mismatchingContainers(), CheckStl::missingComparison(), move(), CheckAssignIf::multiCondition(), nextArgument(), CheckClass::noMemset(), CheckNonReentrantFunctions::nonReentrantFunctions(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckNullPointer::nullPointerDefaultArgument(), CheckNullPointer::nullPointerLinkedList(), CheckNullPointer::nullPointerStructByDeRefAndChec(), CheckObsoleteFunctions::obsoleteFunctions(), CheckOther::oppositeInnerCondition(), UninitVar::parse(), EraseCheckLoop::parse(), Nullpointer::parse(), ExecutionPathBufferOverrun::parse(), CheckBufferOverrun::parse_for_body(), CheckMemoryLeakInFunction::parse_noreturn(), ExecutionPath::parseCondition(), UninitVar::parseCondition(), Nullpointer::parseCondition(), UninitVar::parseLoopBody(), Nullpointer::parseLoopBody(), UninitVar::parserhs(), CheckUnusedFunctions::parseTokens(), Check64BitPortability::pointerassignment(), CheckPostfixOperator::postfixOperator(), PreprocessorMacro::PreprocessorMacro(), Tokenizer::printUnknownTypes(), processFunc(), CheckStl::pushback(), CheckStl::redundantCondition(), CheckOther::redundantGetAndSetUserId(), Tokenizer::removeExceptionSpecifications(), Tokenizer::removeMacroInVarDecl(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantAssignment(), Tokenizer::removeRedundantConditions(), Tokenizer::removeRedundantFor(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::removeTemplate(), Tokenizer::removeUnnecessaryQualification(), replace(), CheckLeakAutoVar::ret(), CheckAutoVariables::returnPointerToLocalArray(), CheckAutoVariables::returnReference(), CheckAutoVariables::returnTemporary(), Scope::Scope(), Tokenizer::setVarId(), setVarIdClassDeclaration(), setVarIdClassFunction(), setVarIdParseDeclaration(), setVarIdStructMembers(), simpleMatch(), EnumValue::simplify(), Tokenizer::simplifyAddBraces(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyArrayAccessSyntax(), Tokenizer::simplifyAsm(), Tokenizer::simplifyAssignmentBlock(), Tokenizer::simplifyAssignmentInFunctionCall(), Tokenizer::simplifyAttribute(), Tokenizer::simplifyBitfields(), Tokenizer::simplifyBorland(), Tokenizer::simplifyBuiltinExpect(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCallingConvention(), Tokenizer::simplifyCasts(), Tokenizer::simplifyCharAt(), CheckMemoryLeakInFunction::simplifycode(), Tokenizer::simplifyComma(), Tokenizer::simplifyComparisonOrder(), Tokenizer::simplifyCompoundAssignment(), Preprocessor::simplifyCondition(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyConditions(), Tokenizer::simplifyConst(), Tokenizer::simplifyConstTernaryOp(), Tokenizer::simplifyDebugNew(), Tokenizer::simplifyDeclspec(), Tokenizer::simplifyDoublePlusAndDoubleMinus(), Tokenizer::simplifyEmptyNamespaces(), Tokenizer::simplifyEnum(), Tokenizer::simplifyErrNoInWhile(), Tokenizer::simplifyExternC(), Tokenizer::simplifyFileAndLineMacro(), Tokenizer::simplifyFlowControl(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyFunctionReturn(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), Tokenizer::simplifyIfNot(), Tokenizer::simplifyIfNotNull(), Tokenizer::simplifyIfSameInnerCondition(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyKeyword(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyLabelsCaseDefault(), Tokenizer::simplifyLogicalOperators(), Tokenizer::simplifyMathExpressions(), Tokenizer::simplifyMathFunctions(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyMicrosoftMFC(), Tokenizer::simplifyMicrosoftStringFunctions(), Tokenizer::simplifyMulAndParens(), Tokenizer::simplifyNamespaceStd(), Tokenizer::simplifyNestedStrcat(), Tokenizer::simplifyNull(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyOperatorName(), Tokenizer::simplifyParameterVoid(), Tokenizer::simplifyPlatformTypes(), Tokenizer::simplifyPointerToStandardType(), Tokenizer::simplifyQtSignalsSlots(), Tokenizer::simplifyRealloc(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyReference(), Tokenizer::simplifyReturnStrncat(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySizeof(), Tokenizer::simplifySQL(), Tokenizer::simplifyStd(), Tokenizer::simplifyStdType(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTemplates(), Tokenizer::simplifyTokenList(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyUndefinedSizeArray(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), simplifyVarMap(), simplifyVarMapExpandValue(), Tokenizer::simplifyWhile0(), CheckStl::size(), CheckOther::sizeofCalculation(), CheckOther::sizeofsizeof(), skipPointers(), skipScopeIdentifiers(), skipTernaryOp(), splitDefinitionFromTypedef(), CheckStl::stlBoundaries(), CheckStl::stlOutOfBounds(), CheckStl::string_c_str(), stringifyList(), CheckOther::strPlusChar(), CheckOther::suspiciousSizeofCalculation(), SymbolDatabase::SymbolDatabase(), TemplateSimplifier::templateParameters(), CheckClass::thisSubtraction(), tokAt(), Tokenizer::tokenize(), Tokenizer::tokenizeCondition(), Tokenizer::unsupportedTypedef(), TemplateSimplifier::useDefaultArgumentValues(), CheckStl::uselessCalls(), Tokenizer::validate(), CheckMemoryLeakInClass::variable(), variableIsUsedInScope(), CheckClass::virtualDestructor(), CheckOther::warningOldStylePointerCast(), Variables::write(), and CheckBufferOverrun::writeOutsideBufferSize().
| void Token::next | ( | Token * | nextToken | ) | [inline, private] |
| Token * Token::nextArgument | ( | ) | const |
Returns the first token of the next argument.
Does only work on argument lists. Returns 0, if there is no next argument
Definition at line 817 of file token.cpp.
References link(), next(), and str().
Referenced by Function::argsMatch(), CheckMemoryLeakInFunction::call_func(), CheckNullPointer::CanFunctionAssignPointer(), CheckIO::checkFileUsage(), CheckBufferOverrun::checkFunctionCall(), CheckBufferOverrun::checkFunctionParameter(), CheckOther::checkMathFunctions(), CheckInternal::checkMissingPercentCharacter(), CheckBufferOverrun::checkReadlinkBufferUsage(), CheckBufferOverrun::checkScope(), CheckOther::checkSizeofForPointerSize(), CheckBufferOverrun::checkSprintfCall(), CheckInternal::checkTokenMatchPatterns(), CheckInternal::checkTokenSimpleMatchPatterns(), CheckInternal::checkUnknownPattern(), CheckIO::checkWrongPrintfScanfArguments(), countParameters(), Scope::findFunction(), CheckLeakAutoVar::functionCall(), CheckMemoryLeakInFunction::getcode(), CheckOther::invalidFunctionUsage(), CheckIO::invalidScanf(), CheckStl::mismatchingContainers(), CheckClass::noMemset(), CheckNullPointer::parseFunctionCall(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyReturnStrncat(), and CheckStl::string_c_str().
| Token* Token::previous | ( | ) | const [inline] |
Definition at line 346 of file token.h.
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), SymbolDatabase::addNewFunction(), CheckAssignIf::assignIf(), CheckMemoryLeakInFunction::call_func(), CheckMemoryLeakNoVar::check(), CheckStl::checkAutoPointer(), CheckOther::checkComparisonOfBoolWithBool(), CheckOther::checkComparisonOfFuncReturningBool(), CheckClass::checkConst(), CheckOther::checkDuplicateIf(), CheckIO::checkFileUsage(), CheckBufferOverrun::checkGlobalAndLocalVariable(), CheckOther::checkInnerScope(), CheckOther::checkNegativeBitwiseShift(), CheckUninitVar::checkScope(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSelfAssignment(), CheckOther::checkSignOfUnsignedVariable(), CheckOther::checkUnreachableCode(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckOther::clarifyCalculation(), CheckOther::clarifyCondition(), CheckOther::clarifyStatement(), CheckOther::complexDuplicateExpressionCheck(), TokenList::createAst(), Tokenizer::deleteInvalidTypedef(), deleteNext(), Tokenizer::duplicateDefinition(), Tokenizer::duplicateTypedef(), Tokenizer::eraseDeadCode(), Variable::evaluate(), TemplateSimplifier::expandSpecialized(), CheckMemoryLeak::functionArgAlloc(), CheckMemoryLeakInFunction::getcode(), TemplateSimplifier::getTemplateInstantiations(), hasArrayEnd(), hasArrayEndParen(), CheckClass::initializeVarList(), insertToken(), SymbolDatabase::isFunction(), Tokenizer::isFunctionParameterPassedByValue(), Function::isImplicitlyVirtual_rec(), isint(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), isPartOfClassStructUnion(), CheckNullPointer::isPointerDeRef(), Tokenizer::IsScopeNoReturn(), CheckUninitVar::isVariableUsage(), CheckStl::iterators(), move(), CheckBufferOverrun::negativeIndex(), CheckNonReentrantFunctions::nonReentrantFunctions(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckNullPointer::nullPointerStructByDeRefAndChec(), CheckClass::operatorEqToSelf(), UninitVar::parse(), EraseCheckLoop::parse(), Nullpointer::parse(), ExecutionPathBufferOverrun::parse(), CheckBufferOverrun::parse_for_body(), UninitVar::parserhs(), Check64BitPortability::pointerassignment(), CheckPostfixOperator::postfixOperator(), CheckStl::pushback(), Tokenizer::removeRedundantConditions(), replace(), CheckAutoVariables::returnPointerToLocalArray(), CheckAutoVariables::returnReference(), CheckAutoVariables::returnTemporary(), Tokenizer::setVarId(), setVarIdClassDeclaration(), setVarIdParseDeclaration(), EnumValue::simplify(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyComma(), Tokenizer::simplifyCompoundAssignment(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyConditions(), Tokenizer::simplifyConstTernaryOp(), Tokenizer::simplifyEnum(), Tokenizer::simplifyErrNoInWhile(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), Tokenizer::simplifyIfNotNull(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyLogicalOperators(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyMulAndParens(), Tokenizer::simplifyNestedStrcat(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyRealloc(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifySizeof(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyUndefinedSizeArray(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), Tokenizer::simplifyWhile0(), splitDefinitionFromTypedef(), CheckStl::string_c_str(), CheckOther::suspiciousSizeofCalculation(), SymbolDatabase::SymbolDatabase(), tokAt(), and TemplateSimplifier::useDefaultArgumentValues().
| void Token::previous | ( | Token * | previousToken | ) | [inline, private] |
| void Token::printOut | ( | const char * | title = 0 | ) | const |
For debugging purposes, prints token and all tokens followed by it.
| title | Title for the printout or use default parameter or 0 for no title. |
Definition at line 955 of file token.cpp.
References stringifyList().
Referenced by CheckMemoryLeakInFunction::checkScope(), and Tokenizer::simplifyTokenList().
| void Token::printOut | ( | const char * | title, |
| const std::vector< std::string > & | fileNames | ||
| ) | const |
For debugging purposes, prints token and all tokens followed by it.
| title | Title for the printout or use default parameter or 0 for no title. |
| fileNames | Prints out file name instead of file index. File index should match the index of the string in this vector. |
Definition at line 962 of file token.cpp.
References stringifyList().
| unsigned int Token::progressValue | ( | ) | const [inline] |
Get progressValue.
Definition at line 522 of file token.h.
Referenced by Tokenizer::simplifyKnownVariablesSimplify().
| 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.
| replaceThis | This token will be deleted. |
| start | This will be in the place of replaceThis |
| end | This is also in the place of replaceThis |
Definition at line 241 of file token.cpp.
References _progressValue, next(), previous(), and tokensBack.
Referenced by Tokenizer::simplifyFunctionParameters(), and Tokenizer::simplifyKnownVariables().
| void Token::scope | ( | const Scope * | s | ) | [inline] |
Associate this token with given scope.
| s | Scope to be associated |
Definition at line 450 of file token.h.
Referenced by CheckBufferOverrun::checkBufferAllocatedWithStrlen(), CheckOther::checkInnerScope(), CheckBufferOverrun::checkScope(), Tokenizer::createSymbolDatabase(), CheckExceptionSafety::deallocThrow(), SymbolDatabase::findFunction(), CheckStl::iterators(), CheckClass::noMemset(), CheckNullPointer::nullPointerStructByDeRefAndChec(), and CheckStl::stlBoundaries().
| const Scope* Token::scope | ( | ) | const [inline] |
| void Token::setExpandedMacro | ( | bool | m | ) | [inline] |
Definition at line 272 of file token.h.
Referenced by Tokenizer::copyTokens(), and TokenList::createTokens().
| bool Token::simpleMatch | ( | const Token * | tok, |
| const char | pattern[] | ||
| ) | [static] |
Match given token (or list of tokens) to a pattern list.
Possible patterns "someRandomText" If token contains "someRandomText".
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.
| tok | List of tokens to be compared to the pattern |
| pattern | The pattern against which the tokens are compared, e.g. "const" or ") void {". |
Definition at line 444 of file token.cpp.
Referenced by Function::addArguments(), CheckAssignIf::assignIfParseScope(), CheckAutoVariables::autoVariables(), bailoutIfSwitch(), CheckMemoryLeakInFunction::call_func(), CheckStl::checkAutoPointer(), CheckBoost::checkBoostForeachModification(), CheckOther::checkConstantFunctionParameter(), CheckClass::checkConstFunc(), CheckOther::checkDoubleFree(), CheckOther::checkDuplicateBranch(), CheckOther::checkDuplicateIf(), CheckIO::checkFileUsage(), CheckBufferOverrun::checkFunctionParameter(), CheckUnusedVar::checkFunctionVariableUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckBufferOverrun::checkGlobalAndLocalVariable(), CheckOther::checkIncompleteStatement(), CheckOther::checkInnerScope(), CheckBufferOverrun::checkInsecureCmdLineArgs(), CheckClass::checkMemsetType(), CheckOther::checkMemsetZeroBytes(), CheckInternal::checkMissingPercentCharacter(), CheckOther::checkMisusedScopedObject(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckOther::checkRedundantAssignment(), CheckInternal::checkRedundantNextPrevious(), CheckExceptionSafety::checkRethrowCopy(), CheckClass::checkReturnPtrThis(), CheckLeakAutoVar::checkScope(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), CheckMemoryLeakInFunction::checkScope(), EraseCheckLoop::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSizeofForPointerSize(), CheckUnusedVar::checkStructMemberUsage(), CheckBufferOverrun::checkStructVariable(), CheckMemoryLeakStructMember::checkStructVariable(), CheckOther::checkSuspiciousEqualityComparison(), CheckOther::checkSuspiciousSemicolon(), CheckOther::checkSwitchCaseFallThrough(), CheckInternal::checkTokenMatchPatterns(), CheckInternal::checkTokenSimpleMatchPatterns(), CheckInternal::checkUnknownPattern(), CheckOther::checkUnsignedDivision(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::clarifyCondition(), PreprocessorMacro::code(), conditionAlwaysTrueOrFalse(), CheckExceptionSafety::deallocThrow(), CheckExceptionSafety::destructors(), Tokenizer::duplicateDefinition(), Tokenizer::duplicateTypedef(), Tokenizer::elseif(), Tokenizer::eraseDeadCode(), TemplateSimplifier::expandSpecialized(), findsimplematch(), CheckMemoryLeak::getAllocationType(), CheckMemoryLeakInFunction::getcode(), CheckMemoryLeak::getDeallocationType(), TemplateSimplifier::getTemplateDeclarations(), TemplateSimplifier::getTemplateInstantiations(), Scope::getVariableList(), hasArrayEnd(), hasArrayEndParen(), CheckClass::hasAssignSelf(), TemplateSimplifier::hasComplicatedSyntaxErrorsInTemplates(), CheckStl::if_find(), CheckClass::initializationListUsage(), CheckClass::initializeVarList(), TemplateSimplifier::instantiateMatch(), isContainerSizeSlow(), SymbolDatabase::isFunction(), isInitList(), CheckClass::isMemberVar(), CheckNullPointer::isPointerDeRef(), Tokenizer::IsScopeNoReturn(), isTypeWithoutSideEffects(), Scope::isVariableDeclaration(), CheckStl::iterators(), CheckAssignIf::multiCondition(), CheckClass::noMemset(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckNullPointer::nullPointerDefaultArgument(), CheckNullPointer::nullPointerStructByDeRefAndChec(), CheckObsoleteFunctions::obsoleteFunctions(), UninitVar::parse(), Nullpointer::parse(), CheckBufferOverrun::parse_for_body(), UninitVar::parseCondition(), UninitVar::parseLoopBody(), UninitVar::parserhs(), Check64BitPortability::pointerassignment(), PreprocessorMacro::PreprocessorMacro(), processFunc(), CheckStl::pushback(), CheckOther::redundantGetAndSetUserId(), Tokenizer::removeRedundantConditions(), Tokenizer::removeRedundantSemicolons(), TemplateSimplifier::removeTemplate(), CheckAutoVariables::returnReference(), CheckAutoVariables::returnTemporary(), Tokenizer::setVarId(), Tokenizer::simplifyAssignmentBlock(), Tokenizer::simplifyAssignmentInFunctionCall(), Tokenizer::simplifyAttribute(), Tokenizer::simplifyBitfields(), Tokenizer::simplifyBuiltinExpect(), TemplateSimplifier::simplifyCalculations(), Tokenizer::simplifyCasts(), CheckMemoryLeakInFunction::simplifycode(), Tokenizer::simplifyCompoundAssignment(), Preprocessor::simplifyCondition(), Tokenizer::simplifyConditions(), Tokenizer::simplifyDeclspec(), Tokenizer::simplifyErrNoInWhile(), Tokenizer::simplifyFlowControl(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyIfNotNull(), Tokenizer::simplifyIfSameInnerCondition(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyMathExpressions(), Tokenizer::simplifyMathFunctions(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyMicrosoftMFC(), Tokenizer::simplifyMicrosoftStringFunctions(), Tokenizer::simplifyNamespaceStd(), Tokenizer::simplifyNestedStrcat(), Tokenizer::simplifyOperatorName(), Tokenizer::simplifyQtSignalsSlots(), Tokenizer::simplifyRealloc(), Tokenizer::simplifyRedundantConsecutiveBraces(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyReturnStrncat(), Tokenizer::simplifyRoundCurlyParentheses(), Tokenizer::simplifySizeof(), Tokenizer::simplifySQL(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), Tokenizer::simplifyTokenList(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyWhile0(), CheckOther::sizeofCalculation(), CheckStl::string_c_str(), CheckOther::suspiciousSizeofCalculation(), SymbolDatabase::SymbolDatabase(), Tokenizer::tokenize(), CheckStl::uselessCalls(), variableIsUsedInScope(), CheckClass::virtualDestructor(), and Variables::write().
| void Token::str | ( | const std::string & | s | ) |
Definition at line 150 of file token.cpp.
References _str, _varId, and update_property_info().
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), SymbolDatabase::addGlobalFunction(), SymbolDatabase::addNewFunction(), TokenList::addtoken(), UninitVar::analyseFunctions(), analyzeType(), Function::argsMatch(), Variable::arrayDimensions(), CheckBufferOverrun::arrayIndexInForLoop(), CheckBufferOverrun::ArrayInfo::ArrayInfo(), CheckAssignIf::assignIf(), CheckAssignIf::assignIfParseScope(), CheckAutoVariables::autoVariables(), bailoutIfSwitch(), CheckMemoryLeakInFunction::call_func(), CheckMemoryLeakInFunction::check(), CheckOther::checkAssignmentInAssert(), CheckStl::checkAutoPointer(), CheckOther::checkBitwiseOnBoolean(), CheckOther::checkCastIntToCharAndBack(), CheckOther::checkCharVariable(), CheckOther::checkComparisonOfBoolExpressionWithInt(), CheckOther::checkComparisonOfBoolWithBool(), CheckOther::checkComparisonOfBoolWithInt(), CheckOther::checkComparisonOfFuncReturningBool(), CheckClass::checkConst(), CheckOther::checkExpressionRange(), CheckBufferOverrun::checkFunctionCall(), CheckBufferOverrun::checkFunctionParameter(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckBufferOverrun::checkGlobalAndLocalVariable(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncorrectLogicOperator(), CheckOther::checkIncrementBoolean(), CheckOther::checkInnerScope(), CheckUninitVar::checkLoopBody(), CheckOther::checkMathFunctions(), CheckClass::checkMemsetType(), CheckOther::checkMemsetZeroBytes(), CheckOther::checkPipeParameterSize(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckBufferOverrun::checkReadlinkBufferUsage(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), checkRvalueExpression(), CheckUninitVar::checkScope(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), CheckMemoryLeakInFunction::checkScope(), EraseCheckLoop::checkScope(), CheckBufferOverrun::checkScopeForBody(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSelfAssignment(), CheckOther::checkSizeofForArrayParameter(), CheckOther::checkSizeofForPointerSize(), CheckOther::checkSleepTimeInterval(), CheckOther::checkSuspiciousCaseInSwitch(), CheckOther::checkUnreachableCode(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::clarifyCalculation(), CheckOther::clarifyStatement(), TemplateSimplifier::cleanupAfterSimplify(), PreprocessorMacro::code(), CheckAssignIf::comparison(), conditionAlwaysTrueOrFalse(), CheckClass::constructors(), CheckClass::copyconstructors(), Tokenizer::copyTokens(), countMinArgs(), countParameters(), TokenList::createAst(), Tokenizer::createLinks2(), Tokenizer::deleteInvalidTypedef(), Nullpointer::dereference(), doAssignment(), Tokenizer::duplicateDeclarationError(), Tokenizer::duplicateDefinition(), Tokenizer::duplicateEnumError(), Tokenizer::duplicateTypedef(), Tokenizer::duplicateTypedefError(), EraseCheckLoop::end(), Tokenizer::eraseDeadCode(), Variable::evaluate(), TemplateSimplifier::expandSpecialized(), findClosingBracket(), Scope::findFunction(), SymbolDatabase::findFunction(), SymbolDatabase::findScope(), SymbolDatabase::findType(), SymbolDatabase::findVariableType(), for_condition(), for_init(), for_maxvalue(), CheckMemoryLeak::functionArgAlloc(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), Preprocessor::getcfgs(), CheckMemoryLeakInFunction::getcode(), CheckMemoryLeak::getDeallocationType(), CheckMemoryLeak::getReallocationType(), CheckClass::hasAllocation(), CheckClass::hasAssignSelf(), CheckStl::if_find(), if_findCompare(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), insertToken(), TokenList::insertTokens(), CheckOther::invalidFunctionUsage(), CheckOther::invalidPointerCast(), CheckIO::invalidScanf(), CheckIO::invalidScanfFormatWidthError(), CheckClass::isBaseClassFunc(), isBool(), isChar(), isComplexType(), CheckClass::isConstMemberFunc(), SymbolDatabase::isFunction(), Tokenizer::isFunctionParameterPassedByValue(), Function::isImplicitlyVirtual_rec(), isLowerThanAnd(), isLowerThanMulDiv(), isLowerThanPlusMinus(), isLowerThanXor(), CheckClass::isMemberFunc(), CheckClass::isMemberVar(), isNonBoolStdType(), isPartOfClassStructUnion(), CheckNullPointer::isPointerDeRef(), Tokenizer::IsScopeNoReturn(), Scope::isVariableDeclaration(), CheckUninitVar::isVariableUsage(), CheckStl::iterators(), CheckLeakAutoVar::leakIfAllocated(), linkBrackets(), Match(), CheckOther::mathfunctionCallError(), CheckStl::mismatchingContainers(), nextArgument(), CheckClass::noMemset(), CheckNonReentrantFunctions::nonReentrantFunctions(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckNullPointer::nullPointerStructByDeRefAndChec(), TokenStrEquals::operator()(), CheckClass::operatorEqToSelf(), CheckOther::oppositeInnerCondition(), UninitVar::parse(), EraseCheckLoop::parse(), Nullpointer::parse(), CheckBufferOverrun::parse_for_body(), UninitVar::parseCondition(), Nullpointer::parseCondition(), CheckNullPointer::parseFunctionCall(), UninitVar::parseLoopBody(), UninitVar::parserhs(), CheckUnusedFunctions::parseTokens(), PreprocessorMacro::PreprocessorMacro(), SymbolDatabase::printOut(), Tokenizer::printUnknownTypes(), SymbolDatabase::printVariable(), processFunc(), CheckStl::pushback(), CheckStl::redundantCondition(), Tokenizer::removeMacroInVarDecl(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantFor(), Tokenizer::removeUnnecessaryQualification(), CheckAutoVariables::returnPointerToLocalArray(), CheckAutoVariables::returnReference(), CheckAutoVariables::returnTemporary(), Scope::Scope(), Tokenizer::setVarId(), setVarIdParseDeclaration(), setVarIdStructMembers(), EnumValue::simplify(), Tokenizer::simplifyAddBracesPair(), Tokenizer::simplifyAddBracesToCommand(), Tokenizer::simplifyAsm(), Tokenizer::simplifyAssignmentBlock(), Tokenizer::simplifyBitfields(), TemplateSimplifier::simplifyCalculations(), CheckMemoryLeakInFunction::simplifycode(), Tokenizer::simplifyComma(), Tokenizer::simplifyComparisonOrder(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyConditions(), Tokenizer::simplifyConstTernaryOp(), Tokenizer::simplifyEnum(), Tokenizer::simplifyErrNoInWhile(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionPointers(), Tokenizer::simplifyFunctionReturn(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), Tokenizer::simplifyInitVar(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyLogicalOperators(), Tokenizer::simplifyMulAndParens(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyOperatorName(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifySizeof(), Tokenizer::simplifySQL(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyUndefinedSizeArray(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), simplifyVarMapExpandValue(), Tokenizer::simplifyWhile0(), CheckStl::size(), CheckStl::sizeError(), Tokenizer::sizeOfType(), skipBrackets(), skipBracketsAndMembers(), skipScopeIdentifiers(), skipTernaryOp(), splitDefinitionFromTypedef(), CheckOther::SuspiciousSemicolonError(), SymbolDatabase::SymbolDatabase(), TemplateSimplifier::templateParameters(), Tokenizer::unhandled_macro_class_x_y(), Tokenizer::unsupportedTypedef(), TemplateSimplifier::useDefaultArgumentValues(), CheckMemoryLeakInClass::variable(), CheckClass::virtualDestructor(), and CheckIO::wrongPrintfScanfArgumentsError().
| const std::string& Token::str | ( | ) | const [inline] |
Definition at line 74 of file token.h.
Referenced by chrInFirstWord(), deleteThis(), firstWordEquals(), firstWordLen(), getCharAt(), and getStrLength().
| const std::string & Token::strAt | ( | int | index | ) | const |
Definition at line 297 of file token.cpp.
Referenced by SymbolDatabase::addNewFunction(), Function::argsMatch(), CheckBufferOverrun::arrayIndexInForLoop(), CheckAssignIf::assignIf(), CheckAssignIf::assignIfParseScope(), CheckMemoryLeakInFunction::call_func(), CheckOther::checkAlwaysTrueOrFalseStringCompare(), CheckOther::checkAssignmentInAssert(), CheckOther::checkComparisonOfFuncReturningBool(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateExpression(), CheckOther::checkDuplicateIf(), CheckIO::checkFileUsage(), CheckBufferOverrun::checkFunctionCall(), CheckBufferOverrun::checkFunctionParameter(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncorrectLogicOperator(), CheckOther::checkInnerScope(), CheckBufferOverrun::checkInsecureCmdLineArgs(), CheckClass::checkMemsetType(), CheckOther::checkModuloAlwaysTrueFalse(), CheckOther::checkNegativeBitwiseShift(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckBufferOverrun::checkReadlinkBufferUsage(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantAssignmentInSwitch(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), checkRvalueExpression(), CheckBufferOverrun::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSignOfUnsignedVariable(), CheckUnusedVar::checkStructMemberUsage(), CheckOther::checkSuspiciousEqualityComparison(), CheckOther::checkSuspiciousStringCompare(), CheckOther::checkUnreachableCode(), CheckOther::checkVariableScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::clarifyCalculation(), PreprocessorMacro::code(), CheckAssignIf::comparison(), conditionAlwaysTrueOrFalse(), doAssignment(), Tokenizer::duplicateTypedef(), Variable::evaluate(), PreprocessorMacro::expandInnerMacros(), Scope::findFunction(), SymbolDatabase::findFunction(), SymbolDatabase::findScope(), SymbolDatabase::findType(), SymbolDatabase::findVariableType(), for_condition(), for_init(), Preprocessor::getcfgs(), Preprocessor::getcode(), CheckMemoryLeakInFunction::getcode(), TemplateSimplifier::getTemplateNamePosition(), CheckClass::hasAssignSelf(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), isComplexType(), SymbolDatabase::isFunction(), CheckUninitVar::isMemberVariableAssignment(), CheckUninitVar::isMemberVariableUsage(), isPartOfClassStructUnion(), CheckNullPointer::isPointerDeRef(), Scope::isVariableDeclaration(), CheckUninitVar::isVariableUsage(), CheckStl::iterators(), CheckOther::mathfunctionCallError(), CheckStl::mismatchingContainers(), CheckAssignIf::multiCondition(), CheckBufferOverrun::negativeIndex(), CheckClass::noMemset(), CheckNullPointer::nullConstantDereference(), CheckOther::oppositeInnerCondition(), UninitVar::parse(), ExecutionPathBufferOverrun::parse(), UninitVar::parserhs(), Check64BitPortability::pointerassignment(), SymbolDatabase::printOut(), Tokenizer::removeMacrosInGlobalScope(), CheckAutoVariables::returnTemporary(), CheckMemoryLeakInFunction::simplifycode(), Preprocessor::simplifyCondition(), Tokenizer::simplifyEnum(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyNestedStrcat(), TemplateSimplifier::simplifyNumericCalculations(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyVarDecl(), splitDefinitionFromTypedef(), CheckOther::suspiciousSizeofCalculation(), SymbolDatabase::SymbolDatabase(), CheckClass::thisSubtraction(), and Tokenizer::unhandled_macro_class_x_y().
| void Token::stringify | ( | std::ostream & | os, |
| bool | varid, | ||
| bool | attributes | ||
| ) | const |
Stringify a token.
| os | The result is shifted into that output stream |
| varid | Print varids. (Style: "varname@id") |
| attributes | Print attributes of tokens like "unsigned" in front of it. |
Definition at line 969 of file token.cpp.
References _str, _varId, isLong(), isSigned(), and isUnsigned().
Referenced by stringifyList().
| std::string Token::stringifyList | ( | bool | varid, |
| bool | attributes, | ||
| bool | linenumbers, | ||
| bool | linebreaks, | ||
| bool | files, | ||
| const std::vector< std::string > * | fileNames = 0, |
||
| const Token * | end = 0 |
||
| ) | const |
Stringify a list of token, from current instance on.
| varid | Print varids. (Style: "varname@id") |
| attributes | Print attributes of tokens like "unsigned" in front of it. |
| linenumbers | Print line number in front of each line |
| linebreaks | Insert into string when line number changes |
| files | print Files as numbers or as names (if fileNames is given) |
| fileNames | Vector of filenames. Used (if given) to print filenames as strings instead of numbers. |
| end | Stringification ends before this token is reached. 0 to stringify until end of list. |
Definition at line 993 of file token.cpp.
References _fileIndex, _linenr, fileIndex(), linenr(), next(), and stringify().
Referenced by CheckOther::checkDuplicateIf(), CheckMemoryLeakInFunction::checkScope(), printOut(), Tokenizer::simplifyAsm(), Tokenizer::simplifyMathExpressions(), Tokenizer::simplifySQL(), and stringifyList().
| std::string Token::stringifyList | ( | const Token * | end, |
| bool | attributes = true |
||
| ) | const |
Definition at line 1051 of file token.cpp.
References stringifyList().
| std::string Token::stringifyList | ( | bool | varid = false | ) | const |
Definition at line 1056 of file token.cpp.
References stringifyList().
| 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).
Definition at line 166 of file token.cpp.
References _str, _type, and eString.
Referenced by CheckIO::checkFileUsage(), CheckInternal::checkMissingPercentCharacter(), CheckBufferOverrun::checkSprintfCall(), CheckInternal::checkTokenMatchPatterns(), CheckInternal::checkTokenSimpleMatchPatterns(), CheckInternal::checkUnknownPattern(), getCharAt(), getStrLength(), and CheckNullPointer::parseFunctionCall().
| 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 274 of file token.cpp.
References next(), and previous().
Referenced by Function::addArguments(), SymbolDatabase::addClassFunction(), UninitVar::analyseFunctions(), Function::argsMatch(), CheckBufferOverrun::arrayIndexInForLoop(), Tokenizer::arraySize(), CheckAssignIf::assignIf(), CheckAssignIf::assignIfParseScope(), CheckAutoVariables::autoVariables(), CheckMemoryLeakInFunction::call_func(), CheckNullPointer::CanFunctionAssignPointer(), CheckOther::checkAlwaysTrueOrFalseStringCompare(), CheckOther::checkAssignmentInAssert(), CheckStl::checkAutoPointer(), CheckBoost::checkBoostForeachModification(), CheckOther::checkComparisonOfBoolExpressionWithInt(), CheckOther::checkComparisonOfBoolWithInt(), CheckClass::checkConstFunc(), CheckOther::checkDoubleFree(), CheckOther::checkDuplicateExpression(), CheckOther::checkDuplicateIf(), CheckIO::checkFileUsage(), CheckBufferOverrun::checkFunctionCall(), CheckBufferOverrun::checkFunctionParameter(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkIncompleteStatement(), CheckOther::checkIncorrectLogicOperator(), CheckOther::checkInnerScope(), CheckBufferOverrun::checkInsecureCmdLineArgs(), CheckOther::checkMathFunctions(), CheckInternal::checkMissingPercentCharacter(), CheckOther::checkModuloAlwaysTrueFalse(), CheckOther::checkPipeParameterSize(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckBufferOverrun::checkReadlinkBufferUsage(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckOther::checkRedundantAssignment(), CheckOther::checkRedundantCopy(), CheckClass::checkReturnPtrThis(), CheckLeakAutoVar::checkScope(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), CheckMemoryLeakInFunction::checkScope(), EraseCheckLoop::checkScope(), CheckBufferOverrun::checkScopeForBody(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSelfAssignment(), CheckOther::checkSignOfUnsignedVariable(), CheckOther::checkSizeofForPointerSize(), CheckOther::checkSleepTimeInterval(), CheckBufferOverrun::checkSprintfCall(), CheckUnusedVar::checkStructMemberUsage(), CheckBufferOverrun::checkStructVariable(), CheckOther::checkSuspiciousEqualityComparison(), CheckOther::checkSuspiciousStringCompare(), CheckInternal::checkTokenMatchPatterns(), CheckInternal::checkTokenSimpleMatchPatterns(), CheckInternal::checkUnknownPattern(), CheckOther::checkUnreachableCode(), CheckOther::checkVarFuncNullUB(), Scope::checkVariable(), CheckOther::checkVariableScope(), CheckIO::checkWrongPrintfScanfArguments(), CheckOther::clarifyCalculation(), CheckOther::clarifyCondition(), CheckOther::clarifyStatement(), TemplateSimplifier::cleanupAfterSimplify(), CheckAssignIf::comparison(), conditionAlwaysTrueOrFalse(), CheckClass::copyconstructors(), countParameters(), doAssignment(), Tokenizer::duplicateDefinition(), Tokenizer::duplicateTypedef(), CheckStl::erase(), Tokenizer::eraseDeadCode(), PreprocessorMacro::expandInnerMacros(), TemplateSimplifier::expandSpecialized(), Scope::findFunction(), SymbolDatabase::findFunction(), CheckMemoryLeakInFunction::findleak(), SymbolDatabase::findScope(), SymbolDatabase::findType(), for3(), for_init(), CheckMemoryLeak::functionArgAlloc(), CheckLeakAutoVar::functionCall(), CheckMemoryLeak::getAllocationType(), Preprocessor::getcfgs(), CheckMemoryLeakInFunction::getcode(), TemplateSimplifier::getTemplateInstantiations(), CheckClass::hasAllocation(), hasArrayEndParen(), CheckClass::hasAssignSelf(), TemplateSimplifier::hasComplicatedSyntaxErrorsInTemplates(), CheckStl::if_find(), Type::initBaseInfo(), CheckClass::initializationListUsage(), CheckClass::initializerListOrder(), CheckClass::initializeVarList(), Tokenizer::initVar(), CheckOther::invalidFunctionUsage(), CheckOther::invalidPointerCast(), CheckIO::invalidScanf(), CheckBufferOverrun::isArrayOfStruct(), isComplexType(), isContainerSizeSlow(), Tokenizer::isFunctionParameterPassedByValue(), CheckClass::isMemberVar(), CheckUninitVar::isMemberVariableAssignment(), CheckNullPointer::isPointerDeRef(), Tokenizer::IsScopeNoReturn(), Scope::isVariableDeclaration(), CheckUninitVar::isVariableUsage(), CheckStl::iterators(), linkAt(), CheckStl::mismatchingContainers(), CheckStl::missingComparison(), CheckAssignIf::multiCondition(), CheckClass::noMemset(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerByDeRefAndChec(), CheckNullPointer::nullPointerLinkedList(), CheckNullPointer::nullPointerStructByDeRefAndChec(), CheckOther::oppositeInnerCondition(), UninitVar::parse(), EraseCheckLoop::parse(), Nullpointer::parse(), ExecutionPathBufferOverrun::parse(), CheckNullPointer::parseFunctionCall(), UninitVar::parseLoopBody(), UninitVar::parserhs(), CheckUnusedFunctions::parseTokens(), SymbolDatabase::printOut(), processFunc(), CheckStl::pushback(), CheckStl::redundantCondition(), Tokenizer::removeMacrosInGlobalScope(), Tokenizer::removeRedundantFor(), Tokenizer::removeUnnecessaryQualification(), CheckAutoVariables::returnReference(), Scope::Scope(), Tokenizer::setVarId(), setVarIdParseDeclaration(), setVarIdStructMembers(), Tokenizer::simplifyAssignmentBlock(), Tokenizer::simplifyAssignmentInFunctionCall(), Tokenizer::simplifyBitfields(), Tokenizer::simplifyBuiltinExpect(), Tokenizer::simplifyCasts(), CheckMemoryLeakInFunction::simplifycode(), Tokenizer::simplifyComparisonOrder(), Tokenizer::simplifyConditionOperator(), Tokenizer::simplifyConstTernaryOp(), Tokenizer::simplifyEnum(), Tokenizer::simplifyErrNoInWhile(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyFunctionParameters(), Tokenizer::simplifyFunctionReturn(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfNotNull(), Tokenizer::simplifyIfSameInnerCondition(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyMathExpressions(), Tokenizer::simplifyMicrosoftMemoryFunctions(), Tokenizer::simplifyMulAndParens(), Tokenizer::simplifyNestedStrcat(), TemplateSimplifier::simplifyNumericCalculations(), Tokenizer::simplifyOperatorName(), Tokenizer::simplifyRealloc(), Tokenizer::simplifyRedundantParentheses(), Tokenizer::simplifyReference(), Tokenizer::simplifyReturnStrncat(), Tokenizer::simplifySizeof(), Tokenizer::simplifySQL(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), TemplateSimplifier::simplifyTemplateInstantiations(), Tokenizer::simplifyTemplates(), Tokenizer::simplifyTokenList(), Tokenizer::simplifyTypedef(), Tokenizer::simplifyUndefinedSizeArray(), Tokenizer::simplifyVarDecl(), Tokenizer::simplifyVariableMultipleAssign(), CheckStl::size(), CheckOther::sizeofCalculation(), skipBracketsAndMembers(), skipScopeIdentifiers(), splitDefinitionFromTypedef(), CheckStl::stlOutOfBounds(), strAt(), CheckStl::string_c_str(), SymbolDatabase::SymbolDatabase(), TemplateSimplifier::templateParameters(), TemplateSimplifier::useDefaultArgumentValues(), and CheckClass::virtualDestructor().
| Token* Token::tokAt | ( | int | index | ) | [inline] |
| Type Token::type | ( | ) | const [inline] |
Definition at line 194 of file token.h.
Referenced by SymbolDatabase::addGlobalFunctionDecl(), CheckOther::checkAssignmentInAssert(), CheckClass::checkConstFunc(), CheckOther::checkExpressionRange(), CheckIO::checkFileUsage(), CheckBufferOverrun::checkFunctionParameter(), CheckInternal::checkMissingPercentCharacter(), CheckBufferOverrun::checkSprintfCall(), CheckOther::checkSuspiciousStringCompare(), CheckInternal::checkTokenMatchPatterns(), CheckInternal::checkTokenSimpleMatchPatterns(), CheckInternal::checkUnknownPattern(), CheckOther::checkVariableScope(), CheckIO::checkWrongPrintfScanfArguments(), Tokenizer::copyTokens(), CheckStl::erase(), TokenList::insertTokens(), CheckIO::invalidScanf(), Match(), CheckNullPointer::nullPointerByCheckAndDeRef(), UninitVar::parse(), CheckNullPointer::parseFunctionCall(), Tokenizer::simplifyAddBracesPair(), Tokenizer::sizeOfType(), and TemplateSimplifier::templateParameters().
| void Token::type | ( | Type | t | ) | [inline] |
| void Token::update_property_info | ( | ) | [private] |
Updates internal property cache like _isName or _isBoolean.
Called after any _str() modification.
Definition at line 62 of file token.cpp.
References _link, _str, _type, _varId, eArithmeticalOp, eAssignmentOp, eBitOp, eBoolean, eBracket, eChar, eComparisonOp, eExtendedOp, eFunction, eIncDecOp, eLogicalOp, eName, eNone, eNumber, eOther, eString, eType, eVariable, and update_property_isStandardType().
Referenced by concatStr(), and str().
| void Token::update_property_isStandardType | ( | ) | [private] |
Update internal property cache about isStandardType()
Definition at line 121 of file token.cpp.
References _isStandardType, _str, _type, and eType.
Referenced by update_property_info().
| void Token::variable | ( | const Variable * | v | ) | [inline] |
Associate this token with given variable.
| v | Variable to be associated |
Definition at line 484 of file token.h.
Referenced by CheckAutoVariables::autoVariables(), CheckOther::checkAssignBoolToPointer(), CheckOther::checkComparisonOfBoolExpressionWithInt(), CheckOther::checkComparisonOfBoolWithBool(), CheckOther::checkComparisonOfBoolWithInt(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateExpression(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckOther::checkIncompleteArrayFill(), CheckOther::checkNegativeBitwiseShift(), CheckOther::checkPipeParameterSize(), CheckBufferOverrun::checkScope(), CheckOther::checkSelfAssignment(), CheckOther::checkSignOfUnsignedVariable(), CheckOther::checkSizeofForArrayParameter(), CheckOther::checkSizeofForPointerSize(), CheckOther::checkSuspiciousStringCompare(), CheckIO::checkWrongPrintfScanfArguments(), CheckClass::copyconstructors(), CheckStl::if_find(), CheckOther::invalidPointerCast(), CheckAutoVariables::isAutoVar(), CheckAutoVariables::isAutoVarArray(), isContainerSizeSlow(), isLocal(), CheckAutoVariables::isNonReferenceArg(), CheckNullPointer::isPointerDeRef(), CheckAutoVariables::isPtrArg(), CheckAutoVariables::isRefPtrArg(), CheckUninitVar::isVariableUsage(), CheckBufferOverrun::negativeIndex(), CheckClass::noMemset(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerByDeRefAndChec(), UninitVar::parse(), Nullpointer::parse(), CheckStl::string_c_str(), and CheckOther::suspiciousSizeofCalculation().
| const Variable* Token::variable | ( | ) | const [inline] |
| unsigned int Token::varId | ( | ) | const [inline] |
Definition at line 351 of file token.h.
Referenced by UninitVar::analyseFunctions(), CheckAutoVariables::autoVariables(), bailoutIfSwitch(), CheckStl::checkAutoPointer(), CheckBoost::checkBoostForeachModification(), CheckOther::checkComparisonOfBoolWithBool(), CheckOther::checkComparisonOfBoolWithInt(), CheckClass::checkConstFunc(), CheckOther::checkDuplicateExpression(), CheckIO::checkFileUsage(), CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(), CheckBufferOverrun::checkGlobalAndLocalVariable(), CheckOther::checkIncorrectLogicOperator(), CheckOther::checkInnerScope(), CheckBufferOverrun::checkInsecureCmdLineArgs(), CheckOther::checkInvalidFree(), CheckUninitVar::checkLoopBody(), CheckMemoryLeakInClass::checkPublicFunctions(), CheckBufferOverrun::checkReadlinkBufferUsage(), CheckMemoryLeakInFunction::checkReallocUsage(), CheckOther::checkRedundantAssignment(), ExecutionPath::checkScope(), CheckBufferOverrun::checkScope(), EraseCheckLoop::checkScope(), CheckUninitVar::checkScopeForVariable(), CheckOther::checkSelfAssignment(), CheckOther::checkSignOfUnsignedVariable(), CheckOther::checkSizeofForArrayParameter(), CheckOther::checkSizeofForPointerSize(), Scope::checkVariable(), CheckOther::checkVariableScope(), conditionAlwaysTrueOrFalse(), CheckClass::copyconstructors(), Tokenizer::copyTokens(), UninitVar::dealloc_pointer(), Nullpointer::dereference(), doAssignment(), CheckStl::erase(), SymbolDatabase::findFunction(), for_init(), CheckMemoryLeak::functionArgAlloc(), CheckMemoryLeak::getAllocationType(), CheckMemoryLeakInFunction::getcode(), CheckStl::if_find(), UninitVar::init_memset_nonzero(), UninitVar::init_pointer(), UninitVar::init_strncpy(), CheckClass::initializeVarList(), Tokenizer::initVar(), TokenList::insertTokens(), CheckClass::isMemberVar(), CheckNullPointer::isPointerDeRef(), CheckUninitVar::isVariableUsage(), CheckLeakAutoVar::leakIfAllocated(), Match(), CheckAssignIf::multiCondition(), CheckBufferOverrun::negativeIndex(), CheckNullPointer::nullConstantDereference(), CheckNullPointer::nullPointerByCheckAndDeRef(), CheckNullPointer::nullPointerByDeRefAndChec(), UninitVar::parse(), EraseCheckLoop::parse(), Nullpointer::parse(), ExecutionPathBufferOverrun::parse(), UninitVar::parseCondition(), CheckNullPointer::parseFunctionCall(), UninitVar::parserhs(), UninitVar::pointer_assignment(), Tokenizer::removeRedundantFor(), Tokenizer::setVarId(), setVarIdStructMembers(), Tokenizer::simplifyAssignmentBlock(), Tokenizer::simplifyComparisonOrder(), Tokenizer::simplifyFuncInWhile(), Tokenizer::simplifyGoto(), Tokenizer::simplifyIfAssign(), Tokenizer::simplifyKnownVariables(), Tokenizer::simplifyKnownVariablesGetData(), Tokenizer::simplifyKnownVariablesSimplify(), Tokenizer::simplifyNestedStrcat(), Tokenizer::simplifyStructDecl(), Tokenizer::simplifyStructInit(), Tokenizer::simplifyVarDecl(), CheckStl::size(), SymbolDatabase::SymbolDatabase(), UninitVar::use(), and CheckMemoryLeakInClass::variable().
| void Token::varId | ( | unsigned int | id | ) | [inline] |
union { ... } [private] |
Token* Token::_astOperand1 [private] |
Definition at line 625 of file token.h.
Referenced by astFunctionCall(), astHandleParentheses(), and astOperand1().
Token* Token::_astOperand2 [private] |
Definition at line 626 of file token.h.
Referenced by astHandleParentheses(), and astOperand2().
Token* Token::_astParent [private] |
Definition at line 627 of file token.h.
Referenced by astFunctionCall(), astHandleParentheses(), astOperand1(), astOperand2(), and astTop().
unsigned int Token::_fileIndex [private] |
Definition at line 599 of file token.h.
Referenced by deleteThis(), insertToken(), and stringifyList().
| const Function* Token::_function |
Definition at line 593 of file token.h.
Referenced by deleteThis().
bool Token::_isExpandedMacro [private] |
Definition at line 615 of file token.h.
Referenced by deleteThis().
bool Token::_isLong [private] |
Definition at line 612 of file token.h.
Referenced by deleteThis().
bool Token::_isPointerCompare [private] |
Definition at line 611 of file token.h.
Referenced by deleteThis().
bool Token::_isSigned [private] |
Definition at line 610 of file token.h.
Referenced by deleteThis().
bool Token::_isStandardType [private] |
Definition at line 614 of file token.h.
Referenced by deleteThis(), and update_property_isStandardType().
bool Token::_isUnsigned [private] |
Definition at line 609 of file token.h.
Referenced by deleteThis().
bool Token::_isUnused [private] |
Definition at line 613 of file token.h.
Referenced by deleteThis().
unsigned int Token::_linenr [private] |
Definition at line 600 of file token.h.
Referenced by deleteThis(), insertToken(), and stringifyList().
Token* Token::_link [private] |
Definition at line 588 of file token.h.
Referenced by deleteThis(), and update_property_info().
Token* Token::_next [private] |
Definition at line 586 of file token.h.
Referenced by astFunctionCall(), astHandleParentheses(), deleteNext(), and deleteThis().
Token* Token::_previous [private] |
Definition at line 587 of file token.h.
Referenced by astHandleParentheses(), and deleteThis().
unsigned int Token::_progressValue [private] |
A value from 0-100 that provides a rough idea about where in the token list this token is located.
Definition at line 606 of file token.h.
Referenced by insertToken(), move(), and replace().
const Scope* Token::_scope [private] |
Definition at line 591 of file token.h.
Referenced by deleteThis().
std::string Token::_str [private] |
Definition at line 597 of file token.h.
Referenced by astHandleParentheses(), concatStr(), deleteThis(), findClosingBracket(), insertToken(), isUpperCaseName(), Match(), simpleMatch(), str(), strAt(), stringify(), strValue(), update_property_info(), and update_property_isStandardType().
Type Token::_type [private] |
Definition at line 608 of file token.h.
Referenced by deleteThis(), strValue(), update_property_info(), and update_property_isStandardType().
| const Variable* Token::_variable |
Definition at line 594 of file token.h.
Referenced by deleteThis().
unsigned int Token::_varId [private] |
Definition at line 598 of file token.h.
Referenced by deleteThis(), str(), stringify(), and update_property_info().
Token** Token::tokensBack [private] |
Definition at line 46 of file token.h.
Referenced by deleteNext(), insertToken(), and replace().
1.7.6.1