aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 6a86fe5..f32dac3 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,6 +1,7 @@
#include "model.h"
#include "builtin.h"
#include "parser.h"
+#include "eval.h"
#include <cstdio>
#ifdef DEBUG
@@ -16,6 +17,13 @@ void tree_print(Cons *ptr) {
int main() {
Tokenizor *tk = new Tokenizor();
ASTGenerator *ast = new ASTGenerator();
- Cons *tree = ast->absorb(tk);
- tree_print(tree);
+ Evaluator *eval = new Evaluator();
+
+ while (1)
+ {
+ Cons *tree = ast->absorb(tk);
+ if (!tree) break;
+ //tree_print(tree);
+ printf("%s\n", eval->run_expr(tree)->ext_repr().c_str());
+ }
}