BinaryOperator() 공개 정적인 메소드

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
리턴 void
예제 #1
0
        /// <summary>
        /// Creates a new binary mapping list.
        /// </summary>
        public BinaryOperatorMappingList(String symbol)
        {
            _mapping = new List <BinaryOperatorMapping>();

            //Registers itself
            Register.BinaryOperator(symbol, this);
        }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }