Ybadoo - Soluções em Software Livre
Tutoriais
Compiladores

Apresente os conjuntos FIRST e FOLLOW das variáveis da gramática a seguir.

G = ({S, A, B, C}, {a, b, c, d}, P, S)
P = {SABC
A → aA | ε
B → bB | CdA
C → cC | ε}

 

FIRST(S) = {a, b, c, d}
FIRST(A) = {a, ε}
FIRST(B) = {b, c, d}
FIRST(C) = {c, ε}
FOLLOW(S) = {$}
FOLLOW(A) = {b, c, d, $}
FOLLOW(B) = {c, $}
FOLLOW(C) = {d, $}