示例#1
0
 /// <summary>
 /// Creates a chained <see cref="DispatchExpression"/> that represents the member-reference dispatching.
 /// </summary>
 /// <param name="left">An <see cref="Expression"/> that representts the receiver or static reference for dispatching.</param>
 /// <param name="name">The name to use for dispatching.</param>
 /// <returns>A chained member-reference <see cref="DispatchExpression"/> that has the properties set to the specified values.</returns>
 public static DispatchExpression Member(
     this Expression left,
     String name
     )
 {
     return(YacqExpression.Dispatch(DispatchTypes.Member, left, name));
 }
示例#2
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);
 }
示例#3
0
 /// <summary>
 /// Creates a <see cref="DispatchExpression"/> that represents the method-call dispatching.
 /// </summary>
 /// <param name="left">An <see cref="Expression"/> that representts the receiver or static reference for dispatching.</param>
 /// <param name="name">The name to use for dispatching.</param>
 /// <param name="arguments">A sequence of <see cref="Expression"/> objects that represents the arguments for dispatching.</param>
 /// <returns>A chained method-call <see cref="DispatchExpression"/> that has the properties set to the specified values.</returns>
 public static DispatchExpression Method(
     this Expression left,
     String name,
     IEnumerable <Expression> arguments
     )
 {
     return(YacqExpression.Dispatch(DispatchTypes.Method, left, name, arguments));
 }
示例#4
0
 /// <summary>
 /// Creates a chained <see cref="DispatchExpression"/> that represents the method-call dispatching.
 /// </summary>
 /// <param name="left">An <see cref="Expression"/> that representts the receiver or static reference for dispatching.</param>
 /// <param name="name">The name to use for dispatching.</param>
 /// <param name="arguments">An array of <see cref="Expression"/> objects that represents the arguments for dispatching.</param>
 /// <returns>A chained method-call <see cref="DispatchExpression"/> that has the properties set to the specified values.</returns>
 public static DispatchExpression Method(
     this Expression left,
     String name,
     params Expression[] arguments
     )
 {
     return(YacqExpression.Dispatch(DispatchTypes.Method, left, name, arguments));
 }
示例#5
0
 /// <summary>
 /// Creates a chained <see cref="DispatchExpression"/> that represents the method-call dispatching.
 /// </summary>
 /// <param name="symbols">The symbol table for the expression.</param>
 /// <param name="left">An <see cref="Expression"/> that representts the receiver or static reference for dispatching.</param>
 /// <param name="name">The name to use for dispatching.</param>
 /// <param name="typeArguments">A sequence of <see cref="Type"/> objects that represents the type arguments for dispatching.</param>
 /// <param name="arguments">An array of <see cref="Expression"/> objects that represents the arguments for dispatching.</param>
 /// <returns>A chained method-call <see cref="DispatchExpression"/> that has the properties set to the specified values.</returns>
 public static DispatchExpression Method(
     this Expression left,
     SymbolTable symbols,
     String name,
     IEnumerable <Type> typeArguments,
     params Expression[] arguments
     )
 {
     return(YacqExpression.Dispatch(symbols, DispatchTypes.Method, left, name, typeArguments, arguments));
 }