Write a YACC + Lex program

Job ID: 33763140

Budget: $10 – $30 USD

You are developing a desktop application where it recognize a mathematical equations. Write a YACC + Lex program that recognizes following formats of mathematical equations:

1) Digits Operation Digits.
• For example: 476 * 23

2) Digits Operation OpenParentheses Digits Operation Digits CloseParentheses • For example: 89 + ( 4 / 99 )

3) OpenParentheses OpenParentheses Digits Operation Digits CloseParentheses Operation CloseParentheses.
• For example: ( ( 32 – 7 ) * 88 ) Notes:
• Digits: 0-9. For example: 1, 4, 44, 66, 432
• Operation: Add/ Subtraction/ Multiply/ divide
• OpenParentheses: (
• CloseParentheses: )
Except the above mentioned formats, all other strings should not be accepted by the parser.