Ok, I'm having some trouble understanding language grammar. I've been trying to figure out these couple exercises, but I need some help.
The first asks to find all possible strings of seven or fewer letters using this language:
Where | means "or".Code:<string>=$ | <word> | $<string>
<word>=abb | a<word>bb
This is what I have so far:
I feel like I'm missing something.Code:$
abb
aabbbb
$$
$$$
$$$$
$$$$$
$$$$$$
$$$$$$$
$abb
$aabbbbb
The other was about writing recursive grammar for a language of strings of one or more letters. The first letter must be uppercase, and the other letters must be lowercase.
Here is what I got:
Can someone confirm if I'm doing it right?Code:<string>=<upper> | <string><lower>
<upper>=A | B | ...Z
<lower>=a | b | ...z
Thanks a lot for any input! :D