Skip to main content
added 91 characters in body
Source Link
gnasher729
  • 31.6k
  • 35
  • 55

In your first grammar, change S to X and leave A unchanged. In your second grammar, change S to Y and A to B. Then add S -> X | Y.

And fix your grammars to handle n < m-1 instead of n=m-2 and n>m-1 instead of n = m+2.

In your first grammar, change S to X and leave A unchanged. In your second grammar, change S to Y and A to B. Then add S -> X | Y.

In your first grammar, change S to X and leave A unchanged. In your second grammar, change S to Y and A to B. Then add S -> X | Y.

And fix your grammars to handle n < m-1 instead of n=m-2 and n>m-1 instead of n = m+2.

Source Link
gnasher729
  • 31.6k
  • 35
  • 55

In your first grammar, change S to X and leave A unchanged. In your second grammar, change S to Y and A to B. Then add S -> X | Y.