aboutsummaryrefslogtreecommitdiffstats
path: root/sources/apps/parsertest/ptest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/apps/parsertest/ptest.cpp')
-rw-r--r--sources/apps/parsertest/ptest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/sources/apps/parsertest/ptest.cpp b/sources/apps/parsertest/ptest.cpp
new file mode 100644
index 0000000..28aabac
--- /dev/null
+++ b/sources/apps/parsertest/ptest.cpp
@@ -0,0 +1,18 @@
+#include <string>
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <string.h>
+#include "prog.h"
+#include "parser.h"
+
+int main()
+{
+ // https://stackoverflow.com/questions/2602013/read-whole-ascii-file-into-c-stdstring
+ std::ifstream t("example.smc");
+ std::stringstream buffer;
+ buffer << t.rdbuf();
+ string program = buffer.str();
+ Parser p;
+ p.parse_program(program);
+}