An open API service indexing awesome lists of open source software.

https://github.com/cycloctane/cyclocalc

Simple math expression evaluator written in C99. Based on Pratt Parsing.
https://github.com/cycloctane/cyclocalc

algorithms ast c parser

Last synced: 8 months ago
JSON representation

Simple math expression evaluator written in C99. Based on Pratt Parsing.

Awesome Lists containing this project

README

          

## cyclocalc

Simple mathematical expression evaluator based on Pratt Parsing.

Supported operators:

- Arithmetic: `+ - * / %`
- Bitwise: `| & ^ << >>`
- Parentheses: `( )`

### build

```bash
make cyclocalc
```

### usage

```bash
./cyclocalc "6 * (3 + 4)"
```

repl:

```
$ ./cyclocalc
(calc)> 6 * (3 + 4)
42
(calc)>
```