1234567891011121314151617181920212223 |
- #include "erpl.h"
- #include "erpli.c" // implementations
- #include "erple.c" // expressions evaluation
- int main (int argc, char** argv) {
- Atom *expr, *ret;
- Table *root_scope = NULL;
- while (!interrupted) {
- // TODO fix the "shell wannabe"
- printf("> ");
- expr = parse();
- ret = eval(expr,&root_scope);
- if (ret) {
- printf("returned: "); print_expression(ret); putchar(10);
- stack_push(ret, &stack);
- }
- free_atom(expr);
- if (ret != expr)
- free_atom(ret);
- }
- return 0;
- }
|