diff options
author | Teddy <[email protected]> | 2013-08-03 23:09:59 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-03 23:09:59 +0800 |
commit | c66dc142d240ec2e2ae78201d9614de76535be38 (patch) | |
tree | c9df286951328d7a477415946e8000beef6843ad /main.cpp | |
parent | e462669c3c3cc04ea29420e14dbb589899d201ec (diff) |
C++ version now works!
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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()); + } } |