Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
/ parsii Public archive

Super fast and simple evaluator for mathematical expressions written in Java

License

Notifications You must be signed in to change notification settings

scireum/parsii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parsii

Super fast and simple evaluator for mathematical expressions written in Java. More background information can be found in this blog post: http://andreas.haufler.info/2013/12/how-to-write-one-of-fastest-expression.html

Using it is as simple as:

Scope scope = Scope.create();   
Variable a = scope.getVariable("a");   
Expression expr = Parser.parse("3 + a * 4", scope);   
a.setValue(4);   
System.out.println(expr.evaluate());   
a.setValue(5);   
System.out.println(expr.evaluate());

For your convenience: A pre-built jar can be found in the build directory.

parsii is part of the open source initiative of scireum GmbH (http://www.scireum.de)
Check out or micro kernel called SIRIUS: https://github.com/scireum/sirius

Maven

parsii is available under https://mvn.scireum.com.

<dependency>
  <groupId>com.scireum</groupId>
  <artifactId>parsii</artifactId>
  <version>...</version>
</dependency>