Java expression parser (extensive)

Description

On this page you find the source code for an expression parser written with Java. It is a console program and supports all common mathematical features. Furthermore, you can assign your own variables and functions. The project is written using Eclipse, the most well known Java IDE. The parser works in two steps: first, the expression string is parsed into an object tree. Next, the object tree is evaluated and the results are returned.

To run the program, you can run one of the provided batch files, or you can enter java -jar Parser.jar on a command line.

Features

The features of the expression parser are:

Download

You can download the source code and binaries below.

expression_parser_java_ext.zip (133kB)

Screenshot

As Java programs can be run on various platforms, you can execute the program on Windows, Linux, or Macintosh. Here is a screenshot taken on Ubuntu.

Screenshot

Author

Jos de Jong
September 2010