8.2 Polish Notation

Polish notation, also known as prefix notation, is a form of notation for writing expressions in logic, arithmetic and algebra. The Polish logician Jan Lukasiewicz invented this notation around 1920 in order to simplify sentential logic. In this notation, the operator is written as a prefix, i.e. to the left of the operands. If the arity (the expected number of operands) of the operators is fixed, the result is a syntax devoid of any parentheses that can be parsed without ambiguity. If the notation is used to represent mathematical expressions by interpreters of programming languages, they can be readily parsed into abstract syntax trees and define a one-to-one representation for the same. A typical expression in Polish notation ...

Get Compilers: Principles and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.