diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -5,6 +5,7 @@ typedef void* yyscan_t; #include "ast.h" +#include "code-generation.h" #include "common.h" #include "draw.h" #include "semantic-analysis.h" @@ -95,6 +96,14 @@ int main (int argc, char **argv) else exit(1); + FILE *asm_output = fopen("output.s", "w"); + if (asm_output == NULL) { + fprintf(stderr, "%s: output.s: %s\n", prog_name, ERR_MSG); + exit(1); + } + ccmmc_code_generation(state->ast, state->table, asm_output); + fclose(asm_output); + ccmmc_state_fini(state); fclose(source_handle); return 0; |