Skip to content
/ gogo Public

Go to MIPS compiler, written in Go. Course project for Compiler Design (CS335).

License

Notifications You must be signed in to change notification settings

shivansh/gogo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gogo

Build Status

Go to MIPS compiler, written in Go.

Logo

Gopher vector imported from egonelbre/gophers .


Components

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

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

The generated binary bin/gogo can be used as follows -

Usage: gogo (-r | -r2s | -s) <filename>
  -p	Generates rightmost derivations used in bottom-up parsing
  -r	Generates IR instructions from go program
  -r2s  Generates the MIPS assembly from IR
  -s	Generates MIPS assembly from go program

NOTE: The generated MIPS assembly has been tested to work on SPIM MIPS32 simulator.

Testing

The tests can be built via -

make test

About

Go to MIPS compiler, written in Go. Course project for Compiler Design (CS335).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •