//Debugger views
        private void DebugStep(ProgramStack.DebuggerOptions.eBreakOn BreakOn)
        {
            if (_ps == null)
            {
                _ps = new ProgramStack();
                _ps.Debugger.BreakOn          = BreakOn;
                _ps.Debugger.DebuggerCallback = Debugger;

                _ps.Source = tbRun_Source.Text;
                _ps.RunFunction(_ide.ExecutionTree.Functions[tsDebug_Functions.Text]);
            }
            else
            {
                tsDebug_Stop.Enabled    = true;
                tsDebug_StepOut.Enabled = true;
                _ps.Debugger.BreakOn    = BreakOn;
                _ps.RunUntilBreakPoint();
            }
        }
        private void tsDebug_Run_Click(object sender, EventArgs e)
        {
            if (_ps == null)
            {
                _ps = new ProgramStack();
                _ps.Debugger.BreakOn          = ProgramStack.DebuggerOptions.eBreakOn.Breakpoints;
                _ps.Debugger.DebuggerCallback = Debugger;

                _ps.Source = _run_source;
                if (!_ps.RunFunction(_ide.ExecutionTree.Functions[tsDebug_Functions.Text]))
                {
                    return;
                }
            }

            tsDebug_Stop.Enabled    = false;
            tsDebug_StepOut.Enabled = false;
            _ps.Debugger.BreakOn    = ProgramStack.DebuggerOptions.eBreakOn.Breakpoints;
            _ps.RunUntilBreakPoint();
        }
        //Run
        private void butRun_Run_Click(object sender, EventArgs e)
        {
            _run_ps = new ProgramStack();

            _run_ps.Source = _run_source;
            Buffers.RootBuffer.Clear();
            Buffers.NodeBuffer.Clear();
            Buffers.FunctionStackFrameBuffer.Clear();
            Buffers.BlockStackFrameBuffer.Clear();
            var rv = _run_ps.RunFunction(_ide.ExecutionTree.Functions[cbRun_Function.Text]);

            if (rv)
            {
                ssMain_RunStatus.Text = "Running...";
                int duration = Environment.TickCount;
                rv       = _run_ps.RunUntilBreakPoint();
                duration = Environment.TickCount - duration;
                ssMain_RunStatus.Text = string.Format("{0} ({1}ms/{2}ops={3}. Reused: roots {4}%, nodes {5}%, functions {6}%, blocks {7}%)", (rv ? "Success!" : "Failure!"), duration, _run_ps.ExecutionsCount, Math.Round(((double)_run_ps.ExecutionsCount / duration), 0), Math.Round(Buffers.RootBuffer.Reusability() * 100), Math.Round(Buffers.NodeBuffer.Reusability() * 100), Math.Round(Buffers.FunctionStackFrameBuffer.Reusability() * 100), Math.Round(Buffers.BlockStackFrameBuffer.Reusability() * 100));
            }

            cbRun_ShowTree_CheckedChanged(null, null);
        }
        //Debugger views
        private void DebugStep(ProgramStack.DebuggerOptions.eBreakOn BreakOn)
        {
            if (_ps == null)
            {
                _ps = new ProgramStack();
                _ps.Debugger.BreakOn = BreakOn;
                _ps.Debugger.DebuggerCallback = Debugger;

                _ps.Source = tbRun_Source.Text;
                _ps.RunFunction(_ide.ExecutionTree.Functions[tsDebug_Functions.Text]);
            }
            else
            {
                tsDebug_Stop.Enabled = true;
                tsDebug_StepOut.Enabled = true;
                _ps.Debugger.BreakOn = BreakOn;
                _ps.RunUntilBreakPoint();
            }
        }
        //Run
        private void butRun_Run_Click(object sender, EventArgs e)
        {
            _run_ps = new ProgramStack();

            _run_ps.Source = _run_source;
            Buffers.RootBuffer.Clear();
            Buffers.NodeBuffer.Clear();
            Buffers.FunctionStackFrameBuffer.Clear();
            Buffers.BlockStackFrameBuffer.Clear();
            var rv = _run_ps.RunFunction(_ide.ExecutionTree.Functions[cbRun_Function.Text]);
            if (rv)
            {
                ssMain_RunStatus.Text = "Running...";
                int duration = Environment.TickCount;
                rv = _run_ps.RunUntilBreakPoint();
                duration = Environment.TickCount - duration;
                ssMain_RunStatus.Text = string.Format("{0} ({1}ms/{2}ops={3}. Reused: roots {4}%, nodes {5}%, functions {6}%, blocks {7}%)", (rv ? "Success!" : "Failure!"), duration, _run_ps.ExecutionsCount, Math.Round(((double)_run_ps.ExecutionsCount / duration), 0), Math.Round(Buffers.RootBuffer.Reusability() * 100), Math.Round(Buffers.NodeBuffer.Reusability() * 100), Math.Round(Buffers.FunctionStackFrameBuffer.Reusability() * 100), Math.Round(Buffers.BlockStackFrameBuffer.Reusability() * 100));
            }

            cbRun_ShowTree_CheckedChanged(null, null);
        }
        private void tsDebug_Run_Click(object sender, EventArgs e)
        {
            if (_ps == null)
            {
                _ps = new ProgramStack();
                _ps.Debugger.BreakOn = ProgramStack.DebuggerOptions.eBreakOn.Breakpoints;
                _ps.Debugger.DebuggerCallback = Debugger;

                _ps.Source = _run_source;
                if (!_ps.RunFunction(_ide.ExecutionTree.Functions[tsDebug_Functions.Text]))
                    return;
            }

            tsDebug_Stop.Enabled = false;
            tsDebug_StepOut.Enabled = false;
            _ps.Debugger.BreakOn = ProgramStack.DebuggerOptions.eBreakOn.Breakpoints;
            _ps.RunUntilBreakPoint();
        }