пятница, 21 октября 2016 г.

Expressions notations

What kind of notations for expression syntax do you know? Basincs are:

  • INFIX: 5 * 2 + 3 = 13 (implicit precedence)
  • POSTFIX: 5 2 * 3 + (stack based, explicit precedence)
  • PREFIX: + 3 * 5 2 (reversed postfix)
  • NESTED: (+ (* 5 2) 3) (lisp/s-expressions)
  • FUNCTIONAL: +( *(5 2) 3) (m-expression)
  • MATCHFIX: (* (+ 5 2 +) 3 *) (remembed "end/end if/fi"?)

Another one?

Some of them are very easy for implementation and parsing is trivial (prefix/postfix/nested/matchfix), but more human readable is infix which leads to creation of parsing theory.

Original

Комментариев нет:

Отправить комментарий

Thanks for your posting!