'Give the reachable non-terminals of G1 and the generating non-terminals of G1

Consider the CFG G1 induced by the following productions with start symbol S:

S = EaaH | bSHb 
E = aGbY | SYb
Q = N
N = aTRaR | aRY
T = F
F = Fa | TaFFb
H = SYaEb | YbaGbG
Y = Rbb | aHaE
D = FaTF | TbbbM
M = YHbDb | bSY
G = Q
R = ε

Give the reachable non-terminals of G1 and the generating non-terminals of G1.

Your answers should list the non-terminals in arbitrary order without separators or spacing.

Make sure your answers pass the Precheck. There is no Check since this question will be marked later.

Precheck tests whether your answers contain only non-terminals from G1.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source