diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..6a86fe5 --- /dev/null +++ b/main.cpp @@ -0,0 +1,21 @@ +#include "model.h" +#include "builtin.h" +#include "parser.h" +#include <cstdio> + +#ifdef DEBUG +extern Cons *empty_list; +void tree_print(Cons *ptr) { + if (!ptr || ptr == empty_list) return; + ptr->_debug_print(); + tree_print(dynamic_cast<Cons*>(ptr->car)); + tree_print(ptr->cdr); +} +#endif + +int main() { + Tokenizor *tk = new Tokenizor(); + ASTGenerator *ast = new ASTGenerator(); + Cons *tree = ast->absorb(tk); + tree_print(tree); +} |