31#define REG_INVALID ((t_regID)(-1))
33#define REG_0 ((t_regID)(0))
77 t_label *addressParam;
unsigned int firstUnusedLblID
Next unused label ID.
t_symbolType type
A valid data type.
t_listNode * instructions
List of instructions.
int arraySize
For arrays only, the size of the array.
t_listNode * labels
List of all labels.
t_listNode * symbols
Symbol table.
t_label * pendingLabel
Next pending label to assign.
char * ID
Symbol name (should never be a NULL pointer or an empty string "").
t_regID firstUnusedReg
Next unused register ID.
void setLabelName(t_program *program, t_label *label, const char *name)
void assignLabel(t_program *program, t_label *label)
t_regID getNewRegister(t_program *program)
bool isArray(t_symbol *symbol)
t_symbol * getSymbol(t_program *program, char *ID)
void programDump(t_program *program, FILE *fout)
void genEpilog(t_program *program)
t_label * createLabel(t_program *program)
void removeInstructionAt(t_program *program, t_listNode *instrLi)
t_symbol * createSymbol(t_program *program, char *ID, t_symbolType type, int arraySize)
char * getLabelName(t_label *label)
t_instruction * genInstruction(t_program *program, int opcode, t_regID rd, t_regID rs1, t_regID rs2, t_label *label, int immediate)
int t_regID
Type for register identifiers.
@ TYPE_INT_ARRAY
‘int’ array type.
@ TYPE_INT
‘int’ scalar type.