Skip to content
This repository has been archived by the owner on Mar 3, 2018. It is now read-only.

Latest commit

 

History

History
15 lines (8 loc) · 932 Bytes

README.md

File metadata and controls

15 lines (8 loc) · 932 Bytes

TapDigit

TapDigit is a simple JavaScript implementation of a math expression lexer, parser, and evaluator.

TapDigit.Lexer splits a math expression into a sequence of tokens. This is useful for e.g. an expression editor with color syntax highlighting.

TapDigit.Parser parses an expression and produces the JSON-formatted syntax tree representation thereof.

TapDigit.Evaluator computes the result of an expression. Variables, constants, and functions supported in the expression syntax can be extended via TapDigit.Context object.

There is also a simple web page (open eval.htm) which demonstrates how it works:

Evaluator screenshot

TapDigit is created by @AriyaHidayat. It is distributed under the BSD license.