예제 #1
0
        internal Expression[] VisitArguments(IArgumentProvider nodes)
        {
            Expression[] newNodes = null;
            for (int i = 0, n = nodes.ArgumentCount; i < n; i++)
            {
                Expression curNode = nodes.GetArgument(i);
                Expression node    = curNode.Accept(this);

                if (newNodes != null)
                {
                    newNodes[i] = node;
                }
                else if (!object.ReferenceEquals(node, curNode))
                {
                    newNodes = new Expression[n];
                    for (int j = 0; j < i; j++)
                    {
                        newNodes[j] = nodes.GetArgument(j);
                    }
                    newNodes[i] = node;
                }
            }
            return(newNodes);
        }
예제 #2
0
 public virtual Expression?Visit(Expression?node) => node?.Accept(this);
예제 #3
0
 public virtual Expression?Visit(Expression?node)
 {
     return(node?.Accept(this));
 }
예제 #4
0
 public Expression Visit(Expression node)
 {
     return((node == null) ? null : node.Accept(this));
 }