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

https://github.com/katistix/eval-from-scratch

A simple "interpreter" that takes in as input simple arithmetic expressions and computes their values.
https://github.com/katistix/eval-from-scratch

cpp mathematics parser tokenizer

Last synced: 12 months ago
JSON representation

A simple "interpreter" that takes in as input simple arithmetic expressions and computes their values.

Awesome Lists containing this project

README

          

# eval-from-scratch

A simple "interpreter" that takes in as input simple arithmetic expressions and computes their values.

This is a **learning project**. It is supposed to teach me the following things:

- how to build a **tokenizer**
- how to compute a simple arithmetic expression
- what is an **Abstract Syntax Tree (AST)**

As I stated, this is _my_ learning journey. But I also try to document the code as much as possible to make it easier to understand for everyone.

## Current progress and features:

- [x] Project structure setup and build system with CMake

- [x] Tokenize the expression and return the `tokens` vector.

- [ ] Build the expression tree

- [ ] Compute simple arithmetic expressions with `+ - / *`

- [ ] Implement parentheses `()`

- [ ] Implement `floating point` numbers

- [ ] Implement constants like `pi`, `e` etc.

## Resources

- [fkkarakurt/mathparser](https://github.com/fkkarakurt/mathparser) - A Mathematical Expression Evaluator and Parser developed in C++.