Added most type checking. Entries seem printing mostly OK in table.
This commit is contained in:
@ -948,14 +948,23 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr) {
|
||||
st_fprint(file_ptr, entry->theName, currentScopeNum, parentScopeNum, arrayType, " Type of Array");
|
||||
}
|
||||
}
|
||||
if (getAdInfoType(entry) == TYPE_RECORD_TYPE) {
|
||||
char *recordAdInfo = (char *)malloc(100);
|
||||
sprintf(recordAdInfo, " elements-%d", entry->additionalinfo->RecAdInfo->numofelements);
|
||||
if (parentScopeNum == 0) {
|
||||
st_fprint(file_ptr, entry->theName, currentScopeNum, -100, "record type", recordAdInfo);
|
||||
} else {
|
||||
st_fprint(file_ptr, entry->theName, currentScopeNum, parentScopeNum, "record type", recordAdInfo);
|
||||
}
|
||||
}
|
||||
|
||||
if (getAdInfoType(entry) == TYPE_RECORD) {
|
||||
char *recordAdInfo = (char *)malloc(100);
|
||||
sprintf(recordAdInfo, " elements-%d", entry->additionalinfo->RecAdInfo->numofelements);
|
||||
if (parentScopeNum == 0) {
|
||||
st_fprint(file_ptr, entry->theName, currentScopeNum, -100, "record", recordAdInfo);
|
||||
st_fprint(file_ptr, entry->theName, currentScopeNum, -100, "record instance", recordAdInfo);
|
||||
} else {
|
||||
st_fprint(file_ptr, entry->theName, currentScopeNum, parentScopeNum, "record", recordAdInfo);
|
||||
st_fprint(file_ptr, entry->theName, currentScopeNum, parentScopeNum, "record instance", recordAdInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user