public override object VisitFunction_call([NotNull] KoraliumParser.Function_callContext context) { var parameterNodes = context.function_parameter(); var functionNameNode = context.function_name(); if (functionNameNode != null) { FunctionCall functionCall = new FunctionCall() { FunctionName = functionNameNode.GetText().ToLower() }; if (context.STAR() != null) { functionCall.Wildcard = true; } foreach (var functionParameterExpression in parameterNodes) { var result = Visit(functionParameterExpression); if (result is SqlExpression sqlExpression) { functionCall.Parameters.Add(sqlExpression); } else { throw new SqlParserException("Could not parse sql expression"); } } return(functionCall); } throw new SqlParserException("Empty function name"); }
/// <summary> /// Exit a parse tree produced by <see cref="KoraliumParser.function_call"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitFunction_call([NotNull] KoraliumParser.Function_callContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="KoraliumParser.function_call"/>. /// <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 VisitFunction_call([NotNull] KoraliumParser.Function_callContext context) { return(VisitChildren(context)); }