Got symbol Table largely working (but without certain entries being added like functions or records)

This commit is contained in:
Partho Bhattacharya
2025-03-14 20:48:11 -04:00
parent ead70170c0
commit 78f1cd3fbb
3 changed files with 19 additions and 7 deletions

View File

@ -17,8 +17,6 @@ TableNode* chara;
TableNode* stri;
TableNode* boo;
TableNode* recprime;
TableNode* funprime;
TableNode* arrayprime;
TableNode* funtypeprime;
@ -234,7 +232,7 @@ SymbolTable* CreateScope(SymbolTable* ParentScope, int Line, int Column) {
//create entry just for things below top level scope
SymbolTable* init(SymbolTable* start){
if(start->Parent_Scope == NULL){
if(start->Parent_Scope != NULL){
printf("Cannot initialize a scope that is not the parent scope\n");
return NULL;
}
@ -280,7 +278,7 @@ SymbolTable* init(SymbolTable* start){
funprime->theName= "primitive function";
funprime->theType=NULL;
funprime->additionalinfo = NULL;
funpprime->next = NULL;
funprime->next = NULL;
//record
recprime = (TableNode*)malloc(sizeof(TableNode));