Organization + Task 1 objectives t#30

This commit is contained in:
Scarlett
2025-02-24 15:28:46 -05:00
parent c1191c888e
commit 44ddfa41f8
23 changed files with 40 additions and 64 deletions

View File

@ -87,7 +87,7 @@ int run(FILE *alpha) {
if (st_flag != NULL) {
//output symbol table, file pointer is
print_symbol_table(top,st_flag);
//print_symbol_table(top,st_flag);
}
if (yyin != NULL) {
@ -115,10 +115,19 @@ int new_file(char *arg, char *alpha) {
int type_len;
const char *basename = alpha;
const char *slash = strchr(alpha, '/');
while (slash != NULL) {
basename = slash + 1;
slash = strchr(basename, '/');
}
mkdir("./out", 0777);
char *new_basename = calloc(strlen(basename) + 5, sizeof(char));
strcpy(new_basename, "./out/");
strcat(new_basename, basename);
basename = new_basename;
if (strcmp(arg, "-tok") == 0) {
type_len = TOK_LEN;
} else if (strcmp(arg, "-st") == 0) {