24 lines
493 B
C
24 lines
493 B
C
#ifndef __GRAVITY__INSTRUCTION_H
|
|
#define __GRAVITY__INSTRUCTION_H
|
|
|
|
#include "value.h"
|
|
#include <stddef.h>
|
|
|
|
typedef enum {
|
|
GravityOpcodeAlloc = 0,
|
|
GravityOpcodeStore,
|
|
GravityOpcodeLoad,
|
|
GravityOpcodeRet
|
|
} GravityOpcode;
|
|
|
|
typedef struct {
|
|
GravityOpcode opcode;
|
|
GravityValue* operands;
|
|
size_t numOperands;
|
|
GravityValue result;
|
|
} GravityInstruction;
|
|
|
|
char* gravityInstructionToCStr(GravityInstruction inst);
|
|
char* gravityOpcodeToCStr(GravityOpcode opcode);
|
|
|
|
#endif |