{"id":13655209,"url":"https://github.com/wangwangwang23333/Compile-Homework","last_synced_at":"2025-04-23T10:32:11.828Z","repository":{"id":82203635,"uuid":"434827997","full_name":"wangwangwang23333/Compile-Homework","owner":"wangwangwang23333","description":"编译原理大作业——自下而上","archived":false,"fork":false,"pushed_at":"2022-02-10T09:20:30.000Z","size":293,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-10T06:34:31.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wangwangwang23333.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-04T06:39:13.000Z","updated_at":"2023-12-24T13:22:47.000Z","dependencies_parsed_at":"2023-07-06T09:33:43.702Z","dependency_job_id":null,"html_url":"https://github.com/wangwangwang23333/Compile-Homework","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangwangwang23333%2FCompile-Homework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangwangwang23333%2FCompile-Homework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangwangwang23333%2FCompile-Homework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangwangwang23333%2FCompile-Homework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangwangwang23333","download_url":"https://codeload.github.com/wangwangwang23333/Compile-Homework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250416535,"owners_count":21427008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T03:00:59.584Z","updated_at":"2025-04-23T10:32:06.811Z","avatar_url":"https://github.com/wangwangwang23333.png","language":"Python","funding_links":[],"categories":["目录"],"sub_categories":["编译原理"],"readme":"## 简介\n本项目为软件工程专业编译原理课程大作业，完成内容为自下而上语法分析章节中的算法。\n\n项目演示视频：https://www.bilibili.com/video/BV1Rq4y1y7z4\n\n我们使用Python作为各个算法的编程语言。同时，我们采用了PyQt5作为可视化界面，使用了包括QTableWidget在内的控件实现输入输出的展示。为了实现语法树和DFA图的生成，我们使用了Graphviz包作为有向图（DFA图和语法树）绘制的工具。\n\n\u003cimg src=\"https://s4.ax1x.com/2022/01/12/7uKvkT.png\"\u003e\n\u003cimg src=\"https://s4.ax1x.com/2022/01/12/7uMVAK.png\"\u003e\n\u003cimg src=\"https://s4.ax1x.com/2022/01/12/7uMu1H.png\"\u003e\n\n## 环境需求\n要运行本项目，请先保证电脑中已有Graphviz环境（配置在环境变量中）\n通过python运行main.py文件即可\n需要python库已添加在requirement.txt中\n\n## 实验内容\n- 实验3.1为FIRSTVAL/LASTVAL集合构造算法，要求接收文法产生式，输出文法符号的FIRSTVT和LASTVT集合元素。\n- 实验3.2为优先关系表构造算法，要求接收算符文法产生式，输出算符优先关系表。\n- 实验3.3为算符优先分析算法，接收算符文法和算符优先分析表，输出算符优先语法分析程序。\n- 实验3.4为识别文法活前缀的DFA构造算法，接收上下文无关文法，输出LR(0)和LR(1)项目的DFA图和状态转移矩阵。\n- 实验3.5为LR(0)分析表构造算法，接收文法产生式和基于LR(0)项目构造的DFA图或状态转移矩阵，输出LR(0)分析表。\n- 实验3.6为SLR分析表构造算法，接收文法产生式和基于LR(0)项目构造的DFA图或状态转移矩阵，输出SLR分析表。\n- 实验3.7为LR(1)分析表构造算法，接收文法产生式和于LR(1)项目构造的DFA图或状态转移矩阵，输出LR(1)分析表。\n- 实验3.8为LALR分析表构造算法，接收文法产生式和基于LALAR的DFA图或状态转移矩阵，输出LALR分析表。\n- 实验3.9为基于LR分析表的语法分析总控程序，接收文法产生式和LR分析表，输出语法分析程序。\n- 综合实验为基于LR(1)分析法的语法分析程序生成器，是实验3.4~3.8的综合性实验，接收上下文无关文法，输出语法分析程序。\n\n## 小组分工\n- 汪明杰完成了算法3.2、3.4、3.9和综合性实验与界面设计\n- 卓正一完成了算法3.7和3.8\n- 王立友完成了算法3.1和3.5\n- 梁乔完成了算法3.3和3.6\n\n## 实验亮点\n- 完成了模块要求的全部算法和综合性实验；\n- 通过PyQt5界面，更好的实现了不同算法的输入和输出，让结果呈现更加清晰；\n- 通过Graphviz绘制DFA图和语法树，更好的展现了算法的输出；\n- 代码逻辑清晰，不同功能的算法定义在了不同的类中（如GrammarManager负责词法分析，LR0类和LR1类等）；\n- 有错误捕捉机制，当出现输入错误时程序能够体现在界面上。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangwangwang23333%2FCompile-Homework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangwangwang23333%2FCompile-Homework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangwangwang23333%2FCompile-Homework/lists"}