{"id":20187327,"url":"https://github.com/anaskhan96/r2ic","last_synced_at":"2025-07-12T21:35:54.781Z","repository":{"id":67947213,"uuid":"120630448","full_name":"anaskhan96/r2ic","owner":"anaskhan96","description":"A front end compiler to compile basic constructs in Rust to an intermediate code (quadruples) with optimizations","archived":false,"fork":false,"pushed_at":"2018-11-28T11:30:44.000Z","size":57,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T07:48:53.590Z","etag":null,"topics":["abstract-syntax-tree","intermediate-code","intermediate-representation","lexer","parser","quadruple","rust"],"latest_commit_sha":null,"homepage":"","language":"Python","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/anaskhan96.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":"2018-02-07T15:08:20.000Z","updated_at":"2023-03-17T11:29:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b7b564f-4553-4590-a197-027fe92dd824","html_url":"https://github.com/anaskhan96/r2ic","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/anaskhan96%2Fr2ic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaskhan96%2Fr2ic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaskhan96%2Fr2ic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anaskhan96%2Fr2ic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anaskhan96","download_url":"https://codeload.github.com/anaskhan96/r2ic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173019,"owners_count":21059591,"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":["abstract-syntax-tree","intermediate-code","intermediate-representation","lexer","parser","quadruple","rust"],"created_at":"2024-11-14T03:22:47.936Z","updated_at":"2025-04-10T06:41:23.926Z","avatar_url":"https://github.com/anaskhan96.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# r2ic\n\n`r2ic` converts a rust program (containing only its basic constructs - `if`, `else`, `for`, `while`, and `loop`, along with variable declarations with `let`) to an intermediate code in the form of quadruples. It also generates an abstract syntax tree for expressions and assignments. The intermediate code generated has three kinds of code optimizations:\n+ Constant folding\n+ Constant propagation\n+ Loop unrolling\n\nThe tool is built using Python's PLY framework for scanning tokens and parsing the input.\n\n### How to run it\n\nTest cases can be added inside `src/test-cases` with the format specified. The test case number can then be provided as a command line argument to `main.py` inside the src directory. For eg, to run the test case `src/test-cases/case2.txt`, the command would be as given:\n```bash\ncd src\npython3 main.py 2\n```\n---\nThis project was built under the course *Compiler Design Laboratory* in *PES University*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaskhan96%2Fr2ic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanaskhan96%2Fr2ic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanaskhan96%2Fr2ic/lists"}