Optimizing the main parse loop