public void EndScope() { if (CurrentScope.Parent == null) { throw new SprakInternalRuntimeException("Cannot end root scope"); } CurrentScope = CurrentScope.Parent; FrameDebugInfo.Peek().Scope = CurrentScope; }
public void Reset() { Values.Clear(); Frames.Clear(); FrameDebugInfo.Clear(); CurrentScope = new ExecutionScope(); MainFrame.Scope = CurrentScope; FrameDebugInfo.Push(MainFrame); }
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); }
public ExecutionContext(Computer computer, SignatureResolver resolver) { Computer = computer; SignatureResolver = resolver; Instructions = new InstructionEnumerator(); FrameDebugInfo mainFrame = new FrameDebugInfo(Instructions, FunctionSignature.Main); Memory = new Memory(new SprakConverter(resolver, this), mainFrame); Reset(); }
public void BeginScope(bool inherit) { CurrentScope = new ExecutionScope(CurrentScope, inherit); FrameDebugInfo.Peek().Scope = CurrentScope; }
public Memory(SprakConverter converter, FrameDebugInfo mainFrame) { _converter = converter; MainFrame = mainFrame; }