public override Expression <Func <T, bool> > VisitOr(RsqlParser.OrContext context) { var right = context.and()[0].Accept(this); if (context.and().Length == 1) { return(right); } for (var i = 1; i < context.and().Length; i++) { var left = context.and()[i].Accept(this); right = Expression.Lambda <Func <T, bool> >(Expression.Or(left.Body, right.Body), left.Parameters); } return(right); }
/// <summary> /// Visit a parse tree produced by <see cref="RsqlParser.or"/>. /// <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 VisitOr([NotNull] RsqlParser.OrContext context) { return(VisitChildren(context)); }