aboutsummaryrefslogtreecommitdiffstats
path: root/sources/apps/parsertest/ptest.cpp
diff options
context:
space:
mode:
authorAtaberk <olgunataberk@gmail.com>2022-09-25 17:22:03 +0200
committerAtaberk <olgunataberk@gmail.com>2022-09-25 17:22:03 +0200
commitdc0b3db1b4f1895a07e5fe280ee3790e87f97b9f (patch)
treeb47203aa281bdd959def4451c84d310cd9cf2e12 /sources/apps/parsertest/ptest.cpp
downloaddram-bender-dc0b3db1b4f1895a07e5fe280ee3790e87f97b9f.tar.gz
Initial commit
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);
+}