https://github.com/guacs/meval
https://github.com/guacs/meval
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/guacs/meval
- Owner: guacs
- Created: 2023-02-26T12:18:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-26T14:24:39.000Z (about 2 years ago)
- Last Synced: 2025-01-23T18:14:30.312Z (3 months ago)
- Language: D
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# meval
A CLI based tool for evaluating mathematical expressions.
## Installation
1. Clone the repository with:
```
git clone https://github.com/guacs/meval.git
```2. Install the D compiler from [here](https://dlang.org/download.html) if you haven't already installed it.
3. 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`
## GrammarThe 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