Turning an expression tree into basic machine code is typically relatively straightforward if the target is stack-based. Basically you do a post-order traversal. For leaf nodes, just push the value. For other nodes, obtain the arguments from the stack, perform the operation and push the result.