-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
35 lines (32 loc) · 837 Bytes
/
Copy pathmain.c
File metadata and controls
35 lines (32 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
#include "SymTab.h"
#include "IOMngr.h"
extern int yyparse();
SymTab *table;
SymTab *fList; // this is where I am going to store functions. This is so the last syscall of the program is still in main
SymTab *parameters;
int inAFunction;
int offset;
char * currentFunction; // the name of the function we're currently in
int stackPointerCounter;
//SymTab *ProcSymTab;
//struct SymEntry *entry;
//int inProc =0;
FILE *aFile;
int main(int argc, char * argv[]) {
table = createSymTab(100);
fList = createSymTab(50);
parameters = createSymTab(50);
offset = 0;
inAFunction = 0;
currentFunction = (char*)malloc(sizeof(char) * 20);
stackPointerCounter = 4;
//assumes there is a listing file
openFiles(argv[1], argv[2]);
if (argc == 4) {
aFile = fopen(argv[3], "w");
} else {
aFile = stdout;
}
yyparse();
}