public bool Run() { if (int.Parse(flag.Eval()) > 0) { foreach (var statement in Children) { var run_flag = statement.Run(); if (!run_flag) { return(false); } } } return(true); }
public string Eval() { return(isMul ? (int.Parse(left.Eval()) * int.Parse(right.Eval())).ToString() : (int.Parse(left.Eval()) / int.Parse(right.Eval())).ToString()); }
public string Eval() { return(isAdd ? (int.Parse(left.Eval()) + int.Parse(right.Eval())).ToString() : (int.Parse(left.Eval()) - int.Parse(right.Eval())).ToString()); }
public bool Run() { VariableManager.RESULT = expr.Eval(); return(true); }