C# Class CSE.CsEval

Main class for evaluating expressions
Mostra file Open project: kcherr1/CSharp-Eval

Public Methods

Method Description
Eval ( CsEvaluator evaluator ) : object

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.

Eval ( object evalEnvironment, string data ) : object

Used for quick evaluation. Use this when the evaluation environment changes often. If the environment is consistent, set CsEval.EvalEnvironment then call CsEval.Eval(string data).

Eval ( string data ) : object

Used for normal evaluation.

GetEvaluator ( string data ) : CsEvaluator

Gets a CsEvaluator object for the expression

Method Details

Eval() public static method

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
return object

Eval() public static method

Used for quick evaluation. Use this when the evaluation environment changes often. If the environment is consistent, set CsEval.EvalEnvironment then call CsEval.Eval(string data).
public static Eval ( object evalEnvironment, string data ) : object
evalEnvironment object /// Provides an evaluation environment for the given expression. /// The stored evaluation environment is temporarily replaced /// when the given statement is evaluated and restored afterwards. ///
data string The expression to evaluate
return object

Eval() public static method

Used for normal evaluation.
public static Eval ( string data ) : object
data string The expression to evaluate
return object

GetEvaluator() public static method

Gets a CsEvaluator object for the expression
public static GetEvaluator ( string data ) : CsEvaluator
data string Expression to evaluate
return CsEvaluator