{"id":21832848,"url":"https://github.com/winstonliyt/c-basedcompilerwithqt","last_synced_at":"2026-04-28T13:36:18.346Z","repository":{"id":240850611,"uuid":"773299607","full_name":"WinstonLiyt/C-basedCompilerWithQt","owner":"WinstonLiyt","description":"C-based Compiler With Qt for Course 10031202 Project","archived":false,"fork":false,"pushed_at":"2024-06-16T04:07:44.000Z","size":46890,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T17:07:24.402Z","etag":null,"topics":["compiler-design","cpp","grammar-parser","lr1-parser","syntax-analyzer"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WinstonLiyt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-03-17T09:41:49.000Z","updated_at":"2025-01-16T02:06:18.000Z","dependencies_parsed_at":"2025-01-26T09:38:01.688Z","dependency_job_id":null,"html_url":"https://github.com/WinstonLiyt/C-basedCompilerWithQt","commit_stats":null,"previous_names":["winstonliyt/c-basedcompilerwithqt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WinstonLiyt/C-basedCompilerWithQt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinstonLiyt%2FC-basedCompilerWithQt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinstonLiyt%2FC-basedCompilerWithQt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinstonLiyt%2FC-basedCompilerWithQt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinstonLiyt%2FC-basedCompilerWithQt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WinstonLiyt","download_url":"https://codeload.github.com/WinstonLiyt/C-basedCompilerWithQt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WinstonLiyt%2FC-basedCompilerWithQt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32383615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["compiler-design","cpp","grammar-parser","lr1-parser","syntax-analyzer"],"created_at":"2024-11-27T19:26:36.843Z","updated_at":"2026-04-28T13:36:18.330Z","avatar_url":"https://github.com/WinstonLiyt.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## C-basedCompilerWithQt :wink:\n\n### Project Description\n![main](https://github.com/WinstonLiyt/C-basedCompilerWithQt/assets/104308117/c07469ff-ae13-43a6-9c45-f69d48d4d218)\n\nUsing a high-level programming language, implement a **one-pass compiler** that resembles C. The specific requirements are as follows:\n\n1. **Construct a lexical analysis DFA** to recognize character types in the code and form basic tokens to be sent to the syntax analyzer.\n2. Based on the **LR(1) analysis method**, write a syntax analysis program that, given an input grammar, **automatically generates the ACTION and GOTO tables** and performs reduction and judgment.\n3. The **syntax analysis program** should be able to call the lexical analysis program and take into account the subsequent semantic analysis module.\n4. For a given grammar and a segment of code, the program should **correctly determine whether the code string is a sentence of the grammar** and output the analysis process and syntax tree.\n5. Generate corresponding **quadruples for each syntax structure** (e.g., assignment statements, conditional statements, loop statements, function jumps).\n6. Handle the **backpatching of quadruples** (e.g., jump targets in conditional jump statements).\n7. Perform simple **optimizations**, such as eliminating redundant temporary variables.\n8. **Output the generated quadruples to a file**.\n9. Based on the result of the intermediate code generation, use **live variable information and register allocation algorithms** to generate assembly target code. If successful, **generate MIPS assembly code**.\n10. **Run the assembly code through Mars** and verify that the results of the assembly code match the results of the C++ code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinstonliyt%2Fc-basedcompilerwithqt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwinstonliyt%2Fc-basedcompilerwithqt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwinstonliyt%2Fc-basedcompilerwithqt/lists"}