Wrote the grammar for parser.