首页 课程资源 C/C++     /    编译原理实验LR分析表构造LR分析器

编译原理实验LR分析表构造LR分析器

上传者: zjj133 | 上传时间:2023/5/15 20:36:36 | 文件大小:12.74MB | 文件类型:zip
编译原理实验LR分析表构造LR分析器
LR分析器工作过程算法描述:一个LR分析器的工作过程可看成是栈里的状态序列,已规约串和输入串所构成的三元式的变化过程。
分析开始时的初始三元式为(s0,#,a1a2……an#)其中,s0为分析器的初态;
#为句子的左括号;
a1a2……an为输入串;
其后的#为结束符(句子右括号)。
分析过程每步的结果可表示为(s0s1……sm,#X1X2……Xmai,ai+1……an#)分析器的下一步动作是由栈顶状态sm和现行输入符号ai所唯一决定的。
即,执行ACTION(sm,ai)所规定的动作。
经执行每种可能的动作之后,三元式的变化情形是:(1)若ACTION(sm,ai)为移进,且s=GOTO(sm,ai),则三元式变成:(s0s1……sms,#X1X2……Xmai,ai+1……an#)(2)若ACTION(sm,ai)={A→β},则按照产生式A→β进行规约。
此时三元式变为(s0s1……sms,#X1X2……XmA,aiai+1……an#)此处s=GOTO(Sm-r,A),r为β的长度,β=Xm-r+1……Xm。
(3)若ACTION(sm,ai)为“接受”,则三元式不再变化,变化过程终止,宣布分析成功。
(4)若ACTION(sm,ai)为“报错”,则三元式的变化过程终止,报告错误。
一个LR分析器的工作过程就是一步一步的变换三元式,直至执行“接受”或“报错”为止。

文件下载

资源详情

[{"title":"(85个子文件12.74MB)编译原理实验LR分析表构造LR分析器","children":[{"title":"编译原理实验代码","children":[{"title":"词法分析器-73.pdf <span style='color:#111;'>3.92MB</span>","children":null,"spread":false},{"title":"编译原理课程设计","children":[{"title":"编译原理课程设计","children":[{"title":"报告.doc <span style='color:#111;'>125.37KB</span>","children":null,"spread":false},{"title":"26.dsp <span style='color:#111;'>3.27KB</span>","children":null,"spread":false},{"title":"lr.h <span style='color:#111;'>923B</span>","children":null,"spread":false},{"title":"26.cpp <span style='color:#111;'>2.20KB</span>","children":null,"spread":false},{"title":"《编译原理》实验.doc <span style='color:#111;'>256.00KB</span>","children":null,"spread":false},{"title":"26.opt <span style='color:#111;'>47.50KB</span>","children":null,"spread":false},{"title":"symbol_instr_stack.h <span style='color:#111;'>1.09KB</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"26.ilk <span style='color:#111;'>187.89KB</span>","children":null,"spread":false},{"title":"26.pdb <span style='color:#111;'>449.00KB</span>","children":null,"spread":false},{"title":"26.obj <span style='color:#111;'>18.46KB</span>","children":null,"spread":false},{"title":"26.pch <span style='color:#111;'>219.70KB</span>","children":null,"spread":false},{"title":"vc60.idb <span style='color:#111;'>41.00KB</span>","children":null,"spread":false},{"title":"26.exe <span style='color:#111;'>180.10KB</span>","children":null,"spread":false},{"title":"vc60.pdb <span style='color:#111;'>52.00KB</span>","children":null,"spread":false}],"spread":true},{"title":"status_stack.h <span style='color:#111;'>883B</span>","children":null,"spread":false},{"title":"26.plg <span style='color:#111;'>716B</span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"词法分析器实验报告.pdf <span style='color:#111;'>3.63MB</span>","children":null,"spread":false},{"title":"LL1ForWin","children":[{"title":"5.TXT <span style='color:#111;'>186B</span>","children":null,"spread":false},{"title":"2.TXT <span style='color:#111;'>151B</span>","children":null,"spread":false},{"title":"TreeDlg.cpp <span style='color:#111;'>1.25KB</span>","children":null,"spread":false},{"title":"LL1ForWinDlg.h <span style='color:#111;'>1.72KB</span>","children":null,"spread":false},{"title":"ResizingDialog.cpp <span style='color:#111;'>7.07KB</span>","children":null,"spread":false},{"title":"Set.cpp <span style='color:#111;'>1.99KB</span>","children":null,"spread":false},{"title":"Precept.h <span style='color:#111;'>280B</span>","children":null,"spread":false},{"title":"LL1ForWin.opt <span style='color:#111;'>53.50KB</span>","children":null,"spread":false},{"title":"RES","children":[{"title":"LL1ForWin.rc2 <span style='color:#111;'>401B</span>","children":null,"spread":false},{"title":"LL1ForWin.ico <span style='color:#111;'>1.05KB</span>","children":null,"spread":false}],"spread":true},{"title":"Grammar.h <span style='color:#111;'>1.14KB</span>","children":null,"spread":false},{"title":"LL1ForWin.cpp <span style='color:#111;'>2.06KB</span>","children":null,"spread":false},{"title":"LL1ForWin.h <span style='color:#111;'>1.33KB</span>","children":null,"spread":false},{"title":"LL1ForWin.dsp <span style='color:#111;'>5.43KB</span>","children":null,"spread":false},{"title":"Precept.cpp <span style='color:#111;'>408B</span>","children":null,"spread":false},{"title":"LL1ForWin.ncb <span style='color:#111;'>305.00KB</span>","children":null,"spread":false},{"title":"LL1ForWin.plg <span style='color:#111;'>252B</span>","children":null,"spread":false},{"title":"LL1ForWinDlg.cpp <span style='color:#111;'>10.96KB</span>","children":null,"spread":false},{"title":"TableDlg.h <span style='color:#111;'>1.44KB</span>","children":null,"spread":false},{"title":"LL1ForWin.dsw <span style='color:#111;'>587B</span>","children":null,"spread":false},{"title":"1.TXT <span style='color:#111;'>148B</span>","children":null,"spread":false},{"title":"Grammar.cpp <span style='color:#111;'>18.45KB</span>","children":null,"spread":false},{"title":"StdAfx.cpp <span style='color:#111;'>211B</span>","children":null,"spread":false},{"title":"AnalyzeDlg.cpp <span style='color:#111;'>7.38KB</span>","children":null,"spread":false},{"title":"ResizingDialog.h <span style='color:#111;'>1.59KB</span>","children":null,"spread":false},{"title":"explorer1.cpp <span style='color:#111;'>10.83KB</span>","children":null,"spread":false},{"title":"TreeDlg.h <span style='color:#111;'>1.17KB</span>","children":null,"spread":false},{"title":"AnalyzeDlg.h <span style='color:#111;'>1.81KB</span>","children":null,"spread":false},{"title":"RESOURCE.H <span style='color:#111;'>1.84KB</span>","children":null,"spread":false},{"title":"LL1ForWin.aps <span style='color:#111;'>24.74KB</span>","children":null,"spread":false},{"title":"StdAfx.h <span style='color:#111;'>1.03KB</span>","children":null,"spread":false},{"title":"LL1ForWin.rc <span style='color:#111;'>10.49KB</span>","children":null,"spread":false},{"title":"TableDlg.cpp <span style='color:#111;'>2.74KB</span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"explorer1.obj <span style='color:#111;'>62.91KB</span>","children":null,"spread":false},{"title":"StdAfx.obj <span style='color:#111;'>103.42KB</span>","children":null,"spread":false},{"title":"ResizingDialog.obj <span style='color:#111;'>24.93KB</span>","children":null,"spread":false},{"title":"VC60.PDB <span style='color:#111;'>476.00KB</span>","children":null,"spread":false},{"title":"Grammar.obj <span style='color:#111;'>153.01KB</span>","children":null,"spread":false},{"title":"LL1ForWin.ilk <span style='color:#111;'>433.29KB</span>","children":null,"spread":false},{"title":"LL1ForWin.obj <span style='color:#111;'>15.17KB</span>","children":null,"spread":false},{"title":"Grammar.sbr <span style='color:#111;'>270.00KB</span>","children":null,"spread":false},{"title":"LL1ForWin.pdb <span style='color:#111;'>641.00KB</span>","children":null,"spread":false},{"title":"TableDlg.obj <span style='color:#111;'>39.69KB</span>","children":null,"spread":false},{"title":"TreeDlg.obj <span style='color:#111;'>14.13KB</span>","children":null,"spread":false},{"title":"LL1ForWin.sbr <span style='color:#111;'>3.66KB</span>","children":null,"spread":false},{"title":"TreeDlg.sbr <span style='color:#111;'>4.22KB</span>","children":null,"spread":false},{"title":"LL1ForWin.exe <span style='color:#111;'>212.10KB</span>","children":null,"spread":false},{"title":"StdAfx.sbr <span style='color:#111;'>1.31MB</span>","children":null,"spread":false},{"title":"LL1ForWinDlg.sbr <span style='color:#111;'>263.66KB</span>","children":null,"spread":false},{"title":"TableDlg.sbr <span style='color:#111;'>270.34KB</span>","children":null,"spread":false},{"title":"Precept.sbr <span style='color:#111;'>198.33KB</span>","children":null,"spread":false},{"title":"AnalyzeDlg.sbr <span style='color:#111;'>298.38KB</span>","children":null,"spread":false},{"title":"explorer1.sbr <span style='color:#111;'>13.05KB</span>","children":null,"spread":false},{"title":"LL1ForWinDlg.obj <span style='color:#111;'>67.46KB</span>","children":null,"spread":false},{"title":"LL1ForWin.pch <span style='color:#111;'>6.71MB</span>","children":null,"spread":false},{"title":"LL1ForWin.res <span style='color:#111;'>4.65KB</span>","children":null,"spread":false},{"title":"Precept.obj <span style='color:#111;'>17.09KB</span>","children":null,"spread":false},{"title":"Set.sbr <span style='color:#111;'>91.16KB</span>","children":null,"spread":false},{"title":"VC60.IDB <span style='color:#111;'>257.00KB</span>","children":null,"spread":false},{"title":"ResizingDialog.sbr <span style='color:#111;'>4.57KB</span>","children":null,"spread":false},{"title":"Set.obj <span style='color:#111;'>42.95KB</span>","children":null,"spread":false},{"title":"AnalyzeDlg.obj <span style='color:#111;'>141.00KB</span>","children":null,"spread":false}],"spread":false},{"title":"3.TXT <span style='color:#111;'>158B</span>","children":null,"spread":false},{"title":"4.TXT <span style='color:#111;'>189B</span>","children":null,"spread":false},{"title":"explorer1.h <span style='color:#111;'>3.66KB</span>","children":null,"spread":false},{"title":"Set.h <span style='color:#111;'>536B</span>","children":null,"spread":false}],"spread":false},{"title":"词法分析器.pdf <span style='color:#111;'>1.56MB</span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • Q_JH:
    不是很符合自己的要求,但可以参考2015-11-03
  • yueshilong521:
    部分代码可以参考,不是很符合自己的要求2014-06-12
  • kekeme6:
    没法构造LR分析表2014-06-11
  • dny2012:
    不错,代码可以参考2014-05-27

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明