1.有文法G[S], 求此文法的每一个非终结符号的First集和Follow集。 S::=aAcB | Bd A::= AaB | Bc | ε B::= bBc | ABc | ε
时间: 2023-11-23 20:53:44 浏览: 86
LL(1)suanfa.rar_Follow_ Follow_LL(1)文法_LL(1)_计算first
对于文法G[S],每一个非终结符号的First集和Follow集如下:
1. First集:
- First(S) = {a, b}
- First(A) = {a, ε}
- First(B) = {b, ε}
- First(C) = {c, d}
- First(D) = {d, ε}
- First(E) = {c, g}
2. Follow集:
- Follow(S) = {$}
- Follow(A) = {b, c}
- Follow(B) = {c, d}
- Follow(C) = {b}
- Follow(D) = {b, c}
- Follow(E) = {c, d}
阅读全文