Closed frankhart2018 closed 3 years ago
expr -> string is a very näive grammar. Convert it to a full scale grammar, refer:- http://www2.lawrence.edu/fast/GREGGJ/CMSC270/parser/parser.html
The grammar will be:
expr -> sum sum -> mul (+|- mul) mul -> factor (*|/ factor) factor -> term term -> string | number
expr -> string is a very näive grammar. Convert it to a full scale grammar, refer:- http://www2.lawrence.edu/fast/GREGGJ/CMSC270/parser/parser.html
The grammar will be: