write the grammer and implement the LL1 program