peterxu422 wrote
I'm trying to implement the label, if, and if-goto parts of Project8. It seems that when we implement 'label', we must use the format functionName$label. I am unsure as to how we would acquire the functionName in our implementation. How can we tell which function we are in when we are parsing through the VM code? Any insights on how to go about this?
Save the function name when you encounter a
function VM command. Although it should not be needed before the first
function, I initialize my functionName variable to the filename so that it's obvious that something's FUBAR if I see a generated label like MyClass.vm$label.
--Mark