code: public static void setParents(Parse p) {
      Parse[] children = p.getChildren();
      for (int ci = 0; ci < children.length; ci++) {
        children[ci].setParent(p);
        setParents(children[ci]);
      }
    }
docs: Assigns parent references for the specified parse so that they
  are consistent with the children references.
  @param p The parse whose parent references need to be assigned.