Пример #1
0
        public override Value VisitOrExpr(AbstractIfStmtParser.OrExprContext ctx)
        {
            Value left  = this.Visit(ctx.expr(0));
            Value right = this.Visit(ctx.expr(1));

            bool leftBoolVal  = getBoolValue(left);
            bool rightBoolVal = getBoolValue(right);
            bool orExprVal    = leftBoolVal || rightBoolVal;

            return(new Value(orExprVal));
            //return new Value(left.asBoolean() || right.asBoolean());
        }
Пример #2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="AbstractIfStmtParser.orExpr"/>.
 /// <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 VisitOrExpr([NotNull] AbstractIfStmtParser.OrExprContext context)
 {
     return(VisitChildren(context));
 }
 /// <summary>
 /// Enter a parse tree produced by <see cref="AbstractIfStmtParser.orExpr"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void EnterOrExpr([NotNull] AbstractIfStmtParser.OrExprContext context)
 {
 }