Code Monkey home page Code Monkey logo

kompilator's Introduction

EN | PL

Compiler of a Simple Imperative Language

Developed as part of a Formal Languages and Translation Techniques course at Wrocław University of Science and Technology (winter 2020/2021).

Technologies

Created using:

How to use

In the main directory run

python3 compiler.py <input file> <output file>

Files

  • specs.pdf – project guidelines including the grammar of the compiled langugage and the assembly commands available in the virtual machine (in Polish),
  • compiler.py – the lexer and the parser,
  • symbol_table.py – memory management and the symbol table,
  • code_generator.py – generation of the output assembly code from the syntax tree.

The tests_* directories contain some examples that allow to test the output code. Most of them were written by Maciej Gębala and Karol Gotfryd. They can be conveniently run with

./test.sh <directory name>

Error handling tests can be run using

./test_errors.sh

Both scripts require a pre-compiled virtual machine executable in the main project directory. The machine was developed by the lecturer, Maciej Gębala. Its sources can be found inside the virtual_machine directory. In order for all tests to run correctly, build it with the CLN library installed.

The misc directory contains some simple scripts that helped me during the development process.

kompilator's People

Contributors

chceswieta avatar

Stargazers

 avatar  avatar

Watchers

 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.