abusalimov / mrcalc

MapReduce Calculator, sir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MapReduce calculator Build Status

MrCalc is a simple calculator application supporting basic arithmetic operations on numbers and MapReduce functions on sequences.

screenshot

Download

MrCalc uses the standard Maven build suite and requires Java 8 runtime.

$ git clone https://github.com/abusalimov/mrcalc.git mrcalc
$ cd mrcalc
$ mvn package
$ java -jar mrcalc-<VERSION>-jar-with-dependencies.jar

Also the latest release is available for downloading here.

Language grammar

program = (stmt)* EOF ;

stmt = "var" ID "=" expr
     | "out" expr
     | "print" STRING
     ;
expr = ID
     | number
     | '(' expr ')'
     | expr OP expr
     | '{' expr ',' expr '}'
     | "map" '(' expr ',' ID '->' expr ')'
     | "reduce" '(' expr ',' expr ',' ID ID '->' expr ')'
     ;

number = INT | FLOAT ;

INT   = r'0[0-7]*' | r'[1-9][0-9]*' | r'0[xX][0-9a-fA-F]+' ;
FLOAT = r'[0-9]+\.[0-9]*|\.[0-9]+' ;

OP = '+' | '-' | '*' | '/' | '^' ;
ID = r'[a-zA-Z_][a-zA-Z_0-9]*' ;

About

MapReduce Calculator, sir

License:MIT License


Languages

Language:Java 87.0%Language:Groovy 12.4%Language:ANTLR 0.7%