mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
35 lines
752 B
R
35 lines
752 B
R
|
#include "Continuation.h"
|
||
|
#include "defs.h"
|
||
|
|
||
|
@implementation Continuation
|
||
|
+ (id) newWithState: (state_t []) st environment: (Frame) e continuation: (Continuation) c pc: (integer) p
|
||
|
{
|
||
|
return [[self alloc] initWithState: st environment: e continuation: c pc: p];
|
||
|
}
|
||
|
- (id) initWithState: (state_t []) st environment: (Frame) e continuation: (Continuation) c pc: (integer) p
|
||
|
{
|
||
|
self = [self init];
|
||
|
state.program = st.program;
|
||
|
state.pc = p;
|
||
|
state.literals = st.literals;
|
||
|
state.stack = st.stack;
|
||
|
cont = c;
|
||
|
env = e;
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
- (void) invokeOnMachine: (Machine) m
|
||
|
{
|
||
|
[m state: &state];
|
||
|
[m environment: env];
|
||
|
[m continuation: cont];
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
- (string) printForm
|
||
|
{
|
||
|
return "<continuation>";
|
||
|
}
|
||
|
|
||
|
@end
|