summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 6516eab..5f6c169 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;