Exemplo n.º 1
0
        Expr Comparison()
        {
            var expr = Addition();

            while (MatchNext(TokenType.Greater) ||
                   MatchNext(TokenType.GreaterEqual) ||
                   MatchNext(TokenType.Less) ||
                   MatchNext(TokenType.LessEqual))
            {
                var @operator = Previous();
                var right     = Addition();
                expr = new BinaryExpr(expr, @operator, right);
            }

            return(expr);
        }