This site uses cookies only for the purpose of identifying user sessions.
This is required to properly register actions.
CFG for expressions over $\{ + , - , * , / , ( , ) , 0 , 1, \ldots, 9 \}$
Write a CFG generating the language
of “well-formed” expressions over $\{ + , - , * , / , ( , ) , 0 , 1, \ldots , 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.
Authors: Carles Creus, Guillem Godoy
/
Documentation: