BNF Exercises - Problem 2


Write a syntactic specification using Backus-Naur Form to describe the mini-language with the following description:

Describe the set of integer numbers that are composed of exactly two decimal digits and may be optionally preceded by a sign from the set {+,-}, and where the leftmost digit must always be non-zero. Valid examples would include 67, -34, or +22. The strings 02, 179, or 1 would not be in the language.

Last updated 2001/03/15
© J.A.N. Lee, 2001.