void compute_size_and_depth(const std::vector<RE*> &res, size_t *psize, size_t *pdepth) {
    std::vector<StackItem> stack;

    const size_t nre = res.size();
    DASSERT(nre > 0);
    *psize = nre - 1;
    *pdepth = 0;

    for (size_t i = 0; i < nre; ++i) {
        compute_re_size_and_depth(res[i], stack, psize, pdepth);
    }
}
void compute_size_and_depth(const std::vector<RE*> &res, size_t *psize, size_t *pdepth) {
    std::vector<StackItem> stack;

    const size_t nre = res.size();
    DASSERT(nre > 0);
    *psize = nre - 1;
    *pdepth = 0;

    for (size_t i = 0; i < nre; ++i) {
        compute_re_size_and_depth(res[i], stack, psize, pdepth);
    }
}