Cppcheck
|
Token and its full scopename. More...
#include <templatesimplifier.h>
Public Member Functions | |
TokenAndName (Token *token, std::string scope) | |
Constructor used for instantiations. More... | |
TokenAndName (Token *token, std::string scope, const Token *nameToken, const Token *paramEnd) | |
Constructor used for declarations. More... | |
TokenAndName (const TokenAndName &other) | |
~TokenAndName () | |
bool | operator== (const TokenAndName &rhs) const |
std::string | dump (const std::vector< std::string > &fileNames) const |
Token * | token () const |
void | token (Token *token) |
const std::string & | scope () const |
const std::string & | name () const |
const std::string & | fullName () const |
const Token * | nameToken () const |
const Token * | paramEnd () const |
void | paramEnd (const Token *end) |
bool | isClass () const |
bool | isFunction () const |
bool | isVariable () const |
bool | isAlias () const |
bool | isSpecialization () const |
bool | isPartialSpecialization () const |
bool | isForwardDeclaration () const |
bool | isVariadic () const |
bool | isFriend () const |
const Token * | aliasStartToken () const |
Get alias start token. More... | |
const Token * | aliasEndToken () const |
Get alias end token. More... | |
bool | isAliasToken (const Token *tok) const |
Is token an alias token? template < ... More... | |
bool | isSameFamily (const TemplateSimplifier::TokenAndName &decl) const |
Is declaration the same family (class, function or variable). More... | |
Private Types | |
enum | { fIsClass = (1 << 0) , fIsFunction = (1 << 1) , fIsVariable = (1 << 2) , fIsAlias = (1 << 3) , fIsSpecialization = (1 << 4) , fIsPartialSpecialization = (1 << 5) , fIsForwardDeclaration = (1 << 6) , fIsVariadic = (1 << 7) , fIsFriend = (1 << 8) , fFamilyMask = (fIsClass | fIsFunction | fIsVariable) } |
Private Member Functions | |
void | isClass (bool state) |
void | isFunction (bool state) |
void | isVariable (bool state) |
void | isAlias (bool state) |
void | isSpecialization (bool state) |
void | isPartialSpecialization (bool state) |
void | isForwardDeclaration (bool state) |
void | isVariadic (bool state) |
void | isFriend (bool state) |
bool | getFlag (unsigned int flag) const |
Get specified flag state. More... | |
void | setFlag (unsigned int flag, bool state) |
Set specified flag state. More... | |
Private Attributes | |
Token * | mToken |
std::string | mScope |
std::string | mName |
std::string | mFullName |
const Token * | mNameToken |
const Token * | mParamEnd |
unsigned int | mFlags |
Token and its full scopename.
Definition at line 71 of file templatesimplifier.h.
|
private |
Enumerator | |
---|---|
fIsClass | |
fIsFunction | |
fIsVariable | |
fIsAlias | |
fIsSpecialization | |
fIsPartialSpecialization | |
fIsForwardDeclaration | |
fIsVariadic | |
fIsFriend | |
fFamilyMask |
Definition at line 80 of file templatesimplifier.h.
TemplateSimplifier::TokenAndName::TokenAndName | ( | Token * | token, |
std::string | scope | ||
) |
Constructor used for instantiations.
token | template instantiation name token "name<...>" |
scope | full qualification of template(scope) |
Definition at line 98 of file templatesimplifier.cpp.
References Token::findClosingBracket(), isFunction(), mToken, Token::next(), Token::strAt(), and Token::templateSimplifierPointer().
TemplateSimplifier::TokenAndName::TokenAndName | ( | Token * | token, |
std::string | scope, | ||
const Token * | nameToken, | ||
const Token * | paramEnd | ||
) |
Constructor used for declarations.
token | template declaration token "template < ... >" |
scope | full qualification of template(scope) |
nameToken | template name token "template < ... > class name" |
paramEnd | template parameter end token ">" |
Definition at line 114 of file templatesimplifier.cpp.
References Token::findClosingBracket(), Token::findmatch(), Token::findOpeningBracket(), isAlias(), isClass(), isForwardDeclaration(), isFriend(), isFunction(), isPartialSpecialization(), isSpecialization(), isVariable(), isVariadic(), Token::link(), Token::Match(), mFullName, mName, mNameToken, mParamEnd, mScope, mToken, Token::next(), Token::previous(), Token::simpleMatch(), Token::str(), Token::strAt(), InternalError::SYNTAX, Token::templateSimplifierPointer(), and Token::tokAt().
TemplateSimplifier::TokenAndName::TokenAndName | ( | const TokenAndName & | other | ) |
Definition at line 230 of file templatesimplifier.cpp.
References mToken, and Token::templateSimplifierPointer().
TemplateSimplifier::TokenAndName::~TokenAndName | ( | ) |
Definition at line 238 of file templatesimplifier.cpp.
const Token * TemplateSimplifier::TokenAndName::aliasEndToken | ( | ) | const |
Get alias end token.
template < ... > using X = foo < ... >; ^
Definition at line 258 of file templatesimplifier.cpp.
References Token::findsimplematch().
Referenced by TemplateSimplifier::printOut(), and TemplateSimplifier::simplifyTemplateAliases().
const Token * TemplateSimplifier::TokenAndName::aliasStartToken | ( | ) | const |
Get alias start token.
template < ... > using X = foo < ... >; ^
Definition at line 251 of file templatesimplifier.cpp.
References Token::tokAt().
Referenced by TemplateSimplifier::printOut(), and TemplateSimplifier::simplifyTemplateAliases().
std::string TemplateSimplifier::TokenAndName::dump | ( | const std::vector< std::string > & | fileNames | ) | const |
Definition at line 244 of file templatesimplifier.cpp.
References Token::Match(), and ErrorLogger::toxml().
|
inline |
Definition at line 177 of file templatesimplifier.h.
Referenced by TemplateSimplifier::printOut(), TemplateSimplifier::replaceTemplateUsage(), TemplateSimplifier::simplifyTemplateAliases(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), specMatch(), and TemplateSimplifier::useDefaultArgumentValues().
|
inlineprivate |
Get specified flag state.
flag | flag to get state of |
Definition at line 126 of file templatesimplifier.h.
|
inline |
Definition at line 199 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 102 of file templatesimplifier.h.
Referenced by TemplateSimplifier::printOut(), TemplateSimplifier::simplifyTemplateAliases(), specMatch(), and TemplateSimplifier::useDefaultArgumentValues().
bool TemplateSimplifier::TokenAndName::isAliasToken | ( | const Token * | tok | ) | const |
Is token an alias token? template < ...
> using X = foo < ... >; ^
tok | token to check |
Definition at line 265 of file templatesimplifier.cpp.
References Token::next().
Referenced by TemplateSimplifier::simplifyTemplateAliases().
|
inline |
Definition at line 190 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 93 of file templatesimplifier.h.
Referenced by TemplateSimplifier::expandTemplate(), and TemplateSimplifier::printOut().
|
inline |
Definition at line 208 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 111 of file templatesimplifier.h.
Referenced by TemplateSimplifier::getTemplateDeclarations(), and TemplateSimplifier::printOut().
|
inline |
Definition at line 214 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 117 of file templatesimplifier.h.
Referenced by TemplateSimplifier::printOut(), specMatch(), and TemplateSimplifier::useDefaultArgumentValues().
|
inline |
Definition at line 193 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 96 of file templatesimplifier.h.
Referenced by TemplateSimplifier::expandTemplate(), TemplateSimplifier::printOut(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), and specMatch().
|
inline |
Definition at line 205 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 108 of file templatesimplifier.h.
Referenced by TemplateSimplifier::printOut(), and specMatch().
|
inline |
Is declaration the same family (class, function or variable).
decl | declaration to compare to |
Definition at line 249 of file templatesimplifier.h.
References mFlags.
Referenced by specMatch().
|
inline |
Definition at line 202 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 105 of file templatesimplifier.h.
Referenced by TemplateSimplifier::expandTemplate(), TemplateSimplifier::printOut(), TemplateSimplifier::simplifyTemplateInstantiations(), specMatch(), and TemplateSimplifier::useDefaultArgumentValues().
|
inline |
Definition at line 196 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 99 of file templatesimplifier.h.
Referenced by TemplateSimplifier::expandTemplate(), TemplateSimplifier::printOut(), and TemplateSimplifier::simplifyTemplateInstantiations().
|
inline |
Definition at line 211 of file templatesimplifier.h.
Referenced by TokenAndName().
|
inlineprivate |
Definition at line 114 of file templatesimplifier.h.
Referenced by TemplateSimplifier::expandTemplate(), TemplateSimplifier::printOut(), TemplateSimplifier::simplifyTemplateAliases(), and TemplateSimplifier::simplifyTemplateInstantiations().
|
inline |
|
inline |
Definition at line 180 of file templatesimplifier.h.
Referenced by TemplateSimplifier::expandTemplate(), TemplateSimplifier::printOut(), TemplateSimplifier::simplifyTemplateInstantiations(), TemplateSimplifier::simplifyTemplates(), and specMatch().
|
inline |
Definition at line 157 of file templatesimplifier.h.
References mFlags, mFullName, mName, mNameToken, mParamEnd, mScope, and mToken.
|
inline |
Definition at line 183 of file templatesimplifier.h.
Referenced by TemplateSimplifier::expandTemplate(), TemplateSimplifier::printOut(), and TemplateSimplifier::useDefaultArgumentValues().
|
inline |
Definition at line 186 of file templatesimplifier.h.
|
inline |
Definition at line 171 of file templatesimplifier.h.
Referenced by TemplateSimplifier::addNamespace(), TemplateSimplifier::alreadyHasNamespace(), TemplateSimplifier::expandTemplate(), TemplateSimplifier::printOut(), and TemplateSimplifier::simplifyTemplateInstantiations().
|
inlineprivate |
Set specified flag state.
flag | flag to set state |
state | new state of flag |
Definition at line 135 of file templatesimplifier.h.
|
inline |
|
inline |
Definition at line 168 of file templatesimplifier.h.
|
private |
Definition at line 78 of file templatesimplifier.h.
Referenced by isSameFamily(), and operator==().
|
private |
Definition at line 75 of file templatesimplifier.h.
Referenced by operator==(), and TokenAndName().
|
private |
Definition at line 74 of file templatesimplifier.h.
Referenced by operator==(), and TokenAndName().
|
private |
Definition at line 76 of file templatesimplifier.h.
Referenced by operator==(), and TokenAndName().
|
private |
Definition at line 77 of file templatesimplifier.h.
Referenced by operator==(), and TokenAndName().
|
private |
Definition at line 73 of file templatesimplifier.h.
Referenced by operator==(), and TokenAndName().
|
private |
Definition at line 72 of file templatesimplifier.h.
Referenced by operator==(), and TokenAndName().