Question: In regards to the interperter class, how should the resolve method be constructed? I'm having a hard time constructing this method.. Also, what Node paramter
In regards to the interperter class, how should the resolve method be constructed? I'm having a hard time constructing this method.. Also, what Node paramter is the interpreter taking?

Finally, we will build (the beginning of) our interpreter. Create a new class called Interpreter. Add a method called "Resolve". It will take a Node as a parameter and return a float. For now, we will do all math as floating point. The parser handles the order of operations, so this function is very simple. It should check to see what type the Node is: For FloatNode, return the value. For IntNode, return the value, cast as float. For MathOpNode, it should call Resolve() on the left and right sides. That will give you two floats. Then look at the operation (plus, minus, times, divide) and perform the math.
Step by Step Solution
There are 3 Steps involved in it
Heres an example implementation of the Interpreter class with the Resolve method public class Interp... View full answer
Get step-by-step solutions from verified subject matter experts
