GithubHelp home page GithubHelp logo

dario-santos / natrixcompilerinterpreter Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 1.86 MB

A compiler for the Natrix language, the final project of the Language Processing course at the University of Beira Interior (UBI).

License: GNU General Public License v3.0

OCaml 49.24% Makefile 0.04% Shell 0.99% Assembly 49.72%
ocaml menhir ocamllex compiler natrix interpreter ubi university-project

natrixcompilerinterpreter's Introduction

Natrix Compiler Interpreter

This is the compiler and interpreter of the Natrix language. (Link to the documentation bellow).

How to Use It

If you have downloaded the source code use the makefile that is in the folder ./Compiler.

make

This coomand will generate the natrix.exe executable.

The program offers a set of options:

-parser-only: Executes only the lexer and parser. -print-ast : Print the abstract syntax tree of the given file. -interpt : Uses the interpreter instead of the compiler.

Using an option:

dune exec ./natrix.exe -interpt file.nx

How to Test

This project contains a folder with a set of tests, the easiast way to test the compiler and interpreter is to use the entry test in the makefile.

make

make test

Natrix Documentation

The full documentation of the Natrix language can be accessed bellow:

https://dario-santos.github.io/2020/01/12/natrixdoc.html

natrixcompilerinterpreter's People

Contributors

dario-santos avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

natrixcompilerinterpreter's Issues

A better memory management for the compiler

Right now the compiler allocs the memory occupied by the program, a better aproach would be to alloc and free the memory only when needed.

Example:

if( ... )
{
    // Allocs the memory needed by the if statement
    // ...
    // Frees the memory
}

When entering a function or a if statement.

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.