Apresente os conjuntos FIRST e FOLLOW das variáveis da gramática a seguir.
G = ({S, A, B, C}, {a, b, c}, P, S)
P = {S → ABC
A → aA | a
B → Bb | b
C → cC | ε}Eliminação da recursividade à esquerda das produções da gramática:
G = ({S, A, B, C, W}, {a, b, c}, P, S)
P = {S → ABC
A → aA | a
B → bW | b
W → bW | b
C → cC | ε}Fatoração a esquerda das produções da gramática:
G = ({S, A, B, C, W, X, Y, Z}, {a, b, c}, P, S)
P = {S → ABC
A → aX
X → A | ε
B → bY
Y → W | ε
W → bZ
Z → W | ε
C → cC | ε}Conjuntos FIRST e FOLLOW das variáveis da gramática:FIRST(S) = {a}
FIRST(A) = {a}
FIRST(X) = {a, ε}
FIRST(B) = {b}
FIRST(Y) = {b, ε}
FIRST(W) = {b}
FIRST(Z) = {b, ε}
FIRST(C) = {c, ε}FOLLOW(S) = {$}
FOLLOW(A) = {b}
FOLLOW(X) = {b}
FOLLOW(B) = {c, $}
FOLLOW(Y) = {c, $}
FOLLOW(W) = {c, $}
FOLLOW(Z) = {c, $}
FOLLOW(C) = {$}