The visualization below demonstrates the algorithm presented in our SLE'17 paper. It accepts the same rudimentary arithmetic language presented in Section 2:

expr = num "+" num
     | num "-" num

num = digit+

digit = "0".."9"