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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user