public T ExeStackPop() { T s; try { s = exeStack.Pop(); } catch (DataTypesException e) { Console.WriteLine(e.StackTrace); throw new ExpException("Error at exeStackPop"); } return s; }
public ProgramState OneStep(ProgramState prgState) { MyIStack <IStatement> exeStack = prgState.getExecutionStack(); if (exeStack.IsEmpty()) { throw new Exception("stack is empty"); } return(exeStack.Pop().Execute(prgState)); }
public PrgState OneStep(PrgState state) { MyIStack <IStmt> stk = state.GetExeStack(); if (stk.IsEmpty()) { throw new MyException("Stack is empty"); } IStmt crtStmt = stk.Pop(); return(crtStmt.Execute(state)); }
private ProgramState ExecuteOneStep(ProgramState programState) { MyIStack <IStatement> executionStack = programState.ExecutionStack; if (executionStack.IsEmpty) { throw new InterpreterControllerException("Execution stack is empty!"); } IStatement current = executionStack.Pop(); return(current.Execute(programState)); }
public ProgramState OneStep(ProgramState state) { MyIStack <IStatement> st = state.GetExeStack(); try { IStatement currentStatement = st.Pop(); return(currentStatement.Execute(state)); } catch (EmptyMyStackException) { throw new MyStatementExecutionException("Exception. Execution stack is empty."); } }
public PrgState OneStep() { IStmt crtStmt = null; if (exeStack.IsEmpty()) { Console.Write("empty stack!! \n"); return(null); } else { crtStmt = exeStack.Pop(); } return(crtStmt.Execute(this)); }