CSE.CsEval.Eval C# (CSharp) Метод

Eval() публичный статический Метод

Used for delayed or continuous evaluation. Use this when you want to parse the expression first and evaluate it later. Or for when the same expression needs to be evaluated several times. CsEvaluator instance comes from CsEval.GetEvaluator.
public static Eval ( CsEvaluator evaluator ) : object
evaluator CsEvaluator The CsEvaluator returned from a call to CsEval.GetEvaluator
Результат object
    public static object Eval(CsEvaluator evaluator) {
      if (CsEval.EvalEnvironment == null)
        throw new Exception("CsEval.EvalEnvironment must be set first. " +
                      "Please refer to http://www.csharp-eval.com/HowTo.php for more information");

      try {
        object result = evaluator.parser.exp().Value;
        return result;
      }
      catch (Antlr.Runtime.RecognitionException re) {
        if (re.Token.Type == CseParser.SEMI)
          throw new Exception("Parsing Error At EOL");
        else
          throw new Exception(String.Format("Parsing Error At \"{0}\"", re.Token.Text));
      }
      catch (Exception npe) {
        throw new Exception("Internal error: " + npe.Message);
      }
    }

Same methods

CsEval::Eval ( object evalEnvironment, string data ) : object
CsEval::Eval ( string data ) : object