diff options
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/driver.c b/driver.c deleted file mode 100644 index 6b0909e..0000000 --- a/driver.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include "ast.h" - -extern FILE *yyin; -extern int yyparse(void); -extern ASTNode *ast_root; - -int main(int argc, char **argv) { - if (argc > 1) { - yyin = fopen(argv[1], "r"); - if (!yyin) { - perror(argv[1]); - return EXIT_FAILURE; - } - } else { - yyin = stdin; - } - - if (yyparse() != 0) { - fprintf(stderr, "Parsing failed.\n"); - return EXIT_FAILURE; - } - - Env *env = NULL; - exec_stmt(&env, ast_root); - env_print(env); - free_ast(ast_root); - - return EXIT_SUCCESS; -} |