Feedback In (pre)postfix operator goes (before) after its own arguments 

Forum: U Chicago, Com Sci 221 old messages, autumn 2000
Re: News Assignment #2, due 11 October (Mike O'Donnell)
Re: Question postfix/prefix (C. Donour Sizemore)
Date: 2000, Oct 07
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

In a pure prefix expression (such as those in Example 2.1 on p. 29), each operator appears immediately before its own operands, but it may appear after some other operands. Similarly, in a pure postfix expression (such as those in Example 2.2), each operator appears immediately after its own operands, but possibly before others. It is not possible to represent every expression with all operators before (or after) all operands. For example, the syntax tree

      *
     / \
    /   \
   /     \
  +       +
 / \     / \
a   b   c   d
can be represented in postfix and in prefix as:
a b + c d + * (postfix)
* + a b + c d (prefix)
But there's no way to indicate the right grouping with all operators before, or all operators after, all of the operands.



Mike O'D.


Messages

to: "In (pre)postfix operator goes (before) after its own arguments"