ImplicitConvert() static private method

static private ImplicitConvert ( Expression expression, Type expectedType ) : Expression
expression System.Linq.Expressions.Expression
expectedType System.Type
return System.Linq.Expressions.Expression
Ejemplo n.º 1
0
 /// <summary>
 /// Reduces this node to a simpler expression, with (if possible) additional symbol tables.
 /// </summary>
 /// <param name="expression">The reducing expression.</param>
 /// <param name="symbols">The additional symbol table for reducing. If <paramref name="expression"/> is not <see cref="YacqExpression"/>, this parameter is ignored.</param>
 /// <param name="expectedType">The type which is expected as the type of reduced expression.</param>
 /// <returns>The reduced expression.</returns>
 public static Expression Reduce(this Expression expression, SymbolTable symbols, Type expectedType = null)
 {
     return(expression != null
         ? expression is YacqExpression
               ? ((YacqExpression)expression).Reduce(symbols, expectedType)
               : YacqExpression.ImplicitConvert(expression, expectedType)
         : null);
 }