public static BinaryOperator ( String symbol, |
||
symbol | String | The symbol of the operator, e.g., +. |
list | The BinaryMapping list of the operator | |
리턴 | void |
/// <summary> /// Creates a new binary mapping list. /// </summary> public BinaryOperatorMappingList(String symbol) { _mapping = new List <BinaryOperatorMapping>(); //Registers itself Register.BinaryOperator(symbol, this); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }