top_down and bottom_up rewriting.