Coder Social home page Coder Social logo

gautam1411 / tiger-compiler Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 72 KB

Compiler for the Tiger language defined in Andrew Appel’s book Modern Compiler Implementation in C .

License: MIT License

C 97.65% C++ 1.17% Tcl 1.18%
compiler-construction compiler-design compiler tiger-compiler tiger-language

tiger-compiler's Introduction

Tiger-Compiler (Undergrad Project)

Compiler for the Tiger language defined in Andrew Appel’s book Modern Compiler Implementation in C . Code generator generates code for a A Simple Target Machine TM defined in Kenneth C. Louden's Compiler Construction textbook.

Authors:

(1)Gautam Singh

(2)Reuben D'souza

A given Tiger program is compiled to generate Three-Address-Code(TAC) which is then run on the simulator to get the desired output. The compiler's code is in the folder named src. The simulator's code is in tm.c file. The output, TAC is generated in a file named TCODE.tm

To run in Windows platform, the code can be compiled in Turbo C to get executable file of ".exe" extension.The executable file "tm" can be run with this TAC file as the arguement. The "tm" has the following commands,

1.step <n>             		: Execute n (default 1) TM instructions

2.go                      	: Execute TM instructions until HALT

3.regs                    	: Print the contents of the registers.

4.iMem <b><n>    		: Print n iMem locations starting at b

5.dMem <b><n>  	        	: Print n dMem locations starting at b

6.trace				: Toggle instructions trace.

7.print				: Toggle print of total instructions executed.

8.clear				: Reset simulator for new execution of program.

9.help 				: Cause this list of commands to be printed.

10.quit				: Terminate the simulation.

tiger-compiler's People

Contributors

gautam1411 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

shyamsunder007

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.