quakeforge/ruamoko/scheme/Instruction.h
Brian Koropoff adba6b26dc Scheme updates:
- Boolean type (no support in lexer yet)
	- Conditionals
	- Defines (only work correctly at top level)
	- More core builtins (apply, cons, car, cdr)
	- Variable-argument functions
	- Incremental garbage collection
	- Garbage collection fixes
	- Other misc bugs fixed
2005-05-06 23:25:06 +00:00

51 lines
936 B
Objective-C

#ifndef __Instruction_h
#define __Instruction_h
#include "SchemeObject.h"
typedef enum {
LABEL,
PUSH,
POP,
MAKECLOSURE,
MAKECONT,
LOADENV,
LOADLITS,
MAKEENV,
GET,
SET,
SETREST,
SETSTACK,
GETLINK,
GETGLOBAL,
SETGLOBAL,
CALL,
RETURN,
IFFALSE,
GOTO
} 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