public void Reset() { foreach (var stack in _stacksRegistry.Values) { stack.Clear(); } Heap.Clear(); ObjectHeap.Clear(); WordsList.Clear(); Picture = string.Empty; SetupDefaults(); }
public InterpreterState(Stack stack, FloatingPointStack floatingPointStack, ObjectStack objectStack, ReturnStack returnStack, ExceptionStack exceptionStack, InputSourceStack inputSourceStack, Heap heap, ObjectHeap objectHeap, IWordsList wordsList) { Stack = stack ?? throw new ArgumentNullException(nameof(stack)); FloatingPointStack = floatingPointStack ?? throw new ArgumentNullException(nameof(floatingPointStack)); ObjectStack = objectStack ?? throw new ArgumentNullException(nameof(objectStack)); ReturnStack = returnStack ?? throw new ArgumentNullException(nameof(returnStack)); ExceptionStack = exceptionStack ?? throw new ArgumentNullException(nameof(exceptionStack)); InputSourceStack = inputSourceStack ?? throw new ArgumentNullException(nameof(inputSourceStack)); Heap = heap ?? throw new ArgumentNullException(nameof(heap)); ObjectHeap = objectHeap ?? throw new ArgumentNullException(nameof(objectHeap)); Picture = string.Empty; WordsList = wordsList ?? throw new ArgumentNullException(nameof(wordsList)); _stacksRegistry = new Dictionary <string, IStack>(); RegisterDefaultStacks(); SetupDefaults(); }