I need to write a CFG for the language below:
L = { w ∈ Σ* | w is a regular expression over a binary alphabet }
I came up with:
S = SΣ* | ε
X = S | ε
I'm starting the discipline now, and if it isn't correct, i would apreciate an explanation. Many thanks!
PS.: This is not part from a homework, it is just an exercise from a Computer Science Theory book.
ANSWER BASED ON Mo B. POST
S = e | {0,1}
X = S | S* | Z
Y = X | YX
Z = Y | Z | Y
SECOND ANSWER BASED ON Mo B. POST
S = e | {0,1}
X = S | S'*' | '(' Z ')'
Y = X | YX
Z = Y | Z '|' Y