How to create a string grammar from {(,)}* set?

41 Views Asked by At

How to create a grammar that would imitate all the strings from the from the set {(,)}*, and in which (lines) all the parantheses would hava a correct place?

I just do not know how to start, I am a bit newbie in grammars :/

1

There are 1 best solutions below

0
On BEST ANSWER

Something like $$\begin{align}S&\to \epsilon\mid\texttt{(}S\texttt{)}S\end{align} $$ perhaps?