read grammar from a file. finally