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

Program object definition and management. More...

#include <stdio.h>
#include <stdbool.h>
#include "list.h"

Go to the source code of this file.

Data Structures

struct  t_label
struct  t_instrArg
struct  t_instruction
struct  t_symbol
struct  t_program

Macros

#define REG_INVALID   ((t_regID)(-1))
 Constant used for invalid register identifiers.
#define REG_0   ((t_regID)(0))
 Constant identifying a register whose value is always zero.

Typedefs

typedef int t_regID
 Type for register identifiers.

Enumerations

enum  t_symbolType { TYPE_INT , TYPE_INT_ARRAY }

Functions

Construction/destruction of a program
t_programnewProgram (void)
void deleteProgram (t_program *program)
Handling of labels
t_labelcreateLabel (t_program *program)
void assignLabel (t_program *program, t_label *label)
void setLabelName (t_program *program, t_label *label, const char *name)
char * getLabelName (t_label *label)
Generation of instructions
t_regID getNewRegister (t_program *program)
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)
Handling of symbols
t_symbolcreateSymbol (t_program *program, char *ID, t_symbolType type, int arraySize)
t_symbolgetSymbol (t_program *program, char *ID)
bool isArray (t_symbol *symbol)
Utility functions
void genEpilog (t_program *program)
void programDump (t_program *program, FILE *fout)

Detailed Description

Program object definition and management.

Definition in file program.h.