{"id":18447031,"url":"https://github.com/zhb2000/mini-python-parser","last_synced_at":"2026-05-07T17:39:56.374Z","repository":{"id":108880711,"uuid":"374592095","full_name":"zhb2000/mini-python-parser","owner":"zhb2000","description":"A \"Mini-Python\" parser","archived":false,"fork":false,"pushed_at":"2021-06-18T04:38:53.000Z","size":2579,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T10:53:20.100Z","etag":null,"topics":["parser","python","typescript"],"latest_commit_sha":null,"homepage":"https://zhb2000.github.io/mini-python-parser","language":"TypeScript","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/zhb2000.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-06-07T08:31:58.000Z","updated_at":"2023-06-02T11:25:24.000Z","dependencies_parsed_at":"2023-03-31T12:37:11.011Z","dependency_job_id":null,"html_url":"https://github.com/zhb2000/mini-python-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhb2000/mini-python-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhb2000%2Fmini-python-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhb2000%2Fmini-python-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhb2000%2Fmini-python-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhb2000%2Fmini-python-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhb2000","download_url":"https://codeload.github.com/zhb2000/mini-python-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhb2000%2Fmini-python-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32749514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["parser","python","typescript"],"created_at":"2024-11-06T07:11:48.567Z","updated_at":"2026-05-07T17:39:56.356Z","avatar_url":"https://github.com/zhb2000.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini-Python Parser\n编译原理大作业，一个“Mini-Python”语言的 Parser，可以在浏览器里运行并查看结果：[Mini-Python Parser](https://zhb2000.github.io/mini-python-parser)。\n\nMini-Python 的语法基于 Python 3.6 简化而来，文法定义详见[语法分析.md](./doc/parser/语法分析.md)。\n\n如果本仓库对你有帮助，你可以给我点个 Star。( '▿' )\n\n## 截图\n![ast](./doc/pic/screenshot-ast.png)\n\n![tree](./doc/pic/screenshot-tree.png)\n\n## 流程\n### 预处理\nPython 带缩进的语法属于上下文有关文法，但是经过预处理后可以变为上下文无关文法：\n\n- “缩进增”相当于其他语言的左花括号\n- “缩进减”相当于右花括号\n- “换行”相当于分号\n\n此外，预处理器还会执行去除注释、去除空白行等操作。\n\n### 词法分析\n输入预处理后的代码，输出 token 序列。这里使用有限状态自动机（DFA）完成这个步骤。\n\nMini-Python 的词法定义详见[词法分析.md](./doc/scanner/词法分析.md)。\n\n### 语法分析\n输入 token 序列，输出分析树（Parse Tree）。这里使用递归下降方法完成这个步骤。\n\nMini-Python 的文法定义详见[语法分析.md](./doc/parser/语法分析.md)（使用 EBNF 表示）。\n\n### 翻译\n将分析树变换为抽象语法树（AST）。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhb2000%2Fmini-python-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhb2000%2Fmini-python-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhb2000%2Fmini-python-parser/lists"}