public bool VisitExprBooleanAnd(ExprBooleanAnd expr, TCtx arg) { var res = this.Visit(expr, "BooleanAnd", arg, out var argOut) && this.Accept("Left", expr.Left, argOut) && this.Accept("Right", expr.Right, argOut); this._visitor.EndVisitExpr(expr, arg); return(res); }
//Boolean Expressions public bool VisitExprBooleanAnd(ExprBooleanAnd expr, IExpr?parent) { if (expr.Left is ExprBooleanOr) { this.AcceptPar('(', expr.Left, ')', expr); this.Builder.Append("AND"); } else { expr.Left.Accept(this, expr); this.Builder.Append(" AND"); } if (expr.Right is ExprBooleanOr) { this.AcceptPar('(', expr.Right, ')', expr); } else { this.Builder.Append(' '); expr.Right.Accept(this, expr); } return(true); }
public static ExprBooleanAnd WithRight(this ExprBooleanAnd original, ExprBoolean newRight) => new ExprBooleanAnd(left: original.Left, right: newRight);