still working through symbol_table to try and get it to compile soon but fixed issues with storing values and calling the right element of a struct

This commit is contained in:
Partho Bhattacharya
2025-03-14 12:04:53 -04:00
parent 392a4b3ba5
commit f0e0d7bdbc
3 changed files with 54 additions and 21 deletions

View File

@ -7,15 +7,20 @@ typedef struct{
int size;
}primitive_info;
/*This structure can be subsumed into the structure below (1-d array of chars)
typedef struct{
int length;
char* location;
//shouldn't need to store any values since would be compiled at runtime
//int length;
//char* location;
}string_info;
*/
typedef struct{
int numofdimensions;
//the above value tells you how long the below array is. For example if num of dimensions is 5, I can store 1,3,2,5,9 to define > int* arr;
int* sizesofdimensions;
//shouldn't need to store any values (like sizes of dimenions or the location
//int* sizesofdimensions;
//do have to store type of array
TableNode* typeofarray;
}array_info;
@ -35,12 +40,12 @@ typedef struct{
}function_type_info;
typedef union {
PrimAdInfo* primitive_info;
ArrayAdInfo* array_info;
RecAdInfo* record_info;
StringAdInfo* string_info;
FunDecAdInfo* func_dec_info;
FunTypeAdInfo* func_type_info;
primitive_info* PrimAdInfo;
array_info* ArrayAdInfo;
record_info* RecAdInfo;
//string_info* StringAdInfo;
func_dec_info* FunDecAdInfo;
func_type_info* FunTypeAdInfo;
}AdInfo;
typedef struct ListOfTable {