{"id":19415706,"url":"https://github.com/shivansh/gogo","last_synced_at":"2025-04-24T12:32:45.917Z","repository":{"id":57516513,"uuid":"117096320","full_name":"shivansh/gogo","owner":"shivansh","description":"Go to MIPS compiler, written in Go. Course project for Compiler Design (CS335).","archived":false,"fork":false,"pushed_at":"2019-02-12T11:08:34.000Z","size":1054,"stargazers_count":27,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-06-20T03:37:31.982Z","etag":null,"topics":["compiler","garbage-collection","go","gocc","mips","peephole","reaching-definitions"],"latest_commit_sha":null,"homepage":"","language":"Go","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/shivansh.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}},"created_at":"2018-01-11T12:17:55.000Z","updated_at":"2023-11-11T20:45:00.000Z","dependencies_parsed_at":"2022-08-30T01:41:39.091Z","dependency_job_id":null,"html_url":"https://github.com/shivansh/gogo","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/shivansh%2Fgogo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivansh%2Fgogo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivansh%2Fgogo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivansh%2Fgogo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shivansh","download_url":"https://codeload.github.com/shivansh/gogo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223954625,"owners_count":17231187,"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":["compiler","garbage-collection","go","gocc","mips","peephole","reaching-definitions"],"created_at":"2024-11-10T12:44:16.834Z","updated_at":"2024-11-10T12:44:17.335Z","avatar_url":"https://github.com/shivansh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gogo\n[![Build Status](https://travis-ci.org/shivansh/gogo.svg?branch=master)](https://travis-ci.org/shivansh/gogo)\n\nGo to MIPS compiler, written in Go.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Logo\" src=\"gopher.svg\"\u003e\n\u003c/p\u003e\n\n*Gopher vector imported from [egonelbre/gophers\n](https://github.com/egonelbre/gophers).*\n\n- - -\n\n## Components\n\n| Component | Demo |\n|:------------------------:|:----------------------------------------------------------------------------------------------------------------------------------:|\n| Token generation / Lexer | [`test1.out`](test/lexer/test1.out) |\n| Parser | [`struct.go`](test/parser/struct.go) :arrow_right: [`struct.html`](https://shivanshrai84.gitlab.io/staticPages/assets/struct.html) |\n| IR generation | [`scope.go`](test/codegen/scope.go) :arrow_right: [`scope.ir`](test/codegen/scope.ir) |\n| Code generation | [`pascalTriangle.ir`](test/ir/pascalTriangle.ir) :arrow_right: [`pascalTriangle.asm`](test/ir/pascalTriangle.asm) |\n\n## Setting up\nRun `./scripts/setup.sh` from the root directory of the project to set up the pre-commit git hooks.\n\n## Dependencies\n* [gocc](https://github.com/goccmack/gocc)\n\n## Build\nThe following should generate relevant binaries inside the directory `bin` -\n```\nmake\n```\n\nThe generated binary `bin/gogo` can be used as follows -\n```\nUsage: gogo (-r | -r2s | -s) \u003cfilename\u003e\n  -p\tGenerates rightmost derivations used in bottom-up parsing\n  -r\tGenerates IR instructions from go program\n  -r2s  Generates the MIPS assembly from IR\n  -s\tGenerates MIPS assembly from go program\n```\n\n**NOTE:** The generated MIPS assembly has been tested to work on [SPIM](http://spimsimulator.sourceforge.net/) MIPS32 simulator.\n\n## Testing\nThe [tests](test) can be built via -\n```\nmake test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivansh%2Fgogo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshivansh%2Fgogo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivansh%2Fgogo/lists"}