Created
November 26, 2017 09:38
-
-
Save swilly22/e7d762596249c14db1bb7133b6df49c7 to your computer and use it in GitHub Desktop.
expression_eval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Evaluate(root) { | |
if(node_is_const(root)) { | |
return root.value; | |
} | |
for(child in root) { | |
evaluate(child); | |
} | |
return root.op(root.children); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment