public override object VisitUpdate_stmt([NotNull] SqlParser.Update_stmtContext context) { var statement = new UpdateStatement(); if (context.set_clause() != null) { statement.Assignments = new List <AssignExpression>(); foreach (var item in context.set_clause().expr()) { var assignment = (IExpression)VisitExpr(item); statement.Assignments.Add(new AssignExpression { Column = (ColumnExpression)assignment.SubExpressions[0], Value = assignment.SubExpressions[1] }); } } if (context.qualified_table_name() != null) { statement.Table = (TableName)VisitQualified_table_name(context.qualified_table_name()); } if (context.where_clause() != null) { statement.Where = (IExpression)VisitWhere_clause(context.where_clause()); } return(statement); }
/// <summary> /// Visit a parse tree produced by <see cref="SqlParser.update_stmt"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitUpdate_stmt([NotNull] SqlParser.Update_stmtContext context) { return(VisitChildren(context)); }