a stream flattening tool processes nested streams on a stack to traverse the nested streams. The tool produces a flattened stream that enumerates the elements of the nested streams. In one embodiment, the tool initially pushes a stack frame onto the stack for a stream representing all of the ...