Grammar refactoring testcases