Skip to content

Instantly share code, notes, and snippets.

@sposterkil
Created September 3, 2014 02:23
Show Gist options
  • Save sposterkil/2273b63fe7253bca10cf to your computer and use it in GitHub Desktop.
Save sposterkil/2273b63fe7253bca10cf to your computer and use it in GitHub Desktop.
new evaluation()
def evaluation(tree):
print tree.label
if len(tree.children) == 0:
return tree
else:
return apply_op(tree.label, evaluation(tree.children[0]), evaluation(tree.children[1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment