public ProgramState execute(ProgramState programState) { IMyStack<IMyStatement> stack = new WrapperStack<IMyStatement>(); stack.push(statement); IMyDictionary<String, int> copyDictionary = new WrapperDictionary<String, int>(); copyDictionary.addAll(programState.getMyDictionary().getMap()); return new ProgramState(stack, copyDictionary, programState.getOutput(), programState.getHeap(), statement); }
public ProgramState execute(ProgramState programState) { IHeap<int, int> heap = programState.getHeap(); IMyDictionary<String, int> myDictionary = programState.getMyDictionary(); IMyList<String> output = programState.getOutput(); IMyStack<IMyStatement> secondStack = new WrapperStack<IMyStatement>(); ProgramState secondProgramState = new ProgramState(secondStack, myDictionary, output, heap, getStatement()); while (getExpression().eval(myDictionary, heap) != 0) { runAllSteps(secondProgramState); secondStack.push(getStatement()); } return null; }