63 const std::string& getSourceFilePath()
const;
77 static void deleteTokens(
Token *tok);
79 void addtoken(
const std::string& str,
const nonneg int lineno,
const nonneg int column,
const nonneg int fileno,
bool split =
false);
80 void addtoken(
const std::string& str,
const Token *locationTok);
83 void addtoken(
const Token *tok,
const Token *locationTok);
84 void addtoken(
const Token *tok);
96 static Token *copyTokens(
Token *dest,
const Token *first,
const Token *last,
bool one_line =
true);
107 bool createTokens(std::istream &code,
const std::string& file0);
110 void createTokens(simplecpp::TokenList&& tokenList);
113 void deallocateTokens();
116 int appendFileIfNew(std::string fileName);
120 return mTokensFrontBack.front;
124 return mTokensFrontBack.front;
129 return mTokensFrontBack.back;
133 return mTokensFrontBack.back;
165 std::size_t calculateHash()
const;
199 void clangSetOrigFiles();
204 void determineCppC();
206 bool createTokensInternal(std::istream &code,
const std::string& file0);
This is just a container for general settings so that we don't need to pass individual values to func...
TokensFrontBack mTokensFrontBack
Token list.
std::string fileLine(const Token *tok) const
Get file:line for a given token.
void createAst() const
Create abstract syntax tree.
TokenList & operator=(const TokenList &)=delete
const Token * back() const
get last token of list
void simplifyPlatformTypes()
Convert platform dependent types to standard types.
bool validateToken(const Token *tok) const
Verify that the given token is an element of the tokenlist.
TokenList(const TokenList &)=delete
bool isKeyword(const std::string &str) const
void setLang(Standards::Language lang)
const std::string & file(const Token *tok) const
get filename for given token
void simplifyStdType()
Collapse compound standard types into a single token.
const std::vector< std::string > & getFiles() const
Get filenames (the sourcefile + the files it include).
const Token * front() const
get first token of list
std::vector< std::string > mOrigFiles
Original filenames for the tokenized source code (source + included)
std::vector< std::string > mFiles
filenames for the tokenized source code (source + included)
std::string getOrigFile(const Token *tok) const
void validateAst(bool print) const
Check abstract syntax tree.
The token list that the TokenList generates is a linked-list of this class.
static std::vector< std::string > split(const std::string &str, const std::string &sep=" ")
This struct stores pointers to the front and back tokens of the list this token is in.
TokensFrontBack(const TokenList &list)
const Token * findLambdaEndTokenWithoutAST(const Token *tok)
const Token * isLambdaCaptureList(const Token *tok)