public bool DoNext() { if (Point >= Commands.Count) { if (!registerEnd) { OnEnded(this, EventArgs.Empty); registerEnd = true; } return(false); } registerEnd = false; if (RamMachineController.GetCommandBehavior(Commands[(int)Point].Type).PreInvoke() == false) { RamMachineController.Invoke(Commands[(int)Point], this); } Point++; LineInvoked++; if (InvokedLimit > 0 && LineInvoked > InvokedLimit) { throw new RamMachineRuntimeException(Point, $"Limit of {InvokedLimit} commands has been approched, the ram machine code can have infinity loop at {Point+1} line", null); } return(true); }
public void Invoke(IRamMachine ram) { RamMachineController.Invoke(this, ram); }