MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / preprocess

Method preprocess

test/testpreprocessor.cpp:66–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65 template<size_t size>
66 void preprocess(const char (&code)[size], std::vector<std::string> &files, const std::string& file0, TokenList& tokenlist, const simplecpp::DUI& dui)
67 {
68 if (!files.empty())
69 throw std::runtime_error("file list not empty");
70
71 if (tokenlist.front())
72 throw std::runtime_error("token list not empty");
73
74 simplecpp::OutputList outputList;
75 const simplecpp::TokenList tokens1(code, files, file0, &outputList);
76
77 // Preprocess..
78 simplecpp::TokenList tokens2(files);
79 simplecpp::FileDataCache cache;
80 simplecpp::preprocess(tokens2, tokens1, files, cache, dui, &outputList);
81 Preprocessor preprocessor(tokens2, settingsDefault, *this, Standards::Language::C);
82 (void)preprocessor.reportOutput(outputList, true);
83
84 // Tokenizer..
85 tokenlist.createTokens(std::move(tokens2));
86 }
87
88 template<size_t size>
89 std::vector<RemarkComment> getRemarkComments(const char (&code)[size], ErrorLogger& errorLogger) const

Callers 1

expandMacrosMethod · 0.45

Calls 4

frontMethod · 0.80
reportOutputMethod · 0.80
emptyMethod · 0.45
createTokensMethod · 0.45

Tested by

no test coverage detected