public PrgState execute(PrgState state) { MyIStack <IStmt> stk = state.getExeStack(); // stk.pop(); MyIDictionary <String, int> symTbl = state.getSymTable(); IFileTable <int, FileTuple> fileTbl = state.getFileTable(); int value_exp = this.exp_file_id.eval(symTbl); FileTuple ft = fileTbl.getValue(value_exp); if (!fileTbl.isDefined(value_exp)) { throw new Exception("The key is not defined in the file table"); } StreamReader streamReader = fileTbl.getValue(value_exp).getStreamReader(); try { streamReader.Close(); } catch (IOException ex) { throw new Exception(ex.Message); } fileTbl.remove(value_exp); return(state); }
public ProgramState(MyIStack <IStatement> executionStack, MyIDictionary <string, int> symbolTable, MyIList <int> output) { this.executionStack = executionStack; this.symbolTable = symbolTable; this.output = output; }
public PrgState oneStep(PrgState state) { MyIStack <IStmt> stk = state.getStk(); IStmt crtStmt = stk.pop(); return(crtStmt.execute(state)); }
public PrgState oneStep(PrgState state) { MyIStack <IStmt> stk = state.getExeStack(); try { if (stk.empty()) { throw new Exception("Empty stack"); } IStmt crtStmt = stk.pop(); PrgState newState = crtStmt.execute(state); if (flag == 1) { this.displayCrtPrgState(newState); } //repo.logPrgStateExec(); return(newState); } catch (Exception ex) { throw new Exception(ex.Message); } }
public ProgState execute(ProgState prog) { MyIStack <IStmt> stk = prog.getStk(); stk.push(st2); stk.push(st1); return(prog); }
public PrgState execute(PrgState state) { MyIStack <IStmt> stk = state.getStk(); stk.push(second); stk.push(first); return(null); }
public PrgState(MyIStack <IStmt> exeStack, MyIDictionary <string, int> symTable, MyIList <int> output, MyIFileDictionary <int, KeyValuePair <string, StreamReader> > fileTable, IStmt prg) { this.exeStack = exeStack; this.symTable = symTable; this.output = output; this.fileTable = fileTable; exeStack.push(prg); }
public PrgState(MyIStack <IStmt> stk, MyIDictionary <String, int> symtbl, MyIList <int> ot, MyIDictionary <int, MyPair <String, StreamReader> > fT, IStmt prg) { exeStack = stk; symTable = symtbl; outList = ot; fileTable = fT; exeStack.Push(prg); }
public ProgramState(IStatement statement) { executionStack = new MyStack <IStatement>(new Stack <IStatement>()); executionStack.Push(statement); symbolTable = new MyDictionary <string, int>(new Dictionary <string, int>()); outputList = new MyList <int>(new List <int>()); fileTable = new MyDictionary <int, Tuple <string, TextReader> >(new Dictionary <int, Tuple <string, TextReader> >()); }
public PrgState(IStmt prg) { exeStack = new MyStack <IStmt>(new Stack <IStmt>()); exeStack.push(prg); symTable = new MyDictionary <string, int>(new Dictionary <string, int>()); outList = new MyList <int>(new List <int>()); fileTable = new MyDictionary <int, Tuple <string, TextReader> >(new Dictionary <int, Tuple <string, TextReader> >()); }
public ProgramState Execute(ProgramState state) { MyIStack <IStatement> stack = state.getExecutionStack(); stack.Push(second); stack.Push(first); return(null); }
public PrgState execute(PrgState prgState) { MyIStack <IStmt> stk = prgState.getExeStack(); stk.push(second); stk.push(first); return(prgState); }
public ProgState(MyIStack <IStmt> stk, MyIDictionary <string, int> dict, MyIList <int> list, MyIFileTable <Tuple> fileT, IStmt prog) { this.stk = stk; this.dict = dict; this.list = list; this.fileT = fileT; stk.push(prog); }
public PrgState execute(PrgState state) { MyIStack <IStmt> stk = state.getExeStack(); stk.push(snd); stk.push(first); return(state); }
public ProgramState Execute(ProgramState state) { MyIStack <IStatement> st = state.GetExeStack(); st.Push(this.second); st.Push(this.first); return(null); }
public PrgState(MyIStack<T> stk, MyIDictionary symtbl, MyIList ot, MyIHeap heap, int id) { exeStack = stk; @out = ot; symTable = symtbl; mHeap = heap; mId = id; }
public PrgState(IStmt prg) { this.exeStack = new MyStack <IStmt>(); this.symTable = new MyDictionary <String, int>(); this.outTbl = new MyList <int>(); this.originalProgram = prg.deepCopy(); this.fileTable = new FileTable <int, FileTuple>(); this.exeStack.push(prg); }
public ProgramState Execute(ProgramState programState) { MyIStack <IStatement> executionStack = programState.ExecutionStack; executionStack.Push(second); executionStack.Push(first); return(programState); }
public PrgState(IStmt prg) { exeStack = new MyStack <IStmt>(); symTable = new MyDictionary <string, int>(); outList = new MyList <int>(); fileTable = new MyFileTable <int, Tuple <string, StreamReader> >(); originalProgram = prg; exeStack.push(prg); }
public PrgState() { id = 0; exeStack = null; symTable = null; output = null; originalProgram = null; heap = null; }
public PrgState(MyIStack <IStmt> stk, MyIDictionary <string, int> symtbl, MyIList <int> ot, IFileTable <int, FileTuple> fileTable, IStmt prg) { this.exeStack = stk; this.symTable = symtbl; this.outTbl = ot; this.originalProgram = prg.deepCopy(); this.fileTable = fileTable; this.exeStack.push(prg); }
public PrgState Execute(PrgState state) { MyIStack <IStmt> stk = state.GetStk(); stk.Push(this.snd); stk.Push(this.first); return(null); }
public PrgState <T> Execute <T>(PrgState <T> state) { MyIStack <T> stk = state.GetStk(); stk.Push((T)mSecond); stk.Push((T)mFirst); return(null); }
public PrgState oneStep(PrgState prgState) { MyIStack <IStmt> exeStack = prgState.getExeStack(); if (exeStack.isEmpty()) { throw new Exception("stack is empty"); } return(exeStack.pop().execute(prgState)); }
public PrgState(MyIStack <IStmt> stk, Stack <MyIDictionary <MyMap> > symtbl, MyIList <int> otp, IStmt crtstm, IHeap <HMap> h) { id++; exeStack = stk; symTable = symtbl; output = otp; originalProgram = crtstm; exeStack.Push(crtstm); heap = h; }
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)); }
public ProgramState(MyIStack <IStatement> exeStack, MyIDictionary <string, int> symTab, MyIList <int> outList, MyIDictionary <int, MyPair <string, StreamReader> > fileTab, IStatement originalProgram) { this.exeStack = exeStack; this.symTab = symTab; this.outList = outList; this.fileTab = fileTab; this.originalProgram = originalProgram; this.exeStack.Push(originalProgram); }
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."); } }