improved shell script and makefile for generating parser code