ucsb-cs56-projects / cs56-utilities-calculator

-
1 stars 10 forks source link

Add support for nested expressions #24

Closed MadRubicant closed 6 years ago

MadRubicant commented 7 years ago

Currently, the calculator is only capable of evaluating trivial expressions of the form [number] [op] [number]. Add support for nesting and multiple expressions, following order of operations.

For example, 1 + 1 + 1 should be a valid expression, as should (1 + 1) * 2

300 pts

MadRubicant commented 7 years ago

F16 OK (300 pts)

xavierholt commented 6 years ago

This is a big one! We're getting into parser territory here; also note that this may be incompatible with https://github.com/UCSB-CS56-Projects/cs56-utilities-calculator/issues/37. Bumping the points:

400 XP

xavierholt commented 6 years ago

If you do decide to do this one, you might want to take a shot at https://github.com/UCSB-CS56-Projects/cs56-utilities-calculator/issues/46 first, and then implement Dijkstra's Shunting-Yard Algorithm on top of it.