parse an entire file