private void _DoBinaryOperation(string Operator, CTypeSign Signed)
{
switch (Operator)
{
case "+": SafeILGenerator.BinaryOperation(Signed == CTypeSign.Signed ? SafeBinaryOperator.AdditionSigned : SafeBinaryOperator.AdditionUnsigned); break;
case "-": SafeILGenerator.BinaryOperation(Signed == CTypeSign.Signed ? SafeBinaryOperator.SubstractionSigned : SafeBinaryOperator.SubstractionUnsigned); break;
case "*": SafeILGenerator.BinaryOperation(Signed == CTypeSign.Signed ? SafeBinaryOperator.MultiplySigned : SafeBinaryOperator.MultiplyUnsigned); break;
case "/": SafeILGenerator.BinaryOperation(Signed == CTypeSign.Signed ? SafeBinaryOperator.DivideSigned : SafeBinaryOperator.DivideUnsigned); break;
case "%": SafeILGenerator.BinaryOperation(Signed == CTypeSign.Signed ? SafeBinaryOperator.RemainingSigned : SafeBinaryOperator.RemainingUnsigned); break;
case "&": SafeILGenerator.BinaryOperation(SafeBinaryOperator.And); break;
case "|": SafeILGenerator.BinaryOperation(SafeBinaryOperator.Or); break;
case "^": SafeILGenerator.BinaryOperation(SafeBinaryOperator.Xor); break;
case "<<": SafeILGenerator.BinaryOperation(SafeBinaryOperator.ShiftLeft); break;
case ">>": SafeILGenerator.BinaryOperation(Signed == CTypeSign.Signed ? SafeBinaryOperator.ShiftRightSigned : SafeBinaryOperator.ShiftRightUnsigned); break;
case "&&": SafeILGenerator.BinaryOperation(SafeBinaryOperator.And); break;
case "||": SafeILGenerator.BinaryOperation(SafeBinaryOperator.Or); break;
case "<": SafeILGenerator.CompareBinary(Signed == CTypeSign.Signed ? SafeBinaryComparison.LessThanSigned : SafeBinaryComparison.LessThanUnsigned); break;
case ">": SafeILGenerator.CompareBinary(Signed == CTypeSign.Signed ? SafeBinaryComparison.GreaterThanSigned : SafeBinaryComparison.GreaterThanUnsigned); break;
case "<=": SafeILGenerator.CompareBinary(Signed == CTypeSign.Signed ? SafeBinaryComparison.LessOrEqualSigned : SafeBinaryComparison.LessOrEqualUnsigned); break;
case ">=": SafeILGenerator.CompareBinary(Signed == CTypeSign.Signed ? SafeBinaryComparison.GreaterOrEqualSigned : SafeBinaryComparison.GreaterOrEqualUnsigned); break;
case "==": SafeILGenerator.CompareBinary(SafeBinaryComparison.Equals); break;
case "!=": SafeILGenerator.CompareBinary(SafeBinaryComparison.NotEquals); break;
default: throw (new NotImplementedException(String.Format("Operator {0} not implemented", Operator)));
}
}