public Expression parse(){
        Token tok = getNext();
        if (tok.getType().equals(Token.Type.NUMBER)) { return new Number(tok);}
        if (tok.getType().equals(Token.Type.VARIABLE)) { return new Variable(tok);}
        if (tok.getType().equals(Token.Type.OPEN_PARENS)){
            Expression left = parse();
            tok = getNext();
            if (tok.getType().equals(Token.Type.ADDITION) || tok.getType().equals(Token.Type.MULTIPLICATION)){
                Token.Type op = tok.getType();
                Expression right = parse();
                tok = getNext();
                if (tok.getType().equals(Token.Type.CLOSE_PARENS)){
                    if (op.equals(Token.Type.MULTIPLICATION)){return new Multiplication(left, right);}
                    if (op.equals(Token.Type.ADDITION)){return new Addition(left, right);}
                    
                }
            }
            if (tok.getType().equals(Token.Type.CLOSE_PARENS)){return left;}
            else{throw new RuntimeException("invalid input");}
        }
        throw new RuntimeException("invalid input");
    }