Convert a tokenstream to an array of nodes