code: function injectParentPointers(node, parent) {
      node.$parent = parent;
      var list = children(node);
      for (var i=0; i<list.length; i++) {
          injectParentPointers(list[i], node);
      }
  }
docs: Assigns parent pointers to each node. The parent pointer is called $parent.