1 vote

Repeat Question $4.2.1$ for each of the following grammars and strings:

- $S\rightarrow 0S1\mid 01$ with string $000111$.
- $S\rightarrow +SS\mid \ast SS\mid a$ with string $+\ast aaa$.
- $S\rightarrow S(S)S\mid \epsilon$ with string $(()())$.
- $S\rightarrow S+S\mid SS\mid (S)\mid S\ast\mid a$ with string $(a+a)\ast a$.
- $S\rightarrow (L)\mid a$ and $L\rightarrow L,S\mid S$ with string $((a,a),a,(a))$.
- $S\rightarrow aSbS\mid bSaS\mid\epsilon$ with string $aabbab$.
- The following grammar for boolean expressions:

- $bexpr\:\rightarrow\:bexpr\:or\:bterm\mid bterm$
- $bterm\:\rightarrow\:bterm\:and\:bfactor\mid bfactor$
- $bfactor\:\rightarrow\:not\:bfactor\mid (bexpr)\mid true\mid false$