code: private boolean makeCaptureHistoryTree(CaptureTreeNode node) {
          //CaptureTreeNode child;
          int k = stkp;
          //int k = kp;
  
          while (k < stk) {
              StackEntry e = stack[k];
              if (e.type == MEM_START) {
                  int n = e.getMemNum();
                  if (n <= Config.MAX_CAPTURE_HISTORY_GROUP && bsAt(regex.captureHistory, n)) {
                      CaptureTreeNode child = new CaptureTreeNode();
                      child.group = n;
                      child.beg = e.getMemPStr() - str;
                      node.addChild(child);
                      stkp = k + 1;
                      if (makeCaptureHistoryTree(child)) return true;
  
                      k = stkp;
                      child.end = e.getMemPStr() - str;
                  }
              } else if (e.type == MEM_END) {
                  if (e.getMemNum() == node.group) {
                      node.end = e.getMemPStr() - str;
                      stkp = k;
                      return false;
                  }
              }
          }
          return true; /* 1: root node ending. */
      }
docs: a temporary