aboutsummaryrefslogtreecommitdiff
path: root/grammar/expression.grm
blob: 6c4eddb6fdac909063a48601d0d8250613322daf (plain)
1
2
3
4
5
6
main -> expression
expression -> binary_operation | number | '(' expression ')'
binary_operation -> expression binary_operand expression
binary_operand -> '+' | '-' | '*' | '/'
number -> digit number | digit
digit -> '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'