public object VisitEquivalenceExpression(KpExperimentParser.EquivalenceExpressionContext context) { var leftPredicateContext = context.implicationExpression().FirstOrDefault(); var rightPredicateCotext = context.implicationExpression().Skip(1).FirstOrDefault(); var result = default(IPredicate); if (rightPredicateCotext != null) { result = new BooleanExpression { LeftOperand = VisitImplicationExpression(leftPredicateContext) as IPredicate, RightOperand = VisitImplicationExpression(rightPredicateCotext) as IPredicate, Operator = BooleanOperator.Equivalence, }; } else { result = VisitImplicationExpression(leftPredicateContext) as IPredicate; } return(result); }
/// <summary> /// Visit a parse tree produced by <see cref="KpExperimentParser.equivalenceExpression"/>. /// <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 VisitEquivalenceExpression([NotNull] KpExperimentParser.EquivalenceExpressionContext context) { return(VisitChildren(context)); }