{"id":15047929,"url":"https://github.com/gangliao/tiger","last_synced_at":"2025-04-10T01:06:55.159Z","repository":{"id":84829263,"uuid":"80359206","full_name":"gangliao/TIGER","owner":"gangliao","description":"implement a full compiler based on c++ 11","archived":false,"fork":false,"pushed_at":"2017-04-24T00:00:15.000Z","size":43505,"stargazers_count":22,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T01:06:44.855Z","etag":null,"topics":["backend","code-generator","compiler","cplusplus-11","front-end","graph-coloring","parser","scanner"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gangliao.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":"2017-01-29T17:11:30.000Z","updated_at":"2024-04-03T19:01:14.000Z","dependencies_parsed_at":"2023-04-24T15:47:06.532Z","dependency_job_id":null,"html_url":"https://github.com/gangliao/TIGER","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangliao%2FTIGER","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangliao%2FTIGER/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangliao%2FTIGER/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gangliao%2FTIGER/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gangliao","download_url":"https://codeload.github.com/gangliao/TIGER/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137887,"owners_count":21053775,"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":["backend","code-generator","compiler","cplusplus-11","front-end","graph-coloring","parser","scanner"],"created_at":"2024-09-24T21:06:06.919Z","updated_at":"2025-04-10T01:06:55.153Z","avatar_url":"https://github.com/gangliao.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"## TIGER - A Tiny Full Compiler\n\n[![Build Status](https://travis-ci.com/gangliao/TIGER.svg?token=bQUUVqcsZpghUieTvsMM\u0026branch=master)](https://travis-ci.com/gangliao/TIGER/builds)\n\nThis tiny compiler includes both front end and back end.\n\n\u003e Front end: Grammar Rules, LL(1) Parse Table, Syntax and Semantic Check and Intermediate Code.\n\n\n\u003e Back end: IR Optimization (Intra-block CFG optimization), MIPS Register Allocation, Instruction Selection and Code Generation.\n\nYou can access https://github.com/gangliao/TIGER to view the documentation! \n\n### How to Build\n\n0. development environment\n\n\tCurrently, this project repository is maintained on github publicly and also been deployed on Travis CI.\n\tIt supports both Ubuntu and Mac OS X.\n\n1. build:\n\n\t```bash\n\t\t# cd project dir\n\t\tcd Tiger-Compiler\n\t\t# build scanner, parser, generator\n\t\tmkdir build \u0026\u0026 cd build\n\t\t# cmake building tool\n\t\tcmake ..\n\t\tmake -j4\n\t```\n\n2. run:\n\n\tYou can parsing test cases named `*.tiger` under `/testCases2` to generate IR code.\n\tDefault it will utilize **CFG optimized technique** to generate MIPS asm code.\n\n\t```bash\n\t\t# verbose mode: \"-d to implement a verbose mode\"\n\t\t./src/parser \u003cfilename\u003e -d\n\t```\n\n\tIf you want to use the **naive** mode to generate asm code, simply issue:\n\n\t```bash\n\t\t./src/parser \u003cfilename\u003e -d -naive\n\t```\n\n3. test:\n\n\tIn [testCases2](testCases2) directory, it includes a test script `test.sh` to execute all test cases and\n\tgenerate the corresponding asm files `*.naive.s` and `*.cfg.s`.\n\n\tAfter souce code is compiled, you can simply issue the commands:\n\n\t```bash\n\tcd testCases2\n\tsh ./test.sh\n\t```\n\n### Demo\n\n**NOTE:** This demo is `gif` graph format. If you have problem to view it in the markdown file,\nyou can directly open it which located at `img/demo.gif`.\n\nThis Demo shows that\n\n\t(1) [Compile Source Code] How to compile and generate parser binary ?\n\n\t(2) [Compiler Front End] How to transfrom raw tiger program into IR code ?\n\n\t(3) [Compiler Back End] How to generate optimized MIPS asm code via IR code ?\n\n\u003ca href=\"img/demo.gif\" target=\"_blank\"\u003e\u003cimg src=\"img/demo.gif\" width=\"1000\" /\u003e\u003c/a\u003e\n\n### Desgin Internals\n\n[Tiger Compiler Front End - Design Internals](design_doc/front_end.md)\n\n[Tiger Compiler Back End - Design Internals](design_doc/back_end.md)\n\n### Test Cases\n\nWe passed all tests cases which provided by TA.\n\nPlease check out the details in report [Phase2_Testing_and_Output.pdf](Phase2_Testing_and_Output.pdf) from current directory, which includes test cases and their quality comparisons for naive and CFG intra-block register allocation.\n\n### Accomplishment\n\n- [x] Register allocation code\n\t- [x] Naive\n\t- [x] CFG and intra block allocation\n\t- [ ] EBB and intra-EBB allocation\n\t- [x] Whole function register allocation\n\t- [x] Live Range Analysis and Graph Coloring\n- [x] Instruction selection and generation code\n- [x] Passes tests using generated code executing on simulator.\n- [x] Report (desgin Internals, how to build, run, code quality comparisions, etc.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgangliao%2Ftiger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgangliao%2Ftiger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgangliao%2Ftiger/lists"}