Reference no: EM133270006
Write BNF grammar rules to implement the tiny calculator behaviors listed below. You should list the grammar with some descriptions in a comment section at the beginning of your code file, or in a separate Markdown file.
- statement_list (list of binary expression statements)
- statement (assignment or expression)
- expression
- 5 arithmetic operations (+, -, *, /,^)
- (expression) # parenthesis for setting user's precedence
- variables (C-like identifiers)
- numbers (C-like integers or floats)
- Supporting signs (+, -) e.g. 2 - -3 + 2 -7 --2 (output: 2)
This is for a flex/bison programming assignment, need help with these BNF grammar rules!