31#define REG_INVALID ((t_regID)(-1))
33#define REG_0 ((t_regID)(0))
unsigned int firstUnusedLblID
Next unused label ID.
t_symbolType type
A valid data type.
t_listNode * instructions
List of instructions.
t_listNode * mcRegWhitelist
char * comment
A comment string associated with the instruction, or NULL if none.
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.
unsigned int labelID
Unique numeric identifier for the label.
char * ID
Symbol name (should never be a NULL pointer or an empty string "").
bool global
True if the label will be defined as 'global'.
t_instrArg * rSrc1
First source argument (or NULL if none).
t_regID firstUnusedReg
Next unused register ID.
t_instrArg * rSrc2
Second source argument (or NULL if none).
int immediate
Immediate argument.
t_regID ID
The register identifier.
t_label * label
Label associated with the instruction, or NULL.
t_instrArg * rDest
Destination argument (or NULL if none).
int opcode
Instruction opcode.
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.
t_program * newProgram(void)
void deleteProgram(t_program *program)
@ TYPE_INT_ARRAY
‘int’ array type.
@ TYPE_INT
‘int’ scalar type.