Update
I was wrong it isn't simpler than I thought.. Infact I had a very strong idea of the steps I need to take to accomplish the math stack parser.
I'm not done yet! Look out.
Here's some not so pretty Eye candy the image was edited to explain what's going on
Here I've got some test code that finally divides inside the equasion and replaces the old text with the new values..
This requires some initialization..
I can't even begin to explain why it works but I indeed did use quite a loopy method.
Maybe that's because I've been drinking a little *teehee* of course..
Well on with it I guess
Basically it can divide!
It's doing multiple things
It's making a list of all the integers found in the string
It's making a list of all the operands found in the string
It's using a rule that there should be exactly one more integer than operand in the whole of both sets.
It's using a pair value rule
I'm treating each operation as a pair of 3 values.
"50/100" is a pair
"20/1000" is a pair
This is the logic I used
The next thing it does is it uses the fact it can extract the variable integers from the original string to convert them to strings.
Once it converts the first value and the second value to strings
It gets their length.
It uses the iterator that finds the first occuring "/" symbol's place in the string as the start point.
It then subtracts the start point from the first value's string length to get something called extract_st
it then sets the firstvalue_st, firstvalue_nd
secondvalue_st and secondvalue_nd variables which represent where in the string these values lengths start and end.
By getting all of this information I have a way (without having to do match cases specifically on the integer values)
to get the exact place inside the string where they occur
Then since I already have the values themselves and I know what the oprand is I can simply set this
result = first_value / second_value
result_string$ = str$(result) and I convert the result back into a string
next, I replace what was removed from the string like this
removed_string$ = mid$(inputstr$, extract_st, len(inputstr$)-extract_nd)
by doing this I always get the exact location of the entire equasion no matter the length or how many numbers are in it
Next.
I end up with this:
inputstr$ = replace$(inputstr$, removed_string$, "!", 0, 0, 1) the last parameter is the replace once only case
now later I do this
inputstr$ = replace$(inputstr$, "!", result_string$, 0, 0, 1) //And this basically captures the result and re-injects it into the string
Here I've got some test code that finally divides inside the equasion and replaces the old text with the new values..
This requires some initialization..
I can't even begin to explain why it works but I indeed did use quite a loopy method.
Maybe that's because I've been drinking a little *teehee* of course..
Well on with it I guess
Basically it can divide!
It's doing multiple things
It's making a list of all the integers found in the string
It's making a list of all the operands found in the string
It's using a rule that there should be exactly one more integer than operand in the whole of both sets.
It's using a pair value rule
I'm treating each operation as a pair of 3 values.
"50/100" is a pair
"20/1000" is a pair
This is the logic I used
The next thing it does is it uses the fact it can extract the variable integers from the original string to convert them to strings.
Once it converts the first value and the second value to strings
It gets their length.
It uses the iterator that finds the first occuring "/" symbol's place in the string as the start point.
It then subtracts the start point from the first value's string length to get something called extract_st
it then sets the firstvalue_st, firstvalue_nd
secondvalue_st and secondvalue_nd variables which represent where in the string these values lengths start and end.
By getting all of this information I have a way (without having to do match cases specifically on the integer values)
to get the exact place inside the string where they occur
Then since I already have the values themselves and I know what the oprand is I can simply set this
result = first_value / second_value
result_string$ = str$(result) and I convert the result back into a string
next, I replace what was removed from the string like this
removed_string$ = mid$(inputstr$, extract_st, len(inputstr$)-extract_nd)
by doing this I always get the exact location of the entire equasion no matter the length or how many numbers are in it
Next.
I end up with this:
inputstr$ = replace$(inputstr$, removed_string$, "!", 0, 0, 1) the last parameter is the replace once only case
now later I do this
inputstr$ = replace$(inputstr$, "!", result_string$, 0, 0, 1) //And this basically captures the result and re-injects it into the string

I'm working on properly implementing the early version of the if statement right now, and creating a boolean expression evaluator that can also pull variable names during comparison ( == operations ) and find out the state of the parameters. Because I already coded simplemath expressions without parenthesis should be easy to resolve.
I'll also have to check the input types during this, and I've decided instead of labeling the tokens globally I'll label them on a per expression basis to better suit the situation which might mean stepping through the token list more than once but hey it's working. And it's fast
This should work pretty well for most other cases.
Now the good part, IF EXPR THEN -> Result should be able to execute soon.
Without variables there still isn't a lot you can do but i'll make basic (first level) variables accesible asap so that TinySB is at least somewhat useful.
Printing of strings will be supported too as well as assignment and if I can finish those few tasks today I can release a very unstable Alpha version soon.
Essentially I have reduced processing input yet another step.
Now in one fell step I can basically label everything about an input line.
This is beyond cool (for me).