fixed issue with not printing array instances in symbol table
This commit is contained in:
@ -1128,6 +1128,17 @@ void print_symbol_table(SymbolTable *table, FILE *file_ptr) {
|
||||
st_fprint(file_ptr, getName(entry), currentScopeNum, parentScopeNum, arrayType, " Type of Array");
|
||||
}
|
||||
}
|
||||
if (getAdInfoType(entry) == TYPE_ARRAY) {
|
||||
char *arrayType = (char *)malloc(100);
|
||||
sprintf(arrayType, " %d -> %s", getNumArrDim(entry),
|
||||
getName(getArrType(entry)));
|
||||
|
||||
if (parentScopeNum == 0) {
|
||||
st_fprint(file_ptr, getName(entry), currentScopeNum, -100, getType(entry), " Array Instance");
|
||||
} else {
|
||||
st_fprint(file_ptr, getName(entry), currentScopeNum, parentScopeNum, getType(entry), " Array Instance");
|
||||
}
|
||||
}
|
||||
if (getAdInfoType(entry) == TYPE_RECORD_TYPE) {
|
||||
char *recordAdInfo = (char *)malloc(100);
|
||||
sprintf(recordAdInfo, " elements-%d size-%d bytes", getRecLength(entry), getRecTotal(entry));
|
||||
|
Reference in New Issue
Block a user