Quote:
|
Originally Posted by ApothiX
use tokenize, and parse the line
|
Now I'm confused.
Anyways, I do use tokenize in this script. However, if I were to make it have real functionality, it might be better to parse it myself.
Using tokenize to parse it, you'd want to have custom delimeters +,-,*,/,%,^,(,)
But either way, you're going to have to figure out what you skipped anyway.
So you could parse it yourself, and then store as args and operators. You'd probably store the numbers and operators in scattered arrays, and then try to find some way of applying the order of operations.