2005-05-08 03:44:18 +00:00
|
|
|
#include "BaseContinuation.h"
|
2010-12-16 11:01:49 +00:00
|
|
|
#include "Cons.h"
|
2005-05-08 03:44:18 +00:00
|
|
|
|
|
|
|
instruction_t returninst;
|
|
|
|
BaseContinuation base;
|
|
|
|
|
|
|
|
@implementation BaseContinuation
|
|
|
|
+ (void) initialize
|
|
|
|
{
|
|
|
|
returninst.opcode = RETURN;
|
|
|
|
base = [BaseContinuation new];
|
|
|
|
}
|
|
|
|
+ (id) baseContinuation
|
|
|
|
{
|
|
|
|
return base;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) restoreOnMachine: (Machine) m
|
|
|
|
{
|
|
|
|
[m state].program = &returninst;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) invokeOnMachine: (Machine) m
|
|
|
|
{
|
2010-12-16 11:01:49 +00:00
|
|
|
[m value: [(Cons) [m stack] car]];
|
2005-05-08 03:44:18 +00:00
|
|
|
[m state].program = &returninst;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|