MarineB210 / calculator-cucumber-2024

This repository is used for teaching purposes at the University of Mons. It contains Java code for computing arithmetic expressions. The code uses design patterns and is accompanied with JavaDoc, unit tests and BDD scenarios. We have also paid particular attention to code quality.
2 stars 1 forks source link

[FEATURE] Expression parser #8

Closed MarineB210 closed 6 months ago

MarineB210 commented 7 months ago

Describe the new functionality you would like to see In order to make the Calculator usable in practice, it needs to accept an input parameter of type string. This string will be read, parsed and converted into a syntactically valid expression, or a syntax error will be returned if the string does not respect the correct syntax. Valid expressions will be evaluated, and the result of the evaluation will be printed on the console.

In order to achieve this functionality we need an expression parser:

Is your feature request related to a specific need or problem? Without a proper expression parser, the caclulator is not really practically useful, since creating expressions manually in terms of object trees is very cumbersome, error-prone and time-consuming.

Additional context Several Java libraries exist for creating parsers, it is recommended to choice the most appropriate one of them rather than to reinvent the wheel from scratch.