#include "bnf.h" #include "cpp.h" #include "cppbnf.h" #include "lexer.h" #include "grammer.h" #include "minicc.h" #include "debug.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" #include #include #include #include #include #include #include #include class CppTest: public ::testing::Test { protected: CppTest() { //debug = true; } ~CppTest() { } }; #if 1 TEST_F(CppTest, preprocessing_tokenize) { CPP cpp; auto pp_tokens = cpp.preprocessing_tokenize("int main() { return 1; }"); ASSERT_EQ(pp_tokens.size(), 9); auto tokens = cpp.tokens_from_pptokens(pp_tokens); ASSERT_EQ(tokens.size(), 9); //auto result = cpp.analysis(tokens); } #endif #if 0 TEST_F(CppTest, preprocessing_tokenize2) { CPP cpp; auto ppTree = cpp.preprocessing_tokenize("in ma"); cpp.tokens_from_pptokens(ppTree); } #endif #if 0 TEST(Cpp, translate) { CPP::translate(); } #endif