Exemplo n.º 1
0
 private void ProcessLimitClause(SqlParser.Limit_clauseContext context, SelectStatement statement)
 {
     if (context.K_OFFSET() != null && context.expr().Length == 2)
     {
         statement.Limit  = ParseLiteralValue <int>((IExpression)VisitExpr(context.expr()[0]));
         statement.Offset = ParseLiteralValue <int>((IExpression)VisitExpr(context.expr()[1]));
     }
     else if (context.expr().Length == 2)
     {
         statement.Limit  = ParseLiteralValue <int>((IExpression)VisitExpr(context.expr()[1]));
         statement.Offset = ParseLiteralValue <int>((IExpression)VisitExpr(context.expr()[0]));
     }
     else if (context.expr().Length == 1)
     {
         statement.Limit = ParseLiteralValue <int>((IExpression)VisitExpr(context.expr()[0]));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="SqlParser.limit_clause"/>.
 /// <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 VisitLimit_clause([NotNull] SqlParser.Limit_clauseContext context)
 {
     return(VisitChildren(context));
 }