34 #include <simplecpp.h>
60 Directive(std::string _file,
const int _linenr,
const std::string &_str);
73 friend class PreprocessorHelper;
74 friend class TestPreprocessor;
75 friend class TestUnusedVar;
93 void inlineSuppressions(
const simplecpp::TokenList &tokens,
SuppressionList &suppressions);
95 std::list<Directive> createDirectives(
const simplecpp::TokenList &tokens)
const;
97 std::set<std::string>
getConfigs(
const simplecpp::TokenList &tokens)
const;
99 void handleErrors(
const simplecpp::OutputList &outputList,
bool throwError);
101 bool loadFiles(
const simplecpp::TokenList &rawtokens, std::vector<std::string> &files);
103 void removeComments();
105 void setPlatformInfo(simplecpp::TokenList *tokens)
const;
107 simplecpp::TokenList preprocess(
const simplecpp::TokenList &tokens1,
const std::string &
cfg, std::vector<std::string> &files,
bool throwError =
false);
109 std::string getcode(
const simplecpp::TokenList &tokens1,
const std::string &
cfg, std::vector<std::string> &files,
const bool writeLocations);
118 std::size_t calculateHash(
const simplecpp::TokenList &tokens1,
const std::string &toolinfo)
const;
120 void simplifyPragmaAsm(simplecpp::TokenList *tokenList)
const;
127 void dump(std::ostream &out)
const;
129 void reportOutput(
const simplecpp::OutputList &outputList,
bool showerror);
131 static bool hasErrors(
const simplecpp::Output &output);
134 static void simplifyPragmaAsmPrivate(simplecpp::TokenList *tokenList);
136 void missingInclude(
const std::string &filename,
unsigned int linenr,
const std::string &header,
HeaderTypes headerType);
137 void error(
const std::string &filename,
unsigned int linenr,
const std::string &msg);
139 static bool hasErrors(
const simplecpp::OutputList &outputList);
This is an interface, which the class responsible of error logging should implement.
The cppcheck preprocessor.
HeaderTypes
Include file types.
std::list< simplecpp::MacroUsage > mMacroUsage
simplecpp tracking info
std::list< simplecpp::IfCond > mIfCond
std::string mFile0
filename for cpp/c file - useful when reporting errors
const Settings & mSettings
std::map< std::string, simplecpp::TokenList * > mTokenLists
list of all directives met while preprocessing file
static char macroChar
character that is inserted in expanded macros
ErrorLogger & mErrorLogger
This is just a container for general settings so that we don't need to pass individual values to func...
class for handling suppressions
@ error
Programming error.
static std::string cfg(const std::vector< std::string > &configs, const std::string &userDefines)
static void getConfigs(const simplecpp::TokenList &tokens, std::set< std::string > &defined, const std::string &userDefines, const std::set< std::string > &undefined, std::set< std::string > &ret)
A preprocessor directive Each preprocessor directive (#include, #define, #undef, #if,...
std::string file
name of (possibly included) file where directive is defined
std::string str
the actual directive text
unsigned int linenr
line number in (possibly included) file where directive is defined