Revised grammar generation procedure for JDK6.