Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arxeiss/go-expression-calculator
Custom implementation of calculator handling operator precedence and parentheses.
https://github.com/arxeiss/go-expression-calculator
ast calculator lexer parser recursive-descent recursive-descent-parser shunting-yard shuntingyard
Last synced: about 1 month ago
JSON representation
Custom implementation of calculator handling operator precedence and parentheses.
- Host: GitHub
- URL: https://github.com/arxeiss/go-expression-calculator
- Owner: arxeiss
- Created: 2021-01-16T18:53:45.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-21T15:29:05.000Z (about 3 years ago)
- Last Synced: 2024-06-21T03:14:14.399Z (5 months ago)
- Topics: ast, calculator, lexer, parser, recursive-descent, recursive-descent-parser, shunting-yard, shuntingyard
- Language: Go
- Homepage: https://dev.to/arxeiss/lexer-expression-calculator-3j9p
- Size: 246 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Expression calculator in Go
Custom implementation of calculator which accept string as an input. And handles parentheses and operator precedence properly.
The idea to try implement custom expression calculator raised from the puzzle of [Day 18 of Advent of Code 2020](https://github.com/arxeiss/advent-of-code-2020/tree/master/day18).
## How to run
1. Clone repository
1. Build calculator with `make build`
1. Execute calculator with `./calculator` and show help with `./calculator --help`## Blog posts
About each part I'm also writing article on Dev.to and my personal blog.
1. Lexer - [Dev.To](https://dev.to/arxeiss/lexer-expression-calculator-3j9p) 🇬🇧 & [kutac.cz](https://www.kutac.cz/pocitace-a-internety/lexer-1-dil-vlastni-kalkulacky-s-vyrazy) 🇨🇿
1. Shunting yard parser - [Dev.To](https://dev.to/arxeiss/shunting-yard-parser-expression-calculator-cik) 🇬🇧 & [kutac.cz](https://www.kutac.cz/pocitace-a-internety/shunting-yard-algoritmus-2-dil-vlastni-kalkulacky) 🇨🇿
1. AST & Evaluator - [Dev.To](https://dev.to/arxeiss/ast-evaluator-expression-calculator-1cdg) 🇬🇧 & [kutac.cz](https://www.kutac.cz/pocitace-a-internety/evaluator-ast-3-dil-vlastni-kalkulacky) 🇨🇿
1. Recursive descent parser - [Dev.To](https://dev.to/arxeiss/recursive-descent-parser-5581) 🇬🇧 & [kutac.cz](https://www.kutac.cz/pocitace-a-internety/recursive-descent-4-dil-vlastni-kalkulacky) 🇨🇿