diff options
author | Teddy <[email protected]> | 2014-04-04 01:07:15 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2014-04-04 01:07:15 +0800 |
commit | a52fc0e7c5d05c7a4b18d8520826e448576826f9 (patch) | |
tree | e074fa63de537a34cdac5a3a78a5ae2788dad2ba /main.c | |
parent | ef1c46b1eef2b22100d9eca9c4d0e6ffab7c7eab (diff) |
...
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -3,6 +3,7 @@ #include <stdlib.h> #include "cibic.tab.h" #include "ast.h" +#include "semantics.h" extern char linebuff[]; extern char *lptr; @@ -41,6 +42,11 @@ void print_ast() { else exit(1); } +void print_sem() { + yyparse(); + semantics_check(ast_root); +} + void print_help() { fprintf(stderr, "CBIC: C Implemented Bare and Ingenuous Compiler\n\n" @@ -62,8 +68,9 @@ static struct option lopts[] = { enum { PRINT_AST, - PRINT_HELP -} mode = PRINT_HELP; + PRINT_HELP, + PRINT_SEM +} mode = PRINT_SEM; int main(int argc, char **argv) { int option_index = 0; @@ -103,6 +110,7 @@ int main(int argc, char **argv) { { case PRINT_AST: print_ast(); break; case PRINT_HELP: print_help(); break; + default: print_sem(); } return 0; } |