generate random grammar final