summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
Diffstat (limited to 'read.c')
-rw-r--r--read.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/read.c b/read.c
new file mode 100644
index 0000000..0fa6c47
--- /dev/null
+++ b/read.c
@@ -0,0 +1,19 @@
+#include <string.h>
+#include <stdio.h>
+
+#include "read.h"
+#include "run.h"
+
+AstNode read() {
+ AstNode ret;
+ memset(&ret, 0, sizeof ret);
+ pcc_context_t *ctx = pcc_create(NULL);
+ pcc_parse(ctx, &ret);
+ pcc_destroy(ctx);
+ return ret;
+}
+
+int main() {
+ for(;;) printf("%d\n",eval(read()));
+}
+