May 29, 2025
digit as a non-terminal can expand into terminals (0, 1, 2, etc.).digit (for single digits) and NAT (for natural numbers).NAT can be a digit or a digit followed by a NAT (recursive).NAT = digit or non-zero followed by digits.digit = 0 or non-zero.non-zero = any terminal digit from 1 to 9.digits = digit or digit followed by digits (recursive).