first_of_grammar considering epsilon(null) value as $ in input file Input format as below S->ACB|CbB|Ba A->da|BC B->g|$ C->h|$ Output is as below