diff --git a/lib/token.h b/lib/token.h index 5479863eef52..fada7d4296ca 100644 --- a/lib/token.h +++ b/lib/token.h @@ -23,6 +23,7 @@ #include "config.h" #include "mathlib.h" +#include "tokenlist.h" #include "valueflow.h" #include "templatesimplifier.h" #include "utils.h" @@ -45,19 +46,9 @@ class Settings; class Type; class ValueType; class Variable; -class TokenList; class ConstTokenRange; class Token; -/** - * @brief This struct stores pointers to the front and back tokens of the list this token is in. - */ -struct TokensFrontBack { - Token *front; - Token *back; - const TokenList* list; -}; - struct ScopeInfo2 { ScopeInfo2(std::string name_, const Token *bodyEnd_, std::set usingNamespaces_ = std::set()) : name(std::move(name_)), bodyEnd(bodyEnd_), usingNamespaces(std::move(usingNamespaces_)) {} std::string name; diff --git a/lib/tokenlist.h b/lib/tokenlist.h index 3ea24c66ab43..695160ed99ca 100644 --- a/lib/tokenlist.h +++ b/lib/tokenlist.h @@ -22,7 +22,6 @@ //--------------------------------------------------------------------------- #include "config.h" -#include "token.h" #include #include @@ -31,14 +30,25 @@ #include class Settings; +class Token; namespace simplecpp { class TokenList; } +class TokenList; /// @addtogroup Core /// @{ +/** + * @brief This struct stores pointers to the front and back tokens of the list this token is in. + */ +struct TokensFrontBack { + Token *front; + Token *back; + const TokenList* list; +}; + class CPPCHECKLIB TokenList { public: explicit TokenList(const Settings* settings);