Skip to content

sdiguana/XCalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XCalc

XCalc is an ANTLR4/TypeScript based expression calculator, supporting variable assignment.

Dependencies:

$ npm i --save antlr4ts

Usage

tsconfig.json "module":"commonjs" for testing with mocha "module":"es2015" for deployment on web applications

let eg = new XCalc.ExpressionGroup(["D=4", "E=1", "F=D + 3 * E"]).evaluate();
//To print F as the original equations:
console.log(eg.expressions[2].printExpr(false));
//Print F as results:
console.log(eg.expressions[2].print(true));
//Show all variables with value-assignements:
console.log(eg.variableMap.print().join("\n"));

About

Expression Engine with variable assignment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published