summaryrefslogtreecommitdiffhomepage
path: root/test-cpp.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-03-21 16:06:47 +0100
committerRoland Reichwein <mail@reichwein.it>2020-03-21 16:06:47 +0100
commitcdf001920fde6652b344775589b0524ff6529809 (patch)
tree883ab6232a4c4ca4056b123bff7c7d1cd98c5cf4 /test-cpp.cpp
parent3cc139bce0283018473d4906ee2ea5f40f771255 (diff)
Added Gram::Compiler to CPP (WIP)
Diffstat (limited to 'test-cpp.cpp')
-rw-r--r--test-cpp.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/test-cpp.cpp b/test-cpp.cpp
new file mode 100644
index 0000000..d08f9b0
--- /dev/null
+++ b/test-cpp.cpp
@@ -0,0 +1,61 @@
+#include "bnf.h"
+#include "cpp.h"
+#include "cppbnf.h"
+#include "lexer.h"
+#include "grammer.h"
+#include "minicc.h"
+#include "debug.h"
+
+#include <boost/algorithm/string.hpp>
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#include <algorithm>
+#include <cctype>
+#include <deque>
+#include <map>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+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