Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Arithmetic-evaluation/00-TASK.txt
Normal file
23
Task/Arithmetic-evaluation/00-TASK.txt
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Create a program which parses and evaluates arithmetic expressions.
|
||||
|
||||
;Requirements:
|
||||
* An [[wp:Abstract_syntax_tree|abstract-syntax tree]] (AST) for the expression must be created from parsing the input.
|
||||
* The AST must be used in evaluation, also, so the input may not be directly evaluated (e.g. by calling eval or a similar language feature.)
|
||||
* The expression will be a string or list of symbols like "(1+3)*7".
|
||||
* The four symbols + - * / must be supported as binary operators with conventional precedence rules.
|
||||
* Precedence-control parentheses must also be supported.
|
||||
<br>
|
||||
|
||||
;Note:
|
||||
For those who don't remember, mathematical precedence is as follows:
|
||||
* Parentheses
|
||||
* Multiplication/Division (left to right)
|
||||
* Addition/Subtraction (left to right)
|
||||
<br>
|
||||
|
||||
;C.f:
|
||||
* [[24 game Player]].
|
||||
* [[Parsing/RPN calculator algorithm]].
|
||||
* [[Parsing/RPN to infix conversion]].
|
||||
<br><br>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue