I'm trying to learn C++ in my spare time, and I've been on and off with it for a few months. I came back into it about a month ago. I just started learning about recursion from a C++ book I bought, and I'm really getting the hang of it just yet.
Here is a question I need help on:
"Consider a language of character strings that contain only dots and dashes. All strings in this language contain at least four characters and begin with either two dots or dashes. If the first two characters are dots, the last one must be a dash; if the first two characters are dashes, the last one must be a dot. Write a recursive grammar for this language."
I'd appreciate any help with this. Oh and if you offer me a solution, if you could try to make it relatively simple, as I am a beginner!
Here is a question I need help on:
"Consider a language of character strings that contain only dots and dashes. All strings in this language contain at least four characters and begin with either two dots or dashes. If the first two characters are dots, the last one must be a dash; if the first two characters are dashes, the last one must be a dot. Write a recursive grammar for this language."
I'd appreciate any help with this. Oh and if you offer me a solution, if you could try to make it relatively simple, as I am a beginner!
