Skip to content

SarthakRout/GIPSC

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GIPSC

CS335 Compilers Course Project

We build a compiler from Golang to MIPS using Python.

Advanced Features Supported

  • Constant Folding
  • Multi-dimensional Arrays
  • Multilevel pointers
  • Custom module imports
  • Multiple returns
  • Multiple assignments
  • Floating point ops
  • Goto for labelled statements

Execution

  • Run following command from root directory to run the compiler on a Go source file.
python src/Milestone6/compiler.py PATH_TO_FILE

Execution

  • Run following command from root directory to generate AST for a Go file.
./bin/parser PATH_TO_FILE

Testing

  • To run all the test cases for Milestone 4, run the following command from root of the project :
make 

Execution

  • Run following command from root directory to run parser on a Go file.
python src/Milestone3/parser.py PATH_TO_FILE
  • Run following command from root directory to run lexer on a Go file.
python src/Milestone3/lexer.py PATH_TO_FILE

Testing

  • To run all the test cases for Milestone 3, run the following command from root of the project :
make 
  • To clean generated file run:
make clean

Visualization

  • To obtain dot file, run following commnd from PROJECT_ROOT/src/Milestone3:
python gen_automation.py
  • To obtain automata, run following command from PROJECT_ROOT/src/Milestone3:
dot -Tpdf test.dot -o automaton.pdf
  • To obtain parse tree From project root directory, use
./bin/parser tests/Milestone3/ctest1.go

To test regex for tokens

  • From project root directory, use
python3 tests/Milestone2/test_regex.py 

or

make test_Milestone2

To test source code for any program

  • Run
python3 src/Milestone2/lexer.py PATH-TO-SOURCE-CODE

SIT Details

Source Language : GoLang Implementation Language : Python Target Language : MIPS

Group Members

  • Aditi Goyal
  • Devanshu Singla
  • Sarthak Rout
  • Yatharth Goswami

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 82.3%
  • Assembly 15.8%
  • Go 1.8%
  • Other 0.1%