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.
- Host: GitHub
- URL: https://github.com/katistix/eval-from-scratch
- Owner: katistix
- Created: 2024-04-28T05:31:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-28T05:34:07.000Z (about 2 years ago)
- Last Synced: 2025-06-27T15:51:11.568Z (12 months ago)
- Topics: cpp, mathematics, parser, tokenizer
- Language: C++
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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++.