C# Class YAMP.BinaryOperator

The abstract base class for any binary operator (+, -, *, ...).
Inheritance: Operator
Mostrar archivo Open project: FlorianRappl/YAMP Class Usage Examples

Public Methods

Method Description
BinaryOperator ( String op, Int32 level ) : System

Creates a new binary operator.

Evaluate ( Expression expressions, Value>.IDictionary symbols ) : Value

The implementation of the more general evaluate method.

Handle ( Expression left, Expression right, Value>.IDictionary symbols ) : Value

Handles the evaluation of two expressions.

Perform ( Value left, Value right ) : Value

Performs the operation with the 2 evaluated values.

PerformOverFind ( Value left, Value right, BinaryOperatorMappingList mapping ) : Value

Performs the operation from finding the operator in the mapping.

TryPerformOverFind ( Value left, Value right, BinaryOperatorMappingList mapping, Value &value ) : System.Boolean

Tries to perform the operation from finding the operator in the mapping.

Method Details

BinaryOperator() public method

Creates a new binary operator.
public BinaryOperator ( String op, Int32 level ) : System
op String The operator string.
level System.Int32 The operator level.
return System

Evaluate() public method

The implementation of the more general evaluate method.
public Evaluate ( Expression expressions, Value>.IDictionary symbols ) : Value
expressions Expression The array of expressions, binary operators require Length == 2.
symbols Value>.IDictionary The external symbols to consider.
return Value

Handle() public method

Handles the evaluation of two expressions.
public Handle ( Expression left, Expression right, Value>.IDictionary symbols ) : Value
left Expression The expression on the left.
right Expression The expression on the right.
symbols Value>.IDictionary The external symbols to consider.
return Value

Perform() public abstract method

Performs the operation with the 2 evaluated values.
public abstract Perform ( Value left, Value right ) : Value
left Value The left value.
right Value The right value.
return Value

PerformOverFind() public method

Performs the operation from finding the operator in the mapping.
public PerformOverFind ( Value left, Value right, BinaryOperatorMappingList mapping ) : Value
left Value
right Value
mapping BinaryOperatorMappingList
return Value

TryPerformOverFind() public static method

Tries to perform the operation from finding the operator in the mapping.
public static TryPerformOverFind ( Value left, Value right, BinaryOperatorMappingList mapping, Value &value ) : System.Boolean
left Value
right Value
mapping BinaryOperatorMappingList
value Value
return System.Boolean