Arithmetic evaluation: Difference between revisions

m
→‎Icon and Unicon: notes, spelling
m (fix typo)
m (→‎Icon and Unicon: notes, spelling)
Line 948:
A compact recursive descent parser using Hanson's device. This program
* handles left and right associativity and different precedences,
* accepts integers, reals, and radix constants (e.g. 3r10 is 3 in base 3), but not E notation
* accepts the Icon operators + - * / % (remainder) and ^ (exponentiation)
* canstring easilyinvocation beis extendedused to useevaluate binary operators hence other Icon binary operators (andincluding shouldhandle bemultiple ablecharacter toones) handlecan mutiplebe charactereasily operators)added
* uses Icon style type coercion on operands
* accepts single unary operators, e.g. +(+3) works but ++3 will break it)
* represents the AST is a nested list eliminating unneeded parenthesis.
==={{header|Icon}}===
Anonymous user