all compilation errors are gone. Function Types are properly entering Symbol Table. Some Type checking is taking place among expressions.

This commit is contained in:
Partho Bhattacharya
2025-03-14 22:42:08 -04:00
parent 78f1cd3fbb
commit 1544f2b728
2 changed files with 31 additions and 12 deletions

View File

@ -316,19 +316,25 @@ SymbolTable* init(SymbolTable* start){
return start;
}
TableNode* CreateEntry(SymbolTable* table, char* typeOf, char* id, AdInfo* ad) {
TableNode* CreateEntry(SymbolTable* table, TableNode* typeOf, char* id, AdInfo* ad) {
if(table ==NULL){
printf("Null reference to table");
return NULL;
}
/*
TableNode* topDef = (table_lookup(getAncestor(table),typeOf));
if(topDef == NULL){
printf("This type is not defined at the top level\n");
return NULL;
}
*/
if(typeOf == NULL){
printf("This is not pointing to a proper definition\n");
return NULL;
}
TableNode* newEntry = (TableNode*)malloc(sizeof(TableNode));
newEntry->theType = topDef;
newEntry->theType = typeOf/*topDef*/;
newEntry->theName = id;
newEntry->additionalinfo = ad;
if (table->entries == NULL) {