BinaryOperator() public static méthode

Provides registration of operator's Mappings list
public static BinaryOperator ( String symbol, BinaryOperatorMappingList list ) : void
symbol String The symbol of the operator, e.g., +.
list BinaryOperatorMappingList The BinaryMapping list of the operator
Résultat void
Exemple #1
0
        /// <summary>
        /// Creates a new binary mapping list.
        /// </summary>
        public BinaryOperatorMappingList(String symbol)
        {
            _mapping = new List <BinaryOperatorMapping>();

            //Registers itself
            Register.BinaryOperator(symbol, this);
        }
Exemple #2
0
 /// <summary>
 /// Helper for registering a modulo operator.
 /// </summary>
 /// <param name="left">The type on the left side.</param>
 /// <param name="right">The type on the right side.</param>
 /// <param name="mod">The function to execute.</param>
 protected static void RegisterModulo(Type left, Type right, Func <Value, Value, Value> mod)
 {
     Register.BinaryOperator(ModuloOperator.Symbol, left, right, mod);
 }
Exemple #3
0
 /// <summary>
 /// Helper for registering a member operator.
 /// </summary>
 /// <param name="left">The type on the left side.</param>
 /// <param name="right">The type on the right side.</param>
 /// <param name="member">The function to execute.</param>
 protected static void RegisterMember(Type left, Type right, Func <Value, Value, Value> member)
 {
     Register.BinaryOperator(MemberOperator.Symbol, left, right, member);
 }
Exemple #4
0
 /// <summary>
 /// Helper for registering a power operator.
 /// </summary>
 /// <param name="left">The type on the left side.</param>
 /// <param name="right">The type on the right side.</param>
 /// <param name="power">The function to execute.</param>
 protected static void RegisterPower(Type left, Type right, Func <Value, Value, Value> power)
 {
     Register.BinaryOperator(PowerOperator.Symbol, left, right, power);
 }
Exemple #5
0
 /// <summary>
 /// Helper for registering a minus operator.
 /// </summary>
 /// <param name="left">The type on the left side.</param>
 /// <param name="right">The type on the right side.</param>
 /// <param name="sub">The function to execute.</param>
 protected static void RegisterMinus(Type left, Type right, Func <Value, Value, Value> sub)
 {
     Register.BinaryOperator(MinusOperator.Symbol, left, right, sub);
 }
Exemple #6
0
 /// <summary>
 /// Helper for registering a division operator.
 /// </summary>
 /// <param name="left">The type on the left side.</param>
 /// <param name="right">The type on the right side.</param>
 /// <param name="divide">The function to execute.</param>
 protected static void RegisterDivide(Type left, Type right, Func <Value, Value, Value> divide)
 {
     Register.BinaryOperator(RightDivideOperator.Symbol, left, right, divide);
 }
Exemple #7
0
 /// <summary>
 /// Helper for registering a multiplication operator.
 /// </summary>
 /// <param name="left">The type on the left side.</param>
 /// <param name="right">The type on the right side.</param>
 /// <param name="multiply">The function to execute.</param>
 protected static void RegisterMultiply(Type left, Type right, Func <Value, Value, Value> multiply)
 {
     Register.BinaryOperator(MultiplyOperator.Symbol, left, right, multiply);
 }
Exemple #8
0
 /// <summary>
 /// Helper for registering a plus operator.
 /// </summary>
 /// <param name="left">The type on the left side.</param>
 /// <param name="right">The type on the right side.</param>
 /// <param name="add">The function to execute.</param>
 protected static void RegisterPlus(Type left, Type right, Func <Value, Value, Value> add)
 {
     Register.BinaryOperator(PlusOperator.Symbol, left, right, add);
 }