Git Product home page Git Product logo

dproc's Introduction

dproc

Dproc programming language compiler

Index

  1. About
  2. File structure
  3. User manual
    1. Install
    2. Built-in functions
    3. Running a dproc file
    4. Running the tests
  4. Examples
  5. References

About

Dproc is a data processing oriented language. It's intended to process and auto document its operations.

Files structure

src/dproc.lex: token definition
src/dproc.grm: grammar 
src/interpreter.sml: execution

User Manual

Install

In order to run it, you need to install SML:

Linux:

apt-get install smlnj

MacOS:

brew update
brew install smlnj

Builtin Functions

  • Arithmetic: sum (+), subtraction (-), product (*) and division (/);
  • Logical: greater (>), greater or equal (>=), less (<), less or equal (<=), equal (==) and different (!-);
  • Boolean: and (and), or (or).

Running a dproc file

You can run dproc files as follows:

./dproc my_program.dproc

It's going to be executed and it will generate a log file called my_program.log.

All the variables final values will be displayed.

Running the tests

Just call:

./dproc_tests

Examples

column a;
column b;
column c;
column d;

a = [5, 1, 2, 4, 3];
b = [2, 2, 1, 1, 2];

c = multiplicacao(b, 2);
d = logic_comp(a, ">", c, 1, 0);

Generates:

Running tests/test_log_comp.dproc
val it = () : unit
Varibles:
val it = ["a","b","c","d"] : string list
Their values:
val it =
  [List [Int_v 5,Int_v 1,Int_v 2,Int_v 4,Int_v 3],
   List [Int_v 2,Int_v 2,Int_v 1,Int_v 1,Int_v 2],
   List [Int_v 4,Int_v 4,Int_v 2,Int_v 2,Int_v 4],
   List [Int_v 1,Int_v 0,Int_v 0,Int_v 1,Int_v 0]] : Ast.Value list

References

SML Language Processing Tools User Guide.

dproc's People

Contributors

alexandresmtoledo avatar lgmoneda avatar nicolasfigueiredo avatar

Watchers

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