impl new grammar design