Пример #1
0
        private Expr Or()
        {
            Expr expr = And();

            while (Match(TokenType.OR))
            {
                Token op    = Previous();
                Expr  right = And();
                expr = new Expressions.Logical(expr, op, right);
            }

            return(expr);
        }
Пример #2
0
        private Expr And()
        {
            Expr expr = Equality();

            while (Match(TokenType.AND))
            {
                Token op    = Previous();
                Expr  right = Equality();
                expr = new Expressions.Logical(expr, op, right);
            }

            return(expr);
        }
Пример #3
0
 object Expressions.IVisitor <object> .VisitLogicalExpr(Expressions.Logical expr)
 {
     Resolve(expr.Left);
     Resolve(expr.Right);
     return(null);
 }