Exemple #1
0
        public Expr term()
        {
            Expr x = unary();

            while (look.tag == '*' || look.tag == '/')
            {
                Token tok = look;
                move();
                x = new Arith(tok, x, unary());
            }
            return(x);
        }
Exemple #2
0
        public Expr expr()
        {
            Expr x = term();

            while (look.tag == '+' || look.tag == '-')
            {
                Token tok = look;
                move();
                x = new Arith(tok, x, term());
            }
            return(x);
        }