Git Product home page Git Product logo

pycompiler's Introduction

PYCompiler πŸ‘€

PYCompiler is a compiler for a simple version of python that was develop in the subject "Programming Languaje Design" at Univeristy of Oviedo (uniovi)

Getting Started πŸš€

To begin with the project, clone the repository in your own computer. To do so, you can use this command:

git clone https://github.com/mistermboy/PYCompiler.git;

Alternative, you can download the repository as a zip file from the repository main page.

Once you have the repository, import the project in eclipse.

-> File 
  -> Import
    -> General 
      -> Existing Projects into Workspace...

Using PYCompyler 🏁

To use PYCompyler there are two alternatives, you can write your own program (View the syntax) (Ver la sintaxis) or use an example one. I recommend you the second option, if itΒ΄s your first time. There are a few example programs in the folder called "program4Test".

Once you've chosen an option, you only have to run the main class, that is located in the "py" package, passing the name of the input and the output file as a parameters. Here is a example with the program "big.input.txt", that calculates the Fibonacci sequence.

-> Run as 
  -> Run configurations
    -> Java Application  
      -> Arguments 
        -> programs4Test/big.input.txt output.txt

Now you'll see the instrospector window, that shows a general view of the AST (Abstract Syntax Tree) built by the compiler. You can take a look if you want but itΒ΄s not necesary.

Close the introspector window and check the output file. You should see the instructions of the program you passed written in a language like assembler.

MAPL πŸ”§

At this point we need to use some tool that is able to interpret the instructions. That tool is MAPL.

Execute "MAPL.cmd".

Location -> PYCompiler\MAPL.cmd

By default, MAPL load the "output.txt" file but you can chose other in "File -> Open..."

Using MAPL is very simple. At the left of the window we have the instructions of the program loaded and the buttons to run, debugg, reload... In the middle the static memory and finally in the rigth, the stack memory. Also there is an small terminal at bottom left.

To end with the example, run the program by clicking in the green arrow and look what happends. You should see the Fibonacci sequence calculated in the terminal. πŸ’»

Development 🚧 βš™οΈ

Now you will learn how the project is composed:

Built With πŸ› οΈ

License πŸ“‹

This project is licensed under the MIT License - see the LICENSE file for details.

pycompiler's People

Contributors

mistermboy avatar thewillyhuman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pycompiler's Issues

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.