Add error checking via production rules to LALR(1) grammar to handle all inputs
I have a grammar that represents expressions. Let's say for simplicity it's: S -> E E -> T + E | T T -> P * T | P P -> a | (E) With a , + , * , ( and ) being the letters in my alphabet. The above rules can generate valid arithmetic expressions containing parenthesis, multiplication and addition using proper order of operations and associativity. My goal is to accept every string, containing 0 or more of the letters of my alphabet. Here are my constraints: The grammar must "accept" all strings contained 0 or more letters of my alphabet. New terminals may be introduced and inserted into the