aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
blob: 6a86fe5b2b86ee6b24a4332e87c9f7657df7eb18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
}