{"id":19297282,"url":"https://github.com/hchunhui/compiler","last_synced_at":"2026-01-10T06:05:06.104Z","repository":{"id":3630258,"uuid":"4696677","full_name":"hchunhui/compiler","owner":"hchunhui","description":"a mini C-like language(C1) compiler","archived":false,"fork":false,"pushed_at":"2019-11-24T13:43:39.000Z","size":1297,"stargazers_count":35,"open_issues_count":5,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-09T23:02:27.668Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/hchunhui.png","metadata":{"files":{"readme":"README","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}},"created_at":"2012-06-18T02:46:09.000Z","updated_at":"2024-07-21T15:06:23.000Z","dependencies_parsed_at":"2022-08-18T00:05:42.609Z","dependency_job_id":null,"html_url":"https://github.com/hchunhui/compiler","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/hchunhui%2Fcompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hchunhui%2Fcompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hchunhui%2Fcompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hchunhui%2Fcompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hchunhui","download_url":"https://codeload.github.com/hchunhui/compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250214957,"owners_count":21393705,"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-11-09T23:01:50.308Z","updated_at":"2025-04-22T09:30:34.637Z","avatar_url":"https://github.com/hchunhui.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"C1编译器说明\n-------------------\n* 特点 *\n    - 多目标：对C1源代码，可以生成MIPS汇编码、EIR二进制码和C代码；\n    - 强大的类型系统：可以识别C语言语法的类型定义，输出其类型表达式；\n    - 实现绝大部分C1语言特征；\n    - 带有扩展语法：如continue、for等；\n    - 较详细的错误报告；\n\n* 文档 *\ndoc/c1.pdf\ndoc/c0.pdf 2.1节 中间代码生成，参照c1.y\n\n* 重要文件说明 *\nsrc/\n|--rule/\n|  |--c1.y          语法文件\n|  |--c1.lex        词法文件\n|--src/\n|  |--c1c.c         编译器的主程序\n|  |--sym_tab.c     符号表实现\n|  |--type.c        类型系统\n|  |--check.c       语义检查系统\n|  |--gen_c.c       从AST生成C代码的生成器\n|  |--gen_eir.c     从AST生成PL/0中间代码的生成器\n|  |--gen_spim.c    从AST生成MIPS汇编代码的生成器\n|--include/\n|  |--ast_node.h    AST实现\n|  |--list.h        链表实现（从Linux内核中抽取）\n|  |--node_type.h   AST结点类型定义\n|  |--type.h        类型系统头\n|  |--error.h       错误提示\n|  |--eir_inst.h    EIR指令格式\n|  |--gen.h         生成器接口\n|--test/*.c         简单的测试程序\n|--eir/*.c1         测试程序\n\n* 建造 *\n\tmake clean\n\tmake\n生成：\nc1c\n\n* 运行 *\n从命令行读取参数，使用方法类似GCC：\n\n编译生成EIR中间代码：\n\t./c1c src_file [-o out_file]\n解释EIR：\n        ./interpreter out_file\n\n编译生成C代码：\n\t./c1c src_file [-o out_file] -m c\n\t\n编译生成MIPS汇编代码：\n\t./c1c src_file [-o out_file] -m spim\n\n帮助：\n\t./c1c -h\n\nPB09210183 何春晖\n2012.05.05\n2012.06.13\n2012.06.17\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhchunhui%2Fcompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhchunhui%2Fcompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhchunhui%2Fcompiler/lists"}