parser.y refactoring