Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small tokenize.h cleanup #6250

Merged
merged 2 commits into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lib/tokenize.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ enum class Severity;
/** @brief The main purpose is to tokenize the source code. It also has functions that simplify the token list */
class CPPCHECKLIB Tokenizer {

friend class TestSimplifyTokens;
friend class TestSimplifyTypedef;
friend class TestSimplifyUsing;
friend class TestTokenizer;
friend class SymbolDatabase;
friend class TestSimplifyTemplate;
friend class TemplateSimplifier;

friend class TestSimplifyTemplate;
friend class TestSimplifyTypedef;
friend class TestTokenizer;

public:
explicit Tokenizer(const Settings & settings, ErrorLogger *errorLogger, const Preprocessor *preprocessor = nullptr);
~Tokenizer();
Expand Down Expand Up @@ -105,6 +104,7 @@ class CPPCHECKLIB Tokenizer {
const char FileName[],
const std::string &configuration = emptyString);

private:
/** Set variable id */
void setVarId();
void setVarIdPass1();
Expand Down Expand Up @@ -139,7 +139,7 @@ class CPPCHECKLIB Tokenizer {
*/
void splitTemplateRightAngleBrackets(bool check);


public:
/**
* Calculates sizeof value for given type.
* @param type Token which will contain e.g. "int", "*", or string.
Expand All @@ -148,6 +148,7 @@ class CPPCHECKLIB Tokenizer {
nonneg int sizeOfType(const Token* type) const;
nonneg int sizeOfType(const std::string& type) const;

private:
void simplifyDebug();

/** Simplify assignment where rhs is a block : "x=({123;});" => "{x=123;}" */
Expand Down Expand Up @@ -351,6 +352,7 @@ class CPPCHECKLIB Tokenizer {
*/
static std::string simplifyString(const std::string &source);

public:
/**
* is token pointing at function head?
* @param tok A '(' or ')' token in a possible function head
Expand Down
Loading