How to evaluate expression tree

This article is tagged with: How to evaluate expression tree and lua

how to evaluate expression tree

Algorithm :
Let t be the syntax tree
If t is not null then
If t.info is operand then
Return t.info
Else
A = solve(t.left)
B = solve(t.right)
return A operator B
where operator is the info contained in t

This article is tagged with: How to evaluate expression tree and lua