void check(const char code[]) { // Clear the error buffer.. errout.str(""); // Tokenize.. Tokenizer tokenizer(&settings, this); std::istringstream istr(code); tokenizer.tokenize(istr, "test.cpp"); // Check... CheckSizeof checkSizeof(&tokenizer, &settings, this); checkSizeof.runChecks(&tokenizer, &settings, this); }
void check(const char code[]) { // Clear the error buffer.. errout.str(""); Settings settings; settings.addEnabled("warning"); settings.addEnabled("portability"); settings.inconclusive = true; // Tokenize.. Tokenizer tokenizer(&settings, this); std::istringstream istr(code); tokenizer.tokenize(istr, "test.cpp"); // Check... CheckSizeof checkSizeof(&tokenizer, &settings, this); checkSizeof.runChecks(&tokenizer, &settings, this); }
void checkP(const char code[]) { // Clear the error buffer.. errout.str(""); // Raw tokens.. std::vector<std::string> files; files.push_back("test.cpp"); std::istringstream istr(code); const simplecpp::TokenList tokens1(istr, files, files[0]); // Preprocess.. simplecpp::TokenList tokens2(files); std::map<std::string, simplecpp::TokenList*> filedata; simplecpp::preprocess(tokens2, tokens1, files, filedata, simplecpp::DUI()); // Tokenize.. Tokenizer tokenizer(&settings, this); tokenizer.createTokens(&tokens2); tokenizer.simplifyTokens1(""); // Check... CheckSizeof checkSizeof(&tokenizer, &settings, this); checkSizeof.runChecks(&tokenizer, &settings, this); }