Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/iaguirre88/parse_string_calculator

Using Erlang parse tools to evaluate a string math expression and calculate its value
https://github.com/iaguirre88/parse_string_calculator

elixir erlang leex parser yecc

Last synced: 12 days ago
JSON representation

Using Erlang parse tools to evaluate a string math expression and calculate its value

Awesome Lists containing this project

README

        

# Calculator

**Slides**: https://iaguirre88.github.io/parse_string_calculator/

Simple toy app to test [yecc](http://erlang.org/doc/man/yecc.html) and
[leex](http://erlang.org/doc/man/leex.html).

It takes a string with a basic math expresion representation and parses it to
get its result. Currently it only supports `+`, `*` and `parentheses`.

## Example inputs
* `"1"`
* `"3+2"`
* `"3*2+1"`
* `"(1)"`
* `"3 * (2 + 1)"`
* `"3 * (2 + 1 + 5 * (3+2))"`