Write a
non-ambiguous CFG generating the language
of “well-formed” expressions over
{+,−,∗,/,(,),0,1,…,9}.
For instance,
23∗(2+003)+15∗4 is a well-formed expression, whereas
13∗∗15 and
)(3 are not. For simplicity, in this problem
we exclude the use of
+ and
− as unary operators, such that
we also consider
+3 or
−5 as non-well-formed expressions.