Arithmetic evaluation: Difference between revisions

m
Added to <5 category
m (→‎{{header|D}}: Changed over to works with template)
m (Added to <5 category)
Line 1:
[[Category:Less Than 5 Examples]]{{task}}[[Category:Recursion]]
Create a program which parses and evaluates arithmetic expressions. Requirements: an [http://en.wikipedia.org/wiki/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 [http://en.wikipedia.org/wiki/Binary_relation binary relations] with conventional precedence rules. Precedence-control parentheses must also be supported.
 
Anonymous user