Implementing custom pop actions for production rules.