{"id":32346154,"url":"https://github.com/vaibhav-2303/minic-compiler","last_synced_at":"2026-05-18T07:33:27.658Z","repository":{"id":67945996,"uuid":"319291860","full_name":"VAIBHAV-2303/MiniC-Compiler","owner":"VAIBHAV-2303","description":"Compiler Front-End Code for a C-like language","archived":false,"fork":false,"pushed_at":"2020-12-07T12:20:25.000Z","size":140,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-08T02:03:53.675Z","etag":null,"topics":["antlr4","compiler-design","llvm","llvm-ir","oops-in-cpp","visitor-pattern"],"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/VAIBHAV-2303.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-12-07T11:01:39.000Z","updated_at":"2023-11-16T02:05:55.000Z","dependencies_parsed_at":"2023-03-03T09:30:23.388Z","dependency_job_id":null,"html_url":"https://github.com/VAIBHAV-2303/MiniC-Compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VAIBHAV-2303/MiniC-Compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAIBHAV-2303%2FMiniC-Compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAIBHAV-2303%2FMiniC-Compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAIBHAV-2303%2FMiniC-Compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAIBHAV-2303%2FMiniC-Compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VAIBHAV-2303","download_url":"https://codeload.github.com/VAIBHAV-2303/MiniC-Compiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAIBHAV-2303%2FMiniC-Compiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33169265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: 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":["antlr4","compiler-design","llvm","llvm-ir","oops-in-cpp","visitor-pattern"],"created_at":"2025-10-24T05:55:37.630Z","updated_at":"2026-05-18T07:33:27.654Z","avatar_url":"https://github.com/VAIBHAV-2303.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniC-Compiler\n\n## Description\n\nThis repository contains code for a full-fledged Front-End for the MiniC language, more details regarding the language can be found in *LanguageManual.pdf*. The project was completed in the following phases:\n\n### Parsing phase\n\nThe micro-syntax and macro-syntax can be found in *MiniC.g4*. The tokenizing and parsing is being automatically done using Antlr4-runtime and toolchanin.\n\n### AST generation and Semantic Analysis phase\n\nThe code for building AST can be found in *Ast.h* and *BuildAstVisitor.h*. Visitor design pattern has been used to facilitate clean and efficient production. Semantic Analysis code can be found in *SemanticAnalysisVisitor.h* and Symbol Table class in *SymbolTable.h*. The checks being done are:\n\n* Type Checking\n* Variable Declaration\n\n### LLVM IR generation phase\n\n*IRGenVisitor.h* contains code for generating non-optimized LLVM IR for the code, which can be further executed using LLVM tools like the lli interpreter.\n\nA decent amount of sample programs are available in *Sample Programs* directory which can be used for extensive testing and demonstration.\n\n## How To Run\n\n```bash\nbar@foo:~/MiniC-Compiler/src$ make\n```\n\nRunning *make* will compile the entire code and generate some Antlr files and two executables *main* and *bonus*.\n\n```bash\nbar@foo:~/MiniC-Compiler/src$ ./main \u003cpath to .mc file\u003e\n```\n\nThis will generate LLVM IR for the code in a file called *temp.ll*. This is in human readable format.\n\n```bash\nbar@foo:~/MiniC-Compiler/src$ llvm-as temp.ll\nbar@foo:~/MiniC-Compiler/src$ lli temp.bc\n```\n\nThis will convert the IR to bitcode format which is then ready to be executed by the LLVM Interpreter lli.\n\n```bash\nbar@foo:~/MiniC-Compiler/src$ ./bonus\n```\n\nThis will automatically read the *temp.bc* file and print the Extended Basic Blocks from the Control Flow Graph which are used in Super Value Numbering.\n\n```bash\nbar@foo:~/MiniC-Compiler/src$ make clean\n```\n\nUse this to clean up the generated files and executables.\n\n## Author\n\n* Vaibhav Garg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhav-2303%2Fminic-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaibhav-2303%2Fminic-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaibhav-2303%2Fminic-compiler/lists"}