编译原理课程设计:语法分析器

上传者: rliriong | 上传时间: 2024-04-15 21:16:57 | 文件大小: 7.3MB | 文件类型: RAR
所使用的开发环境:Windows10、python(PyCharm)环境 注意:expression已给,包括测试的例子,但是需要词法分析器分析出的token表,格式:(行数, token分类, token内容),可以配套我的词法分析器使用。 要求:创建一个使用LR(1) 方法的语法分析程序,程序有两个输入:1)一个是文本文档,其中包含2º型文法(上下文无关文法)的产生式集合;2)任务1词法分析程序输出的(生成的)token令牌表。程序的输出包括:YES或NO(源代码字符串符合此2º型文法,或者源代码字符串不符合此2º型文法);错误提示文件,如果有语法错标示出错行号,并给出大致的出错原因。 项目简介:程序读入上下文无关文法,并进行拓广文法,将产生式依次形成项目进行储存,设定好起点进行处理得到完整的项目集族,按照项目集族之间的转换得到action、goto表,读取词法分析得到的token,按照之前得到的action、goto表进行处理,得到语法分析的结果,查看是否符合自己设定的语法,如果出错可以形成缺失或者错误导致的错误报告,并输出到result.txt(正确会得到‘YES’)。

文件下载

资源详情

[{"title":"( 27 个子文件 7.3MB ) 编译原理课程设计:语法分析器","children":[{"title":"Parser","children":[{"title":"expression","children":[{"title":"ex_2.txt <span style='color:#111;'> 103B </span>","children":null,"spread":false},{"title":"ex_2说明.txt <span style='color:#111;'> 287B </span>","children":null,"spread":false}],"spread":true},{"title":"main.py <span style='color:#111;'> 1005B </span>","children":null,"spread":false},{"title":"__pycache__","children":[{"title":"to_LR1.cpython-310.pyc <span style='color:#111;'> 8.60KB </span>","children":null,"spread":false},{"title":"read.cpython-310.pyc <span style='color:#111;'> 2.10KB </span>","children":null,"spread":false}],"spread":true},{"title":"result.txt <span style='color:#111;'> 3B </span>","children":null,"spread":false},{"title":"read.py <span style='color:#111;'> 3.15KB </span>","children":null,"spread":false},{"title":"main.exe <span style='color:#111;'> 7.47MB </span>","children":null,"spread":false},{"title":".idea","children":[{"title":"Parser.iml <span style='color:#111;'> 291B </span>","children":null,"spread":false},{"title":"misc.xml <span style='color:#111;'> 208B </span>","children":null,"spread":false},{"title":".name <span style='color:#111;'> 7B </span>","children":null,"spread":false},{"title":"modules.xml <span style='color:#111;'> 271B </span>","children":null,"spread":false},{"title":"encodings.xml <span style='color:#111;'> 199B </span>","children":null,"spread":false},{"title":"sonarlint","children":[{"title":"issuestore","children":[{"title":"index.pb <span style='color:#111;'> 390B </span>","children":null,"spread":false},{"title":"c","children":[{"title":"e","children":[{"title":"ce8d37635f534cf43db6d9a19767fdde88c93a44 <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"a","children":[{"title":"f","children":[{"title":"affb32350af3005f0ecda925a2617dd9df4f452f <span style='color:#111;'> 974B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"f","children":[{"title":"1","children":[{"title":"f1bdda93d9a278e358509d498e17d97764c1fb29 <span style='color:#111;'> 63B </span>","children":null,"spread":false}],"spread":false},{"title":"5","children":[{"title":"f580b61c3e1774fa4f83b24494168f6cc42fabc0 <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"3","children":[{"title":"a","children":[{"title":"3abcc6241fe0d305cb4bf43c096a467f03562717 <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false},{"title":"e","children":[{"title":"3eeb74d2b070a6b9469281ad495e4ce9d8e54482 <span style='color:#111;'> 176B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":true},{"title":"workspace.xml <span style='color:#111;'> 3.01KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 50B </span>","children":null,"spread":false},{"title":"inspectionProfiles","children":[{"title":"Project_Default.xml <span style='color:#111;'> 410B </span>","children":null,"spread":false},{"title":"profiles_settings.xml <span style='color:#111;'> 174B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"to_LR1.py <span style='color:#111;'> 16.15KB </span>","children":null,"spread":false},{"title":"code","children":[{"title":"out_from_task1.txt <span style='color:#111;'> 515B </span>","children":null,"spread":false}],"spread":true},{"title":"main.spec <span style='color:#111;'> 852B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

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