3、以下哪个不属于SCAMPER奔驰法A.Substitute替代B.Adapt调整C.Eliminate消除D.Innovation 创新
3、以下哪个不属于SCAMPER奔驰法
A.Substitute替代
B.Adapt调整
C.Eliminate消除
D.Innovation 创新
参考答案和解析
答:(a) 该文法的拓广文法G'为 (0) S' → S (1) S → Sab (2) S → bR (3) R → S (4) R → a其LR(0)项目集规范族和goto函数(识别活前缀的DFA)如下:I0 = {S'→·S, S→·Sab, S→·bR}I1 = {S'→S·, S→S·ab}I2 = {S→b·R, R→·S, R→·a, S→·Sab, S→·bR}I3 = {S→Sa·b}I4 = {S→bR·}I5 = {R→S·, S→S·ab}I6 = {R→a·}I7 = {S→Sab·}求FOLLOW集: FOLLOW(S')={$} FOLLOW(R)=FOLLOW(S)={a,$}在I5中,出现移进-归约冲突,且FOLLOW(R)∩{a}={a}因此,此文法不是SLR(1)文法。(b) 该文法的拓广文法G'为 (0) S' → S (1) S → aSAB (2) S → BA (3) A → aA (4) A → B (5) B → b其LR(0)项目集规范族和goto函数(识别活前缀的DFA)如下:I0 = {S'→·S, S→·aSAB, S→·BA, B→·b}I1 = {S'→S·}I2 = {B→b·}I3 = {S→a·SAB, S→·aSAB, S→·BA, B→·b}I4 = {S→B·A, A→·aA, A→·B, B→·b}I5 = {S→aS·AB, A→·aA, A→·B, B→·b}I6 = {S→aSA·B, B→·b}I7 = {A→a·A, A→·aA, A→·B, B→·b}I8 = {A→B·}I9 = {S→BA·}I10 = {S→aSAB·}I11 = {A→aA·}求FOLLOW集: FOLLOW(S')={$} FOLLOW(S)={a,b,$} FOLLOW(A)={a,b,$} FOLLOW(B)={a,b,$}
相关考题:
单选题以下哪个不属于书法的基本要素。()A字法B句法C笔法D章法