1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <string.h> #include <stdio.h> #include "read.h" #include "run.h" AstNode read() { AstNode ret; memset(&ret, 0, sizeof ret); pcc_context_t *ctx = pcc_create(NULL); pcc_parse(ctx, &ret); pcc_destroy(ctx); return ret; } int main() { Ht e = ht_new(); for (;;) printf("%d\n",eval(&e, read())); }