Clean up shift-reduce parsing loop.