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

Method preprocess

test/helpers.cpp:114–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void SimpleTokenizer2::preprocess(const char* code, std::size_t size, std::vector<std::string> &files, const std::string& file0, Tokenizer& tokenizer, ErrorLogger& errorlogger)
115{
116 simplecpp::OutputList outputList;
117 simplecpp::TokenList tokens1({code, size}, files, file0, &outputList);
118
119 Preprocessor preprocessor(tokens1, tokenizer.getSettings(), errorlogger, Path::identify(tokens1.getFiles()[0], false));
120 (void)preprocessor.loadFiles(files); // TODO: check result
121 simplecpp::TokenList tokens2 = preprocessor.preprocess("", files, outputList);
122 (void)preprocessor.reportOutput(outputList, true);
123
124 // Tokenizer..
125 tokenizer.list.createTokens(std::move(tokens2));
126
127 std::list<Directive> directives = preprocessor.createDirectives();
128 tokenizer.setDirectives(std::move(directives));
129}
130
131bool LibraryHelper::loadxmldata(Library &lib, const char xmldata[], std::size_t len)
132{

Callers 1

notokensMethod · 0.45

Calls 5

loadFilesMethod · 0.80
reportOutputMethod · 0.80
createDirectivesMethod · 0.80
setDirectivesMethod · 0.80
createTokensMethod · 0.45

Tested by 1

notokensMethod · 0.36