public String toString() { return("SWITCH(" + op.ToString() + ") " + " case " + opCase1.ToString() + ": " + case1.ToString() + " case " + opCase2.ToString() + ": " + case2.ToString() + " default: " + defaultCase.ToString()); }
public override string ToString() { return("ExeStack:" + exeStack.ToString() + "\n" + "SymTable:" + symTable.ToString() + "\n" + "Out:" + outTbl.ToString() + "\n" + "FileTable:" + fileTable.ToString() + "\n" + "OriginalProgram:" + originalProgram.ToString() + "\n"); }
private void button1_Click(object sender, EventArgs e) { StmtMenu m = new StmtMenu(); m.ShowDialog(); prg = m.GetPrg(); this.textBox1.Text = prg.ToString(); ctr = new Controller <IStmt>(prg); }
public void UiInput() { StmtMenu(); IStmt stmt = AddStmt(GetInputString()); Console.WriteLine("You've added to program: "); Console.WriteLine(stmt.ToString()); ctrl.Add(stmt); }
protected void newTouched(object sender, EventArgs e) { IStmt prgStatement = new CompStmt(new AssignStmt("v", new ConstExp(0)), new CompStmt(new RepeatStmt(new CompStmt(new ForkStmt(new CompStmt(new PrintStmt(new VarExp("v")), new AssignStmt("v", new ArithExp(new VarExp("v"), "+", new ConstExp(1))))), new AssignStmt("v", new ArithExp(new VarExp("v"), "+", new ConstExp(1)))), new RelationalExp(new VarExp("v"), "==", new ConstExp(3))), new CompStmt(new SkipStmt(), new CompStmt(new SkipStmt(), new CompStmt(new SkipStmt(), new PrintStmt(new ArithExp(new VarExp("v"), "*", new ConstExp(10)))))))); IStmt stmt = prgStatement; //newStatement("First Statement:"); //prgStatement; // List <PrgState> programs = new List <PrgState>(); programs.Add(new PrgState(new MyLibraryStack <IStmt>(), new MyLibraryDictionary <string, int>(), new MyLibraryHeap <int>(), new MyLibraryList <int>(), stmt)); ctrl.PrgList = programs; textview.Buffer.Text = stmt.ToString(); }
public ProgState onestep(ProgState prog) { MyIStack <IStmt> stk = prog.getStk(); try { stk.isEmpty(); } catch (StackExceptions) { throw new StmtExecException("The program is over!!! \n"); } IStmt st = stk.pop(); if (flag == 1) { System.Console.WriteLine(st.ToString()); } try { return(st.execute(prog)); } catch (ControllerException e) { throw new StmtExecException(e); } }
public override String ToString() { string s = "Execution Stack: "; s += System.Environment.NewLine; s += exeStack.ToString(); s += "Symbol Table: "; s += System.Environment.NewLine; s += symTable.ToString(); s += "Messages: "; s += System.Environment.NewLine; s += messages.ToString(); s += "File table: "; s += System.Environment.NewLine; s += fileTable.ToString(); s += "Original program: "; s += System.Environment.NewLine; s += originalPrg.ToString(); s += System.Environment.NewLine; s += "--------------------------------------------------------------------"; return(s); }
public override String ToString() { return("if ( " + exp.ToString() + " ) then ( " + thenStmt.ToString() + ")"); }
private void button2_Click(object sender, EventArgs e) { prg = new AssignStmt(GetString(), GetExp()); this.textBox1.Text = prg.ToString(); Close(); }
private void button1_Click(object sender, EventArgs e) { prg = new CompStmt(ShowMenu(), ShowMenu()); this.textBox1.Text = prg.ToString(); Close(); }
public void Init() { stmt = new CompStmt(new AssignStmt("a", new ArithExpr(new ConstExpr(2), "*", new ConstExpr(3))), new PrintStmt(new ConstExpr(33))); Assert.AreEqual("( a = 2 * 3; print( 33 ) )", stmt.ToString()); }
public override string ToString() { return("IF(" + mExp.ToString() + ")THEN(" + mThenS.ToString() + ")ELSE(" + mElseS.ToString() + ")"); }
public override string ToString() { return("While( " + exp.ToString() + ") { " + stmt.ToString() + " }"); }
public override string ToString() { return("IF(" + exp.ToString() + ")THEN(" + thenS.ToString() + ")"); }
public override string ToString() { return(" forkStmt ( " + mStmt.ToString() + " ) "); }
public override String ToString() { return("WHILE " + exp.ToString() + " THEN(" + statement.ToString() + ") "); }
public override string ToString() { return("IF(" + condition.ToString() + ") THEN (" + thenS.ToString() + ") ELSE (" + elseS.ToString() + ")"); }
public override string ToString() { return("repeat (" + stmt.ToString() + ") until " + exp.ToString() + ""); }
public override string ToString() { return("SWITCH (" + mVarExp.ToString() + ") CASE (" + mExp1.ToString() + "): " + mStatement1.ToString() + " CASE (" + mExp2.ToString() + "): " + mStatement2.ToString() + " DEFAULT: " + mStatement3.ToString()); }
public override String ToString() { return("( If " + expr.ToString() + " then " + ifs.ToString() + " else " + elses.ToString() + ")"); }
public void Init() { stmt = new PrintStmt(new ArithExpr(new ConstExpr(3), "+", new ConstExpr(4))); Assert.AreEqual("print( 3 + 4 )", stmt.ToString()); }
public void Init() { stmt = new IfStmt(new VarExpr("a"), new AssignStmt("v", new ConstExpr(2)), new AssignStmt("v", new ConstExpr(3))); Assert.AreEqual("If a then v = 2 else v = 3", stmt.ToString()); }
public override string ToString() { return("If " + expr.ToString() + " then " + stmt1.ToString() + " else " + stmt2.ToString()); }
public override String ToString() { return("fork( " + stm.ToString() + ")"); }
public override String ToString() { return("fork(" + forkStmt.ToString() + ")"); }
public override String ToString() { return("IF (" + exp.ToString() + ") THEN (" + thenS.ToString() + ") ELSE (" + elseS.ToString() + ")"); }
public override String ToString() { return("Switch (" + var.ToString() + ") case (" + exp1.ToString() + "): " + stm1.ToString() + "case (" + exp2.ToString() + "):" + stm2.ToString() + "default: " + stm3.ToString()); }
public void Init() { stmt = new AssignStmt("a", new ArithExpr(new ConstExpr(2), "*", new ConstExpr(3))); Assert.AreEqual("a = 2 * 3", stmt.ToString()); }
public override String ToString() { return("(" + first.ToString() + ";" + snd.ToString() + ")"); }
public override string ToString() { return(first.ToString() + "; " + second.ToString()); }