我被问到要测试的问题:显示字符串的解析树,证明b在T的后面。
S=> ET
T=>bSc | d
E=>aTE| ε我解决了第一盘:
First(S)=>First(E)=>{a} U First(T)=> {a,b,d}
First(T)=>{b,d}
First(E)=>{a,ε}以下是一组:
Follow(S)=>{$,c}
Follow(T)=>Follow(S) U First(E)=> {$,c} U First(E)=>{$,c,a}
Follow(E)=>First(T) U Follow(E)=>{b,d}我哪里出问题了?
发布于 2017-03-10 01:02:30
你写道:
跟随(T)⇒跟随(S)∪First(E)
但是ε在第一位(E),所以应该是:
跟随(T)⇒跟随(S)∪First(E)∪跟随(E)
https://stackoverflow.com/questions/42708230
复制相似问题