public Execute ( AbstractMachineState state ) : void | ||
state | AbstractMachineState | |
return | void |
public override void Execute(AbstractMachineState state)
{
AMProgram program = (AMProgram)state.Program;
program.CP = state.E.CP;
state.E = state.E.CE;
program.Next();
}
public void Deallocate() { AbstractMachineState state = SetupMachine(); AMProgram program = (AMProgram)state.Program; ProgramNode CP = new ProgramNode(); EnvironmentFrame env = new EnvironmentFrame(); state.E = new EnvironmentFrame(env, CP, 2); DeallocateInstruction i = new DeallocateInstruction(); i.Execute(state); Assert.AreEqual("deallocate", i.Name()); Assert.AreEqual(0, i.NumberOfArguments()); Assert.AreSame(CP, program.CP); Assert.AreSame(env, state.E); }