public override object VisitIn_expression([NotNull] KoraliumParser.In_expressionContext context) { if (context.element != null) { var left = Visit(context.element) as ScalarExpression; if (left == null) { throw new SqlParserException("Could not find a scalar expression in left side of 'IN'"); } InExpression inExpression = new InExpression() { Expression = left, Not = context.NOT() != null }; var scalarExpressionNodes = context.scalar_expression(); foreach (var node in scalarExpressionNodes) { var scalarExpression = Visit(node) as ScalarExpression; if (scalarExpression == null) { throw new SqlParserException("Could not find a scalar expression in 'IN' array"); } inExpression.Values.Add(scalarExpression); } return(inExpression); } throw new NotImplementedException(); }
/// <summary> /// Exit a parse tree produced by <see cref="KoraliumParser.in_expression"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitIn_expression([NotNull] KoraliumParser.In_expressionContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="KoraliumParser.in_expression"/>. /// <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 VisitIn_expression([NotNull] KoraliumParser.In_expressionContext context) { return(VisitChildren(context)); }