A CLI based tool for evaluating mathematical expressions.
-
Clone the repository with:
git clone https://github.com/guacs/meval.git
-
Install the D compiler from here if you haven't already installed it.
-
Run the following for building and testing the application (ensure you are in the root directory of the project):
build =>
dub build
test =>
dub test
The grammar that is used for parsing.
expression -> term
term -> factor (("-" | "+") factor)*
factor -> unary (("*" | "/") unary)*
unary -> ("+" | "-") unary | primary
primary -> NUMBER | "(" expression ")"
*
=> repeats zero or more times