编译原理 龙书答案(9)

时间:2025-01-18

编译原理 龙书答案

a/b] } = I6

goto(I1, a) = I3, goto(I1, b) = {[S→b , a/b]} = I7

goto(I2, S) = {[S→AS , $/a/b], [A→S A, a/b], [A→ SA, a/b], [A→ a, a/b], [S→ AS, a/b], [S→ b, a/b] } = I8

goto(I2, A) = I2, goto(I2, a) = I3, goto(I2, b) = I4 goto(I5, S) = I5, goto(I5, A) = I6, goto(I5, a) = I3, goto(I5, b) = I7

goto(I6, S) = {[S→AS , a/b], [A→S A, a/b], [A→ SA, a/b], [A→ a, a/b], [S→ AS, a/b], [S→ b, a/b] } = I9

goto(I6, A) = {[S→A S, a/b] , [S→ AS, a/b], [S→ b, a/b], [A→ SA, a/b], [A→ a, a/b] } = I10 goto(I6, a) = I3, goto(I6, b) = I7 goto(I8, S) = I5, goto(I8, A) = I6, goto(I8, a) = I3, goto(I8, b) = I7 goto(I9, S) = I5, goto(I9, A) = I6, goto(I9, a) = I3, goto(I9, b) = I7 goto(I10, S) = I9, goto(I10, A) = I10, goto(I10, a) = I3, goto(I10, b) = I7 规范LR分析表为:

f) 利用LR(1)项目集合并的方法构造LALR分析表 解:

同心集合并:

I2 10 = {[S→A S, $/a/b] , [S→ AS, $/a/b], [S→

b, $/a/b], [A→ SA, a/b], [A→ a, a/b] } I47 = {[S→b , $/a/b]}

I89 = {[S→AS , $/a/b], [A→S A, a/b], [A→ SA, a/b], [A→ a, a/b], [S→ AS, a/b], [S→ b, a/b] }

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219