CogPar: A Versatile Parser for Mathematical Expressions in Java

CogPar: A Versatile Parser for Mathematical Expression in Java

CogPar is lightweight but versatile parser for mathematical expressions.It can be used to analyse expressions and store them in an internal data structure for later evaluation. Repeated evaluation of the same expression using CogPar is fast.

CogPar comes with a highly configurable tokenizer which can be adapted for your own needs.

Arbitrary named variables are supported and values can be assigned in a single line of code.

The parser, it’s grammar an the tokenizer are well documented. You can read more about the internal workings of CogPar in these posts.

CogPar is distributed under the MIT license, so feel free to use it in your own projects.

You can download CogPar from Github.

Current release version 1.0.1

The code reference for CogPar can be found here.

CogPar in Java Applications

CogPar is currently used in the following applications:

Android Applications

DiffIt!: An Android app for calculating and explaining derivatives of mathematical expressions.

Tewter Essential Algebra: A GCSE training app for Android for the revision of algebra. Questions are generated randomly. The parser is used to parse the clear text input of the user and compare it to the correct result of the question.

If you have any applications that use CogPar and that you would like to be showcased here, please leave a comment.

Changes in version 1.0.1