Think recursively. Operands return the value, binary operators perform themselves on the left and right value:
if (is_operand())
return value;
T a = recurse(left);
T b = recurse(right);
switch (operator()) {
case '+': return a + b;
case '-': return a - b;
case '*': return a * b;
case '/': return a / b;
}
It's also easy to turn the four function calculator into something more powerful. You can easily modify the algorithm to handle unary operators and add error checking to verify that the syntax of the expression is correct.