Parser to implement the grammar