grok grammar decomposition for future refactoring