public int parseExpression() throws IOException {
        Element localRoot = IRT.createElement(String.valueOf(Tags.OPERATION));
        curRootElement.appendChild(localRoot);
        curRootElement = localRoot;

        int result = parseTerm();
        while (curToken.type == PLUS ||
                curToken.type == MINUS) {
            switch (curToken.type) {
                case PLUS:
                    localRoot.setAttribute("opcode", "+");
                    curToken = lexer.getToken();
                    result += parseTerm();
                    break;
                case MINUS:
                    localRoot.setAttribute("opcode", "-");
                    curToken = lexer.getToken();
                    result -= parseTerm();
                    break;
            }
        }
//        if (curToken.type != Lexer.Type.END_OF_STREAM) {
//            throw new IOException(curToken.row + ":" + curToken.column +
//                    " ожидалось: END_OF_STREAM. получено: " + curToken.c);
//        }
        return result;
    }