{"id":22246659,"url":"https://github.com/rmsnow/simplecompiler","last_synced_at":"2025-03-25T11:24:50.187Z","repository":{"id":119332212,"uuid":"112603422","full_name":"RMSnow/SimpleCompiler","owner":"RMSnow","description":"一个完整的编译器前端","archived":false,"fork":false,"pushed_at":"2017-12-17T17:16:55.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T10:30:41.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/RMSnow.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":"2017-11-30T11:26:41.000Z","updated_at":"2017-11-30T13:44:16.000Z","dependencies_parsed_at":"2023-07-17T09:16:00.258Z","dependency_job_id":null,"html_url":"https://github.com/RMSnow/SimpleCompiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSnow%2FSimpleCompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSnow%2FSimpleCompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSnow%2FSimpleCompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RMSnow%2FSimpleCompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RMSnow","download_url":"https://codeload.github.com/RMSnow/SimpleCompiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245451305,"owners_count":20617490,"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-12-03T05:28:44.723Z","updated_at":"2025-03-25T11:24:50.157Z","avatar_url":"https://github.com/RMSnow.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 一个完整的编译器前端\n\n来自龙书`附录A`\n\n## 源语言\n\n一个程序由一个块组成，该块中包含可选的声明和语句。语法符号`basic`表示基本类型。  \n\n    program -\u003e block\n    \n    block   -\u003e { decls stmts }\n    \n    decls   -\u003e decls decl\n             | null\n             \n    decl    -\u003e type id ;\n    \n    type    -\u003e type [ num ] \n             | basic\n      \n    stmts   -\u003e stmts stmt\n             | null\n\n把赋值当作一个语句（而不是表达式中的运算符）可以简化翻译工作。  \n\n    stmt    -\u003e loc = bool ;\n             | if ( bool ) stmt\n             | if ( bool ) stmt else stmt\n             | while ( bool ) stmt\n             | do stmt while ( bool ) ;\n             | break ;\n             | block\n             \n    loc     -\u003e loc [ bool ]\n             | id\n\n表达式的产生式处理了运算符的结合性和优先级。它们对每个优先级级别都使用了一个非终结符号，而非终结符号factor用来表示括号中的表达式、标识符、数组引用和常量。  \n      \n    bool    -\u003e bool || join\n             | join \n    \n    join    -\u003e join \u0026\u0026 equality\n             | equality\n    \n    equality    -\u003e equality == rel\n                 | equality != rel\n                 | rel\n    \n    rel     -\u003e expr \u003c expr\n             | expr \u003c= expr\n             | expr \u003e= expr\n             | expr \u003e expr\n             | expr\n             \n    expr    -\u003e expr + term\n             | expr - term\n             | term\n             \n    term    -\u003e term * unary\n             | term / unary\n             | unary\n    \n    unary   -\u003e ! unary\n             | - unary\n             | factor\n    \n    factor  -\u003e ( bool )\n             | loc\n             | num\n             | real\n             | true\n             | false\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmsnow%2Fsimplecompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmsnow%2Fsimplecompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmsnow%2Fsimplecompiler/lists"}