quakeforge/ruamoko/scheme/Instruction.h

53 lines
928 B
C
Raw Normal View History

#ifndef __Instruction_h
#define __Instruction_h
#include "SchemeObject.h"
typedef enum {
LABEL,
PUSH,
POP,
MAKECLOSURE,
MAKECONT,
LOADENV,
LOADLITS,
MAKEENV,
POPENV,
GET,
SET,
SETREST,
SETSTACK,
GETLINK,
GETGLOBAL,
SETGLOBAL,
CALL,
RETURN,
IFFALSE,
GOTO
} opcode_e;
struct instruction_s {
opcode_e opcode;
int operand;
};
typedef struct instruction_s instruction_t;
@interface Instruction: SchemeObject
{
opcode_e opcode;
int operand, offset;
2011-02-14 13:39:43 +00:00
Instruction *label;
}
+ (id) opcode: (opcode_e) oc;
+ (id) opcode: (opcode_e) oc operand: (int) op;
2011-02-14 13:39:43 +00:00
+ (id) opcode: (opcode_e) oc label: (Instruction *) l;
- (id) initWithOpcode: (opcode_e) oc operand: (int) op label: (Instruction *) l;
- (void) offset: (int) ofs;
- (int) offset;
- (opcode_e) opcode;
2011-02-14 13:39:43 +00:00
- (void) emitStruct: (instruction_t *) program;
@end
#endif //__Instruction_h