Arithmetic expression evaluator.
This program interactively receives instructions.
Run cabal run
and interact with main program.
Possible commands are:
EVAL <order> <expr>
<order>
is one ofPRE
orPOST
indicating preorder or post order evaluation respectively<expr>
is a well formed arithmetic expression in the indicated<order>
. Valid operations are+
,-
,*
,/
. The result of this command is the evaluation of the given expression, or an error if the expression is malformed.
MOSTRAR <orden> <expr>
: Displays an infix notation expression provided a preorder or postorder expression using the same rules as above.SALIR
: exit program.
To run testcases use:
cabal clean
cabal configure --enable-tests --enable-coverage`
and then run: cabal test
Coverage tests information is under:
dist/hpc/vanilla/eval-test/*