reduceop () /* reduce binary op */
{ TOKEN op, lhs, rhs;
rhs = popopnd();
lhs = popopnd();
op = popop();
op-> operands = lhs;
lhs-> link = rhs;
rhs-> link = NULL;
pushopnd(op); }
We use the first child - next sibling form of tree; this represents an arbitrary tree using only two pointers. The tree form of a binary operator and operands is:
op
/
/
operands /
/
/ link
lhs ----------> rhs
Down arrows are always operands; side arrows are always link. The pretty-printer will print this as:
(op lhs rhs)
Contents    Page-10    Prev    Next    Page+10    Index