BNF Exercises - Problem 2


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

Strings that contain sequences of binary digits {0,1} and where each successive digit is the complement of the digit to its left. That is, alternating 0s and 1s. Samples would include 01, 1010, and 010101. However the string 11 would not be part of the language.

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