C++ Code Implement a recursive descent parser for a logic calculator based on th
ID: 3758992 • Letter: C
Question
C++ Code
Implement a recursive descent parser for a logic calculator based on the Grammar below.
The user can use either capital or lower case 'T' and 'F' in their expression.
Use either a ';' or '=' to indicate the expression should be evaluated immediately.
The program should not exit when it encounters an error in the expression. Rather, it should output error information and then accept the next expression.
Use either a capital or lowercase 'Q' to indicate you want to exit the program.
Grammar
Note: This grammar uses the '|' symbol as a terminal. In place of that symbol, we will use '' to separate replacement options for each grammar rule.
Expression Term Expression | Term
Term Factor Term & Factor
Factor Primary Factor ^ Primary
Primary T F ( Expression ) ! Expression