got compilation to work

This commit is contained in:
Partho
2025-04-25 16:55:27 -04:00
parent 46d8a852a6
commit 1999230265
4 changed files with 241 additions and 105 deletions

View File

@ -3,7 +3,6 @@
#include "runner.h"
FILE *ir_flag = NULL;
FILE *cg_flag = NULL;
//Constant_Stack *head = NULL;
int main(int argc, char *argv[]) {
if (argc == 1) {
@ -38,6 +37,7 @@ int main(int argc, char *argv[]) {
alpha_file = fopen(argv[argc - 1], "r");
}
}
cg_flag = fopen("cg.s", "w");
return run(alpha_file);
}
@ -125,6 +125,8 @@ int run(FILE *alpha) {
print_symbol_table(top, st_flag);
emit_as_file(stdout, begin);
fclose(st_flag);
generate();
fclose(cg_flag);
}
if (asc_flag != NULL) {
@ -141,10 +143,10 @@ int run(FILE *alpha) {
fclose(ir_flag);
}
if (cg_flag != NULL) {
printf("Flag -cg is not implemented yet\n");
fclose(cg_flag);
}
//if (cg_flag != NULL) {
// printf("Flag -cg is not implemented yet\n");
//fclose(cg_flag);
//}
if (yyin != NULL) {
fclose(yyin);