protected override void AcceptInternal(IExpressionVisitor visitor) { if (_nodes == null) return; for (int index = 0; index < _nodes.Count; index++) _nodes[index] = AcceptWithCheck(visitor, _nodes[index], true); }
/// <summary> /// Accept an expression visitor /// </summary> /// <param name="visitor">The expression visitor</param> public virtual void Accept(IExpressionVisitor visitor) { if (visitor == null) { throw new ArgumentNullException("visitor"); } visitor.Visit(this); }
public override void Accept(IExpressionVisitor visitor) { if (!visitor.BeforeVisit(this)) return; Expression.Accept(visitor); visitor.AfterVisit(this); }
protected override void AcceptInternal(IExpressionVisitor visitor) { if (Target != null) _target = AcceptWithCheck(visitor, Target, false); for (int index = 0; index < _arguments.Count; index++) { _arguments[index] = AcceptWithCheck(visitor, _arguments[index], true); } }
protected override void AcceptInternal(IExpressionVisitor visitor) { _operand = AcceptWithCheck(visitor, Operand, true); }
internal abstract void VisitorCall(IExpressionVisitor visitor);
public static Expression Visit(Expression expression, IExpressionVisitor visitor) { return expression.Visit(visitor); }
protected NodeVisitor(IExpressionVisitor expressionVisitor) { _expressionVisitor = expressionVisitor; }
protected virtual void VisitJoin(IExpressionVisitor visitor, DeleteStatement statement, JoinClause joining) { visitor.VisitJoin(joining); }
public override void Accept(IExpressionVisitor v) { v.VisitConditionOf(this); }
public abstract TResult Accept <TContext, TResult>(IExpressionVisitor <TContext, TResult> visitor, TContext context);
public virtual void Accept(IExpressionVisitor visitor) { visitor.Visit(this); }
public override void Accept(IExpressionVisitor v) { v.VisitPhiFunction(this); }
public override TResult Accept <TResult>(IExpressionVisitor <TResult> visitor) { return(visitor.Visit(this)); }
/// <summary> /// Visits the specified expression visitor. /// </summary> /// <typeparam name="TImmutableParameter">The type of the parameter1.</typeparam> /// <typeparam name="TMutableParameter">The type of the parameter2.</typeparam> /// <typeparam name="TResult">The type of the result.</typeparam> /// <param name="expressionVisitor">The expression visitor.</param> /// <param name="parameter1">The parameter1.</param> /// <param name="parameter2">The parameter2.</param> public abstract void Visit <TImmutableParameter, TMutableParameter, TResult>( IExpressionVisitor <TImmutableParameter, TMutableParameter, TResult> expressionVisitor, TImmutableParameter parameter1, TMutableParameter parameter2);
public T Accept <T>(IExpressionVisitor <T> visitor) { return(visitor.FieldAccess(this)); }
public void Accept(IExpressionVisitor visitor) { visitor.FieldAccess(this); }
public abstract void Accept(IExpressionVisitor visitor);
protected override void AcceptInternal(IExpressionVisitor visitor) { }
/// <summary> /// Dispatches to the specific visit method for this node type. /// </summary> /// <param name="visitor">The visitor to visit this node with.</param> protected override void AcceptInternal(IExpressionVisitor visitor) { }
internal override void VisitorCall(IExpressionVisitor visitor) { visitor.CallVisitor(this); }
protected override void VisitReturning(IExpressionVisitor visitor, ReturningClause returning) { /* * 由于 MySQL 的 DELETE 语句不支持 RETURN|RETURNING 子句,故不输出任何内容,且不调用基类同名方法以避免生成错误的语句。 */ }
public override TResult Accept <TResult, TContext>( IExpressionVisitor <TResult, TContext> visitor, TContext environment) { return(visitor.Visit(this, environment)); }
public void Accept(IExpressionVisitor visitor) { }
public abstract T Accept <T>(IExpressionVisitor <T> visitor);
protected override void AcceptInternal(IExpressionVisitor visitor) { if (RelativeSourceExpression != null) _relativeSourceExpression = AcceptWithCheck(visitor, RelativeSourceExpression, true); }
/// <summary> /// Visits the <paramref name="visitor"/> based upon the type of the /// <see cref="IExpression"/>. /// </summary> /// <param name="visitor">The <see cref="IIntermediateTreeVisitor"/> /// to visit.</param> /// <remarks>In this instance visits the <paramref name="visitor"/> /// through <see cref="IExpressionVisitor.Visit(ITypeReferenceExpression)"/>.</remarks> /// <exception cref="System.ArgumentNullException">thrown when <paramref name="visitor"/> /// is null.</exception> public void Accept(IExpressionVisitor visitor) { //ToDo: Fix #2. visitor.Visit(this); }
protected virtual void VisitFrom(IExpressionVisitor visitor, DeleteStatement statement, ICollection <ISource> sources) { visitor.VisitFrom(sources, (v, j) => this.VisitJoin(v, statement, j)); }
public override void Accept <T>(IExpressionVisitor <T> visitor) => visitor.VisitTypeReference(this);
/// <summary> /// Calls the visitor on the expression. /// </summary> protected override void AcceptInternal(IExpressionVisitor visitor) { _condition = AcceptWithCheck(visitor, Condition, true); _ifTrue = AcceptWithCheck(visitor, IfTrue, true); _ifFalse = AcceptWithCheck(visitor, IfFalse, true); }
public override void Accept(IExpressionVisitor v) { v.VisitConstant(this); }
public abstract void Accept(IExpressionVisitor arg1);
public virtual void Visit(IExpressionVisitor visitor) { visitor.Visit(this); }
protected virtual Expression Visit(IExpressionVisitor visitor) { return visitor.Visit(this); }
public override void Accept(IExpressionVisitor v) { v.VisitUnaryExpression(this); }
public override void Accept(IExpressionVisitor visitor) { Operand.Accept(visitor); visitor.Visit(this); }
public override void Accept(IExpressionVisitor visitor) { visitor.VisitConditionalExpression(this); }
protected override void AcceptInternal(IExpressionVisitor visitor) { if (Target != null) _target = AcceptWithCheck(visitor, Target, false); }
public T Accept <T>(IExpressionVisitor <T> visitor) => visitor.VisitFunctionCall(this);
public override void Accept(IExpressionVisitor visitor) { Require.NotNull(visitor, "visitor"); visitor.Visit(this); }
public override TOutput AcceptVisitor <TContext, TOutput>(IExpressionVisitor <TContext, TOutput> visitor, TContext context) { EnsureArg.IsNotNull(visitor, nameof(visitor)); return(visitor.VisitSortParameter(this, context)); }
public override void Accept(IExpressionVisitor visitor) { visitor.Visit(this); }
protected override void OnVisit(IExpressionVisitor visitor, UpsertStatement statement) { if (statement.Returning != null && statement.Returning.Table != null) { visitor.Visit(statement.Returning.Table); } const string SOURCE_ALIAS = "SRC"; if (statement.Fields == null || statement.Fields.Count == 0) { throw new DataException("Missing required fields in the upsert statment."); } visitor.Output.Append("MERGE INTO "); visitor.Visit(statement.Table); visitor.Output.AppendLine(" USING (SELECT "); for (int i = 0; i < statement.Values.Count; i++) { if (i > 0) { visitor.Output.Append(","); } visitor.Visit(statement.Values[i]); } visitor.Output.AppendLine(") AS " + SOURCE_ALIAS + " ("); for (int i = 0; i < statement.Fields.Count; i++) { if (i > 0) { visitor.Output.Append(","); } visitor.Output.Append(statement.Fields[i].Name); } visitor.Output.AppendLine(") ON"); for (int i = 0; i < statement.Entity.Key.Length; i++) { var field = Metadata.DataEntityPropertyExtension.GetFieldName(statement.Entity.Key[i], out _); if (i > 0) { visitor.Output.Append(" AND "); } if (string.IsNullOrEmpty(statement.Table.Alias)) { visitor.Output.Append($"{field}={SOURCE_ALIAS}.{field}"); } else { visitor.Output.Append($"{statement.Table.Alias}.{field}={SOURCE_ALIAS}.{field}"); } } if (statement.Updation.Count > 0) { visitor.Output.AppendLine(); visitor.Output.Append("WHEN MATCHED"); if (statement.Where != null) { visitor.Output.Append(" AND "); visitor.Visit(statement.Where); } visitor.Output.AppendLine(" THEN"); visitor.Output.Append("\tUPDATE SET "); int index = 0; foreach (var item in statement.Updation) { if (index++ > 0) { visitor.Output.Append(","); } visitor.Visit(item.Field); visitor.Output.Append("="); visitor.Visit(item.Value); } } visitor.Output.AppendLine(); visitor.Output.AppendLine("WHEN NOT MATCHED THEN"); visitor.Output.Append("\tINSERT ("); for (int i = 0; i < statement.Fields.Count; i++) { if (i > 0) { visitor.Output.Append(","); } visitor.Output.Append(visitor.Dialect.GetIdentifier(statement.Fields[i])); } visitor.Output.Append(") VALUES ("); for (int i = 0; i < statement.Fields.Count; i++) { if (i > 0) { visitor.Output.Append(","); } visitor.Output.Append(SOURCE_ALIAS + "." + statement.Fields[i].Name); } visitor.Output.Append(")"); //输出返回子句 this.VisitReturning(visitor, statement.Returning); visitor.Output.AppendLine(";"); }
protected override void AcceptInternal(IExpressionVisitor visitor) { Name = AcceptWithCheck(visitor, Name, true); Equal = AcceptWithCheck(visitor, Equal, true); Value = AcceptWithCheck(visitor, Value, true); }
public override void Accept(IExpressionVisitor v) { v.VisitSlice(this); }
protected override void AcceptInternal(IExpressionVisitor visitor) { StartTag = AcceptWithCheck(visitor, StartTag, true); if (StartTagEnd != null) StartTagEnd = AcceptWithCheck(visitor, StartTagEnd, true); if (EndTag != null) EndTag = AcceptWithCheck(visitor, EndTag, true); for (int i = 0; i < _elements.Count; i++) { XmlExpressionNode node = AcceptWithCheck(visitor, _elements[i], false); if (node == null) { _elements.RemoveAt(i); i--; } else _elements[i] = node; } for (int i = 0; i < _attributes.Count; i++) { XmlExpressionNode node = AcceptWithCheck(visitor, _attributes[i], false); if (node == null) { _attributes.RemoveAt(i); i--; } else _attributes[i] = node; } }
public void AcceptExpressionVisitor(IExpressionVisitor visitor) { visitor.VisitUnknown(this); }
protected override void AcceptInternal(IExpressionVisitor visitor) { _expression = AcceptWithCheck(visitor, Expression, true); }
public void Accept(IExpressionVisitor visitor) => visitor.Visit(this);
/// <summary> /// Calls the visitor on the expression. /// </summary> protected override void AcceptInternal(IExpressionVisitor visitor) { _left = AcceptWithCheck(visitor, Left, true); _right = AcceptWithCheck(visitor, Right, true); }
public override T Accept <T>(IExpressionVisitor <T> visitor) { return(visitor.VisitVariableExpr(this)); }
public override void Accept(IExpressionVisitor visitor) { visitor.VisitAssignment(this); }
public abstract TOutput AcceptVisitor <TContext, TOutput>(IExpressionVisitor <TContext, TOutput> visitor, TContext context);