Пример #1
0
        public FrameDebugInfo(InstructionEnumerator instructions,
                              FunctionSignature signature, ExecutionScope scope = null)
        {
            _instructions = instructions;

            FunctionSignature = signature;
            Scope             = scope;
        }
Пример #2
0
        public void EndScope()
        {
            if (CurrentScope.Parent == null)
            {
                throw new SprakInternalRuntimeException("Cannot end root scope");
            }

            CurrentScope = CurrentScope.Parent;

            FrameDebugInfo.Peek().Scope = CurrentScope;
        }
Пример #3
0
        public void Reset()
        {
            Values.Clear();
            Frames.Clear();
            FrameDebugInfo.Clear();

            CurrentScope = new ExecutionScope();

            MainFrame.Scope = CurrentScope;
            FrameDebugInfo.Push(MainFrame);
        }
Пример #4
0
        public void BeginFrame(int index, FunctionSignature debugSignature)
        {
            Memory.FrameDebugInfo.Peek().FixLocation();

            ExecutionScope debugScope = Memory.CurrentScope;
            FrameDebugInfo debugInfo  = new FrameDebugInfo(Instructions, debugSignature, debugScope);

            Memory.Frames.Push(Instructions.Index + 1);
            Instructions.Jump(index);

            Memory.FrameDebugInfo.Push(debugInfo);
        }
Пример #5
0
 public ExecutionScope(ExecutionScope parent, bool inherit)
 {
     Parent   = parent;
     Global   = parent.Global;
     _inherit = inherit;
 }
Пример #6
0
 public ExecutionScope()
 {
     Parent   = null;
     Global   = this;
     _inherit = false;
 }
Пример #7
0
        public void BeginScope(bool inherit)
        {
            CurrentScope = new ExecutionScope(CurrentScope, inherit);

            FrameDebugInfo.Peek().Scope = CurrentScope;
        }