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);
 }
Пример #2
0
 public string Eval()
 {
     return(isMul ?
            (int.Parse(left.Eval()) * int.Parse(right.Eval())).ToString() :
            (int.Parse(left.Eval()) / int.Parse(right.Eval())).ToString());
 }
Пример #3
0
 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);
 }