Postfix Notation
In postfix notation, the operator follows the operand. For example, in the expression (a − b) * (c + d) + (a − b), the postfix representation is:
Syntax Tree
The syntax tree is nothing more than a condensed form of the parse tree. The operator and keyword nodes of the parse tree (Figure 1) are moved to their parent, and a chain of single productions is replaced by single link (Figure ).
Three-Address Code
Three address code is a sequence of statements of the form x = y op z. Since a statement involves no more than three references, it is called a "three-address statement," and a sequence of such statements is referred to as three-address code. For example, the three-address code for the expression a + b * c + d is:
Sometimes a statement might contain less than three references; but it is still called a three-address statement. The following are the three-address statements used to represent various programming language constructs:
-
Used for representing arithmetic expressions:
-
Used for representing Boolean expressions:
-
Used for representing array references and dereferencing operations:
-
Used for representing a procedure call: