{"id":16930530,"url":"https://github.com/erfaniaa/compilers-course-project","last_synced_at":"2025-04-11T18:32:14.248Z","repository":{"id":81362061,"uuid":"152960551","full_name":"Erfaniaa/compilers-course-project","owner":"Erfaniaa","description":"Converting a pseudo-C source code to a pseudo-assembly code","archived":false,"fork":false,"pushed_at":"2020-04-23T22:08:30.000Z","size":700,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T14:21:43.744Z","etag":null,"topics":["compilers","cpp","grammar","lalr-parser","lark-parser","parser","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Erfaniaa.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-10-14T09:59:07.000Z","updated_at":"2024-06-07T23:47:41.000Z","dependencies_parsed_at":"2023-07-11T10:46:33.765Z","dependency_job_id":null,"html_url":"https://github.com/Erfaniaa/compilers-course-project","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/Erfaniaa%2Fcompilers-course-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erfaniaa%2Fcompilers-course-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erfaniaa%2Fcompilers-course-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Erfaniaa%2Fcompilers-course-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Erfaniaa","download_url":"https://codeload.github.com/Erfaniaa/compilers-course-project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248458651,"owners_count":21107122,"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":["compilers","cpp","grammar","lalr-parser","lark-parser","parser","python3"],"created_at":"2024-10-13T20:41:54.468Z","updated_at":"2025-04-11T18:32:14.224Z","avatar_url":"https://github.com/Erfaniaa.png","language":"Python","readme":"# Compilers Course Project\r\n\u003e Converting a pseudo C source code to a pseudo assembly code\r\n\r\nFor more information, read the PDF files which are located in this repository (they're in Persian language).\r\n\r\n## Dependencies\r\n\r\n    pip3 install -r requirements.txt\r\n  \r\n  \r\n## Usage\r\n\r\n\tpython3 run.py input_file_name.c\r\n\r\n**Sample input (pseudo C source code):**\r\n\r\nCheck out [sample.c](https://github.com/Erfaniaa/compilers-course-project/blob/master/sample.c) in the repository (to see the language features).\r\n\r\n    python3 run.py sample.c\r\n\r\n**Sample output (pseudo assembly codes):**\r\n\r\n\tNo syntax errors\r\n\tline number 0: jmp 15 \r\n\tline number 1: mov 0 #0 \r\n\tline number 2: pop 10000 \r\n\tline number 3: mov 4 #47 \r\n    line number 4: push 4 \r\n    line number 5: jmp 10000 \r\n    line number 6: push #0 \r\n    line number 7: jmp 10000 \r\n    line number 8: pop 4 \r\n    line number 9: pop 10000 \r\n    line number 10: add 4 #47 4 \r\n    ...\r\n\r\n\r\n## Notes\r\n\r\n- This project was done by [Ali Mirjahani](https://github.com/alimirjahani7) and [Erfan Alimohammadi](https://github.com/erfaniaa) in 2019 for the [Shahid Beheshti University](http://en.sbu.ac.ir) Compilers Course project.\r\n- You can modify the codes and produce your own programming language. There are not much hard-codes, so editing the language grammar would be easy. Grammar rules files have \".in\" extension in the repository.\r\n- There are no switch-case statements in the scanner finite-state machine part. Just draw your DFA graph on a paper, and enter the graph nodes and edges in the scanner; it will work for you! So, modifying scanner DFA (adding and removing edges) doesn't take time from you.\r\n- This project uses a LL(1) parser (which is implemented by us) and a LALR parser (which is lark-parser, for parsing the boolean expressions). It switches between these two parsers, according to its state.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfaniaa%2Fcompilers-course-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferfaniaa%2Fcompilers-course-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferfaniaa%2Fcompilers-course-project/lists"}