edited grammar and made corresponding functions in parser