Yacc
Compilers
Principles, Techniques, & Tools
Second Edition
A simple desk calculator that reads an arithmetic expression, evaluates it, and then prints its numeric value.
Starting with the grammer
'0' - '9']
digit = [
E -> E + T | T
T -> T * F | F F -> (E) | digit