Beispiel #1
0
        public void ExitQueryExpression(QueryParser.QueryExpressionContext context)
        {
            var operators = context.UNION_EXCEPT();

            CompileLeftAssociativeOperator(operators, _queries, (op, left, right) =>
            {
                if (string.Equals(op.Symbol.Text, "union", StringComparison.OrdinalIgnoreCase))
                {
                    var union = left.Union(right);
                    return(union);
                }

                Trace.Assert(string.Equals(
                                 op.Symbol.Text,
                                 "except",
                                 StringComparison.OrdinalIgnoreCase
                                 ), $"Expecting UNION or EXCEPT, got {op.Symbol.Text}");

                var except = left.Except(right);
                return(except);
            });
        }
Beispiel #2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="QueryParser.queryExpression"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitQueryExpression([NotNull] QueryParser.QueryExpressionContext context)
 {
 }
Beispiel #3
0
        // All methods in this group are either no-ops or they pop 1 or more queries from the
        // _queries stack and push one query to the _queries stack as a result of an operation.

        public void EnterQueryExpression(QueryParser.QueryExpressionContext context)
        {
        }