Java rewrite engine2

change the perl file and make compiling parsing option from cat to kast.