--debug flag can be used to printout token list (for development purposes)
This commit is contained in:
parent
c413c8d4b3
commit
b3dd9e699b
|
@ -370,7 +370,7 @@ unsigned int CppCheck::check()
|
|||
|
||||
void CppCheck::checkFile(const std::string &code, const char FileName[])
|
||||
{
|
||||
Tokenizer _tokenizer;
|
||||
Tokenizer _tokenizer(_settings);
|
||||
|
||||
// Tokenize the file
|
||||
{
|
||||
|
|
|
@ -41,6 +41,13 @@ Tokenizer::Tokenizer()
|
|||
_tokensBack = 0;
|
||||
}
|
||||
|
||||
Tokenizer::Tokenizer(const Settings &settings)
|
||||
{
|
||||
_tokens = 0;
|
||||
_tokensBack = 0;
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
Tokenizer::~Tokenizer()
|
||||
{
|
||||
DeallocateTokens();
|
||||
|
@ -1240,6 +1247,10 @@ void Tokenizer::simplifyTokenList()
|
|||
}
|
||||
|
||||
createLinks();
|
||||
if (_settings._debug)
|
||||
{
|
||||
_tokens->printOut();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ private:
|
|||
|
||||
public:
|
||||
Tokenizer();
|
||||
Tokenizer(const Settings &settings);
|
||||
~Tokenizer();
|
||||
|
||||
/**
|
||||
|
@ -188,6 +189,7 @@ private:
|
|||
std::map<std::string, unsigned int> _typeSize;
|
||||
std::vector<std::string> _files;
|
||||
Token *_tokens;
|
||||
Settings _settings;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue