Git Product home page Git Product logo

gogo-1's Introduction

gogo

Go to MIPS compiler implemented in Go. Made as a course project for CS335 (Compiler Design).

Logo

Gopher vector imported from egonelbre/gophers .


Components

Component Demo Status
Token generation / Lexer test1.out ✔️
Parser struct.go ➡️ struct.html ✔️
IR generation scope.go ➡️ scope.ir ✔️
Code generation pascalTriangle.ir ➡️ pascalTriangle.asm ✔️

The file main.go contains routines described as follows corresponding to each component -

Routine Description
GenToken() Generates the tokens returned by lexer from the input program
GenAsmFromIR() Generates the assembly code using the IR generated from the input program
GenHTML() Generates the rightmost derivations used in the bottom-up parsing and pretty-prints them in HTML
GenAsm() GenAsm generates the assembly code from the input program

Setting up

Run ./scripts/setup.sh from the root directory of the project to set up the pre-commit git hooks.

Dependencies

Build

The following should generate relevant binaries inside the directory bin -

make

Alternatively, individual components can be built via -

make deps
make gentoken
make tac
make gogo

The generated binary bin/gogo can be used to generate (Tokens | Assembly | HTML) from the corresponding (go | IR | go) files -

bin/gogo test.go

Testing

The tests can be built via -

make test

gogo-1's People

Contributors

aniketp avatar kpsunil avatar shivansh avatar tvatsal1996 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.