quakeforge/ruamoko/scheme/Instruction.h
Brian Koropoff 281b683e14 Initial commit of a future partial implementation of the R5RS Scheme
standard, implemented in Ruamoko.  Currently works for a few simple
"Hello, world!" programs.
2005-05-01 11:48:36 +00:00

46 lines
871 B
Objective-C

#ifndef __Instruction_h
#define __Instruction_h
#include "SchemeObject.h"
typedef enum {
LABEL,
PUSH,
POP,
MAKECLOSURE,
MAKECONT,
LOADENV,
LOADLITS,
MAKEENV,
GET,
SET,
GETLINK,
GETGLOBAL,
CALL,
RETURN
} opcode_e;
struct instruction_s {
opcode_e opcode;
integer operand;
};
typedef struct instruction_s instruction_t;
@interface Instruction: SchemeObject
{
opcode_e opcode;
integer operand, offset;
Instruction label;
}
+ (id) opcode: (opcode_e) oc;
+ (id) opcode: (opcode_e) oc operand: (integer) op;
+ (id) opcode: (opcode_e) oc label: (Instruction) l;
- (id) initWithOpcode: (opcode_e) oc operand: (integer) op label: (Instruction) l;
- (void) offset: (integer) ofs;
- (integer) offset;
- (opcode_e) opcode;
- (void) emitStruct: (instruction_t []) program;
@end
#endif //__Instruction_h