Esempio n. 1
0
        public object VisitAndExpression(KpExperimentParser.AndExpressionContext context)
        {
            var leftPredicateContext = context.ltlExpressionOperand().FirstOrDefault();
            var rightPredicateCotext = context.ltlExpressionOperand().Skip(1).FirstOrDefault();
            var result = default(IPredicate);

            if (rightPredicateCotext != null)
            {
                result = new BooleanExpression
                {
                    LeftOperand  = VisitLtlExpressionOperand(leftPredicateContext) as IPredicate,
                    RightOperand = VisitLtlExpressionOperand(rightPredicateCotext) as IPredicate,
                    Operator     = BooleanOperator.And,
                };
            }
            else
            {
                result = VisitLtlExpressionOperand(leftPredicateContext) as IPredicate;
            }

            return(result);
        }
Esempio n. 2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="KpExperimentParser.andExpression"/>.
 /// <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 VisitAndExpression([NotNull] KpExperimentParser.AndExpressionContext context)
 {
     return(VisitChildren(context));
 }