public int Run(int label, Dictionary <string, int> env, Program p) { var ne = new Dictionary <string, int>(env); ne[var] = exp.Eval(env); return(p.GetCommand(label + 1).Run(label + 1, ne, p)); }
public int Run(int label, Dictionary <string, int> env, Program p) { var v = cond.Eval(env); if (v == 0) { return(p.GetCommand(falseLabel).Run(falseLabel, env, p)); } else { return(p.GetCommand(trueLabel).Run(trueLabel, env, p)); } }
public double Eval(Dictionary <char, double> variablesValue) => _left.Eval(variablesValue) + _right.Eval(variablesValue);
public void ConstEvalTest1() => Assert.Equal(7, _constExpr1.Eval());
public int Eval(Dictionary <string, int> env) { return(op(left.Eval(env), right.Eval(env))); }
public int Eval(Dictionary <string, int> env) { return(op(exp.Eval(env))); }
public int Run(int label, Dictionary <string, int> env, Program p) { return(value.Eval(env)); }
public double Eval(Dictionary <char, double> variablesValue) { return(Math.Pow(_base.Eval(variablesValue), _power.Eval(variablesValue))); }
public double Eval(Dictionary <char, double> variablesValue) => _expr.Eval(variablesValue) * -1;