See InFix to PostFix and PostFix expression evaluation.