GithubHelp home page GithubHelp logo

suanxuan / nlp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 57 KB

knowledge graph

License: GNU General Public License v3.0

Java 8.78% C 87.98% Makefile 0.81% C++ 1.32% Clean 1.04% Shell 0.07%

nlp's Introduction

Overview

c-minus is a ridiculously trivial compiler project, which was originally written for a university subject (Queensland University of Technology's course ITB464 Modern Compiler Construction). It implements the C-Minus language, which is the simplest possible conventional imperative language that does something interesting (recursion, arrays, iteration, decision -- that's it)

Here's what a C-Minus program might look like:

/*
 * A program to perform Euclid's algorithm to computer
 *  the greatest common denominator (GCD) of a pair of integers. 
 */

int gcd(int u, int v)
{
    if (v == 0) return u ;
    else return gcd(v,u-u/v*v);
    /* u-u/v*v == u mod v */
}

void main(void)
{   int x; int y;
    x = input(); y = input();
    output(gcd(x,y));
}

Presently, it implements a single DCODE back end, which emits the intermediate representation used by QUT's proprietary Gardens Point Modula suite of compilers.

To Do

  • Implement a different back end so it can generate executables on contemporary machines; e.g. LLVM, MSIL.

Support

Supplied as-is. If it breaks, you get to keep both pieces.

Example Usage

A few examples are below, but you my also find example usage in the '/example' and '/test' directories.

nlp's People

Contributors

suanxuan 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.