Refactoring RuleAstEmitter.