On Friday, 10 June 2016 at 15:03:30 UTC, jmh530 wrote:
On Friday, 10 June 2016 at 14:25:37 UTC, Adam D. Ruppe wrote:
To make an interpreter, you can just add a method to the AST
objects that interprets and gives a result.... boom, it works!
Given my limited knowledge of compilers/interpreters, this part
kind of seems like magic.
Let's say you have something simple like 1+2, you would build
an AST that looks something like
+
/ \
1 2
What would be the next step?
https://en.wikipedia.org/wiki/Tree_traversal#Post-order