Let $G = (V,T,S,P)$ be the phrase structure grammar with $V = \{0,1,A,S\}$, $T=\{0,1\}$, and a set of productions $P$ consisting of:
$S \to 1S$
$S \to 00A$
$A \to 0A$
$A \to 0$
What is the language generated by G?
I know how to start it by creating a derivative tree. And I have also created it. My only problem is that I don't know how to use that information to answer the question. Can someone help?
It looks like the language is $1^{*}000(0)^{*}$. Notice we can have no $1$'s present; and if we do, we can keep revisiting $S$. To terminate, we need to visit the $S \to 00A$ rule to get to the $A$ rules. Then we can keep tacking on $0$'s or terminate with one additional $0$.