Original Post
Hello, I'm trying to create a simple interpreter for my VERY simple scripting language. Heres a script that I want to run
display 5 + $myvar This should just simply print 14 on my console. $myvar is an internal static variable which holds the value 9. How would I parse this line so that my output is predictable. When I grab this line from the user its stored in a char array. How do I convert an instruction (such as addition) from a char array to an actual instruction? And how would I parse $myvar to be equal to 9? I was thinking of using strtok but maybe theres an easier way. I'm open to suggestions, guidance, comments, and pointers. Thank you!!