Project made on october 2020
Table of Contents
This is a program named evalexpr.
This project shows how the evaluation of an arithmetic expression works by handling precedence, variables, and functions.
The following open source packages are used in this project:
- Stack vers.2.13
code
.
โโโ app
โ โโโ Main.hs
โโโ funEvalExpr.cabal
โโโ Makefile
โโโ package.yaml
โโโ src
โ โโโ Calculator.hs
โ โโโ Check.hs
โ โโโ Lib.hs
โโโ stack.yaml
โโโ stack.yaml.lock
โโโ unitTest
โโโ unit_test.bats
Support:
- + (plus)
- - (sub)
- * (multiplication)
- / (division)
- ^ (exponential)
works with () - parenthesis
Compile the makefile (make) and add some arithmetic expression like this !
$> ./funEvalExpr "6 * 12 / 2 * (1 - 2 - (2 - 4 - 5) - 10) ^ 2 * (2 - 7 - 4) ^ 3" $> -419904.00
> make && test_runOr Put the executable in the `unitTest` folder and run like this :
> bats unit_test.bats
Evalexpr | Test |
---|---|
error management | 100% |
one single unary operator | 100% |
parenthesis | 100% |
Mixed binary operators | 100% |
All mixed | 100% |
Coding style | 66.7% |
๐ฆ Edouard Touch
Email: edouard.touch@epitech.eu
GitHub: @eydou