ACSE 2.0.3
Advanced Compiler System for Education
Loading...
Searching...
No Matches
program.c File Reference

Program object implementation. More...

#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "errors.h"
#include "program.h"
#include "scanner.h"
#include "codegen.h"
#include "target_info.h"
#include "target_asm_print.h"

Go to the source code of this file.

Functions

void deleteLabel (t_label *lab)
void deleteLabels (t_listNode *labels)
t_instrArgnewInstrArg (t_regID ID)
t_instructionnewInstruction (int opcode)
void deleteInstruction (t_instruction *inst)
void deleteInstructions (t_listNode *instructions)
t_symbolnewSymbol (char *ID, t_symbolType type, int arraySize)
t_programnewProgram (void)
void deleteProgram (t_program *program)
t_labelcreateLabel (t_program *program)
void setRawLabelName (t_program *program, t_label *label, const char *finalName)
void setLabelName (t_program *program, t_label *label, const char *name)
void assignLabel (t_program *program, t_label *label)
char * getLabelName (t_label *label)
void addInstruction (t_program *program, t_instruction *instr)
t_instructiongenInstruction (t_program *program, int opcode, t_regID rd, t_regID rs1, t_regID rs2, t_label *label, int immediate)
void removeInstructionAt (t_program *program, t_listNode *instrLi)
t_regID getNewRegister (t_program *program)
t_symbolcreateSymbol (t_program *program, char *ID, t_symbolType type, int arraySize)
bool isArray (t_symbol *symbol)
t_symbolgetSymbol (t_program *program, char *ID)
void genEpilog (t_program *program)
void programDump (t_program *program, FILE *fout)

Detailed Description

Program object implementation.

Definition in file program.c.

Function Documentation

◆ addInstruction()

void addInstruction ( t_program * program,
t_instruction * instr )

Definition at line 312 of file program.c.

◆ deleteInstruction()

void deleteInstruction ( t_instruction * inst)

Definition at line 71 of file program.c.

◆ deleteInstructions()

void deleteInstructions ( t_listNode * instructions)

Definition at line 91 of file program.c.

◆ deleteLabel()

void deleteLabel ( t_label * lab)

Definition at line 27 of file program.c.

◆ deleteLabels()

void deleteLabels ( t_listNode * labels)

Definition at line 33 of file program.c.

◆ newInstrArg()

t_instrArg * newInstrArg ( t_regID ID)

Definition at line 45 of file program.c.

◆ newInstruction()

t_instruction * newInstruction ( int opcode)

Definition at line 55 of file program.c.

◆ newSymbol()

t_symbol * newSymbol ( char * ID,
t_symbolType type,
int arraySize )

Definition at line 107 of file program.c.

◆ setRawLabelName()

void setRawLabelName ( t_program * program,
t_label * label,
const char * finalName )

Definition at line 184 of file program.c.