Changing grammar interpreter output to match grammar parser input grammar