In the following CFG,
S -> aSb | SS | ε
I'm really confused with what happens with the rule S -> SS. In my textbook it explains that that the grammar generates the strings aabb, abab, and aababb. How does it generate each of these strings? What is a parse tree that can demonstrate this?
$S \to SS$ means that if $S$ is a word, then $SS$ is also a word. That is, from $ab$ we may deduce $abab$.
$aabb$ may be obtained as $\epsilon \mapsto ab \mapsto a(ab)b$ by the $aSb$ rule.
$abab$ may be obtained as $\epsilon \mapsto ab \mapsto (ab)(ab)$ by the $SS$ rule.
$aababb$ may be obtained by the $aSb$ rule on $abab$.