Changed java code to print error code of grammar