{"id":24486163,"url":"https://github.com/tamimehsan/c-compiler","last_synced_at":"2026-01-02T14:05:30.975Z","repository":{"id":110305925,"uuid":"532440038","full_name":"TamimEhsan/C-Compiler","owner":"TamimEhsan","description":"A short subset of C Compiler","archived":false,"fork":false,"pushed_at":"2024-04-06T12:50:38.000Z","size":517,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T14:38:21.185Z","etag":null,"topics":["bison","c-compiler","compiler","intermediate-code-generation","lexical-analysis","semantic-analysis","symbol-table","yacc"],"latest_commit_sha":null,"homepage":"","language":"Yacc","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/TamimEhsan.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":"2022-09-04T04:43:30.000Z","updated_at":"2024-05-17T18:30:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"66d930ac-9906-40e2-ba4c-c242a991b668","html_url":"https://github.com/TamimEhsan/C-Compiler","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/TamimEhsan%2FC-Compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TamimEhsan%2FC-Compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TamimEhsan%2FC-Compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TamimEhsan%2FC-Compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TamimEhsan","download_url":"https://codeload.github.com/TamimEhsan/C-Compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243652704,"owners_count":20325611,"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":["bison","c-compiler","compiler","intermediate-code-generation","lexical-analysis","semantic-analysis","symbol-table","yacc"],"created_at":"2025-01-21T14:33:23.755Z","updated_at":"2026-01-02T14:05:25.932Z","avatar_url":"https://github.com/TamimEhsan.png","language":"Yacc","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Simple C Compiler**\n\nA very basic compiler of C with not so basic functionalities\n\n### Quick Run\nYou need to install the following in your ubuntu machine\n```\nsudo apt install yacc\nsudo apt install flex\n```\nalso make sure you have gcc compiler installed. Yes, we will compile a compiler with a compiler!\nThen finally run the script file to get the desired executable\n```\nbash script.h\n```\nThe code generates a asm file. You will need 8086 emulator to run the intermediate code. \n### Inner Workings\n- Stage 1: Lexical Analysis\n- Stage 2: Semantic Analysis\n- Stage 3: Intermediate Code Generation\n- Stage 4: Optimization\n\nLexical analyzer Flex is user to parse the tokens. Then the tokens are fed them to Yacc for semantic analysis. The identifiers are stored a in a symbol table. Then it generates executable intermediate 8086 codes. And finally it optimizes code using various optimization technique like peephole optimization. Then using 8086 emulator the asm can be executed to get the desired output.\n\n### Supported functionalities\n- Basic operations\n- Type casting\n- Simple IO\n- Scope management\n- Controll Statement\n- Functions with parameters and return value\n- Recursion\n- Verbose error detection\n- Single and Multi line comment\n\nSupported data types are\n- Integer\n- Float\n- Double\n- Char","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamimehsan%2Fc-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftamimehsan%2Fc-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftamimehsan%2Fc-compiler/lists"}