Esempio n. 1
0
 public static Expression NewNumOperator(TokenType tokenType, Expression expression1, Expression expression2)
 {
     if (tokenType == TokenType.Plus && expression1.Type == typeof(string))
     {
         return(new StrConcatOperator(Validator.CheckType <IExpression <string> >(expression1), Validator.CheckType <IExpression <string> >(expression2)));
     }
     else
     {
         return(new NumOperator(tokenType, Validator.CheckType <IExpression <double> >(expression1), Validator.CheckType <IExpression <double> >(expression2)));
     }
 }
Esempio n. 2
0
 public static Expression NewCompareOperator(TokenType tokenType, Expression expression1, Expression expression2)
 {
     if (expression1.Type == typeof(double))
     {
         return(new CompareOperator <double>(tokenType, Validator.CheckType <IExpression <double> >(expression1), Validator.CheckType <IExpression <double> >(expression2)));
     }
     else if (expression1.Type == typeof(string))
     {
         return(new CompareOperator <string>(tokenType, Validator.CheckType <IExpression <string> >(expression1), Validator.CheckType <IExpression <string> >(expression2)));
     }
     else
     {
         return(new CompareOperator <bool>(tokenType, Validator.CheckType <IExpression <bool> >(expression1), Validator.CheckType <IExpression <bool> >(expression2)));
     }
 }
Esempio n. 3
0
 public UnaryNotOperator(Expression expression)
 {
     this.expression = Validator.CheckType <IExpression <bool> >(expression);
 }
Esempio n. 4
0
 public static Expression NewBoolOperator(TokenType tokenType, Expression expression1, Expression expression2)
 {
     return(new BoolOperator(tokenType, Validator.CheckType <IExpression <bool> >(expression1), Validator.CheckType <IExpression <bool> >(expression2)));
 }
Esempio n. 5
0
 public UnaryMinusOperator(Expression expression)
 {
     this.expression = Validator.CheckType <IExpression <double> >(expression);
 }