Calculate simple expressions using trees