Update...
Expression engine complete. Was a stupid mistake where I was treating the function as a expression start, while stilll tokeinizing the opening (
So the problem WAS in the tokenizer after all. Finally, I can move on to actual line processing/execution, and variables.
Though I also just belted out a couple test constants. PI and Deg2Rad.
Deg2Rad=PI/180. You multiply degrees by that to turn it into radians... though since I'm NOT going to make SIN/COS/Arctan use radians, I guess that one's kinda pointless.
Still, it's really cool to see it finally evaluate:
From here should be smooth sailing, I actually consider that the hardest part of writing an interpreter. It even has error handling:Code:Enter expression or blank line to quit >64*sin(45*pi/180)+160 result: 205.25483400
Which that's done at the tokenizer, so the actual interpreter part would never even get that code to try and run it. In the final version I plan for the EDITOR to not allow you to add such a line without fixing the error first.Code:Enter expression or blank line to quit >160+64*sin(45*pi/180 processing: 160+64*sin(45*pi/180 Error in Expression: Closing Bracket Missing 160+64*sin(45*pi/180 ^
Bookmarks